using HAL to correct axis errors
- Mike_Eitel
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1126
- Thank you received: 184
18 Feb 2018 08:47 #106115
by Mike_Eitel
Replied by Mike_Eitel on topic using HAL to correct axis errors
I like your true diy
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Premium Member
-
Less
More
- Posts: 104
- Thank you received: 16
18 Feb 2018 15:14 #106135
by pgf
Replied by pgf on topic using HAL to correct axis errors
I think "true diy" might be a euphemism for "doesn't work all that well".

Please Log in or Create an account to join the conversation.
- Mike_Eitel
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1126
- Thank you received: 184
18 Feb 2018 15:24 #106136
by Mike_Eitel
Replied by Mike_Eitel on topic using HAL to correct axis errors
But its fun to think about and tinker.
Have fun!
Have fun!
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23297
- Thank you received: 4938
28 Feb 2018 17:22 #106725
by andypugh
Replied by andypugh on topic using HAL to correct axis errors
There is also a special kinematics file that can be used to correct a skewed machine:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...y_XY_skew_correction
That might not work so well with a gantry machine, it predates joints-axes.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...y_XY_skew_correction
That might not work so well with a gantry machine, it predates joints-axes.
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Premium Member
-
Less
More
- Posts: 104
- Thank you received: 16
28 Feb 2018 17:32 #106728
by pgf
Replied by pgf on topic using HAL to correct axis errors
thanks andy. guess that could have saved me a bit of work. oh well -- it wasn't hard, and i enjoyed it. and what's most important....
MY MILL CAN CUT RIGHT ANGLES!!!
there. just had to say that.
paul
MY MILL CAN CUT RIGHT ANGLES!!!
there. just had to say that.

paul
Please Log in or Create an account to join the conversation.
- Mike_Eitel
-
- Offline
- Platinum Member
-
Less
More
- Posts: 1126
- Thank you received: 184
28 Feb 2018 19:03 #106739
by Mike_Eitel
Replied by Mike_Eitel on topic using HAL to correct axis errors
Nice to read from a happy man!
The following user(s) said Thank You: pgf
Please Log in or Create an account to join the conversation.
- LAUSCH
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 3
04 Sep 2022 09:43 #251158
by LAUSCH
Replied by LAUSCH on topic using HAL to correct axis errors
Hi paul,
Can you explain why you set:
option singleton yes;
If you do this you will get errors from the lines in HAL:
addf nonsquare-table.0.cmd servo-thread
addf nonsquare-table.0.fb servo-thread
I have thus comment the line
//option singleton yes;
And LinuxCNC starts without error.
Cheers
Christian
Can you explain why you set:
option singleton yes;
If you do this you will get errors from the lines in HAL:
addf nonsquare-table.0.cmd servo-thread
addf nonsquare-table.0.fb servo-thread
I have thus comment the line
//option singleton yes;
And LinuxCNC starts without error.
Cheers
Christian
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Premium Member
-
Less
More
- Posts: 104
- Thank you received: 16
04 Sep 2022 18:00 #251178
by pgf
Replied by pgf on topic using HAL to correct axis errors
Well, I clearly didn't get errors from that code when I last ran the mill. I had to look up what the "singleton" option does -- it seems appropriate for this module, since you can really only have one of these components per system. But perhaps you're running a newer version of hal, with tighter restrictions on naming.
paul
paul
Please Log in or Create an account to join the conversation.
- pgf
- Offline
- Premium Member
-
Less
More
- Posts: 104
- Thank you received: 16
05 Apr 2025 14:57 #325765
by pgf
Replied by pgf on topic using HAL to correct axis errors
I wanted to bring this thread up to date, in case anyone finds it and finds it useful. I recently upgraded my mill from 2.7.4 to 2.9.4, which of course brought in the joints axes changes.
Those required some rework of my skew corrector. The component module itself was unchanged. It's in a post above .
But the linkage into HAL did change, due to joints axes, and the introduction of pid.
First, 2.7: the original HAL had a fairly simple connection between motor and stepgen:
I was able to simply insert the nonsquare function block into the middle of each Y axis signal path, and tap into the X signal path.
The newer LinuxCNC path in 2.8/2.9 is a little more complicated, with the introduction of the PID mechanism.
Integrating the nonsquare function in the new HAL is similar, butasymmetric. TreIn the output direction, the nonsquare function is inserted between the joint and pid (which then feeds stepgen), but in the feedback direction, we insert between stepgen and the joint.
Regardless, the new function is inserted just after (cmd) and before (fb) the joint command. The X control for the new function is similarly attached directly to the joint function.
Those required some rework of my skew corrector. The component module itself was unchanged. It's in a post above .
But the linkage into HAL did change, due to joints axes, and the introduction of pid.
First, 2.7: the original HAL had a fairly simple connection between motor and stepgen:
ypos-cmd
axis.1.motor-pos-cmd ==> stepgen.1.position-cmd
ypos-fb
stepgen.1.position-fb ==> axis.1.motor-pos-fb
xpos-cmd
axis.0.motor-pos-cmd ==> stepgen.0.position-cmd
xpos-fb
stepgen.0.position-fb ==> axis.0.motor-pos-fb
I was able to simply insert the nonsquare function block into the middle of each Y axis signal path, and tap into the X signal path.
ypos-cmd
axis.1.motor-pos-cmd ==> nonsquare-table.y-in
ypos-cmd-adjusted
nonsquare-table.y-out ==> stepgen.1.position-cmd
ypos-fb-adjusted
stepgen.1.position-fb ==> nonsquare-table.y-fb-in
ypos-fb
nonsquare-table.y-fb-out ==> axis.1.motor-pos-fb
xpos-cmd
axis.0.motor-pos-cmd ==> stepgen.0.position-cmd
==> nonsquare-table.x-in
xpos-fb
stepgen.0.position-fb ==> axis.0.motor-pos-fb
==> nonsquare-table.x-fb-in
The newer LinuxCNC path in 2.8/2.9 is a little more complicated, with the introduction of the PID mechanism.
y-pos-cmd
joint.1.motor-pos-cmd ==> pid.y.command
y-output
pid.y.output ==> hm2_7i96.0.stepgen.01.velocity-cmd
y-pos-fb
hm2_7i96.0.stepgen.01.position-fb ==> joint.1.motor-pos-fb
==> pid.y.feedback
x-pos-cmd
joint.0.motor-pos-cmd ==> pid.x.command
x-output
pid.x.output ==> hm2_7i96.0.stepgen.00.velocity-cmd
x-pos-fb
hm2_7i96.0.stepgen.00.position-fb ==> joint.0.motor-pos-fb
==> pid.x.feedback
Integrating the nonsquare function in the new HAL is similar, butasymmetric. TreIn the output direction, the nonsquare function is inserted between the joint and pid (which then feeds stepgen), but in the feedback direction, we insert between stepgen and the joint.
Regardless, the new function is inserted just after (cmd) and before (fb) the joint command. The X control for the new function is similarly attached directly to the joint function.
y-pos-cmd
joint.1.motor-pos-cmd ==> nonsquare-table.y-in
new-y-pos-cmd
nonsquare-table.y-out ==> pid.y.command
y-output
pid.y.output ==> hm2_7i96.0.stepgen.01.velocity-cmd
y-pos-fb
hm2_7i96.0.stepgen.01.position-fb ==> nonsquare-table.y-fb-in
==> pid.y.feedback
new-y-pos-cmd-fb
nonsquare-table.y-fb-out ==> joint.1.motor-pos-fb
x-pos-cmd
joint.0.motor-pos-cmd ==> pid.x.command
==> nonsquare-table.x-in
x-output
pid.x.output ==> hm2_7i96.0.stepgen.00.velocity-cmd
x-pos-fb
hm2_7i96.0.stepgen.00.position-fb ==> joint.0.motor-pos-fb
==> pid.x.feedback
==> nonsquare-table.x-fb-in
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Time to create page: 0.079 seconds