On Saturday 17 March 2018 18:51:15 Mark Wendt wrote: > On Mar 17, 2018 5:53 PM, "Gene Heskett" <[email protected]> wrote: > > On Saturday 17 March 2018 13:35:06 Mark wrote: > > Managed to get out to the shop for a little bit today and monkeyed > > around with the lincurve hal coding. > > > > Here's the code in lincurve.hal: > > > > ############################## > > > > loadrt lincurve > > loadrt offset > > addf lincurve.0 servo-thread > > addf offset.0.update-output servo-thread > > > > > > setp lincurve.0.x-val-00 3.000 > > setp lincurve.0.y-val-00 -0.007 > > setp lincurve.0.x-val-01 5.000 > > setp lincurve.0.y-val-01 0.000 > > setp lincurve.0.x-val-02 11.000 > > setp lincurve.0.y-val-02 0.000 > > setp lincurve.0.x-val-03 12.000 > > setp lincurve.0.y-val-03 -0.001 > > setp lincurve.0.x-val-04 18.000 > > setp lincurve.0.y-val-04 -0.001 > > setp lincurve.0.x-val-05 19.000 > > setp lincurve.0.y-val-05 0.000 > > setp lincurve.0.x-val-06 27.000 > > setp lincurve.0.y-val-06 0.000 > > setp lincurve.0.x-val-07 28.000 > > setp lincurve.0.y-val-07 0.003 > > setp lincurve.0.x-val-08 33.000 > > setp lincurve.0.y-val-08 0.000 > > setp lincurve.0.x-val-09 34.000 > > setp lincurve.0.y-val-09 -0.002 > > setp lincurve.0.x-val-10 38.000 > > setp lincurve.0.y-val-10 -0.002 > > setp lincurve.0.x-val-11 39.000 > > setp lincurve.0.y-val-11 0.001 > > setp lincurve.0.x-val-12 41.000 > > setp lincurve.0.y-val-12 0.001 > > setp lincurve.0.x-val-13 42.000 > > setp lincurve.0.y-val-13 0.002 > > setp lincurve.0.x-val-14 47.000 > > setp lincurve.0.y-val-14 0.002 > > setp lincurve.0.x-val-15 48.000 > > setp lincurve.0.y-val-15 0.005 > > > > > > net axis.0.joint-pos-cmd offset.0.in > > net lincurve.0.out offset.0.offset > > net z-raw axis.2.joint-pos-cmd offset.0.in > > net z-corr lincurve.0.out offset.0.offset > > net z-cmd offset.0.out stepgen.2.pos-cmd > > net z-pos-fb-raw stepgen.2.pos-fb offset.0.fb-in > > net z-pos-fb-offs offset.0.fb-out axis.2.joint-pos-fb > > > > ################################ > > > > An here's what I get when I run it: > > > > mark@canecutter:~$ /usr/bin/linuxcnc > > '/home/mark/linuxcnc/configs/Cane-Cutter/Cane-Cutter.ini' > > LINUXCNC - 2.7.12 > > Machine configuration directory is > > '/home/mark/linuxcnc/configs/Cane-Cutter' Machine configuration file > > is 'Cane-Cutter.ini' > > Starting LinuxCNC... > > . > > Found file(REL): ./Cane-Cutter.hal > > Found file(REL): ./lin_curve.hal > > ./lin_curve.hal:11: parameter or pin 'lincurve.0.x-val-02' not found > > Shutting down and cleaning up LinuxCNC... > > LinuxCNC terminated with an error. You can find more information in > > the log: > > /home/mark/linuxcnc_debug.txt > > and > > /home/mark/linuxcnc_print.txt > > as well as in the output of the shell command 'dmesg' and in the > > terminal > > > > > > > > > > > > Nothing of note in either the debug or print text files to point me > > in the right direction, nor is there anything of note in dmesg. If > > it's reading lincurve.0.x-val-00 and lincurve.0.x-val-01, why is is > > saying "parameter or pin 'lincurve.0.x-val-02' not found"? Am I > > missing something in the hal file, or is there a typo somewhere > > before this that's killing it? Lincurve is supposed to take up to > > 16 x,y pairs, but it seems to be bombing at 3 x,y pairs. Does the > > qualifier "personality" have to be set to something like 16? > > > > Thanks, > > Mark > > For what has been discussed, IIRC and according to man 9 lincurve, > you'll need a "count=1 personality=16". > > I didn't see an "addf" listed in this message, but to link it into the > rest of the code, you will need that too. This addf is the only > statement that is processed in the order of its position in the addf > order for the servo-thread, so the addf for lincurve.0 will need to be > after the addf for motion. > > It sound's like you are getting close. > > > Gene, > > That was a whoopsie. I posted an old hal file, one of my first > iterations that I hadn't synced to the operational one. My follow up > email posted the correct one. > > Ya, I thinkit's getting pretty close. It's blatantly obvious my hal > coding skills need a little work. ;-) > > Mark > Which is why, when I'm working on a hal file, a copy of that section of the docs is open in another workspace. I'm getting better, but far from perfect myself. But I didn't write the hal stack, so you'll see me asking questions too. So don't think you are too far afield when adding something to your machine and have to ask for a howto. Its the nature of the beast. I am, by the week, discovering some of the things linuxcnc can do that I hadn't a clue it could do, yet properly programmed, it just works. Its humbling to me, for sure.
Andy touched on something in a previous msg in this thread, an item I may have been tempted to suggest, and that is the order of signal names, argument #1 to a net statement. To explain it from my view: net netname src target That establishes the netname as a copy of the src signal, and the src of the signal, which needs to be the first encountered when reading in the .hal file. >From that point on, the netname is re-usable with this syntax: net netname target [target] [target] etc, etc. This will then distribute the src to all the named targets, and if you run out of line room to hit all the targets, then another: net netname target target target just expands the number of targets. It can get confusing when there is 500+ LOC between the statements, but hal doesn't care. -- Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page <http://geneslinuxbox.net:6309/gene> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
