CNC AXIS IN PARKING MODE
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 17710
- Thank you received: 5183
23 Nov 2025 04:02 #339025
by PCW
Replied by PCW on topic CNC AXIS IN PARKING MODE
If you could do the motion via a handwheel rather than a direct mechanical connection,
you could probably use external offsets to accomplish this motion without disabling the
drive.
you could probably use external offsets to accomplish this motion without disabling the
drive.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- papagno-source
- Offline
- Premium Member
-
Less
More
- Posts: 113
- Thank you received: 7
23 Nov 2025 08:35 #339035
by papagno-source
Replied by papagno-source on topic CNC AXIS IN PARKING MODE
Good morning everyone.
Rodw, yes, indeed, the pin for freewheeling will be managed by a GUI.
The idea is good, but in practice, we wouldn't solve anything, because when the operator selects mechanical movement and the pin switch is executed, we disable the drive.
In this case, for example, pos.command is 200 mm.
Now the operator can move the axis mechanically.
Let's imagine that it has reached -1000 mm in the feedback position.
Now the operator disables the mechanical handwheel, we execute the switch, and re-enable the axis, but LinuxCNC will issue a ferror alarm because the commanded position is 200 mm and the feedback is -1000.
Clearly, increasing the ferror parameter to 1000 mm is not feasible.
In reality, the only way to adjust the command position value to the feedback is to turn off the auxiliaries so that LinuxCNC copies the feedback position to the command position, and then turn the machine back on.
This axis parking feature is useful in many situations, even on mechanically indexed axis tables.
We need to find a way to modify the LinuxCNC code so that it switches a pin and the command position follows the feedback, just like when LinuxCNC is disabled with an emergency.
In this case, if you rotate the encoder or move the scale, the command position follows the feedback.
There should be a pin for each axis, which can be enabled on the fly.
Rodw, yes, indeed, the pin for freewheeling will be managed by a GUI.
The idea is good, but in practice, we wouldn't solve anything, because when the operator selects mechanical movement and the pin switch is executed, we disable the drive.
In this case, for example, pos.command is 200 mm.
Now the operator can move the axis mechanically.
Let's imagine that it has reached -1000 mm in the feedback position.
Now the operator disables the mechanical handwheel, we execute the switch, and re-enable the axis, but LinuxCNC will issue a ferror alarm because the commanded position is 200 mm and the feedback is -1000.
Clearly, increasing the ferror parameter to 1000 mm is not feasible.
In reality, the only way to adjust the command position value to the feedback is to turn off the auxiliaries so that LinuxCNC copies the feedback position to the command position, and then turn the machine back on.
This axis parking feature is useful in many situations, even on mechanically indexed axis tables.
We need to find a way to modify the LinuxCNC code so that it switches a pin and the command position follows the feedback, just like when LinuxCNC is disabled with an emergency.
In this case, if you rotate the encoder or move the scale, the command position follows the feedback.
There should be a pin for each axis, which can be enabled on the fly.
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 11720
- Thank you received: 3968
23 Nov 2025 12:22 #339044
by rodw
Replied by rodw on topic CNC AXIS IN PARKING MODE
Sorry, I based he code on my experience but now I see your situation is different. You could modify the code to achieve what you desire. Just swap things around.
Please Log in or Create an account to join the conversation.
- papagno-source
- Offline
- Premium Member
-
Less
More
- Posts: 113
- Thank you received: 7
23 Nov 2025 18:52 #339073
by papagno-source
Replied by papagno-source on topic CNC AXIS IN PARKING MODE
Thank you all for your support. I understand this is a unique technical situation, but the intention is to add a fundamental function to LCNC that can handle even special situations and make it similar to commercial CNCs.
In any case, the only problem is being able to modify the position command value, making it identical to the feedback value.
i.e.: joint.0.motor-pos-cmd = joint.0.motor-pos-fb i.e.:
net Zenable joint.2.amp-enable-out and2.0.in0
net switch bottongui.out and2.0.in1
net pidok and2.0.out pid.2.enable
net Zpos pos_cmd_out pid.0.command
net Zfeedback pos_fb_in joint.0.motor-pos-fb pid.0.feedback
FUNCTION(_) {
if(isfreewheeling)
pos_cmd_out = joint.0.motor-pos-cmd
else
joint.0.motor-pos-cmd = pos_fb_in;
}
But I don't know if joint.0.motor-pos-cmd can be overridden, because I think it's written by the trivkins module.
You should probably modify trivkins.c
In any case, the only problem is being able to modify the position command value, making it identical to the feedback value.
i.e.: joint.0.motor-pos-cmd = joint.0.motor-pos-fb i.e.:
net Zenable joint.2.amp-enable-out and2.0.in0
net switch bottongui.out and2.0.in1
net pidok and2.0.out pid.2.enable
net Zpos pos_cmd_out pid.0.command
net Zfeedback pos_fb_in joint.0.motor-pos-fb pid.0.feedback
FUNCTION(_) {
if(isfreewheeling)
pos_cmd_out = joint.0.motor-pos-cmd
else
joint.0.motor-pos-cmd = pos_fb_in;
}
But I don't know if joint.0.motor-pos-cmd can be overridden, because I think it's written by the trivkins module.
You should probably modify trivkins.c
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4655
- Thank you received: 2078
23 Nov 2025 19:09 #339076
by Aciera
Replied by Aciera on topic CNC AXIS IN PARKING MODE
'joint.0.motor-pos-cmd' cannot be written to from hal.
linuxcnc.org/docs/html/man/man9/motion.9.html#JOINT%20PINS
linuxcnc.org/docs/html/man/man9/motion.9.html#JOINT%20PINS
Please Log in or Create an account to join the conversation.
- papagno-source
- Offline
- Premium Member
-
Less
More
- Posts: 113
- Thank you received: 7
24 Nov 2025 18:27 #339164
by papagno-source
Replied by papagno-source on topic CNC AXIS IN PARKING MODE
Thanks everyone for the support.
Yes, I know, so where can I change the value in the source code?
Yes, I know, so where can I change the value in the source code?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4655
- Thank you received: 2078
24 Nov 2025 19:55 #339170
by Aciera
Replied by Aciera on topic CNC AXIS IN PARKING MODE
I don't really know but have a look here:
github.com/LinuxCNC/linuxcnc/blob/bd96ca...tion/control.c#L2023
github.com/LinuxCNC/linuxcnc/blob/bd96ca...tion/control.c#L2023
Please Log in or Create an account to join the conversation.
Time to create page: 0.095 seconds