CSS/G96 for other than X-axis?
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 1996
- Thank you received: 821
28 Mar 2026 18:41 - 28 Mar 2026 18:45 #344888
by spumco
CSS/G96 for other than X-axis? was created by spumco
I have a part-off slide mounted to my lathe spindle 90 degrees to X-axis. It's defined as "V" axis as that seemd to match the basic cartesian configuration best; it's not a Y axis as all the tools mounted on X can't move in Y.
I'm working on a custom M-code to run the part-off process. I'd like to accomplish the following:
If I re-define the parting slide a "U" axis instead of "V", will that work since "U" is considered as co-linear with X?
If CSS is hard-coded to X, any ideas how I can accomplish CSS on a non-X axis?
I don't need/want to move the X-axis while the parting slide is moving since the subspindle is mounted to X-axis slide and will (hopefully) be clamped on to the part. But swapping the X and V (or U) joint/axis before a part-off and then switching back seems... complicated. And likely to cause lots of following error issues.
I'm all ears if anyone's got suggestions.
I'm working on a custom M-code to run the part-off process. I'd like to accomplish the following:
- Program part-off in diameter, just like programming an X-mounted tool in diameter mode
- In progress, I think I just have to cut the joint movement scale in half, and fiddle with the homing so "V0" is tool tip at center of rotation
- Program feed per rev (G95)
- Seems pretty straight-forward
- Use CSS (G96)
- How?
If I re-define the parting slide a "U" axis instead of "V", will that work since "U" is considered as co-linear with X?
If CSS is hard-coded to X, any ideas how I can accomplish CSS on a non-X axis?
I don't need/want to move the X-axis while the parting slide is moving since the subspindle is mounted to X-axis slide and will (hopefully) be clamped on to the part. But swapping the X and V (or U) joint/axis before a part-off and then switching back seems... complicated. And likely to cause lots of following error issues.
I'm all ears if anyone's got suggestions.
Last edit: 28 Mar 2026 18:45 by spumco. Reason: forum editor misery
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4674
- Thank you received: 2086
29 Mar 2026 09:02 #344900
by Aciera
Replied by Aciera on topic CSS/G96 for other than X-axis?
Not sure but looking at this makes me think that CSS is indeed hard coded to the X-Axis:
github.com/LinuxCNC/linuxcnc/blob/4025bf...ontrol.c#L1918-L1922
So the only thing I can think of is to use a switchable custom kinematic that swaps the joints used for the V axis and the X axis.
github.com/LinuxCNC/linuxcnc/blob/4025bf...ontrol.c#L1918-L1922
So the only thing I can think of is to use a switchable custom kinematic that swaps the joints used for the V axis and the X axis.
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 1996
- Thank you received: 821
29 Mar 2026 13:56 #344907
by spumco
Replied by spumco on topic CSS/G96 for other than X-axis?
I guess Y-axis turning/parting wasn't really a thing in the early days of LCNC.
Pausing and axis (disconnect feedback) works fine, especially since the X-axis won't move during the swap. Your C-axis encoder disconnect component is a perfect example of this.
But I don't see how to 'write' a new/different position for an axis after it's homed. Unless there's some sort of math going on backstage that takes the current V-axis position and adds/subtracts/whatever from the X-axis. Switching the stepgen is, as you've shown, pretty straight-forward.
My particular config may be slightly easier to dea with, at least for testing since the X-axis machine zero corresponds with the subspindle in-line with the main spindle. G53 X0 is where the X-axis will need to stay during the axis swap.
Any idea what a switchable kinematics axis swap thing looks like?
Pausing and axis (disconnect feedback) works fine, especially since the X-axis won't move during the swap. Your C-axis encoder disconnect component is a perfect example of this.
But I don't see how to 'write' a new/different position for an axis after it's homed. Unless there's some sort of math going on backstage that takes the current V-axis position and adds/subtracts/whatever from the X-axis. Switching the stepgen is, as you've shown, pretty straight-forward.
My particular config may be slightly easier to dea with, at least for testing since the X-axis machine zero corresponds with the subspindle in-line with the main spindle. G53 X0 is where the X-axis will need to stay during the axis swap.
Any idea what a switchable kinematics axis swap thing looks like?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4674
- Thank you received: 2086
29 Mar 2026 14:53 #344911
by Aciera
Replied by Aciera on topic CSS/G96 for other than X-axis?
for a simple example of how to use switchable kinematics see:
configs/sim/axis/vismach/millturn
which uses this custom kinematics component:
github.com/LinuxCNC/linuxcnc/blob/master...onents/millturn.comp
for your use case it would look even simpler.
Forward mapping:
and the inverse:
Limit and acc/vel values can be switched as well (this is also shown in the millturn sim)
configs/sim/axis/vismach/millturn
which uses this custom kinematics component:
github.com/LinuxCNC/linuxcnc/blob/master...onents/millturn.comp
for your use case it would look even simpler.
Forward mapping:
// define forward kinematic models using case structure for
// for switchable kinematics
switch (switchkins_type) {
case 0:
pos->tran.x = j[0];
pos->tran.z = j[1];
pos->v = j[2];
break;
case 1:
pos->tran.x = j[2];
pos->tran.z = j[1];
pos->v = j[0];
break;
}
// unused coordinates:
pos->a = 0;
pos->b = 0;
pos->c = 0;
pos->u = 0;
pos->w = 0;and the inverse:
switch (switchkins_type) {
case 0:
j[0] = pos->tran.x;
j[1] = pos->tran.z;
j[2] = pos->v;
break;
case 1:
j[2] = pos->tran.x;
j[1] = pos->tran.z;
j[0] = pos->v;
break;
}Limit and acc/vel values can be switched as well (this is also shown in the millturn sim)
The following user(s) said Thank You: spumco
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4674
- Thank you received: 2086
29 Mar 2026 15:10 #344914
by Aciera
Replied by Aciera on topic CSS/G96 for other than X-axis?
one advantage of using switchable kinematics is that all joints can be homed normally on startup.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 1996
- Thank you received: 821
29 Mar 2026 19:12 #344924
by spumco
Replied by spumco on topic CSS/G96 for other than X-axis?
That's fantastic.
I've no idea what that pos->trans stuff means or does, but if you think it's the right plan I'm hopeful.
I've obviously got some reading to do.
I've no idea what that pos->trans stuff means or does, but if you think it's the right plan I'm hopeful.
I've obviously got some reading to do.
Please Log in or Create an account to join the conversation.
Time to create page: 0.078 seconds