Hi,
I wanted to run my understanding of the Kinematics module with the community and maybe get some more insight into the organization of the kinematics modules.
The question I have I how does Linuxcnc accommodate G5x, G43 and G92 offsets in the final position values given to the kinematics module?
1. G5x, G92 and G43 offsets are applied and stored in the Gcode interpreter. The task and planner modules have no knowledge of the offset values.
2. The Task (milltask) module will take axis values from the Gcode module in what it thinks is Machine Coordinate System (MCS). Let us call this coordinate system as the "Assumed" MCS (AMCS)
3. Trajectory planning is done by the realtime motion component and it is done in the AMCS space.
3. The kinematics module using switchkins assumes the G5x coordinate frame has its origin at the rot_point offset which is given in the original machine MCS coordinate frame. This is done by setting the G54 offset to the rotation center point at the start of the Gcode in the example NGC file made by Aciera in the XYZAB sim config.
4. The Tool length offset is applied along the Z axis of the workpiece by the Gcode interpreter.
5. The Inverse Kinematics function calculates the joint positions from the assumed AMCS positions handed to it via the motion/trajectory planner module.
The formula used by the XYZBC inverse kins is:
Code:
qx = pos->tran.x - x_rot_point - dx;
qy = pos->tran.y - y_rot_point;
qz = pos->tran.z - z_rot_point - dz - dt;
j[0] = cb*qx + sa*sb*qy - ca*sb*qz + cb*dx - sb*dz+ x_rot_point;
j[1] = ca*qy + sa*qz + y_rot_point;
j[2] = sb*qx - sa*cb*qy + ca*cb*qz + sb*dx + cb*dz + z_rot_point + dt;
j[3] = pos->a;
j[4] = pos->b;
My inferences are as follows:
1. First we corrected the assumption that the Gcode module made about the G5x and G43 and AB axes center offsets and substracted them from the AMCS. This aligned the center of the workpiece coordinate system to the rotation center.
2. Then we orient the the workpiece coordinate frame to align the axes with the original MCS.
3. Then reapply the G5x offset along the MCS axes and the tool Z offset along the J2 axis.
My Questions:
1. We compensated for G5x and G43 offsets in the inverse kinematics. What about G92 offset? OR does that not need to be compensated in this way? I am comming up with some mechanism to check the G92 offset in the sim config.
2. The G43 offset is compensated only along the Z axis. What if the G43 offset is applied along other axes too? For this also I am going to do some trials on the sim config
3. If we have to remove rotate and re-apply the G5x and tool offsets in the inverse kinematics, can we say that there is an inherent flaw in the method of inverse kinematics and the location of application (gcode interpreter) of offsets in Linuxcnc? Should the offsets be handled in the kinematics module?
4. The position velocity and acceleration limits being applied to the axes by the motion planner will be very poor approximations of the correct values (which aer measured along the joints). Although joints-axes separation from V2.8 onwards does address this issue to a certain extent, the velocity and acceleration limits should be handled in a more refined way?
I would appreciate any comments and will surely help in furthering my understanding of the kinematics moduleand overall structure of LinuxCNC.
-automata