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

Thread: learning g code

  1. #1
    Registered
    Join Date
    Oct 2006
    Location
    israel
    Posts
    29
    Downloads
    0
    Uploads
    0

    learning g code

    hey all,

    my partner and i are building audio devices and until now we always sent work with cnc to contractors but this might change as i am getting a small emco f1 mill from a friend as a gift. this could be perfect to dill our small boxes for potentiometrs and switches. the machine is old and you have to program it using it's keyboard in gcode. i have no idea where to start learning this. any suggestions? thanks!


  2. #2
    Registered
    Join Date
    Aug 2006
    Location
    USA
    Posts
    3
    Downloads
    0
    Uploads
    0
    A couple of places on the web list G and M codes as a reference; one can be found here: http://www.machinetoolhelp.com/Appli...G-M-codes.html

    Learning how to use these codes isn't very difficult in itself. Machines can be different though, so I strongly suggest patience and plenty of scrap material. Basically, you begin with the code "command" and follow with coordinates.

    The code "G20" should set you to inch units, and "G21" to metric. Assuming you're set up for inch units on the machine and to absolute coordinates:


    ----------------------
    Example:
    G00 Z1.000

    The G00 indicates a rapid move to the absolute position where Z = 1.000inches.


    ----------------------
    Example: a rapid move (not doing any cutting, but just getting from point A to point B quickly) can be entered as:

    G00 X0.500 Y0.800

    The G00 indicates a rapid move to the absolute position where X = 0.5 and Y = 0.800 inches.

    ----------------
    Example:
    G01 X0.500 Y1.606 F2.5

    The G01 specifies a linear feed from your current position to the absolute coordinates of X = 0.500 and Y = 1.606, with a feed rate of 2.5 units/minute.

    --------------
    Example:
    G04 #12

    The G04 indicates a pause is needed for 12 ("#12") seconds. For safety concerns, never use this pause to change out tools or otherwise stick your fingers near the machine. It's only human to get your fingers in the wrong place at the wrong time, and it's only machine-like for the mill to not care and maul them anyway.

    For a definite hold in the cycle, use M00 (hold until key is pressed) or M06 (the wait-for-tool-change) codes instead.

    --------------
    Example:
    G81 X1.000 Y2.000 Z-1.500 F2.25 R0.500

    (Assumes absolute coordinates and inch units used for this example)

    G81 indicates a drill cycle, which is what I think you're looking for in your project as well. The X and Y indicate where the hole will be drilled. But, if the tool is currently positioned below the release plane (R0.500) at absolute 0.5 inches, the Z axis will be moved to 0.5 first. Safety consideration.

    The hole will be drilled down to the absolute position of -1.5 inches (Z-1.500); note the negative sign.

    It's a good idea as habit to put G80 on the next line, which clears the drill cycle from the memory.

    ---------------
    Example:
    G28
    Return to "home" coordinates (0, 0, 0).

    ---------------
    Example:
    M02

    End of program... this is the last line in your code.


    So, a quick program using some of the examples above:

    G20
    G90
    M00
    G00 Z0.500
    G00 X0.626 Y1.125
    M08
    G04 #2
    G01 Z-0.250 F1.2
    G01 X2.000 Y1.125 F2.2
    G01 Z0.005
    M09
    G00 Z0.500
    M02

    This isn't the most efficient way of doing it, but just wanted to illustrate an easy-to-see example. At first, inch units and absolute coordinates are specified using the G20 and G90 codes. The, the machine waits for you to press a key to begin from the M00 code, and when received, it rapidly moves the Z axis to absolute 0.5 inches. It moves quickly to coordinates (0.626, 1.125 inches), then turns on the flood coolant. The machine pauses for 2 seconds. The operation is then set for a feed rate of 1.2 ipm, drilling to an absolute depth of -0.25 inches. Since the Z is not raised in the next line of code, you are milling a slot from your current position and depth to coodinates (2.000, 1.125) at a new feed rate of 2.2 ipm. The tool is raised to just above the part (in this case, the top of the part was Z=0.000) and the coolant turned off. The tool was then quickly raised to 0.500 inches (absolute) to clear the part a good amount more.

    Everyone's machine is different though, and the code listed above is not necessarily the most efficent way to do things nor encompasses all the setting to be made. Just illustrative.

    Hope it helps answer your questions a bit.


  3. #3
    Registered
    Join Date
    Oct 2006
    Location
    israel
    Posts
    29
    Downloads
    0
    Uploads
    0
    thanks you very much for your comments and Nightsdawn for taking the time to explain!!! i am sure this will become very handy!


  4. #4
    Registered
    Join Date
    May 2006
    Location
    usa
    Posts
    27
    Downloads
    0
    Uploads
    0
    Why learn to write g-code by hand?
    There are some inexspensive CNC programs that do all the g-code stuff for you. Check out this site. www.simplecnc.com


  5. #5
    Registered
    Join Date
    Aug 2006
    Location
    USA
    Posts
    3
    Downloads
    0
    Uploads
    0
    True, there are programs out there that make life so much easier. There's also buggy programs out there as well.

    I have not tried the simplecnc you are selling, so please don't consider the above as my opinion of it. But, I've just tried some other demos that have kicked out *strange things* before, lol!

    Having at least a basic understanding of G and M codes is important, IMHO. If a program spits out a code that is off, you can at least go in there and fix it if needed. You're not trusting your machine and your tools to a "black box", per se.

    Just my opinion.


  6. #6
    Registered
    Join Date
    May 2006
    Location
    usa
    Posts
    27
    Downloads
    0
    Uploads
    0

    Verification of Tool Path

    I know software can have bugs. After all it is writen by people. I always use a backplot tool to validate tool path before running it on the machine. Even if you are programming by hand it is possible to make costly mistakes.
    Thanks
    Jeff


  7. #7
    Registered
    Join Date
    Feb 2007
    Location
    Brunei
    Posts
    632
    Downloads
    0
    Uploads
    0
    I just learn a bunch of stuff from Nightdawn regarding G and M codes. Thanks even if i am six month late looking at this thread.


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

    G-code

    I understand that there is alot of programs that can DO IT for you. But why not use 000.1 percent of your brain to learn somthing new.


    I am a beginner, Learning from G-CODE, rather a piece of software, I then would understand what the g-code does.

    Just my two cents.....


  9. #9
    Registered
    Join Date
    Feb 2007
    Location
    Brunei
    Posts
    632
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by VaRMiT View Post
    I understand that there is alot of programs that can DO IT for you. But why not use 000.1 percent of your brain to learn somthing new.
    uh??


  10. #10
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    8
    Downloads
    0
    Uploads
    0

    ??

    Uhh...what...im saying its a good idea to learn to do G-CODE, rather than haveing the thing do it for you.


  11. #11
    Registered
    Join Date
    Feb 2007
    Location
    Brunei
    Posts
    632
    Downloads
    0
    Uploads
    0
    Hi varmint,

    I am just curious who you are addressing the remark to. Since I just posted here I assume you are directing it to me. But I really don't get why you said what you said. To me it sounded a bit personal. But I could be wrong. Peace!


  12. #12
    Registered
    Join Date
    May 2007
    Location
    USA
    Posts
    8
    Downloads
    0
    Uploads
    0

    Code

    NOOOOO!!! Nothing personal. Im a newbie. Just another view Excited about learning. I have a CNC on its way. I dont even know how to spell my name in g-code let alone tell someone else what to do. But I apologize for coming accross aggressive.


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.