(Solved) G43 not being applied in g-code
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 2057
- Thank you received: 853
27 Apr 2026 04:34 #345964
by spumco
(Solved) G43 not being applied in g-code was created by spumco
Revisiting an issue I noticed here:
forum.linuxcnc.org/10-advanced-configura...l-orientation#345715
At the time I wasn't sure if this was a GUI issue, or something in my config. I've since switched GUIs (Axis, FlexGUI, and Qtpyvcp) and the issue is the same across all three GUIs.
Problem I have is that G43 isn't being applied consistently during a program. G43 works via MDI, and all three GUI tool-change buttons.
I've tried every permutation:
Tn M6 G43
Tn M6 G43 Hn
M6 Tn G43
M6 Tn G43 Hn
And the same as above, but with G43 on another line. Also tried an M1 after the tool change line(s) - even a few lines down - but LCNC just isn't applying the tool offset.
When I run a program, LCNC excutes the tool change - new tool number is displayed in all three GUIs - but doesn't apply the offset.
Tool number doesn't matter - whatever tool offset was previously applied remains active after the Tn M6 line.
Under Axis I was using the "T" remap from the sim lathe-fanucy
Under qtpyvcp, I commented out the "T" and "M6" remap and was just using the 'stock' M6
I'm sure this is something on my end and unlikely to be an LCNC problem. Maybe the remap.py and stdglue.py used by my other remapped M-codes is interfering with 'normal' M6/G43?
Anyone have an idea what would interfere with G43 being applied during a program, but not via MDI or a GUI-based command?
forum.linuxcnc.org/10-advanced-configura...l-orientation#345715
At the time I wasn't sure if this was a GUI issue, or something in my config. I've since switched GUIs (Axis, FlexGUI, and Qtpyvcp) and the issue is the same across all three GUIs.
Problem I have is that G43 isn't being applied consistently during a program. G43 works via MDI, and all three GUI tool-change buttons.
I've tried every permutation:
Tn M6 G43
Tn M6 G43 Hn
M6 Tn G43
M6 Tn G43 Hn
And the same as above, but with G43 on another line. Also tried an M1 after the tool change line(s) - even a few lines down - but LCNC just isn't applying the tool offset.
When I run a program, LCNC excutes the tool change - new tool number is displayed in all three GUIs - but doesn't apply the offset.
Tool number doesn't matter - whatever tool offset was previously applied remains active after the Tn M6 line.
Under Axis I was using the "T" remap from the sim lathe-fanucy
Under qtpyvcp, I commented out the "T" and "M6" remap and was just using the 'stock' M6
I'm sure this is something on my end and unlikely to be an LCNC problem. Maybe the remap.py and stdglue.py used by my other remapped M-codes is interfering with 'normal' M6/G43?
Anyone have an idea what would interfere with G43 being applied during a program, but not via MDI or a GUI-based command?
Please Log in or Create an account to join the conversation.
- andrax
-
- Offline
- Elite Member
-
Less
More
- Posts: 266
- Thank you received: 64
27 Apr 2026 10:55 #345969
by andrax
Replied by andrax on topic (Solved) G43 not being applied in g-code
Do you have a sample program that uses the G43 call?
Please Log in or Create an account to join the conversation.
- spumco
- Offline
- Platinum Member
-
Less
More
- Posts: 2057
- Thank you received: 853
27 Apr 2026 11:35 #345972
by spumco
I can double-check for something abnormal later, but is there something I (or the post processor) could put in a program which would cause LCNC to ignore G43? It's not like there's a GOTO statement skipping over the G43 words.
Replied by spumco on topic (Solved) G43 not being applied in g-code
Not handy at the moment, but the issue persists across multiple programs. First noticed on a fairly simple turning pgm with 3 tool changes, but the same thing happens when I just hand code or trim down a pgm for testing.Do you have a sample program that uses the G43 call?
I can double-check for something abnormal later, but is there something I (or the post processor) could put in a program which would cause LCNC to ignore G43? It's not like there's a GOTO statement skipping over the G43 words.
Please Log in or Create an account to join the conversation.
- andrax
-
- Offline
- Elite Member
-
Less
More
- Posts: 266
- Thank you received: 64
27 Apr 2026 12:42 #345984
by andrax
Replied by andrax on topic (Solved) G43 not being applied in g-code
Please try to provide a program excerpt. I would like to take a look at it and test it on my system.
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: 2057
- Thank you received: 853
27 Apr 2026 21:32 #345994
by spumco
Replied by spumco on topic (Solved) G43 not being applied in g-code
Here's a program snip from the last round of unsuccessful testing:
N10 G7
N15 G90 G18
N20 G20
N25 G53 G0 Z0.
(FACE2 3)
N30 M6 T2 G43 H2
N40 G90 G95 G18
N45 G54
N50 M210
M1
N55 G97 S1650 M4
N60 G0 X-0.81
Z0.1969
N65 G96 D2000 S350 M4
N70 G0 X-0.78 Z-0.02
N75 G1 X-0.75 F0.005
N80 X0.0625
N85 G0 Z0.1969
N90 G97 S2000 M4
As I mentioned earlier, I've also tried the G43 on a separate line, with and without the Hn word. I added the M1 just to stop the pgm before the spindle ramps up during testing.
The X-values are all negative based my post processor (gang tool slant bed back-lathe, X+ is 'up', and T2 is on the 'negative' side of things). The motion is correct for my particular setup.
If I start the above program with T2 loaded and offsets applied (via MDI or GUI cmd), everything works...until the next tool change.
I've also attached my remap.py and stdglue.py just in case there's something in there messing things up.
Thanks for having a look.
Warning: Spoiler!
N10 G7
N15 G90 G18
N20 G20
N25 G53 G0 Z0.
(FACE2 3)
N30 M6 T2 G43 H2
N40 G90 G95 G18
N45 G54
N50 M210
M1
N55 G97 S1650 M4
N60 G0 X-0.81
Z0.1969
N65 G96 D2000 S350 M4
N70 G0 X-0.78 Z-0.02
N75 G1 X-0.75 F0.005
N80 X0.0625
N85 G0 Z0.1969
N90 G97 S2000 M4
As I mentioned earlier, I've also tried the G43 on a separate line, with and without the Hn word. I added the M1 just to stop the pgm before the spindle ramps up during testing.
The X-values are all negative based my post processor (gang tool slant bed back-lathe, X+ is 'up', and T2 is on the 'negative' side of things). The motion is correct for my particular setup.
If I start the above program with T2 loaded and offsets applied (via MDI or GUI cmd), everything works...until the next tool change.
I've also attached my remap.py and stdglue.py just in case there's something in there messing things up.
Thanks for having a look.
Please Log in or Create an account to join the conversation.
- andrax
-
- Offline
- Elite Member
-
Less
More
- Posts: 266
- Thank you received: 64
28 Apr 2026 09:59 #346001
by andrax
Replied by andrax on topic (Solved) G43 not being applied in g-code
I see
G53...
G43...
G54...
G43 currently refers to the machine coordinates. Then you select coordinate system 1.
That might be why G43 becomes ineffective.
Write G54 before G43
G53...
G54...
G43...
In MIDI, by the way, the last coordinate system is always active, so G54.
I hope this helps
regards
G53...
G43...
G54...
G43 currently refers to the machine coordinates. Then you select coordinate system 1.
That might be why G43 becomes ineffective.
Write G54 before G43
G53...
G54...
G43...
In MIDI, by the way, the last coordinate system is always active, so G54.
I hope this helps
regards
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: 2057
- Thank you received: 853
28 Apr 2026 10:42 #346002
by spumco
Replied by spumco on topic (Solved) G43 not being applied in g-code
I was under the impression that a 'G0 G53 Xnnn' line doesn't change the active WCS to the machine coordinates, it just causes LCNC to move to a machine coordinate for that line only.
Second, if a change in WCS causes the tool offsets to be removed everyone using LCNC would have to write programs with G43 after every WCS change.
More importantly, the order of G53-G43-G54 is what is output by the Fusion 360 standard LCNC turning post. I can't be the only one using that post; if that order was wrong everyone who uses the post would be having the same problem.
I will certainly try out your suggestion this evening even if I'm dubious. And thank you for giving it some thought.
Second, if a change in WCS causes the tool offsets to be removed everyone using LCNC would have to write programs with G43 after every WCS change.
More importantly, the order of G53-G43-G54 is what is output by the Fusion 360 standard LCNC turning post. I can't be the only one using that post; if that order was wrong everyone who uses the post would be having the same problem.
I will certainly try out your suggestion this evening even if I'm dubious. And thank you for giving it some thought.
Please Log in or Create an account to join the conversation.
- andrax
-
- Offline
- Elite Member
-
Less
More
- Posts: 266
- Thank you received: 64
28 Apr 2026 12:08 #346005
by andrax
Replied by andrax on topic (Solved) G43 not being applied in g-code
I'm not entirely sure about this either.
At least G10 only affects the currently selected coordinate system. As soon as you switch, your shift disappears.
It could be the same with G43, since you're applying the length correction to G53.
Just try it out.
At least G10 only affects the currently selected coordinate system. As soon as you switch, your shift disappears.
It could be the same with G43, since you're applying the length correction to G53.
Just try it out.
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 520
- Thank you received: 224
28 Apr 2026 13:02 #346006
by MaHa
Replied by MaHa on topic (Solved) G43 not being applied in g-code
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4690
- Thank you received: 2098
28 Apr 2026 15:37 #346011
by Aciera
@spumco
Have you tried without 'RETAIN_G43 = 1' in the ini file? (you have one line commenting it out and another later on activating it)
Replied by Aciera on topic (Solved) G43 not being applied in g-code
Not sure I understand this right but 'M6 Tn G43' certainly works fine for me.so G43 in a line with M6, sets G49
@spumco
Have you tried without 'RETAIN_G43 = 1' in the ini file? (you have one line commenting it out and another later on activating it)
Please Log in or Create an account to join the conversation.
Time to create page: 0.130 seconds