Author Topic: g02 and g03  (Read 9829 times)

Offline matt1of3

  • Ewok
  • *
  • Posts: 3
    • View Profile
g02 and g03
« on: December 29, 2021, 17:28:39 pm »
When I profile a circle I get 3 g02 arcs spaced 120 deg. apart.  What I really would like is a single g02 making a single move completing the circle.
Is it normal for CamBam to divide a circle into 3 parts?
Can I turn it off and make a single g02 command line for a circle?

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7566
    • View Profile
    • Cambam V1.0 French Doc
Re: g02 and g03
« Reply #1 on: December 29, 2021, 18:22:14 pm »
Hello

Welcome to the forum  ;)

Quote
Is it normal for CamBam to divide a circle into 3 parts?

Yes, this is the normal way. The reason is because some controllers do not accept arc > to 180°, so with 3x120° the Gcode is compatible with them.

++
David

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9075
    • View Profile
Re: g02 and g03
« Reply #2 on: December 29, 2021, 20:14:21 pm »
Matt,
The other thing I don't understand is why you want a single circular curve?  Yes, it takes three G02 or G03 instructions to mill a circle, but those happen one-after-the other in continuous fashion, with NO pauses or tool lifts between segments.

So, you wouldn't see a difference in the actual execution of those three commands than you would with a single one.

IF your machine is pausing or lifting the tool between segments, it's a problem with your post-processor or the configuration of your machine.  No 'properly-configured' machine would do such.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline matt1of3

  • Ewok
  • *
  • Posts: 3
    • View Profile
Re: g02 and g03
« Reply #3 on: December 29, 2021, 21:07:56 pm »
3 instructions when one will do is harder to read.  The real problem I'm having is I get a circle error when it runs the secound g02.  Here is the code.

G81 X1.251 Y-0.85 Z-0.45 F10.0
G81 X2.7492
G80
( Profile1 )
G0 Z0.125
G0 X1.505
G0 Z0.0625
G1 F10.0 Z-0.2
G2 F40.0 X1.124 Y-1.07 I1.251 J-0.85
G2 Y-0.63 I1.251 J-0.85
G2 X1.505 Y-0.85 I1.251 J-0.85

I think the machine is not happy with the Y-0.63 (secound g2), everything else looks good to me.  If I remove the middle g2 it works fine.

There is a slight pause between commands, that doesn't concern me.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5322
  • Made in England
    • View Profile
Re: g02 and g03
« Reply #4 on: December 29, 2021, 22:15:55 pm »
Why bother about the number of instructions ? all I look at are the resultant toolpaths. If it's a concern you could always hand optimise later but to me that's defeating the object of using CAM software.
The gcode snippet works fine for me, you should try it in a simulator such as Camotics; https://camotics.org/
or NCnetic; https://ncnetic.com/
« Last Edit: December 29, 2021, 22:32:03 pm by EddyCurrent »
Filmed in Supermarionation

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9075
    • View Profile
Re: g02 and g03
« Reply #5 on: December 29, 2021, 23:07:56 pm »
"G2 Y-0.63 I1.251 J-0.85
G2 X1.505 Y-0.85 I1.251 J-0.85

I think the machine is not happy with the Y-0.63 (secound g2), everything else looks good to me.  If I remove the middle g2 it works fine.

There is a slight pause between commands, that doesn't concern me."
-----
Matt,
Although it 'doesn't concern you', it should.  It's not normal for machines to pause between subsequent commands that begin exactly at the point of the last command's end.  BUT, it might be the pause is because the middle command is ignored.

For that point, the difference appears to be that your machine requires both X and Y coordinates to be supplied, while the second G2 only lists Y.  The other two have both.  I don't think it has to do with the the Y-coordinate, but the lack of an X.

To that end, remove the 'modal' feature of the axes in your post-processor, and it will issue both for every command.

In most post-processors, there is a definition for 'feedmove'.  For instance, in mine, it reads:
<FeedMove>{$g1} {$_f} {$_x} {$_y} {$_z} {$_a} {$_b} {$_c}</FeedMove>

The underscore before each axis or feed command means that item is 'modal'.  That is, if it does not change since the last command, it is NOT re-issued. 

It appears your machine needs all the axes specified in each command.  To accomplish that, simply remove the underscore before any offending axis (or item) in the feedmove clause.

If you have separate definitions for arc moves (G2 or G3) remove the underscores in them, as well.

Lloyd

« Last Edit: December 29, 2021, 23:10:22 pm by lloydsp »
"Pyro for Fun and Profit for More Than Fifty Years"

Offline matt1of3

  • Ewok
  • *
  • Posts: 3
    • View Profile
Re: g02 and g03
« Reply #6 on: December 30, 2021, 19:49:04 pm »
Thanks All, spot on help. 

Apparently my machine is quasi modal, I changed the post and everything worked. 

Again Thanks.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9075
    • View Profile
Re: g02 and g03
« Reply #7 on: December 30, 2021, 21:52:45 pm »
Hooray, Matt!

Every little thing like that which you 'solve' will improve your future machining life!

Good luck.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"