585,555 active members*
3,450 visitors online*
Register for free
Login

Thread: G2 code help

Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2015
    Posts
    54

    G2 code help

    I'm just getting started. While I have Aspire and its next on my to-do list, I'm trying to learn by drilling my new spoil-board using just gcode on mach4 MDI window. I'm trying to make 1 inch recesses where the bolt heads go.
    I tried G2 with the R parameter and kept getting a message about starting where it ended... or something close to that. Then I tried the IJK style and while it created a circle - it didn't put it where I wanted and I can't understand by the description how you make anything other than an arc, not a circle.

    What is the correct code for a 1/2 inch diameter bit to make a 1 inch hole at X2.0, Y2.0 Z-0.5. If you could show me both the R and the IJK ways I would appreciate it.

  2. #2
    Join Date
    Sep 2002
    Posts
    1953
    I don't know your controller but I nevertheless may be able to give some hints.
    A full circle can't be defined by providing only the radius because in this case the center of the circle can not be determined: Every point on a circle with radius R around your starting point would fit as the center point of such a circle.
    The classical way to define a full circle with IJK-style programming in your example would be

    G01 X1.5 Y2.0 Z-0.5
    G02 X1.5 Y2.0 I0.5 J0.0

  3. #3
    Join Date
    Apr 2005
    Posts
    304

    Re: G2 code help

    This is fro Aspire:

    ( Pocket )
    ( File created: Sunday January 05 2020 - 10:49 AM)
    ( for Mach2/3 from Vectric )
    ( Material Size)
    ( X= 10.000, Y= 10.000, Z= 2.000)
    ()
    (Toolpaths used in this file
    (Pocket 1)
    (Tools used in this file: )
    (1 = End Mill {0.5 inch})
    N100G00G20G17G90G40G49G80
    N110G70G91.1
    N120T1M06
    N130 (End Mill {0.5 inch})
    N140G00G43Z0.0000H1
    N150S12000M03
    N160(Toolpath:- Pocket 1)
    N170()
    N180G94
    N190X0.0000Y0.0000F100.0
    N200G00X2.0000Y2.0500Z0.0000
    N210G1Z-0.2500F30.0
    N220G2X2.0500Y2.0000I0.0000J-0.0500F100.0
    N230G2X2.0000Y1.9500I-0.0500J0.0000
    N240G2X1.9500Y2.0000I0.0000J0.0500
    N250G2X2.0000Y2.0500I0.0500J0.0000
    N260G1Y2.2500
    N270G2X2.2500Y2.0000I0.0000J-0.2500
    N280G2X2.0000Y1.7500I-0.2500J0.0000
    N290G2X1.7500Y2.0000I0.0000J0.2500
    N300G2X2.0000Y2.2500I0.2500J0.0000
    N310G00Z0.0000
    N320G00Y2.0500
    N330G1Z-0.5000F30.0
    N340G2X2.0500Y2.0000I0.0000J-0.0500F100.0
    N350G2X2.0000Y1.9500I-0.0500J0.0000
    N360G2X1.9500Y2.0000I0.0000J0.0500
    N370G2X2.0000Y2.0500I0.0500J0.0000
    N380G1Y2.2500
    N390G2X2.2500Y2.0000I0.0000J-0.2500
    N400G2X2.0000Y1.7500I-0.2500J0.0000
    N410G2X1.7500Y2.0000I0.0000J0.2500
    N420G2X2.0000Y2.2500I0.2500J0.0000
    N430G00Z0.0000
    N440G00Z0.0000
    N450G00X0.0000Y0.0000
    N460M09
    N470M30
    %
    Note that everry "circle" consists of four arcs.
    Make no mistake between my personality and my attitude.
    My personality is who I am. My attitude depends on who you are.

  4. #4
    Join Date
    Aug 2009
    Posts
    1570

    Re: G2 code help

    This might help you from Mach4 manual ....G12/G13 –Circle Interpolation:These codes are used to cut a circle using the current position as the center point. Words, Iand J, definethe radius of the circleand the lead-in direction. G12 will cut a circle in the clockwise direction and G13 will cut in the counterclockwise direction.It is also possible to cut a largercircular pocket by specifying Q for the start radius and Pfor the step over amount. This can be useful for cutting a circular pocket or an ID groove.Format1: G12/13 I__J__F__Format 2: G12/13 I__J__P__ Q__See figure 12-1 for a graphic of the motion. The current position will be the center of the circle.
    https://www.machsupport.com/wp-conte...e%20Manual.pdf

    GoodLuck on your mission,
    DJ

  5. #5
    Join Date
    Nov 2015
    Posts
    54

    Re: G2 code help

    CNCFr
    "I don't know your controller but I nevertheless may be able to give some hints.
    A full circle can't be defined by providing only the radius because in this case the center of the circle can not be determined: Every point on a circle with radius R around your starting point would fit as the center point of such a circle.
    The classical way to define a full circle with IJK-style programming in your example would be
    G01 X1.5 Y2.0 Z-0.5
    G02 X1.5 Y2.0 I0.5 J0.0"

    My controller is Mach4 and an ESS from Warp9
    I would swear that I have done that and the circle starts at the XY given and that coordinate becomes the "top" of the circle. i.e. Y2.0 is the top and Y1.5 is the bottom of a circle. I want Y2.0 to be the center of the circle. The next comment might explain why that is.



    ZASto

    G2 X2.0500 Y2.0000 I0.0000 J-0.0500 F100.0

    G2 X2.0000 Y1.9500 I-0.0500 J0.0000
    G2 X1.9500 Y2.0000 I0.0000 J0.0500
    G2 X2.0000 Y2.0500 I0.0500 J0.0000

    Note that every "circle" consists of four arcs
    Ok I see that, and I see it offsets the starting point each time...that explains why G2 was giving me so much trouble. And to be honest I did consider that I had to chase the coordinates around the circle but then thought "nah they wouldn't make such a common operation so complicated" .


    machinehop5
    ".G12/G13 –Circle Interpolation"
    OK there is the code that I really should have used for this. /facepalm .


    But the comment above still holds, though it might be best left to Vectric and I will ask them, but their reply might be slanted toward wood routers and not machining best practices so I would appreciate your opinions on the following:


    1. Why would Aspire use G2, and create 4 arcs when the G12 appears to be so much simpler? Online comments talk about G2 being "more accurate" because additional calculation took place to verify coordinates... though there was debate about this being necessary.
    2. I also noticed none of you suggested G2 "R" parameter which I believe takes the place of the I and K for ...simplification?

  6. #6
    Join Date
    Nov 2015
    Posts
    54

    Re: G2 code help

    Well I found that Mach4 Hobby only supports a subset of the G codes so I can't use a WHILE loop to make this all easier, but I got what I needed using M98 loop and G12 to cut my pockets holes. I still don't know why other software seems to prefer the G1 and G2 for a pocket hole.

    It was also SO frustrating to have Mach4 fail in a way that didn't tell me my code wasn't simply supported in my version because I didn't pay enough. I failed not because I had done something wrong but because only the more expensive ($1400) version supports the statement that make the most sense when coding by hand.

    Also found the importance of a decimal place when typing the Z depth. Was running a flattening pass with a 1 inch flycutter and instead of putting 0.050 I put 0.500. Made a nice Keyhole in the spoilboard. /facepalm
    Alas onward and upward...

Similar Threads

  1. Replies: 51
    Last Post: 09-16-2020, 01:28 AM
  2. Replies: 3
    Last Post: 02-27-2019, 09:53 PM
  3. Program to Convert Mill g code To Laser g code - CMTL
    By doanwannapickle in forum Visual Mill
    Replies: 0
    Last Post: 02-20-2017, 06:08 PM
  4. corel.hpgl > sheetcam.tap > pronterface.g-code > slic3r.g.code> ramps 1.4 > H-BOT
    By thesignworks in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 05-25-2014, 02:11 PM
  5. Replies: 8
    Last Post: 12-15-2010, 09:32 PM

Tags for this Thread

Posting Permissions

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