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:
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