# Thread: G2 and G3 Commands

1. ## G2 and G3 Commands

Being new to GCode, I need some help understanding of usage of the G2 and G3 commands.

How is G2 and G3 used with I, J, and R in controlling the size of arc generated? and... What's a good way to have my X-Y table generate a 0.500 R circle once, and one that goes infinitly in a circle?

FYI - My application of GCode will be for controlling an X-Y table inside an electron beam machine with a fixed gun. I also prefer to use incremental movements and presently begin my circles now from a 9:00 starting position.

Any help would be much appreciated.

2. for milling, g02 is clockwise, g03 is counter-clockwise.
if this an inside circle, starting from 9:00 it would be
x-.500y0
g03 i.500.
this is climb milling

to conventional mill
x-.500y0
g02i.500

think of i as x, and j as y
x0 y.500
g02j-.500

3. Hi, as Hira said on the g2 & g3. The I designates the center of the radi point on the x axis and j is for the y axis and k is for the z. If you need a r (radius) value, you are using software that is not real common, like that free stuff. I think its best you learn a fanuc post which is most common, like in Artsoft Mach3, cnc pro, Hass machines, Fadel machines, etc.. Also remember, in the LINE AFTER ANY CIRCLE (which includes a g2 or g3) make sure you put a g1 or g0 for feed or rapid, because on some machines, if that is not there, any axis will just go anywhere untill you hit a limit, even if it means crashing through things. Proof: Bridgeport boss 7.2 and i have seen this on other machines also. Good Luck.

4. Thanks you two for the explainations. I only have a bench setup to look at while making this, but I think I can go once around with this program I made...

N10 G20 G91 F20
N20 G03 X-0.25 Y0.0 I0.25 J0.0

As I said, I can't see the circle generated. That, I think, will produce me a CCW 0.500 circle starting and ending from 9:00 moving incrementally.

How can I get that circle to repeat 5 time without having to have repeat N20 5 times? And finally, how can I get that program looped infinitely? Is there a loop command thats commonly used? I tried M97, but that didn't seem to work.

5. For a complete circle you only need I and J.

G02 I0.0 J-0.25 will give a single circle of diameter 0.500 with the center located -0.25 away from the start point along the Y axis. At least that is how Haas machines work; some machines would put the center at 0.25 absolute.

Again on the Haas adding an L count gives you that many circles.

G02 I0.0 J-0.25 L10 gives ten complete circles.

Infinity is not allowed in the L count but then you would be a bit old by the time it finished wouldn't you?

6. N3000
(.500 Endmill)
G0g20g54g90g17s3000m3
G0x0y0t4
G43z.1h3m8
G1z-.35f20.
G1y.03
G3x0y.03j-.03d03f3.
G1x0y0f10.
G0g40z1.
M21
G0g43h3z.1
G1z-.35f20.
G1y.03
G3x0y.03j-.03d03f3.
G1x0y0f10.
G0g40z1.m9
G91g28z0
M1
M6

7. Originally Posted by Geof
Infinity is not allowed in the L count but then you would be a bit old by the time it finished wouldn't you?
LOL, my unit is Camsoft Pro and will be operating an X-Y table of our design. I tried what you suggested Geof but it didn't work, thanks tho.

I'm not sure what exactly that is Jackson, what is that?

8. Originally Posted by Bohemund
LOL, my unit is Camsoft Pro and will be operating an X-Y table of our design. I tried what you suggested Geof but it didn't work, thanks tho.

I'm not sure what exaclty that is Jackson, what is that?
you just need to read to the m21, the m21 is for my 4th axis to spin the part
but that is your g3 code

I'm looking for a way to loop my program without needing to repeat a program line. I'll do it if I have to, that's not a problem. Is there an alternative way that's commonly used?

10. This code is used in mech soft, your welcome to try it in your program:
**to repeat gcode indefinitely:
****************************

%
N1 (first line of gcode)
G20 G00 etc.
...
.
..
.
.(more lines of code)
.
.
M1
M99 P1
%

11. To continuously loop your program it's just an M99 at the end. but to stop it you'd have to hit the reset button.
;
;
/M30;
M99;
%
This way you can keep the block delete switch on and it will ignore the M30.
When you're ready to stop the program just flip block delete to off to read the M30.

12. If you have the GOTO function, then

N100
program
GOTO 100

This is an infinite loop. You stop it by turning power off or a RESET, or put a conditional test inside the program that jumps (GOTO) outside of the loop.

.

Page 1 of 2 12 Last