#emc-devel | Logs for 2006-09-28

Back
[02:35:19] <jepler> I've rewritten 'newinst' to kick off the kernel portion of the code by writing to /proc/rtapi/hal/newinst and added second, string parameter to the constructor
[02:36:57] <jepler> this fixes the "realtime threads must be started" problem
[02:42:21] <jepler> http://emergent.unpy.net/index.cgi-files/sandbox/halcmd-newinst-patch-ver2.txt
[02:42:43] <jmkasunich> hi jeff
[02:43:08] <jmkasunich> you are right, perfection is the enemy of good enough
[02:44:15] <jmkasunich> just curious, why does the newinst patch contain changes to control.c?
[02:44:19] <jepler> oops
[02:44:22] <jepler> that's unrelated stuff
[02:44:42] <jmkasunich> lots of irons in the fire
[02:51:32] <jmkasunich> I don't see any reason not to commit it whenever you feel its ready
[02:51:37] <jmkasunich> we can polish it later
[02:51:40] <jepler> ok
[02:52:04] <jmkasunich> I think a logical extension would be delinst, and that should be doable
[02:52:35] <jmkasunich> also, if you say "newinst ddt" and ddt isn't loaded yet, maybe it could do "loadrt ddt"
[02:52:43] <jmkasunich> but those are refinements
[02:52:55] <jmkasunich> getting the core stuff there is the way to start
[02:54:35] <jepler> ok
[02:54:53] <jepler> I am just writing a bit of documentation and then I'll check in what I have
[02:55:38] <jmkasunich> the /proc thing is probably the way to go
[02:59:03] <jmkasunich> am I totally insane when the idea of replacing halcmd with "cat foo.hal >/proc/rtapi/hal" crosses my mind?
[03:01:07] <jepler> just a bit
[03:01:24] <jmkasunich> thought so
[03:01:50] <jmkasunich> if I was totally insane, I'd think I was sane... as long as I doubt my sanity, I'm OK
[03:02:49] <jepler> you were the one who, yesterday, worried about parsing an argument string for 'newinst' in the kernel
[03:03:11] <jmkasunich> I know
[03:03:48] <jmkasunich> using /proc as a channel between halcmd and kernel space is the way to go
[03:03:57] <jmkasunich> putting all of halcmd in kernel space not so smart
[03:04:03] <jepler> for the stuff that is hard in userspace and easy in kernel space that's exactly right
[03:04:41] <jepler> goodnight
[03:04:53] <jmkasunich> the thing that bugs me is what happens when somebody _does_ do "echo meaningless_trash >/proc/rtapi/hal/newinst"
[03:04:56] <jmkasunich> goodnight
[03:05:21] <jepler> I think everything is OK
[03:05:31] <jepler> if that pointer is NULL the write immediately returns
[03:05:33] <jmkasunich> if the /proc code is expecting something nicely packaged by halcmd, it has to do the right thing when it sees crap (probably nothing at all)
[03:05:59] <jepler> the data is transferred through shared memory .. a write to 'newinst' just serves as the way to start the kernel-side code
[03:06:07] <jmkasunich> oh, ok
[03:06:34] <jmkasunich> is there still a constructor task to do that, or does the /proc handling kernel code do the work directly?
[03:06:43] <jepler> this gets rid of the task
[03:06:56] <jmkasunich> good, I think
[03:07:12] <jmkasunich> and the mutex prevents multiple halcmds from fighting over the args being passed in shmem
[03:07:32] <jepler> right. you have to get the mutex and see that the pointer is NULL while you hold it, before you can do anything
[03:07:51] <jmkasunich> I'll need some time to grasp everything you're doing, and thats not tonight.
[03:07:55] <jepler> yeah
[03:07:56] <jepler> see you
[03:08:00] <jmkasunich> I've been staying up too late lately
[03:08:01] <jmkasunich> goodnight
[12:43:35] <skunkworks> anyways - thanks for the spec alex
[12:43:59] <alex_joni> np
[12:44:09] <alex_joni> those were pretty cheap.. let me find out how much if you want
[12:44:16] <skunkworks> I want to get 4 reletivly large ones so that I can get a decent board made for that size.
[12:44:24] <skunkworks> thanks
[12:45:57] <alex_joni> about 4 EUR / piece
[12:45:59] <skunkworks> The first board I made workes pretty well but I need to make some adjustments. the opto-isolator I picked take way to much current to turn on.
[12:46:29] <skunkworks> that isn't bad at all - (with the way the dollar is it is probably $8)
[12:46:34] <skunkworks> :)
[12:46:45] <alex_joni> 6$ or so
[12:48:09] <skunkworks> 7.65000 from digikey for <25
[12:48:12] <skunkworks> not bad.
[12:48:32] <skunkworks> I think the ir2111 runs igbt's also
[12:48:58] <alex_joni> :P
[12:49:02] <alex_joni> don't start me ;D
[12:49:16] <skunkworks> :)
[12:49:32] <skunkworks> did I mention I have had some good luck with them
[12:49:46] <skunkworks> (even totally borking the circuit board the first time)
[12:49:54] <alex_joni> :P
[12:52:53] <skunkworks> was it your robot you where trying to make the drive for using the ir21...
[12:54:10] <skunkworks> alex_joni: was it bread boarded? :)
[12:54:33] <alex_joni> board with holes, put components in, link them with wires
[12:54:49] <alex_joni> usually for testing purposes, not for serious stuff (where you design and build a PCB)
[12:56:18] <skunkworks> I understand. Jmk said you probably didn't have a beefy enough ground plane.
[12:57:11] <alex_joni> sorry.. misread your question
[12:57:14] <skunkworks> he was reading the specs the last time I had brought it up and was impressed with the "saftey features"
[12:57:17] <alex_joni> yes, it was bread boarded
[13:00:50] <skunkworks> :)
[13:01:16] <alex_joni> s/it was/they were/
[13:05:01] <skunkworks> I know what you mean by bread boarded - but for some reason when I think bread board I see the white modules that you push the wires into to make circuits.
[13:05:11] <alex_joni> eek
[13:06:07] <skunkworks> I found out those only work for simple circuits a long time ago. (after I tried to build a audio amp and could not get rid of the noise and feedback)
[15:09:50] <alex_joni> anuone around?
[15:09:55] <alex_joni> anyone even
[15:18:51] <skunkworks> nobody that can contribute anything it looks.. :)
[15:25:16] <jepler> I've been thinking that the stuff 'newinst' does is not recreated by 'halcmd save'...
[15:25:42] <jepler> there's not enough information recorded to do so
[15:26:29] <alex_joni> hi jeff
[15:26:35] <alex_joni> care to look at a diff?
[15:26:35] <jepler> hi alex
[15:26:37] <jepler> sure
[15:28:48] <alex_joni> http://pastebin.ca/185029
[15:29:55] <alex_joni> basicly some cleanup :)
[15:30:26] <alex_joni> all this stuff is handled only in HAL, the emc/NML hooks are only because of inheritance
[15:32:15] <alex_joni> jepler: oopsy..
[15:32:27] <alex_joni> Shutting down and cleaning up EMC...
[15:32:27] <alex_joni> scripts/emc: line 306: 11297 Segmentation fault $HALCMD unload all
[15:32:27] <alex_joni> ERROR: Module hal_lib is in use by blocks,motmod,trivkins
[15:32:27] <alex_joni> ERROR: Module rtapi is in use by blocks,motmod,hal_lib
[15:32:47] <jepler> I didn't see any problems in the patch
[15:32:50] <jepler> hmmm about your segfault though
[15:33:26] <jepler> I did change 'halcmd unload' yesterday
[15:33:34] <jepler> one of my refactors
[15:33:41] <alex_joni> the two are unrelated I bet
[15:33:56] <alex_joni> this was running halui-halvcp sample config
[15:34:01] <jepler> OK I'll try that here
[15:35:20] <jepler> * jepler waits for the docs to rebuild
[15:35:35] <alex_joni> juve@ubuntu:~/emc2$ bin/halcmd unloadrt all
[15:35:35] <alex_joni> Segmentation fault
[15:35:53] <jepler> run it in the debugger pllease
[15:36:00] <alex_joni> juve@ubuntu:~/emc2$ bin/halcmd show comp
[15:36:00] <alex_joni> Loaded HAL Components:
[15:36:00] <alex_joni> ID Type Name PID Ready?
[15:36:00] <alex_joni> 05 User halcmd11779 11779 ready
[15:36:00] <alex_joni> 04 User halcmd11768 11768 ready
[15:36:03] <alex_joni> 03 User halcmd11720 11720 ready
[15:36:03] <jepler> it worked for me last night
[15:36:05] <alex_joni> 02 User halcmd11616 11616 ready
[15:36:08] <alex_joni> 09 User halcmd11297 11297 ready
[15:38:07] <alex_joni> (gdb) set args unloadrt all
[15:38:07] <alex_joni> (gdb) run
[15:38:07] <alex_joni> Starting program: /home/juve/emc2/bin/halcmd unloadrt all
[15:38:07] <alex_joni> Program exited normally.
[15:38:15] <alex_joni> don't you love it when that happens?
[15:38:29] <jepler> Cleanup done
[15:39:01] <jepler> I didn't get it to happen here over several tries
[15:39:07] <alex_joni> I got it again..
[15:39:11] <jepler> running scripts/emc configs/halui_halvcp/halui.ini and then closing tkemc right away
[15:39:50] <jepler> ulimit -c unlimited and repeat until you get a core dump
[15:39:50] <alex_joni> Program received signal SIGSEGV, Segmentation fault.
[15:39:50] <alex_joni> do_unloadrt_cmd (mod_name=0xbff0cca4 "all") at hal/utils/halcmd.c:1704
[15:39:50] <alex_joni> 1704 while ( comps[n][0] != '\0' ) {
[15:40:06] <jepler> yay a traceback
[15:40:21] <jepler> print comps
[15:41:23] <jepler> print n
[15:41:54] <cradek> slowest gdb session ever
[15:42:03] <alex_joni> sorry.. was away for a bit
[15:42:33] <alex_joni> comps doesn't look pretty
[15:42:55] <alex_joni> http://pastebin.ca/185037
[15:43:17] <alex_joni> (gdb) print n
[15:43:17] <alex_joni> $2 = <value optimized out>
[15:44:03] <alex_joni> (gdb) print comps[n]
[15:44:03] <alex_joni> $3 = "blocks", '\0' <repeats 35 times>
[15:44:03] <alex_joni> (gdb) print comps[n][0]
[15:44:03] <alex_joni> $4 = 98 'b'
[15:44:56] <cradek> assuming they are 42 long, it looks correctly terminated to me
[15:45:42] <jepler> #define HAL_NAME_LEN 41 /* length for pin, signal, etc, names */
[15:45:47] <alex_joni> cradek: 41
[15:45:55] <jepler> char comps[64][HAL_NAME_LEN+1];
[15:46:24] <alex_joni> ok
[15:46:36] <alex_joni> jepler: anything else I should check?
[15:46:51] <jepler> x/i $eip
[15:47:10] <alex_joni> (gdb) x/i $eip
[15:47:10] <alex_joni> 0x804cf27 <do_unloadrt_cmd+386>: cmpb $0x0,(%ebx)
[15:47:18] <jepler> print $ebx
[15:47:30] <alex_joni> 42
[15:47:43] <jepler> buh?
[15:47:53] <jepler> that would be executing *(int*)42 == 0
[15:47:56] <alex_joni> (gdb) print $ebx
[15:47:56] <alex_joni> $6 = 42
[15:48:08] <jepler> er, *(char*)42 == 0
[15:48:12] <jepler> no wonder it segfaults
[15:48:36] <jepler> x/b comps[0][0]
[15:48:54] <alex_joni> (gdb) x/b comps[0][0]
[15:48:54] <alex_joni> 0x62: Cannot access memory at address 0x62
[15:49:26] <cradek> 0x62 = 'b'
[15:49:30] <jepler> x/b comps
[15:49:51] <jepler> cradek: thanks for noticing that
[15:50:04] <alex_joni> (gdb) x/b comps
[15:50:04] <alex_joni> 0xbff0c13c: 0x62
[15:50:23] <jepler> can you upload your 'halcmd' binary somewhere?
[15:50:32] <alex_joni> yeah
[15:50:45] <jepler> dapper?
[15:50:50] <alex_joni> should I leave the gdb on?
[15:51:01] <jepler> yeah why not
[15:53:28] <alex_joni> http://dsplabs.cs.utt.ro/~juve/jepler/halcmd
[15:56:46] <alex_joni> jepler: got it?
[15:57:01] <jepler> yes
[15:58:53] <alex_joni> ok, let me know if I should test/try anything else
[16:00:09] <alex_joni> cradek: side-question.. got an user asking if it wouldn't be possible to jog while in auto with interp paused
[16:00:39] <alex_joni> I can see some potential problems, but also benefits
[16:00:55] <cradek> someone said something surprising like that is possible when using tkemc, but I never figured out the specifics
[16:01:10] <alex_joni> really??
[16:01:15] <jepler> that person must be wrong
[16:01:28] <jepler> conterfactually optimistic, even
[16:01:32] <cradek> heh
[16:01:36] <alex_joni> it's handled by emctaskmain, and not allowed
[16:01:40] <alex_joni> afaik
[16:01:45] <cradek> I wish I could remember the exact report
[16:01:57] <alex_joni> conterfactually? gotta remember that
[16:02:01] <cradek> some kind of surprising thing was possible while paused
[16:02:17] <cradek> seems like he said he used it to reposition a new tool
[16:06:15] <alex_joni> jepler: any idea?
[16:07:42] <jepler> no, I'm still not enlightened
[16:09:06] <jepler> the produced code is quite different bwtween our systems .. mine's breezy
[16:09:30] <alex_joni> mine's dapper
[16:09:52] <jepler> I figured
[16:10:05] <alex_joni> gcc4.0
[16:10:31] <jepler> 3.4 here
[16:10:36] <alex_joni> I know
[16:10:41] <alex_joni> err.. I assumed
[16:16:48] <jepler> something must be smashing the stack but I don't see what it is
[16:17:15] <jepler> writing a zero at the location where unloadrt_comp has pushed ebx, so that when it returns you get 0 + 42 as the next address for comp[n][0]
[16:18:10] <jepler> char *argv[3];
[16:18:10] <jepler> argv[0] = EMC2_BIN_DIR "/emc_module_helper";
[16:18:10] <jepler> argv[1] = "remove";
[16:18:10] <jepler> argv[2] = mod_name;
[16:18:10] <jepler> /* add a NULL to terminate the argv array */
[16:18:13] <jepler> argv[3] = NULL;
[16:18:15] <jepler> oh duh
[16:19:06] <jepler> found it!
[16:21:35] <alex_joni> yay
[16:21:39] <alex_joni> what was it?
[16:30:54] <alex_joni> argv[4] ?
[16:32:05] <cradek> damn I even looked at that code
[16:32:31] <alex_joni> works now
[16:32:43] <cradek> yay C
[16:33:04] <alex_joni> yay internet and collaborative work
[16:33:44] <alex_joni> cradek: any thoughts on the diff I pasted earlier?
[16:34:26] <alex_joni> http://pastebin.ca/185029
[16:38:09] <jepler> in my defense it was char *argv[3] before my refactor
[16:38:34] <alex_joni> jepler: no-one blames you :)
[16:38:40] <alex_joni> bet chris wrote that
[16:38:43] <alex_joni> :-P
[16:40:09] <cradek> curse revision control
[16:41:22] <jepler> 1.8 jmkasuni 1749: char *argv[3];
[16:41:48] <cradek> yeah but did I add an argument?
[16:42:04] <cradek> alex_joni: I think the patch is great if we're sure not to need that stuff
[16:42:29] <cradek> I guess we obviously don't need the pid
[16:42:32] <alex_joni> http://cvs.linuxcnc.org/cgi-bin/cvsweb.cgi/emc2/src/hal/utils/halcmd.c.diff?r1=1.42;r2=1.43
[16:42:47] <alex_joni> jepler: it was cradek who added a new param there :P
[16:42:58] <alex_joni> cradek: we obviously don't use any of that
[16:43:10] <cradek> darnit
[16:43:21] <alex_joni> and I'm kidding about the argv[3] :)
[16:43:48] <alex_joni> cradek: I'm glad it wasn't me :P .. I do that all the time
[16:44:00] <cradek> I guess we all make dumb mistakes sometimes
[16:44:05] <cradek> but I hate it worse when it's me
[16:44:12] <alex_joni> right :)
[18:10:52] <tfmacz> Hello all, Can anyone out there help me set up a hal file for the axis limit switches?
[18:11:36] <tfmacz> ooops sorry, wrong group...
[19:05:03] <alex_joni> tfmacz: not wrong
[19:13:51] <skunkworks> alex_joni: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=140035968979
[19:14:14] <skunkworks> give me something to play with. Now I need some decent free-wheeling diodes.
[19:16:53] <skunkworks> give**gives
[20:15:08] <alex_joni> * alex_joni pings jepler
[20:15:53] <alex_joni> what do these ones do? emc/usr_intf/axis/extensions/emcmodule.cc: F2("home_switch_polarity", homeSwitchPolarity);
[20:16:42] <alex_joni> is that staus updates ?
[20:23:45] <jepler> that function, Stat_axis_one, builds a Python dictionary with information about one axis
[20:24:14] <jepler> that particular line creates an item in the dictionary where the key is "home_switch_polarity" and the value is s->status.motion.axis[axisno].homeSwitchPolarity
[20:24:29] <alex_joni> ok, so no biggie if I remove those
[20:24:47] <jepler> by contrast, F() uses the same name for the dictionary key and the C++ class member
[20:24:55] <jepler> no, they're not used in axis, they were just there for completeness
[20:25:03] <alex_joni> jepler: thanks for enlightening me :)
[20:25:17] <jepler> just remove the lines for the stuff you're taking out of the structure, and all will be well
[20:25:49] <alex_joni> indeed.. it runs even
[20:27:27] <jepler> then don't be shy about checking it in
[20:28:01] <alex_joni> http://pastebin.ca/185281
[20:30:02] <alex_joni> I will in a while.. still testing a bit
[20:30:50] <cradek> wow a 2160 line diff that's all minuses? that's great
[20:32:05] <alex_joni> there are a few +'es aswell
[20:32:11] <alex_joni> mainly empty lines :)
[20:32:55] <jepler> cvs diff: ^[: Invalid regular expression
[20:32:56] <jepler> Terminated with fatal signal 11
[20:32:56] <jepler> Core dumped; preserving /tmp/cvs-serv71224 on server.
[20:32:56] <jepler> CVS locks may need cleaning up.
[20:33:54] <alex_joni> thought /tmp gets deleted on startup?
[20:34:15] <cradek> ouch
[20:35:46] <alex_joni> heh.. this is _nice_
[20:36:15] <alex_joni> did you notice that cvs diff file-<tab> only completes with files inside the CVS entry?
[20:37:01] <jepler> I have a patch to remove the useless [AXIS_*]CYCLE_TIME from the sample ini files. any reason I shouldn't check it in?
[20:37:26] <alex_joni> does it affect other files (besides configs) ?
[20:37:35] <jepler> just ini files
[20:37:39] <alex_joni> go ahead
[20:37:50] <alex_joni> * alex_joni was worried about other files and merge errors :)
[20:37:58] <alex_joni> I'll commit my stuff soon too
[20:39:09] <jepler> cvs commit: [20:38:22] waiting for jepler's lock in /cvs/emc2/configs/dallur-thc
[20:39:13] <jepler> cvs commit: [20:38:52] waiting for jepler's lock in /cvs/emc2/configs/dallur-thc
[20:39:15] <jepler> I guess that really did leave a lock
[20:39:17] <jepler> cradek: cleanup on aisle 3
[20:40:59] <cradek> ok
[20:41:09] <alex_joni> * alex_joni loves mc
[20:41:13] <alex_joni> so nice to read diffs
[20:42:10] <cradek> fixed maybe?
[20:43:12] <jepler> my checkin finished
[20:43:45] <cradek> yay
[20:44:02] <alex_joni> here goes mine
[20:45:40] <alex_joni> jepler: you sure axis_* cycle_time isn't used?
[20:47:48] <jepler> alex_joni: pretty sure
[20:47:54] <cradek> wow that's nice, only things that I know what they do are still in the axis sections
[20:48:22] <cradek> jepler: will HOME_IS_SHARED = yes/no work? I notice the other booleans are that way
[20:48:39] <jepler> cradek: I think I used the same "get a boolean" machinery as for the other options
[20:48:42] <jepler> if not it should be fixed
[20:49:34] <alex_joni> cradek, jepler: did you ever try out using LINEAR_UNITS = mm/inch ?
[20:49:48] <cradek> alex_joni: not yet
[20:49:48] <alex_joni> * alex_joni is thinking about converting the inis to that way
[20:49:53] <alex_joni> I'll wait :)
[20:50:02] <cradek> does everything work?
[20:50:08] <cradek> (including axis?)
[20:50:16] <alex_joni> I tested for mm mostly
[20:50:24] <jepler> #if 0
[20:50:24] <jepler> case EMC_AXIS_SET_CYCLE_TIME_TYPE:
[20:50:24] <jepler> set_cycle_time_msg = (EMC_AXIS_SET_CYCLE_TIME *) cmd;
[20:50:24] <jepler> retval = emcAxisSetCycleTime(set_cycle_time_msg->axis,
[20:50:24] <jepler> set_cycle_time_msg->cycleTime);
[20:50:26] <jepler> break;
[20:50:39] <alex_joni> jepler: let me remove that
[20:50:47] <alex_joni> I already removed some references
[20:51:23] <alex_joni> hmm.. think I removed that on the last go :)
[20:51:28] <alex_joni> can't find it anymore :P
[20:52:01] <jepler> then why were you asking me if I was sure it was unused?
[20:52:03] <jepler> :-P
[20:52:07] <cradek> "Calling the 'out of position' due to acceleration 'lag' may be ... a bad idea... cuz you really would be wrong if you >were< in position. ( you OUGHT to be behind schedule"
[20:52:31] <alex_joni> jepler: I removed it because it was if 0'ed out :P
[20:52:45] <cradek> this author made up (guessed) reasons for following errors and then said it shouldn't be that way
[20:53:11] <alex_joni> lol.. where did you read that?
[20:53:18] <cradek> http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl/emcinfo.pl?Following_Error
[20:53:20] <jepler> the wiki
[20:54:11] <alex_joni> tomp
[20:54:17] <alex_joni> :-)
[20:58:05] <alex_joni> jepler: did you run sim/axis.ini ?
[20:58:09] <alex_joni> recently I mean
[21:00:43] <jepler> alex_joni: yes
[21:00:47] <jepler> just before I checked in my changes
[21:01:12] <alex_joni> ok, then I guess you tested with LINEAR_UNITS=inch, and ANGULAR_UNITS=degree
[21:01:23] <jepler> of course!
[21:01:26] <alex_joni> any weird things going on with axis ?
[21:01:45] <alex_joni> * alex_joni never noticed any
[21:01:53] <jepler> I don't know, I haven't tested it much lately
[21:01:57] <alex_joni> except the tool stuff we need yet to decide/fix
[21:02:04] <jepler> I've been doing low-level stuff like comp and newinst
[21:02:51] <alex_joni> right :)
[21:02:58] <alex_joni> which is quite nice btw
[21:03:20] <jepler> http://emergent.unpy.net/files/sandbox/ferror.png
[21:03:29] <jepler> I think this is what that missing graph should look like, judging by the source code
[21:03:36] <jepler> joint->ferror_limit =
[21:03:36] <jepler> joint->max_ferror * fabs(joint->vel_cmd) / joint->vel_limit;
[21:03:41] <jepler> if (joint->ferror_limit < joint->min_ferror) {
[21:03:41] <jepler> joint->ferror_limit = joint->min_ferror;
[21:04:22] <alex_joni> * alex_joni might have that missing pic somewhere
[21:08:53] <alex_joni> nope
[21:27:36] <alex_joni> mind if I check in a change for the configs?
[21:27:56] <alex_joni> replacing 0.0217648236492387462394782 with inch ?
[21:28:18] <cradek> if it's tested, please do :-)
[21:29:01] <alex_joni> ok.. if it still si broken.. well.. you'll find me
[21:29:08] <alex_joni> :P
[21:29:16] <alex_joni> but I doubt that