586,036 active members*
3,603 visitors online*
Register for free
Login
Results 1 to 20 of 20
  1. #1
    Join Date
    Sep 2008
    Posts
    35

    G17, G18 and G19 explanation please

    Can somebody explain to me exactly what the purpose is of the G17, G18 and G19 codes please?
    I am aware that they somehow relate to which of the machine axis are being used but i get confused by the fact that a G17 specifys X and Y axis yet the program being excecuted will use X, Y and Z axis so why is there not a code to specify all 3 axis?

  2. #2
    Join Date
    Jul 2005
    Posts
    12177
    You have it correct, G17 is XY plane, G18 is XZ plane and G19 is YZ, but it really only applies when you are doing circular interpolation; G03 or G02.

    In G17 your circle goes around the Z axis, in G18 around the Y axis and G19 around the X axis.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  3. #3
    Join Date
    Mar 2003
    Posts
    4826
    I think I used a G18 or a G19 once in my programming life thus far, and even then, it was just a manual tryout

    Would it not be the case that arc commands in the various planes all have different formats?
    G17 G02 X,Y, I,J
    G18 G02 X,Z, I,K
    G19 G02 Y,Z, J,K

    Hence my question: why wouldn't the control just know what plane to execute the arc in by its syntax? Of course, modal coordinates could never be assumed, I guess, but still....
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  4. #4
    Join Date
    Sep 2008
    Posts
    35
    Quote Originally Posted by Geof View Post
    You have it correct, G17 is XY plane, G18 is XZ plane and G19 is YZ, but it really only applies when you are doing circular interpolation; G03 or G02.

    In G17 your circle goes around the Z axis, in G18 around the Y axis and G19 around the X axis.

    So does this mean that G18 and G19 will only ever be used on a machine with more than 3 axis as thats the only sort of machine that will allow you to produce a circle around the X or Y axis whereas on a 3 axis vertical mill you will only ever be able to produce a circle around the Z axis so would only ever use G17?
    And like HuFlungDung said - Why would the machine not just know what axis to use? Obviously it needs to be told otherwise we wouldnt use these codes, but i dont understand why.

  5. #5
    Join Date
    Mar 2003
    Posts
    2932
    Remember, these codes were invented when controls weren't as smart as they are now.

    G17, G18 & G19 also select which two axes get cutter comp when you activate G41 or G42 (remember, unless you buy the option, you only get two at a time) and which axes do what when drilling with canned cycles.

  6. #6
    Join Date
    Dec 2008
    Posts
    3109
    dcoupar is on the money

    Another way to look at the G17/G18/G19 issue is that:
    there is 6 axes of motion
    the first 3 are linear ( XYZ )
    the remaining 3 are rotational ( ABC ), around XYZ

    On a drill cycle when all XYZ are defined, which 2 are the positioning axes, and the remaining axis is the drilling line ( eg G18 XZ=positioning Y=drill line ) this is useful to know when programming for a right-angled head

    Mills use the plane command as a point of view that the arc is described as " a true arc ".
    An arc with it endpoints and centre points in the X,Y or Z plane would be seen as a line in either of the other planes.

    Think about the motion of a skateboarder in a 1/2 pipe, if you wanted a cutter to form this inside radii like the skater, then G17 is wrong, as with using G17, it would only create a big C.
    If viewed from the top, the skater is only moving in a line, but we all know he's moving in an arc when viewed from the side

  7. #7
    Join Date
    Feb 2008
    Posts
    586
    Quote Originally Posted by HuFlungDung View Post
    Would it not be the case that arc commands in the various planes all have different formats?
    G17 G02 X,Y, I,J
    G18 G02 X,Z, I,K
    G19 G02 Y,Z, J,K
    This is correct. On machines that have helical interpolation, all of the words X,Y,Z, I,J,K could be used on one line. The plane selection G17 18 and 19 dictate which plane the arc is generated, and which axes create each arc.

    And yes, G41 and G42 are cutter offsets applied in each plane.
    And yes, (parameter enabled) canned cycles like drilling allow a peck by the third axis (G17-Z axis drilling, G18-Y axis drilling, etc).

    As a visual aid, picture the contour you need to cut as you are standing in the plus-plus-plus quadrant of the contour you want to generate, looking back at the origin. On the XZ plane, a G02 will look counterclockwise from the front of the machine, because you are on the backside of that quadrant. Same goes for comp. The offset will need to be reversed because of that same viewpoint.

    I once had a machine with spindles in three directions, one pointing from the Z+ (as any VMC), and some pointing from Y+, and some pointing from X+, so we got used to programming everything in all planes. Even tool lengths!

    G19G43H01X1.
    G18G43H11Y0.
    G17G43H21Z1.

    HTH

  8. #8
    Join Date
    Mar 2003
    Posts
    4826
    Ah, yes, thanks Beege, the requirements for helical interpolation would require the plane to be specified.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  9. #9
    Join Date
    Nov 2004
    Posts
    260
    Quote Originally Posted by HuFlungDung View Post
    I think I used a G18 or a G19 once in my programming life thus far, and even then, it was just a manual tryout

    Would it not be the case that arc commands in the various planes all have different formats?
    G17 G02 X,Y, I,J
    G18 G02 X,Z, I,K
    G19 G02 Y,Z, J,K

    Hence my question: why wouldn't the control just know what plane to execute the arc in by its syntax? Of course, modal coordinates could never be assumed, I guess, but still....
    You could not rely on I and J or I and K or J and K been called out, because only one of each may be called out if the other happends to be zero.
    The G17, G18 or G19 code lets the controller know wich plane to use for circular interpolation.

  10. #10
    Join Date
    Sep 2008
    Posts
    35
    Thanks for the replies, ive read them over and over again and am slowly getting my head round it a little more each time i read through.
    Whilst the subject of helical interpolation has been raised can i also ask exactly what that means as it may make it clearer to me why the planes need to be specified, would it be referring to circular interpolation whilst also moving in the axis that the arc is being formed around? So as to be creating like a spiral effect?

  11. #11
    Join Date
    Jul 2005
    Posts
    12177
    Quote Originally Posted by cossiegaz View Post
    .......would it be referring to circular interpolation whilst also moving in the axis that the arc is being formed around? So as to be creating like a spiral effect?
    Exactly!

    Going around in a circle why moving along in a direction parallel to the axis of rotation; getting all screwed up in other words.

    Very useful for interpolating holes; you ramp down into the hole the cutter is making, or for milling a boss by ramping down the OD. You can also mill threads by having the Z movement per circle equal to the turns per inch; for internal threads G03 starting at the bottom is used and for external G02 starting at the top.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  12. #12
    Join Date
    Sep 2008
    Posts
    35
    Right ive been thinking about this again and am still a little confused, i understand that G17 would be used when producing an arc around Z axis using X and Y plane, G18 for producing an arc around Y axis using X and Z plane and G19 for producing an arc around X axis using Y and Z plane. Now if i was producing an arc starting from for instance X0 Y0 and finishing at X10 Y10 (which would be at a 45 degree angle across both the X and Y axis) and produced the arc using the Z axis then the arc would be equally around the X and Y axis so what G code would i need to use in this case?
    Hopefully i've written my question clearly enough to be understood, sorry if it doesnt make sense.

  13. #13
    Join Date
    Jul 2005
    Posts
    12177
    Good question. (I think)

    You are starting at X0. Y0. and moving to X10. Y10. by having the Z go up and down while both the X and Y axes move.

    You are a nuisance , do you realise this is going to bug me until I have time to go out to my workshop and fire up my mill to do some experimenting.

    Maybe there is a simple answer but it sure eludes me at the moment.

    I will return.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  14. #14
    Join Date
    Nov 2004
    Posts
    260
    Quote Originally Posted by cossiegaz View Post
    Right ive been thinking about this again and am still a little confused, i understand that G17 would be used when producing an arc around Z axis using X and Y plane, G18 for producing an arc around Y axis using X and Z plane and G19 for producing an arc around X axis using Y and Z plane. Now if i was producing an arc starting from for instance X0 Y0 and finishing at X10 Y10 (which would be at a 45 degree angle across both the X and Y axis) and produced the arc using the Z axis then the arc would be equally around the X and Y axis so what G code would i need to use in this case?
    Hopefully i've written my question clearly enough to be understood, sorry if it doesnt make sense.
    if I understand you correctly you want to circular interpolate in two planes?
    Well on some of the newer controllers this is possible to interpolate in 3d.
    However the mayority of older controllers do not allow this, you can interpolate only in one of the 3 planes per block.
    If this is something that is programmed on a cam system it is usually broken down by the postprocessor into tiny little line segments that will be spread out over many Blocks.

  15. #15
    Join Date
    Jul 2005
    Posts
    12177
    So there is no simple answer; just one that stretches to thousands of lines.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  16. #16
    Join Date
    Apr 2006
    Posts
    133
    I just ran these tests on our Haas simulator.
    (1)
    G17 G00 X0. Y0. Z0.
    G18
    G03 X10. Y10. Z0. I5. F10.
    G17

    or
    (2)
    G17 G00 X0. Y0. Z0.
    G19
    G02 X10. Y10. Z0. J5. F10.
    G17

    In both tests the DRO shows X5. Y5. Z5. as it crosses over the top.
    and finishes at X10. Y10. Z0.

    I had to switch to G02 in test 2 to get it to over the top in Z
    I haven't made chips with this however.

  17. #17
    Join Date
    Jul 2005
    Posts
    12177

    I didn't expect this

    I did some playing around on my SuperMiniMill with this program doing a semi-circle around the X Y diagonal;

    %
    O00001
    N1 G00 G20 G40 G49 G80 G90 G98
    N2 G53 G00 Z0.
    N3 (---)
    N4 T1 M06
    N5 G43 H01
    N6 M03 S10000
    N7 G54 G00 X0. Y0. Z1.
    N8 Z0. M08
    N9 G90 G01 Z-0.7 F80.
    N10 M97 P1100 L20
    N11 G90 G00 Z0.1
    N12 X0. Y0.
    N13 G01 Z-0.9 F100.
    N14 M97 P1100 L20
    N15 G90 G00 Z0.1
    N16 X0. Y0.
    N17 G90 G01 Z-1.1 F100.
    N18 M97 P1100 L20
    N19 G90 G00 Z4. M09
    N20 M30
    N21 (-------)
    N1100 G91 G18 G03 R1. X2. Y2.
    N1101 G01 X-0.1
    N1102 G18 G02 R1. X-2. Y-2.
    N1103 X-0.1
    N1104 M99
    N1105 (----)
    %

    The first picture shows a screen shot of the Graphics; I was expecting a straight line on the diagonal because both X and Y move the same distance. Clearly it is not a straight line in the X Y plane.

    The other pictures show the shape that was generated. I expected the elliptical shape because when you slice a cylinder at an angle you get an ellipse; remember your Conic Sections from geometry? But I don't think it is a true ellipse; I have no idea what the shape is.
    Attached Thumbnails Attached Thumbnails Funky6.jpg   Funky1.jpg   Funky2.jpg   Funky3.jpg  

    Funky4.jpg   Funky5.jpg  
    An open mind is a virtue...so long as all the common sense has not leaked out.

  18. #18
    Join Date
    Dec 2008
    Posts
    3109
    Hi Geof,

    Query? what tool are you doing this with ? Ballnose ?
    Are you using the tool tip as your zero?
    Comps ?

    If you use a ballnose cutter and not using comps, then your toolpath should be programmed to the centre of ball to get the proper shape.

    The best way is to picture it,
    -The ball centre is staying off the shape at a constant distance- so the ball centre is used )
    -If tool end is used, then that point will vary in distance from the actual cutting point on the tool as it forms the shape ) ( incorrect part is made )

    The shape you should end up with ( viewed from the front ) is a semi-circle wirh 1" radius and having diagonal cut lines forming this shape

    G18 = arc in XZ and Y controlling the depth of endpoints

    Stock X2" Y2" Z4", hold by 1"
    1" ballnose - toollength set to ball centre
    Face to Z0, 1st
    X0Y0=front LH corner
    Code:
    %
    O00001 
    N1 G00 G20 G40 G49 G80 G90 G98 
    N2 G53 G00 Z0. 
    N3 (---) 
    N4 T1 M06 
    N5 G43 H01 
    N6 M03 S10000 
    N7 G54 G00 X-0.5 Y0. Z1. 
    N8 Z0.1 M08 
    N9 G90 G01 Z-0.5 F80. ( tip actually 1" below) 
    N10 M97 P1100 L20 
    N11 G90 G00 Z0.1 
    N12 X-0.5 Y0.
    N13 G01 Z-0.8 F80.  ( tip actually 1.3" below) 
    N14 M97 P1100 L20 
    N15 G90 G00 Z0.1 
    N16 X-0.5 Y0. 
    N17 G90 G01 Z-1. F100.  ( tip actually 1.5" below) 
    N18 M97 P1100 L20 
    N19 G90 G00 Z4. M09 
    N20 M30 
    N21 (-------) 
    N1100 G91 G18 G03 R1.5 X2.5 Y0.0  ( try 2.5 later )
    N1101 G01 X-0.1 
    N1102 G18 G02 R1.5 X-2.5 Y-0.0  ( try 2.5 later )
    N1103 X-0.1 
    N1104 M99 
    N1105 (----) 
    %
    Boy, I'm not up to scratch with inches ( hope I got it right )

  19. #19
    Join Date
    Jul 2005
    Posts
    12177
    I wasn't worried about all that detail; I was just seeing what the machine would do. Torsten mentioned that an older machine probably would not do the move but JWK42 said it ran on a Haas simulator.

    I was using a 1/2" ballnose and I didn't even bother to try tool comp because Haas machines will not allow tool comp in G18 or G19.

    It was just a bit of fun with no intended shape in mind.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  20. #20
    Join Date
    Sep 2008
    Posts
    35
    JWK42 - Sounds as though maybe a g17 or g18 can be used when cutting at an exact 45degree angle, perhaps you have to select the appropriate planes depending on wether or not you are cutting at more or less than a 45 degree angle?? i.e whichever plane is closest to running through the circular interpolation.
    Geof - I dont know what shape it is either, we produce a few parts on my machine at work which use all 3 axis for interpolation so hopefully we will get round to running them soon and i can see exactly how the axis selection is used.

Similar Threads

  1. G41 and G42/40 explanation
    By noshoesnoshirt in forum G-Code Programing
    Replies: 3
    Last Post: 05-10-2009, 05:57 AM
  2. g02 g03 explanation
    By valmet58 in forum Community Club House
    Replies: 4
    Last Post: 03-20-2008, 03:36 AM
  3. I need some explanation
    By grebator in forum Stepper Motors / Drives
    Replies: 0
    Last Post: 04-04-2007, 01:03 PM
  4. G64 & G61 Explanation Please
    By weaston in forum G-Code Programing
    Replies: 1
    Last Post: 01-31-2007, 11:34 AM
  5. CNC explanation
    By Alex S.A in forum Uncategorised MetalWorking Machines
    Replies: 2
    Last Post: 10-01-2004, 06:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •