Five-Axis RTCP Features: G43.4 and G43.5 Equivalents in LinuxCNC
- ring
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
09 Jun 2025 02:19 #329987
by ring
Five-Axis RTCP Features: G43.4 and G43.5 Equivalents in LinuxCNC was created by ring
Hello everyone,I am a new LinuxCNC user and developer. This time, I would like to use LinuxCNC in combination with my cutting simulation process. I have encountered some problems and would like to know if there are any known solutions in LinuxCNC. If not, I am interested in developing features similar to G43.4 and G43.5.Before we get into the details, let me provide some context. I am running LinuxCNC 2.9.4 on Debian 12 with PREEMPT_RT. Please note that for my simulation process, real-time (RT) capability is not a strict requirement. My simulation uses the configuration from , which matches the machine type I need.Here is my understanding of the five-axis xyzab-tdr support:
The key is the toolpath (TP) transformation. Five-axis machines are different because they require transforming the workspace coordinates to real joint positions, which involves both forward and inverse kinematics. The xyzab-tdr configuration provides these transformations. The main parameters for these transformations are seven in total:, , , , , , and . The , , , , , and define the machine’s geometry, while functions similarly to Fanuc's G43.4 RTCP (Rotating Tool Center Point) tool compensation.In RTCP, G-code is typically provided in two forms:Fanuc-like:
My questions are:
configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr.ini
The key is the toolpath (TP) transformation. Five-axis machines are different because they require transforming the workspace coordinates to real joint positions, which involves both forward and inverse kinematics. The xyzab-tdr configuration provides these transformations. The main parameters for these transformations are seven in total:
tool-offset
x-offset
y-offset
z-offset
x-rot-point
y-rot-point
z-rot-point
x-offset
y-offset
z-offset
x-rot-point
y-rot-point
z-rot-point
tool-offset
G43.4 T1
G01 X107.10843 Y-258.10506 Z16.72037 A-82.485727 B-2.152027
G49
G43.5 T1
G01 X118.38752 Y-257.36350 Z-13.21382 I=-0.087062004 J=-0.995672089 K=-0.032516115
G01
Siemens-like:G01 X107.10843 Y-258.10506 Z16.72037 A-82.485727 B-2.152027
G49
G43.5 T1
G01 X118.38752 Y-257.36350 Z-13.21382 I=-0.087062004 J=-0.995672089 K=-0.032516115
G01
TRAORI(1)
N23 X131.06394 Y-257.06181 Z-28.17010 A3=-.088284415 B3=-.990423696 C3=-.106145012
TRAFOOF
- In Fanuc, G43.4 is modal. Does LinuxCNC use the TP transformation as a modal mode as well? In other words, when using five-axis TP, is G43 equivalent to G43.4 in LinuxCNC?
- The IJK parameters are used for Freeform Surface toolpaths. Does the G-code parser in LinuxCNC support IJK-style input?
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4407
- Thank you received: 1967
09 Jun 2025 08:05 #329999
by Aciera
No, linuxcnc does not support gcode in vector format.
If you are thinking of doing the vector to joint angle calculations in linuxcnc you could preprocess the gcode file in userspace (ie non-real-time) for which you can use any language (even python). Doing it in the interpreter would also be possible but you'd have to invest a fair amount of time to first figure out how it currently works.
Replied by Aciera on topic Five-Axis RTCP Features: G43.4 and G43.5 Equivalents in LinuxCNC
No, G43 activated tool length compensation regardless of which kinematic mode is active.is G43 equivalent to G43.4 in LinuxCNC?
Does the G-code parser in LinuxCNC support IJK-style input?
No, linuxcnc does not support gcode in vector format.
If you are thinking of doing the vector to joint angle calculations in linuxcnc you could preprocess the gcode file in userspace (ie non-real-time) for which you can use any language (even python). Doing it in the interpreter would also be possible but you'd have to invest a fair amount of time to first figure out how it currently works.
Please Log in or Create an account to join the conversation.
- ring
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
09 Jun 2025 10:03 #330005
by ring
Replied by ring on topic Five-Axis RTCP Features: G43.4 and G43.5 Equivalents in LinuxCNC
Thank you for your answer!
Based on your reply, I understand that G43 tool length compensation depends entirely on which kinematic mode is active. I have implemented a conversion from vector format NC (IJK) to XYZAB for my machine, and it seems to work. However, I am concerned whether a simple conversion might misinterpret the intent of the CAM output, or if these two formats (IJK and AB) are truly equivalent and interchangeable.
Here is the logic of my transfer function:
def ijk_to_ab(self, i, j, k):
norm = math.sqrt(i**2 + j**2 + k**2)
i, j, k = i/norm, j/norm, k/norm
a_rad = math.atan2(j, k)
a_deg = math.degrees(a_rad)
b_rad = math.atan2(-i, math.sqrt(j**2 + k**2))
b_deg = math.degrees(b_rad)
return round(a_deg, 6), round(b_deg, 6)
I have two more questions:
Are there any problems with my transfer function (ijk_to_ab)? Although it works in practice, I am worried that a direct conversion might not fully capture all the intent or precision from the CAM output.
If I plan to extend the RS274 module to support vector input, which vector format would be better to implement: the FANUC-style IJK (G43.5) or the SIEMENS-style A3/B3/C3? Are there advantages or disadvantages to either format, especially regarding compatibility and ease of parsing?
Thank you again for your help and suggestions!
Based on your reply, I understand that G43 tool length compensation depends entirely on which kinematic mode is active. I have implemented a conversion from vector format NC (IJK) to XYZAB for my machine, and it seems to work. However, I am concerned whether a simple conversion might misinterpret the intent of the CAM output, or if these two formats (IJK and AB) are truly equivalent and interchangeable.
Here is the logic of my transfer function:
def ijk_to_ab(self, i, j, k):
norm = math.sqrt(i**2 + j**2 + k**2)
i, j, k = i/norm, j/norm, k/norm
a_rad = math.atan2(j, k)
a_deg = math.degrees(a_rad)
b_rad = math.atan2(-i, math.sqrt(j**2 + k**2))
b_deg = math.degrees(b_rad)
return round(a_deg, 6), round(b_deg, 6)
I have two more questions:
Are there any problems with my transfer function (ijk_to_ab)? Although it works in practice, I am worried that a direct conversion might not fully capture all the intent or precision from the CAM output.
If I plan to extend the RS274 module to support vector input, which vector format would be better to implement: the FANUC-style IJK (G43.5) or the SIEMENS-style A3/B3/C3? Are there advantages or disadvantages to either format, especially regarding compatibility and ease of parsing?
Thank you again for your help and suggestions!
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4407
- Thank you received: 1967
09 Jun 2025 11:49 #330006
by Aciera
Replied by Aciera on topic Five-Axis RTCP Features: G43.4 and G43.5 Equivalents in LinuxCNC
If that function works for you and your setup can handle the calculated angles then I don't see a problem there.
I would stick with the fanuc format since it uses ijk words which are already handled in linuxcnc. The A3/B3/C3 words of the siemens style would first have to be built into the interpreter.
I would stick with the fanuc format since it uses ijk words which are already handled in linuxcnc. The A3/B3/C3 words of the siemens style would first have to be built into the interpreter.
Please Log in or Create an account to join the conversation.
Time to create page: 0.061 seconds