#emc-devel | Logs for 2010-10-07

[02:58:03] <CIA-5> EMC: 03cradek 07master * r2010001fbeb6 10/ (6 files in 3 dirs): macro (O-call) capability for touchy
[02:58:05] <CIA-5> EMC: 03cradek 07master * r5a09c99765ea 10/ (6 files in 3 dirs): Merge remote branch 'origin/touchy-macro'
[02:58:06] <CIA-5> EMC: 03cradek 07master * r99f57b401b20 10/ (3 files in 2 dirs): better examples for touchy macros
[03:03:47] <cradek_> cradek_ is now known as cradek
[14:36:18] <SteveStallings> SteveStallings is now known as steves_logging
[15:04:47] <psha> Is cmorley visiting this channel?
[15:13:26] <skunkworks> jepler: remember the tool change patch (estopping while in proccess of tool search/change) I cannot find it here. I think I had formated the machine that it was on.
[15:15:03] <jepler> psha: not often. I think he goes by something like chester88 when he does.
[15:35:52] <jepler> skunkworks: I don't have that patch, sorry.
[15:38:09] <CIA-5> EMC: 03jepler 07master * r44e7da328d5b 10/src/hal/drivers/mesa-hostmot2/hm2_pci.c: hm2_pci: indicate failed registration to userspace
[15:39:03] <skunkworks> jepler: http://emergent.unpy.net/files/sandbox/0001-fix-TOOL_PREPARE-after-estop.patch
[15:39:38] <cradek> jepler: isn't that a bugfix?
[15:40:04] <jepler> cradek: arguably yes, but an untested one
[15:41:42] <skunkworks> I can test it on the machine this weekend. I had tested it in sim.
[15:43:07] <jepler> skunkworks: I know it has my name on it, but that patch doesn't ring any bells
[15:43:18] <skunkworks> jepler: one last stupid question - the extra spindle speed pin you added - that is only in head - right?
[15:43:41] <skunkworks> jepler: http://www.linuxcnc.org/irc/irc.freenode.net:6667/emcdevel/2010-06-29.txt
[15:44:43] <jepler> skunkworks: yes.
[15:45:00] <skunkworks> thanks. Hope to test the spindle speed comp this weekend.
[15:45:54] <jepler> 2010-06-29 16:06:38 <cradek> this screams at me, but I don't know what it's saying
[15:45:57] <jepler> hahah
[15:46:51] <skunkworks> dad has been tasked with mounting the spindle encoder. ;)
[15:46:55] <skunkworks> heh
[15:47:45] <skunkworks> *gear shift comp
[16:33:41] <jepler> incidentally, inspired by psha's proposed halui changes, I've written something different that accomplishes the same goal (I hope). http://emergent.unpy.net/files/sandbox/halui-big-gulp.mbox
[16:35:40] <jepler> the main important bit is the function copy_hal_data, which copies all the relevant fields from the pointers in halui_str to the scalar fields in halui_local_str
[16:36:21] <jepler> it also uses C++ templates to avoid having to keep halui_str and halui_local_str in synch (but you have to keep copy_hal_data in synch with the structure so it's no huge win)
[16:39:34] <psha> jepler: are you sure that volatile is not needed?
[16:40:22] <jepler> psha: in halui_local_str, it is not needed.
[16:41:13] <psha> correct, missed that it's used only in local
[16:41:41] <psha> jepler: have you seen my last attempt with awk?
[16:42:06] <jepler> I only recall seeing one set of patches.
[16:42:15] <psha> on mailing list or here?
[16:42:23] <jepler> mailing list, I think
[16:42:50] <psha> so it's awk version (first was pure C++ with std::map and string keys)
[16:43:12] <jepler> yes, it was with awk
[16:43:26] <psha> i tried to create all relative info based on halui_str so it's not needed to keep in sync two large blocks
[16:43:44] <jepler> yes, I recognized that was one of your goals
[16:43:51] <jepler> I didn't manage it in my effort
[16:45:23] <jepler> I could do ti by adding some more use of C macros to halui
[16:47:25] <jepler> bbl, it's about lunchtime here
[16:48:00] <psha> jepler: you forgot to undef ACOPY
[16:49:06] <jepler> good catch, I fixed it up in my local tree
[16:49:44] <psha> other then it's horrible verbose everything is good
[17:57:08] <psha> jepler: i've tested it a bit and it seem to work
[17:57:31] <psha> but personaly i'd prefer to replace typename::template.... with macro
[17:58:44] <psha> #define PIN(t) typename T::template field<t>::type
[17:58:47] <psha> something like this
[17:58:52] <psha> so declarations looks like
[17:59:13] <psha> PIN(hal_bit_t) machine_on; //pin for setting machine On
[17:59:13] <psha> PIN(hal_bit_t) machine_off; //pin for setting machine Off
[17:59:16] <psha> instead of
[17:59:28] <psha> typename T::template field<hal_bit_t>::type machine_on; //pin for setting machine On
[17:59:31] <psha> typename T::template field<hal_bit_t>::type machine_off; //pin for setting machine O
[17:59:51] <cradek> psha: I haven't tried it yet, but your task mdi fixes encouraged me to merge 'macro' support for touchy that jepler and I wrote a long time ago
[18:02:03] <psha> glad to hear that :)
[18:02:31] <cradek> well I sort of tried it, but not on a machine yet.
[18:03:27] <psha> it would be great if this will work on machine
[18:03:40] <psha> i have no ability to test it on real hardware
[18:04:56] <cradek> you're running no machine at all?
[18:05:26] <psha> yes
[18:05:33] <psha> i've only have one stepper drive with driver
[18:05:41] <psha> to test movements
[18:05:45] <psha> and this's all i have )
[18:09:23] <cradek> the guy who wrote hal had no cnc machine for years - a long time after hal was all done he put motors on his manual machine
[18:09:35] <cradek> jepler was the same way - no machine for a long time
[18:09:42] <cradek> it's kind of funny
[18:10:27] <jepler> now I have a cnc machine that I rarely use
[18:11:27] <psha> some people are engineers and some are programmers :)
[18:11:52] <cradek> jepler makes whatever he needs in my shop :-)
[18:11:53] <jepler> http://emergent.unpy.net/files/sandbox/halui-big-gulp-r2.mbox - should probably reorganize the order in which things are done, but now there's another commit on top of the earlier series to get both the struct definitions and the body of copy_hal_data from a single macro that lists the pins
[18:11:58] <psha> i'm coder with nearly zero knowlege in engineering
[18:11:59] <jepler> I didn't test it yet
[18:12:11] <cradek> psha: you're welcome too, but it's further to travel I think
[18:12:26] <psha> :)
[18:13:52] <psha> jepler: large one :)
[18:14:10] <psha> but working
[18:14:51] <psha> great!
[18:16:35] <psha> * psha taking his hat off
[18:18:48] <psha> it's even possible to generate auto-binding code for most of non-array pins
[18:20:57] <CIA-5> EMC: 03cradek 07master * r8eaa1a327a6f 10/src/emc/usr_intf/touchy/mdi.py: avoid gcode parse error by assuming 0 for unset words in macro mode
[18:22:18] <skunkworks> what is 'macro's'
[18:23:21] <jepler> skunkworks: in C/C++ it's a way to create code by a specific kind of string substitution
[18:23:36] <cradek> I bet he means macros in touchy...
[18:23:46] <jepler> ah, in touchy it's a way to run O-word subroutines in MDI
[18:24:21] <skunkworks> oh - ok
[18:24:22] <cradek> skunkworks: you tell it the names of the arguments, it reminds you onscreen and lets you fill them in, then it runs the mdi command O<macroname> call [arg1] [arg2] ...
[18:24:30] <skunkworks> neat
[18:24:33] <jepler> cradek: you should toss a screenshot up
[18:24:39] <cradek> can do
[18:25:42] <psha> jepler: if you are done with halui i may try to drop lot of code for pin creation on top of yours patchset
[18:25:47] <cradek> http://timeguy.com/cradek-files/emc/touchy-macro.png
[18:26:21] <cradek> poke macro to cycle through the available macros -- then fill out the arguments just like for mdi words, then press cycle start
[18:26:35] <skunkworks> very neat
[18:27:05] <jepler> psha: give me a few to reorganize my commits better
[18:27:13] <cradek> I hope AXIS will grow a similar feature
[18:29:01] <psha> cradek: for keyboardless installations?
[18:29:14] <cradek> yes, touch screen, no kb, no mouse
[18:29:32] <cradek> I wrote touchy for use on my mill
[18:29:41] <psha> won't it be difficult to operate axis in such mode?
[18:29:52] <cradek> yes it would be pretty impossible
[18:29:56] <psha> it's controls are not very large...
[18:29:58] <cradek> that's really why we have touchy
[18:30:11] <cradek> http://timeguy.com/cradek-files/emc/jr.jpg
[18:30:49] <psha> serious :)
[18:30:50] <skunkworks> on a sam scale of 1 to 10... How hard would it be for me to get pallet changing running? ;) (m30)
[18:30:51] <cradek> I did it for this machine - that screen is a touchscreen - the controls are for start/stop/pause/step/jog
[18:31:53] <cradek> skunkworks: for m30 to do it, probably 10; for another gcode, maybe 3
[18:32:18] <skunkworks> heh
[18:32:32] <skunkworks> well - m1XX would be pretty easy.
[18:32:39] <skunkworks> flip a hal bit.
[18:32:46] <cradek> right
[18:33:00] <cradek> weird - m60?
[18:33:05] <skunkworks> saw that
[18:33:10] <cradek> } else if (block->m_modes[4] == 60) {
[18:33:10] <cradek> PALLET_SHUTTLE();
[18:33:16] <SWPadnos> or m60-<whatever the motion controller output code is>
[18:33:25] <skunkworks> reading the ngc 3.0 pdf
[18:34:06] <cradek> m60 is pallet shuttle and then pause like m0
[18:34:20] <jepler> psha: http://emergent.unpy.net/files/sandbox/halui-big-gulp-r3.mbox is split a little better than -r2 was
[18:34:29] <jepler> at least this way the series doesn't introduce and then delete a bunch of lines
[18:34:31] <cradek> oh I see pallet shuttle for m30 now... it is partly in there
[18:34:36] <SWPadnos> does M60 (or PALLET_SHUTTLE() ) actually cause anything to happen in HAL land?
[18:34:52] <skunkworks> there are no pins as far as I know.
[18:35:00] <cradek> void PALLET_SHUTTLE()
[18:35:00] <cradek> {
[18:35:00] <cradek> /*! \todo FIXME-- unimplemented */
[18:35:38] <jepler> void PALLET_SHUTTLE(void)
[18:35:39] <jepler> {
[18:35:39] <jepler> // FIXME-- unimplemented
[18:35:41] <jepler> (emc 1.x)
[18:35:59] <cradek> you have to shuffle that message through task and to iotask (or motion) and do a hal loopback like tool change has
[18:36:18] <cradek> jepler: haha, so it was updated for emc2
[18:37:38] <SWPadnos> looks like one of Paul's sed-based changes, adding \todo everywhere there was a FIXME :)
[18:38:43] <skunkworks> cradek: that is what I was figuring..
[18:39:08] <skunkworks> yeck :)
[18:39:45] <cradek> skunkworks: maybe at emc fest someone will feel like working on it
[18:39:52] <skunkworks> heh
[18:40:03] <psha> jepler: i fear you are loosing bit values now
[18:40:03] <cradek> skunkworks: it's not complicated, just hard/tedious
[18:40:39] <psha> look how bit value is travelling:
[18:40:51] <jepler> psha: that's what I get for not testing. was "r2" OK?
[18:41:04] <skunkworks> maybe when I get the flu again I will dig into it. (I do my best programming when I am sick)
[18:41:15] <psha> r2 was more correct
[18:41:30] <psha> r3 has potential bug
[18:42:01] <psha> but it may be fixed along with dropping lot of useless copy clauses
[18:42:16] <cradek> skunkworks: you could do all your part except hooking up the loopback to emc. hook it to a button or something and wait for emc to become able
[18:42:21] <psha> just store 2 'local' structures and swap them every time
[18:42:34] <psha> write to local0 and compare it with local1, then write to local1 and compare with local0
[18:43:43] <jepler> I think I must not understand the potential problem yet
[18:44:57] <psha> maybe i'm wrong but look
[18:45:00] <psha> bit is set in shmem
[18:45:08] <psha> then copied to local variable
[18:45:19] <psha> this var is compared with old_halui_data
[18:45:44] <skunkworks> cradek: right - That should be fun too. (lots of though as to how it should work - there are 3 possible combos - left pallet on machine, right pallet on on machine and both pallet off saddle.
[18:45:53] <psha> next step we again copy shmem to new local variable and copare it whe old_halui_data left from previous step
[18:46:18] <psha> so in step end we must have old_halui_data equal to local variable
[18:46:43] <psha> in original code this was ensured by lot of copies
[18:47:04] <psha> one in check_bit_changed and lot of others in check_hal_changes
[18:47:10] <jepler> (check_bit_changed's name is terrible)
[18:47:29] <jepler> it copies arg1 to arg2, and if it's a rising edge it returns true
[18:47:32] <psha> diff between r2 and r3 is pretty small and only kills copy in this terrible func
[18:47:59] <psha> oooo
[18:48:01] <psha> sorry (
[18:48:12] <psha> i've missed that you left this copy intact
[18:48:26] <jepler> it's only because I screwed up that it's any different r2 -> r3 :-/
[18:48:49] <psha> i've checked difference between branches
[18:48:51] <psha> it's pretty small
[18:48:55] <jepler> yes, me too.
[18:49:10] <psha> 5+, 5-
[18:49:20] <jepler> yeah, I changed all of check_bit_changed
[18:49:33] <jepler> but I think the meaning is unchanged
[18:49:34] <psha> and so i've lost line 'oldpin = ...'
[18:49:41] <psha> yes, certainly
[18:50:08] <psha> my fault
[18:50:18] <psha> but this copy may be killed too
[18:50:27] <jepler> why?
[18:50:29] <psha> just use two different old_halui_data vars
[18:50:35] <psha> and swap them every turn
[18:51:39] <psha> {
[18:51:39] <psha> halui_str * tmp = halui_old;
[18:51:39] <psha> halui_old = halui_new;
[18:51:39] <psha> halui_new = tmp;
[18:51:39] <psha> halui_str_copy(halui_new, halui_data);
[18:51:41] <psha> }
[18:51:47] <psha> it's from my old patch but idea is same
[18:52:27] <psha> so you don't need to copy bits to old
[18:52:29] <jepler> I see what you're getting at, but do you think that avoiding the copies is an important optimization?
[18:52:42] <psha> it's not optimization but cleanup :)
[18:54:08] <psha> but only ~10 places
[18:54:11] <psha> not so serious
[18:58:05] <psha> jepler: it's very funny but have you noticed that after you added macros there is no need in templates :D
[18:59:15] <jepler> but I love macros and templates both equally
[19:09:32] <psha> but with FIELD macros they are equivalent to just plain hal_*_t types...
[19:09:55] <psha> s/FIELD/HAL_FIELDS
[19:11:31] <psha> keep templates if you like them, there is no harm from them
[19:11:53] <cradek> a machine should have no unnecessary parts
[19:17:48] <alex_joni> like car interiors?
[19:18:23] <cradek> are you making the case that C++ templates are like car seats?
[19:19:13] <alex_joni> no, more like those panels you strap on your car doors
[19:20:22] <alex_joni> a car door could just aswell look like this: http://www.mcalb.com/IMG_0121.JPG
[19:24:52] <SWPadnos> with cars, necessary is in the eye of the buyer
[19:25:15] <SWPadnos> not related to the base functionality of the machine, like getting from point A to point B without walking
[19:26:25] <psha> also with cars some off-road ones are looking better then your photo :)
[19:26:54] <psha> templates or no templates here is not important question really
[19:27:11] <psha> in this case it's only a bit of syntactic sugar
[19:27:24] <psha> compiled into simple types
[19:33:25] <psha> for example look into this one http://psha.org.ru/p/0001-halui-replace-templates-back-with-C-types.patch
[19:33:39] <psha> i won't say that without templates code became much clear
[19:34:16] <psha> for example copy_field is more dirty
[21:17:10] <psha> bb
[22:18:09] <Dave911_> Dave911_ is now known as Dave911
[23:25:20] <KimK> * KimK wonders if someone can make a template or a macro with a cup holder...
[23:27:56] <skunkworks> * skunkworks wonders what the heck kim is talking about
[23:30:21] <KimK> skunkworks: Oh, I was just having a little fun scrolling back to an earlier discussion that I missed. Nevermind.
[23:31:16] <skunkworks> heh
[23:31:59] <skunkworks> KimK: how is it going?
[23:32:53] <KimK> Not too bad, no big news, still looking for work.
[23:33:19] <skunkworks> yeck
[23:34:30] <KimK> Oops, got to go, back in a while, maybe chat more later?
[23:34:43] <skunkworks> sure