CSS/G96 for other than X-axis?
- spumco
- Offline
- Platinum Member
-
- Posts: 2000
- Thank you received: 823
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.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
- Posts: 4676
- Thank you received: 2087
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.
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
- Posts: 2000
- Thank you received: 823
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
-
- Posts: 4676
- Thank you received: 2087
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)
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
- Posts: 4676
- Thank you received: 2087
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
- Posts: 2000
- Thank you received: 823
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.
- spumco
- Offline
- Platinum Member
-
- Posts: 2000
- Thank you received: 823
one advantage of using switchable kinematics is that all joints can be homed normally on startup.
Trying to digest all this and a couple questions occurred to me...
Is this the part of the component/programming that changes the position of the joints?:
- CASE 1
- pos->tran.x = j[0];
- pos->v = j[2];
- Case 2
- pos->tran.x = j[2];
- pos->v = j[0];
Why does X has a 'tran' and V doesn't? I saw that stuff in userkins.comp, but I can't find an explanation of the programming language/syntax.
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
- Posts: 4676
- Thank you received: 2087
Why does X has a 'tran' and V doesn't?
I cannot give you a totally clear answer but that is basically just the way the data structure is setup:
pos->tran.x, pos->tran.y and pos->tran.z are the 'translational' parts of the cartesian axis pose (ie X,Y,Z axes)
The other axes elements are just called pos->a, pos->b, pos->c, pos->u, pos->v and pos->w
Is this the part of the component/programming that changes the position of the joints?:
The lines with 'pos->* = j[*]' are part of the 'Forward' kinematic model (ie the section you have on your last post). This is used to calculate the AXIS position after the respective joint has been homed. In your particular case the axis is set the same as the joint.
The lines with ' j[* = pos->*]' are part of the 'Inverse' kinematic model . This is used to calculate that particular JOINT position according to the requested AXIS position. In your particular case the joint is set the same as the axis.
Note that in your CASE 1 the joints/axes mapping is actually trivial just like 'trivkins' and the only thing you do in CASE 2 it to swap the joints/axes
So each 'CASE n' in the forward model needs to have a matching reciprocal 'CASE n' in the inverse model. In other words, if you run a joint position value through the forward kinematic and you run the resulting axis position value through the inverse model you should get the exact joint position value you started out with. If the models do not match upyou will get unstable results (eg runaway values).
The switch is made using a case structure in the forward and the inverse kinematic:More specifically, when the kinematics switch is made is the above what causes the X and V axes DRO's to switch?
switch (switchkins_type) {
case 0:
....
case 1:
....
}Each case represents a kinematic model. In millturn.comp we have two but you can have as many as you like.
The 'switchkins_type' value is changed using an analog motion pin which is connected to a dedicated hal pin (see [HAL] section of the millturn sim config):
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-typePlease Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
- Posts: 4676
- Thank you received: 2087
sim/axis/vismach/5axis/table-dual-rotary
which uses:
github.com/LinuxCNC/linuxcnc/blob/master.../xyzab_tdr_kins.comp
You can download a detailed html documentation on how the kinematic component above was derived:
forum.linuxcnc.org/10-advanced-configura...mill?start=80#263694
For an example using four kinematic models see:
github.com/Sigma1912/LinuxCNC_Demo_Confi...egrex_200y_kins.comp
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
- Posts: 2000
- Thank you received: 823
right after I posted the question I found an explanation from Andy & RodW that (sort-of) cleared up my confusion:
forum.linuxcnc.org/24-hal-components/327...again?start=40#93573
That was an 'Ahh-ha!' moment: I don't know anything about C (or any other programming language) so that stuff all looks like gibberish to me.
Please Log in or Create an account to join the conversation.