Well, I implemented HeadHeadTCP mode.
I modified xyzbc-trt kinematics .c file and made my kins.c file(attached)
Used sudo halcompile --install command.
However, more importantly, I played with this file for some time and understood the concept how kinematics actually works. I am describing my realisation below. In case I made some thing wrong, corrections are welcome.
The kinematics works as follows:
Actually there are two components, Forward kinematics and Inverse kinematics.
Without going in deep into theory of the above, what I understood during implementation, is that in Inverse kinematics, we give command to the joints to follow a particular geometry by, of course, mathematical (in most cases trigonometric) formula in addition to the G-code command.
For example, in my Head-Head tilting type machine i.e my cutting nozzle/spindle is on A and B rotating axes. So taking Lt as the pivot length, if A axis rotate by ’thA’ radian (or degree for simple understanding), the Z axis must compensate and more specifically shall move to Z- to maintain the tip point height by Lt*cos(thA). Similarly X axis shall move by Lt*sin(thA).
Note that, cos(thA) is positive within 0~90 degree irrespective of thA positive or negative. Hence, if A axis rotates in either direction, Z moves down. And similarly for X axis, if A is positive, X moves positive and vice versa and tool tip is at fix point. This is simple trigonometry.
Same for B axis rotation. In that case, Z and Y axis moves.
Now, in the DRO reading on gmoccapy/axis gui, X, Y and Z movement is not shown if we rotate A and/or B, although the motor rotates physically and machine moves. This is done by the Forward kinematics. That is why the equation is forward kinematics is exactly opposite to inverse kinematics.
If you remove the forward kinematics corrections, for testing purpose only, you find the DRO in GUI show the X, Y and Z movements. But in TCP mode that is not our intention, hence we forcefully neglect such movement in DRO by forward kinematics.
Hope this will help in understanding of ‘how the kinematics work’ and ‘what kinematics do’ sort of question that myself had in my mind for a long time.