Page 1 of 2 12 LastLast
Results 1 to 12 of 15

Thread: Simple GCode Reference / Commands?

  1. #1
    LetterCAM.com
    Join Date
    Oct 2005
    Location
    USA
    Posts
    186
    Downloads
    0
    Uploads
    0

    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
    wms
    wms is offline
    Moderator wms's Avatar
    Join Date
    Mar 2003
    Location
    United States
    Posts
    940
    Downloads
    0
    Uploads
    0
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Twp, MI....USA
    Posts
    22,303
    Downloads
    0
    Uploads
    0
    - 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

    Mach3 2010 Screenset
    http://home.comcast.net/~cncwoodworker/2010.html

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


  4. #4
    Registered
    Join Date
    Jul 2005
    Location
    USA
    Posts
    34
    Downloads
    0
    Uploads
    0
    Try this link, it's pretty handy - http://www.cncezpro.com/gcodes.cfm.


  • #5
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    21
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    939
    Downloads
    0
    Uploads
    0
    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
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,962
    Downloads
    0
    Uploads
    0
    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 (Skype Avail).

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


  • #8
    Registered
    Join Date
    May 2008
    Location
    Portugal
    Posts
    9
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    21
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    939
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    939
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    21
    Downloads
    0
    Uploads
    0
    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!


  • Page 1 of 2 12 LastLast

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.