G2 and G3 Commands


Results 1 to 20 of 20

Thread: G2 and G3 Commands

  1. #1
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default 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.

    Similar Threads:


  2. #2
    Registered
    Join Date
    Oct 2006
    Location
    US
    Posts
    51
    Downloads
    0
    Uploads
    0

    Default

    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. #3
    Registered
    Join Date
    Mar 2007
    Location
    USA
    Posts
    137
    Downloads
    0
    Uploads
    0

    Default

    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. #4
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    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. #5
    Member
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    12177
    Downloads
    0
    Uploads
    0

    Default

    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?

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


  6. #6
    Registered jackson's Avatar
    Join Date
    Oct 2006
    Location
    United States
    Posts
    586
    Downloads
    0
    Uploads
    0

    Default

    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

    individual who perceives a solution and is willing to take command. Very often, that individual is crazy.


  7. #7
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Geof View Post
    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?

    Last edited by Bohemund; 05-18-2007 at 05:51 PM.


  8. #8
    Registered jackson's Avatar
    Join Date
    Oct 2006
    Location
    United States
    Posts
    586
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Bohemund View Post
    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

    individual who perceives a solution and is willing to take command. Very often, that individual is crazy.


  9. #9
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    I fail to follow what your saying.

    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. #10
    Registered
    Join Date
    Jun 2006
    Location
    Denton
    Posts
    15
    Downloads
    0
    Uploads
    0

    Default

    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. #11
    Registered
    Join Date
    Nov 2005
    Location
    United States
    Posts
    52
    Downloads
    0
    Uploads
    0

    Default

    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.
    You might do this instead...
    ;
    ;
    /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. #12
    Registered
    Join Date
    Mar 2005
    Location
    USA
    Posts
    1498
    Downloads
    0
    Uploads
    0

    Default

    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.

    .



  13. #13
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    I tried all those ideas, none worked....thanks tho. I'm using a CamSoft Pro unit where M97 is suppose to be for jumping and goto line numbers. Here's what I tried:

    N00 G20 G91
    N10 G01 X0.1 Y0.1 F30
    N20 M97 N10

    That didn't work. Any ideas?



  14. #14
    Registered
    Join Date
    Mar 2005
    Location
    USA
    Posts
    1498
    Downloads
    0
    Uploads
    0

    Default

    try
    M97 P10
    or
    M97 10

    Find a manual on your control.

    M97 Pxxx is a local subroutine call in HAAS. Not quite the same as a GOTO xxx.

    Is there an explicite GOTO command in your control?

    .



  15. #15
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    Excellent tip gar. There's no GOTO command yet adding the P instead of the N did the trick.

    I got a slight lag where the motors hesitated once it got to the end of my program, then looped. I removed the hesitation with a G08 which is spline smoothing on I discovered, but now the only way to stop my program is with E-STOP. Is that normal with the G08 command?



  16. #16
    Member
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    12177
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Bohemund View Post
    ..... but now the only way to stop my program is with E-STOP. Is that normal with the G08 command?
    Whatever your G08 command is that is not the problem regarding stopping, you have created an endless loop. Some machines have a built in counter so that when this is done by mistake in a program the machine will break itself out.

    Pressfit suggests a way a few posts earlier, put in the Block Delete command \. That is if your software understands it.

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


  17. #17
    Registered
    Join Date
    Mar 2005
    Location
    USA
    Posts
    1498
    Downloads
    0
    Uploads
    0

    Default

    070521-1038 EST USA

    Bohemund:

    If you can test an external binary input, then an appropriate switched signal to the input will allow stopping the program.

    On newer HAAS machines you can also test for keyboard input.

    On your system do you have the capability called MACROS? Included in MACROS are functions like:
    #100 = (a value) (a means to put some value in a variable)
    #100 = #100 +1 (a means to count)
    IF [ ... ] then (do something)

    Since you do not have a GOTO I suspect you lack MACROS and all of their useful functions.

    .



  18. #18
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    36
    Downloads
    0
    Uploads
    0

    Default

    I'm still pretty new at GCode (less than 2 weeks) and don't mean to misstate anything about the CamSoft system I have, but I'm pretty sure that I do have the capability for macros as I've seen references to them in the user manual.

    I'm still learning the syntax on how things are done compared to other systems on advice people give me but macros sound useful and will pursue more info about using them. I think that's also why the Block Delete / isnt working for me atm....syntax.

    At the moment I have...

    N00 G20 G91
    N10 G01 X0.1 Y0.1 F30
    N20 G08
    N30 M97 P10

    That gives me a good non-stop movement for driving my fixture (non-XY as previous examples). I tried putting in the /M30; M99; as referred with no success yet on needing to hit the E-STOP to stop my fixture.

    Any other ideas?



  19. #19
    Member
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    12177
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Bohemund View Post
    ...Any other ideas?
    Does Camsoft recognise M01 the Optional stop command? And do you have a key for optional stop?

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


  20. #20
    Member
    Join Date
    May 2007
    Location
    USA
    Posts
    1003
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Geof View Post
    Does Camsoft recognise M01 the Optional stop command? And do you have a key for optional stop?
    Excellent suggestion, Goef, and one so simple it is easy to overlook because a person is looking for the 'hard-to-find' solution.



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

G2 and G3 Commands

G2 and G3 Commands