- Posts: 110
- Thank you received: 0
Strange preview for circular arc (G2/G3)
- Finngineering
- Topic Author
- Offline
- Premium Member
-
Less
More
9 months 1 day ago #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:
Code:
G2 I52.5 J0 P1
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?
Attachment not found
Please Log in to join the conversation.
9 months 1 day ago #342192
by Aciera
Replied by Aciera on topic Strange preview for circular arc (G2/G3)
Seems to work for me, but maybe you could provide a complete gcode example:
Attachment not found
Please Log in to join the conversation.
- Finngineering
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 110
- Thank you received: 0
9 months 16 hours ago #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.
Code:
G17
F500
G2 I52.5 J0 P1
M2
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.
Attachment not found
Attachment not found
The complete code, with G0 commented out is below:
Code:
G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94
(G0 X-52.5 Y0)
F1000
G2 I52.5 J0 P1
M2
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.
Please Log in to join the conversation.
9 months 15 hours ago #342218
by MaHa
Replied by MaHa on topic Strange preview for circular arc (G2/G3)
Just in case you want helix milling, you need to set z value for start and end. P is the amount of turns, if z-10 P5, it could look like that, pitch 2
Code:
G0 X-52.5 Y0 Z0
F1000
G2 I52.5 J0 Z-10 P5
Attachment not found
Please Log in to join the conversation.
- Finngineering
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 110
- Thank you received: 0
9 months 15 hours ago #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!
Please Log in to join the conversation.
9 months 15 hours ago #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.
Code:
G0 X-[52.5 - [#5410 / 2]] Y0 Z0
F1000
G2 I[52.5 - [#5410 / 2]] J0 Z-10 P5
Please Log in to join the conversation.
8 months 4 weeks ago #342245
by Aciera
Replied by Aciera on topic Strange preview for circular arc (G2/G3)
Testing on current 2.9.8 with the G0 move commented give me this, which is not quite correct but it's not as wrong as what you got:
Attachment not found
Please Log in to join the conversation.
- Finngineering
- Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 110
- Thank you received: 0
8 months 4 weeks ago #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 to join the conversation.
7 months 3 weeks ago #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 to join the conversation.
7 months 3 weeks ago #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 to join the conversation.
Time to create page: 0.102 seconds
