![](/uploads/1/2/7/7/127735940/377249777.png)
[ CNCCookbook’s G-Code Tutorial ]
Circular Interpolation is Motion Along a Circular Arc
Circular Motion is a Mode Initiated Via G02 and G03
Defining an arc’s center with IJK…
This arc starts at X0Y2 and finishes at X2Y0. It’s center is at X0Y0. We could specify it in g-code like this:
G02 (Set up the clockwise arc mode)
X2Y0 I0J-2.0
![G code generator for mach3 G code generator for mach3](/uploads/1/2/7/7/127735940/181288900.jpg)
The I and the J specify relative coordinates from the start point to the center. In other words, if we add the I value to the starting point’s X, and the J value to the starting point’s Y, we get the X and Y for the center.
Defining the Center Via the Radius Using “R”
We can also define the center just by specifying the radius of the circle. In this case, our circle has a radius of 2, so the g-code might be simply:
G02
X2Y0 R2
Many of you will be deciding right here and now that since R is easier to understand and shorter to write, you’re just going to use R and forget about IJK. But, the CNC teachers in the world will suggest that you should prefer IJK. Their argument is that when you use IJK, you get a double check that your arc is correct.
Why?
Because the controller gets to compute an actual set of coordinates for the center via IJK. Once it has the center’s coordinates, it can check that it is equa-distant from both end points. The check of each of those two distances is the double check. In the case of the “R” format, the controller has no such double check. It has to chose a center that guarantees equal distance.
Personally, I don’t know if I agree with the CNC instructors that this is providing any extra checking or not. I say go with whichever approach makes sense for your particular situation, but you should definitely be familiar and comfortable with both. You’re going to need to be comfortable with relative coordinates anyway, as they’re darned handy. May as well get comfortable now.
It’s kind of like being told you should only use the 4-jaw chuck on a lathe when you first start out so you’ll get very comfortable dialing it in. It’s a good skill to be good at as a machinist!
Variations in Arc Syntax for Different G-Code Dialects and Modes
When IJK Are Not Incremental and What About Having Both IJK And R? Plus, Other Modal Shenanigans and Arc Variations
This is another one of those places where lots of obscure things happen and you need to know what your controller will do without assuming anything. In general, the rule is supposed to be that if you have both IJK and R in the same block, R takes precedence and IJK is ignored. But there are controllers that don’t work exactly that way, so be sure you know what’s going on.
G-Wizard Editor let’s you specify several parameters in its Post that determine how arcs work. Here is a screen shot of the setup options:
Arc Options for G-Code Simulation
Engrave file with bad Post settings for Arcs…
Try Our G-Code Simulator and Editor, Free
If R is negative, it takes the longer path (in yellow). Positive gets the shorter path.
Given the two choices shown, the controller chooses the path based on the sign of the radius. Negative forces the longer arc, positive the shorter. The negative sign forces the controller to seek a viable arc of more than 180 degrees.
N46 G1 Z-.5 F10.
N47 Y.5 F30. S2000
N48 G2 J-1.1
N49 G1 Y.75
N50 Z.2
N51 G0 X.75 Y-3.4
N52 G1 Z-.5 F10.
N53 X.5 F30.
N54 G2 I-1.1
N55 X.75
N56 Z.2
N57 G0 X-4.75 Y-3.4
N58 G1 Z-.5 F10.
N59 X-4.5 F30.
N60 G2 I1.1
N61 G1 X-4.75
N62 Z.2
Helix for thread milling…
G01 G42 D08 X0.0235 Y-0.0939 F10.
G03 X0.0939 Y0.0939 Z0.0179 R0.0939
G03 X-0.1179 Y0.1179 Z0.0179 R0.1179
G03 X-0.1185 Y-0.1185 Z0.0179 R0.1185
G03 X0.1191 Y-0.1191 Z0.0179 R0.1191 F16.
G03 X0.1196 Y0.1196 Z0.0179 R0.1196
G03 X-0.1202 Y0.1202 Z0.0179 R0.1202 F26.
G03 X-0.1207 Y-0.1207 Z0.0179 R0.1207
G03 X0.1213 Y-0.1213 Z0.0179 R0.1213
G03 X0.1218 Y0.1218 Z0.0179 R0.1218
G03 X-0.0975 Y0.0975 Z0.0179 R0.0975
Note the thread pitch here is calculated as 0.1″
![For For](https://image.pushauction.com/0/0/4c1f8a06-e99f-4c6d-9426-0d660fa5f62b/5dfd2135-d7cc-4e59-8fe1-765023e7d4e1.jpg)
GWE will measure and tell you the helix pitch, which in this case is 0.100″. That can be useful for identifying what sort of thread is being milled. We can also see that this particular arc runs from 270 degrees to a scosh more than zero (0.1 degrees).
We’ll revisit thread milling in much more detail in a later chapter devoted entirely to the subject. For now, we just wanted you to be familiar with the idea that you can make helixes as well as flat two dimensional arcs.
Making Toolpaths Your Machine Will Be Happier With
Whenever the cutter changes direction, it adds a certain amount of stress. The cutter will bite into the material either more or less than it had been, depending on whether the directions changes towards the workpiece (or uncut material) or away from it. Your machine will be much happier if you program an arc rather than an abrupt straightline change of direction. Even an arc with a very small radius will allow the controller to avoid changing direction instantly, which can leave a mark in the finish in the best case and cause chatter or other problems in the worst case. For slight changes of direction, it may not be worth it. But the more abrupt the change, with 90 degrees being very abrupt, the greater the likelihood you should use an arc to ease through the turn.
Arcs are also a useful way to enter the cut, rather than having the cutter barge straight in. For information on entering the cut with an arc, see the toolpath page from the Milling Feeds and Speeds Course.
Exercises
1. Dig out your CNC controller manual and go through the arc settings to set up GWE to match your control’s way of operating.
2. Do some etch-a-sketch experimentation with GWE. Create some toolpaths that include arcs until you’re comfortable creating them.
Next Article: Running the GWE G-Code Simulator
![](/uploads/1/2/7/7/127735940/377249777.png)