Strange preview for circular arc (G2/G3)
- Finngineering
- Online
- Premium Member
-
Less
More
- Posts: 107
- Thank you received: 47
29 Jan 2026 18:54 #342165
by Finngineering
Strange preview for circular arc (G2/G3) was created by Finngineering
Hello,
I was planning to bore out a disc yesterday and thought I'd handwrite the code. The circular path would be 105 mm in diameter with the center at G54 X0, Y0, and starting at position X-52.5 Y0. Because of my lack of experience, I wrote is as a small program so I could get a preview. But the preview is not what I expected for the:The arc is started from position X-52.5, Y0.
As you can see in the screenshot, the preview shows a strange linear movement and a counter clockwise helix. But when I run the code, the machine makes a 105 mm circle in the XY plane, just as I wanted. The path from this run is visible as well (the red line). I'm guessing I'm doing something wrong, but what?
I was planning to bore out a disc yesterday and thought I'd handwrite the code. The circular path would be 105 mm in diameter with the center at G54 X0, Y0, and starting at position X-52.5 Y0. Because of my lack of experience, I wrote is as a small program so I could get a preview. But the preview is not what I expected for the:
G2 I52.5 J0 P1As you can see in the screenshot, the preview shows a strange linear movement and a counter clockwise helix. But when I run the code, the machine makes a 105 mm circle in the XY plane, just as I wanted. The path from this run is visible as well (the red line). I'm guessing I'm doing something wrong, but what?
Attachments:
Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4661
- Thank you received: 2078
30 Jan 2026 07:41 #342192
by Aciera
Replied by Aciera on topic Strange preview for circular arc (G2/G3)
Attachments:
The following user(s) said Thank You: Finngineering
Please Log in or Create an account to join the conversation.
- Finngineering
- Online
- Premium Member
-
Less
More
- Posts: 107
- Thank you received: 47
30 Jan 2026 16:27 #342217
by Finngineering
Replied by Finngineering on topic Strange preview for circular arc (G2/G3)
The complete code was visible in the screenshot, but for clarity I include it here:
I made a new test with the code you used, and for that the preview is working properly. But if I comment out the G0 move, then the preview is again strange. See the two situations below.
The complete code, with G0 commented out is below:
Maybe this is expected behavior? It certainly wasn't what I expected, but that doesn't mean much. I use LinuxCNC 2.9.2 by the way.
Thank you for having a look. With that the issue is now pinpointed.
G17
F500
G2 I52.5 J0 P1
M2I made a new test with the code you used, and for that the preview is working properly. But if I comment out the G0 move, then the preview is again strange. See the two situations below.
The complete code, with G0 commented out is below:
G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94
(G0 X-52.5 Y0)
F1000
G2 I52.5 J0 P1
M2Maybe this is expected behavior? It certainly wasn't what I expected, but that doesn't mean much. I use LinuxCNC 2.9.2 by the way.
Thank you for having a look. With that the issue is now pinpointed.
Attachments:
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 509
- Thank you received: 213
30 Jan 2026 17:14 #342218
by MaHa
Replied by MaHa on topic Strange preview for circular arc (G2/G3)
Attachments:
The following user(s) said Thank You: Finngineering
Please Log in or Create an account to join the conversation.
- Finngineering
- Online
- Premium Member
-
Less
More
- Posts: 107
- Thank you received: 47
30 Jan 2026 17:34 - 30 Jan 2026 17:34 #342221
by Finngineering
Replied by Finngineering on topic Strange preview for circular arc (G2/G3)
Yes, helix milling was the end goal. But I was trying to build the program as simple as possible to start with, because I have little experience with anything else than G0/G1. But I got stuck because the preview did not show what I expected for an in-plane (XY) circle.
Thank you for the explanation and test you provided!
Thank you for the explanation and test you provided!
Last edit: 30 Jan 2026 17:34 by Finngineering.
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
-
Less
More
- Posts: 509
- Thank you received: 213
30 Jan 2026 17:55 #342222
by MaHa
Replied by MaHa on topic Strange preview for circular arc (G2/G3)
This toolpath is at centerpoint, so don't forget cuttercompensation. If G41/ / G42 makes trouble, whats not unusual, it can be solved like that. Parameter #5410 is tooldiameter of loaded tool.
G0 X-[52.5 - [#5410 / 2]] Y0 Z0
F1000
G2 I[52.5 - [#5410 / 2]] J0 Z-10 P5Please Log in or Create an account to join the conversation.
- Aciera
-
- Offline
- Administrator
-
Less
More
- Posts: 4661
- Thank you received: 2078
31 Jan 2026 10:57 #342245
by Aciera
Replied by Aciera on topic Strange preview for circular arc (G2/G3)
Attachments:
Please Log in or Create an account to join the conversation.
- Finngineering
- Online
- Premium Member
-
Less
More
- Posts: 107
- Thank you received: 47
01 Feb 2026 12:52 #342278
by Finngineering
Replied by Finngineering on topic Strange preview for circular arc (G2/G3)
Maybe the result depends on the starting position, or some other unknown factor(?)
As such, this is okay for me. I was thinking that maybe a have some strange more or similar enabled. But it appears the preview may require a linear move before arcs.
So maybe a bug in the preview code...
As such, this is okay for me. I was thinking that maybe a have some strange more or similar enabled. But it appears the preview may require a linear move before arcs.
So maybe a bug in the preview code...
Please Log in or Create an account to join the conversation.
- Hannes
- Online
- New Member
-
Less
More
- Posts: 14
- Thank you received: 4
09 Mar 2026 20:22 #344068
by Hannes
Replied by Hannes on topic Strange preview for circular arc (G2/G3)
I just quickly tested it. That's a bug in gmoccapy. In axis, it works.
In axis, you have to reload the gcode after each other move, so the initial position of the circle is updated.
G2's I and J parameters are relative to the last position:
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g2-g3
Now if you don't have a G0 or G1 command before, the preview in gmoccapy looks funny. I think the preview interpreter is not initialized with the actual position in the UI. The real machine interpreter has no issues afterwards.
For the first command, X,Y and Z has to be specified to work. G0 X0 Y0 is not enough, G0 X0 Y0 Z0 does the trick.
I suggest writing a bug report.
In axis, you have to reload the gcode after each other move, so the initial position of the circle is updated.
G2's I and J parameters are relative to the last position:
linuxcnc.org/docs/html/gcode/g-code.html#gcode:g2-g3
Now if you don't have a G0 or G1 command before, the preview in gmoccapy looks funny. I think the preview interpreter is not initialized with the actual position in the UI. The real machine interpreter has no issues afterwards.
For the first command, X,Y and Z has to be specified to work. G0 X0 Y0 is not enough, G0 X0 Y0 Z0 does the trick.
I suggest writing a bug report.
Please Log in or Create an account to join the conversation.
- Hannes
- Online
- New Member
-
Less
More
- Posts: 14
- Thank you received: 4
09 Mar 2026 20:37 #344069
by Hannes
Replied by Hannes on topic Strange preview for circular arc (G2/G3)
BTW: Not having a absolute move before a relative move is probably not anything a CAM software would ever do, but it's also not illegal.
However, a "normal" preview tool not knowing where you machine is could not show you anything in that case.
However, a "normal" preview tool not knowing where you machine is could not show you anything in that case.
Please Log in or Create an account to join the conversation.
Time to create page: 0.178 seconds