586,655 active members*
3,826 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Oct 2005
    Posts
    186

    Simple GCode Reference / Commands?

    Hi,

    I am looking for a web site that shows the gcode commands for all of the basic actions. I just need to write gcode to do the following:

    - Go to the starting X/Y position
    - Set the plunge rate
    - Set the feed rate
    - Move the Z to a certain depth
    - Then move at X/Y points (set of lines shaping an object)

    Thats all I need to do. Do I have to specify the units (inches/mm) in the gcode?

    Thanks,

    Warren

  2. #2
    Join Date
    Mar 2003
    Posts
    927
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Mar 2003
    Posts
    35538
    - Go to the starting X/Y position

    G0 Xx.xx Yx.xx (rapid move)

    - Set the plunge rate

    Fx.xx

    - Move the Z to a certain depth

    G1 Z-x.xx

    - Set the feed rate

    Fx.xx

    - Then move at X/Y points (set of lines shaping an object)

    G1 Xx.xx Yx.xx (straight move)

    or

    G2 Xx.xx Yx.xx Ix.xx Jx.xx (clockwise arc)

    or

    G3 Xx.x Yx.xx Ix.xx Jx.xx (ccw arc)

    x.xx represents a coordinate. Notice that I changed the order. The plunge rate IS the feedrate, during the plunging move. Just set the feedrate for the current move prior to making it, or on the same line as the move.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

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

  4. #4
    Join Date
    Aug 2005
    Posts
    34
    Try this link, it's pretty handy - http://www.cncezpro.com/gcodes.cfm.

  5. #5
    Join Date
    Mar 2005
    Posts
    21
    Is there a g-code you can enter at the first part of the file to set the overall feedrate limt? I'm using mach 3 and have no spindle monitor/control but dont want to feed no more than 6.0 for the whole project. Im currently typing "g1 (x/y/z)?.? f6.0" on every line and that is getting old quick at my typing rate of 6 words a minute

  6. #6
    Join Date
    May 2007
    Posts
    1003
    Feedrate is modal on most machines. You should only need to type it in once. Just cut 30 seconds per line off your typing.

  7. #7
    Join Date
    Dec 2003
    Posts
    24223
    Quote Originally Posted by WarrenW View Post
    Do I have to specify the units (inches/mm) in the gcode?

    Thanks,

    Warren
    G20 is Inch input, G21 is Metric, some systems use G70/G71.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  8. #8
    Join Date
    May 2008
    Posts
    13
    Hello,
    I'm looking a parameter or G code (fanuc OM c )to do that: if the program a have 3 points that made a line and if I start the program the machine almost stop in the points and i dont wont that.
    Davide.

  9. #9
    Join Date
    Mar 2005
    Posts
    21
    Quote Originally Posted by g-codeguy View Post
    Feedrate is modal on most machines. You should only need to type it in once. Just cut 30 seconds per line off your typing.
    ok.... I'm not very up on that could you explain a little more?
    Im thinking that means leave my first line and then the rest I dont need to write it anymore as in:
    G1 z-.05 f6.0 (slow)
    g1 x 2.5 (slow)
    g1 y 2.5 (slow)
    g0 z.25 (then rapid move)
    g0 x0. (rapid move)
    g0 y0. (rapid move)
    g1 z-.075 (slow again)
    g1 x 2.5 (slow again)
    g1 y 2.5 (slow again)

    Is that correct?
    Thanks!
    J

  10. #10
    Join Date
    May 2007
    Posts
    1003
    James: Yes & No.

    This is all that is needed.

    G1 Z-.05 F6. (slow)
    X 2.5 (slow)
    Y 2.5 (slow)
    G0 Z.25 (then rapid move)
    X0Y0 (rapid move)
    G1 Z-.075 (slow again)
    X 2.5 (slow again)
    Y 2.5 (slow again)

    Yes. modal means the F6. stays in affect until you use an F with a different feedrate. In your example the one F6. is all that is necessary.

    No, model means a G-code stays in affect until another complimentary G-code is used. G0, G1, G2, & G3 cancel each other out. If you made a 360 degree circle programming it in quadrants using G2, then all that would be necessary is the first G2. The other 3 blocks needn't have the G2. You can use it, but it isn't necessary. You would need a G1 or G0 to cancel the G2 after completing the circle. Programming straight lines only requires the first G1.

    The X0 Y0 needn't be on separate blocks unless they need to be programmed that way to clear a clamp, or if Z0 wasn't the face of the part, and a section was high enough that Z.25 wouldn't clear it when moving to X0Y0.

    Same thing for metric versus inches. This should be set by a parameter in the control. You don't need to program another unless changing from one to the other.

    Same thing for IPM versus IPR. Parameter in machine controls the one used on start-up. Only need another G-code to change it if going from one to the other.

    Same thing for G96/G97. One cancels the other. You can change from G97S1000M3 to a spindle speed of 500 in the same operation by simply programming S500. The G97M3 aren't needed. They are modal. Works the same way for G96.

    Not to say that this is how it works on every machine. I am a long ways from having run every machine with every type of control. There could be some flaky ones that require a G1 or G0 on every block, etc. I've never seen one. Doesn't mean they don't exist.

  11. #11
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by davide.castro View Post
    Hello,
    I'm looking a parameter or G code (fanuc OM c )to do that: if the program a have 3 points that made a line and if I start the program the machine almost stop in the points and i dont wont that.
    Davide.
    Sorry, but I don't understand what you are wanting to know. Would you explain further? Be glad to help if I can.

  12. #12
    Join Date
    Mar 2005
    Posts
    21
    Quote Originally Posted by g-codeguy View Post
    James: Yes & No.

    This is all that is needed.

    G1 Z-.05 F6. (slow)
    X 2.5 (slow)
    Y 2.5 (slow)
    G0 Z.25 (then rapid move)
    X0Y0 (rapid move)
    G1 Z-.075 (slow again)
    X 2.5 (slow again)
    Y 2.5 (slow again)

    Yes. modal means the F6. stays in affect until you use an F with a different feedrate. In your example the one F6. is all that is necessary.

    No, model means a G-code stays in affect until another complimentary G-code is used. G0, G1, G2, & G3 cancel each other out. If you made a 360 degree circle programming it in quadrants using G2, then all that would be necessary is the first G2. The other 3 blocks needn't have the G2. You can use it, but it isn't necessary. You would need a G1 or G0 to cancel the G2 after completing the circle. Programming straight lines only requires the first G1.

    The X0 Y0 needn't be on separate blocks unless they need to be programmed that way to clear a clamp, or if Z0 wasn't the face of the part, and a section was high enough that Z.25 wouldn't clear it when moving to X0Y0.

    Same thing for metric versus inches. This should be set by a parameter in the control. You don't need to program another unless changing from one to the other.

    Same thing for IPM versus IPR. Parameter in machine controls the one used on start-up. Only need another G-code to change it if going from one to the other.

    Same thing for G96/G97. One cancels the other. You can change from G97S1000M3 to a spindle speed of 500 in the same operation by simply programming S500. The G97M3 aren't needed. They are modal. Works the same way for G96.

    Not to say that this is how it works on every machine. I am a long ways from having run every machine with every type of control. There could be some flaky ones that require a G1 or G0 on every block, etc. I've never seen one. Doesn't mean they don't exist.

    Thanks a million! You saved me a whole lot of time and trouble!

  13. #13
    Join Date
    Oct 2007
    Posts
    4
    Quote Originally Posted by g-codeguy View Post
    Sorry, but I don't understand what you are wanting to know. Would you explain further? Be glad to help if I can.
    Hello,
    I work with Davide Castro.

    We would like to know what can we do to machine a 3d surface using fanuc omc control without having bad quality surface or speed feedrate limitations.
    We have written a small program to check the 3 or 2 axes interpolation behavior and we verified that the movements are not smooth. Is there anything we could change on the parameters or G codes to improve the machine for 3d milling ?

    Example ;

    If i run the machine in one axe throught 3 points in a straight line (G64 ON ) at 1000 mm / min the machine doesn´t go smooth but try to stop every time it reads/reach the point de coordinates , is this normal ? What can we do ?


    Regards.

    Manuel Dias

  14. #14
    Join Date
    May 2007
    Posts
    1003
    Quote Originally Posted by manueldiasm View Post
    Hello,
    I work with Davide Castro.

    We would like to know what can we do to machine a 3d surface using fanuc omc control without having bad quality surface or speed feedrate limitations.
    We have written a small program to check the 3 or 2 axes interpolation behavior and we verified that the movements are not smooth. Is there anything we could change on the parameters or G codes to improve the machine for 3d milling ?

    Example ;

    If i run the machine in one axe throught 3 points in a straight line (G64 ON ) at 1000 mm / min the machine doesn´t go smooth but try to stop every time it reads/reach the point de coordinates , is this normal ? What can we do ?


    Regards.

    Manuel Dias
    Okay. I now understand what you want. Unfortunately I can't help you. I only program lathes. I do know that some lathes have a parameter that can be set for what I'll call 'positioning' for want of a better word. That is...the control will stop for one complete revolution at the end of a move before picking up the next block. Very handy if you want a nice square corner.

    Some lathes use a G-code to accomplish the same thing. I see no reason why a mill couldn't also do it. Hopefully someone with actual milling experience will answer your question. If you don't get an answer here, try asking on the Fanuc forum.

    Sorry I couldn't be of more help.

  15. #15
    Join Date
    Nov 2010
    Posts
    0
    Hello, I am new to the whole CNC world and I have been running an Amada Turret Punch now for about a month. I have the basics down for writing a program using G-code. I am trying to figure out how to move the Y-axis away from the turret while it is rotating so that the clamps and the turret do not hit. I thought about using a G70 command to do a transfer on the Y-axis, but that did not work. Any help would be greatly appreciated. Thanks

Posting Permissions

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