Explain G Code parameters please

Discussion in 'Off-Topic' started by spinnaker, Jan 18, 2016.

  1. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    I downloaded Draftsight and drew a simple square. Saved it as a dxf file and loaded it into DXF2GCODE. It has the following parameters that need to be set.

    upload_2016-1-18_11-15-30.png

    I understand feed rates but that is about it. Can anyone explain the others? What is the difference between In feed depth and final mill depth.
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    I do not use Draftsight but I would hazard a guess that if milling a shape or pocket the In feed depth is increment per operation IOW it machines out a pocked of .1181 using increments of .0591.
    The other use is peck drilling where the drill increments in steps and withdraws to clear each time.
    Max.
     
  3. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Those are basically terms that are specific to dxf2gcode..
    I'd assume that
    workpiece top = The Z 0 point.. or the upper most face of your material.
    infeed depth = is the feed/clearance height which is the distance your tool will go to for non-cutting moves to ensure its got enough clearance to avoid dragging the tool over the surface of the material in non-cutting moves. Also known as clearance height or feed height (or even retract height).. Those can be the same or could be different depending on the programming tool you use. Seems its just 1 option for dxf2gcode
    final mill depth = how deep your shape should be cut at or the z depth of the lower face of your cut.. or how deep from the tip you want your tool to be into the part during cutting..
    Here is an example of what my cam tool has for heights (this is for a drilling operation).. Program is HSM express
    heights.PNG
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    Although if the work piece top is set at 0 then an infeed of -.0591 will result in a machining operation?
    2 passes of an infeed of -.0591 results in a final depth of -.1181 .
    Max.
     
  5. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    Why would the infeed depth be negative by default then?

    Is there a better DXF to gcode converter I should be using that is also free?
     
  6. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989

    Ah it did do two passes and I was wondering why. So the first pass is sort of like a pilot hole? And the second pass is the actual cut?
     
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    Once you set a Z zero (work piece top = 0.0)
    Then a downward feed from there on will be in the -ve.
    I know of no DXF to G code that is free, not saying one may be out there.
    You could try the CNCzone.
    Max.
     
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    No I took it to be the total machining took two passes, IOW .1181 in two passes/depths.
    This is usually a case where the tooling/machine is not capable of doing it in one pass at the feeds/speeds programmed.
    Max.
     
  9. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Found this.. and shows "assuming" is bad.. and air-cutting (trial pass before actually putting material in the way while you are learning) is good :)
    Z infeed depth:
    This is the depth the bit will go to for each pass. For the 6040 based CNC machine that Nottingham Hackspace has on loan from Ash, never set it to more than 1mm. 0.5mm is preferable, especially for harder materials like plywood and polycarbonate. The machine is small and spindles easily overstressed; please look after it.

    Z mill depth:
    This is the total depth your GCode will instruct the CNC machine to mill to. It will achieve this by making multiple passes along the lines, each one at the Z infeed depth you set above.

    So based on that infeed depth is also know as stepdown depth for multiple passes..

    If your mill depth is -.5 and infeed is -.1 it will make 5 passes.. each one .1 deeper than the last..

    and FWIW.. Draftsight professional ($299) has a built in gcode converter..
    There may be many others out there now too... I haven't looked in a long time as I've had Inventor and HSM for a long time now running my DIY CNC at home and Haas at work..
    Here is mine.. 18" x 24" cutting area.. running "Smoothieboard/smoothie software" https://dl.dropboxusercontent.com/u/9726802/cnc/CNC 1.jpg

    http://www.dakeng.com/ace.htm
    many others.. just search google and find one you like..
     
  10. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
    I tried Ace. Had trouble getting it to work correctly.

    Inventor HSM is a part of Autodesk? I assume there is a cost?
     
  11. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    Hoe about picking up the book of CNC programming by Peter Smid and write your own G code, very useful to know despite any CAM program you may be using.:cool:
    Max.
     
  12. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989
  13. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    Yes, also try AbeBooks clearing house, I have got deals in the past.
    It should have a CD included.
    Max.
     
  14. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Whats a book? I thought they died when Al Gore invented the internet..
    http://www.cnccookbook.com/CCCookbook.htm
    (quite a bit of "ad/sales" stuff but tons and tons of good info/tools,etc...)..
    Heck you really only need to know a few commands for your machine...
    G00, G01 maybe some arc.. and then the Mcodes to turn on spindle,etc...
    Thats easy to find that in a few minutes without a book..

    But to write code by hand (while a good thing to know for troubleshooting) is insane for anything but super simple parts..
    There are plenty of free/low cost tools out there now.. use them....

    The guy that used to run the Haas here (just passed last year so now I do it) wrote ALL programs by hand..
    I got my hands on HSM Express and we had a race..
    He took over 6 hours.. I did it in under 6 minutes using HSM Express..
    And on top of that my code ran the parts in half the time..

    And yes to spinnaker.. I use Autodesk Inventor for product design for 15 years or so now and a couple years ago they purchased the HSM company and now we get the CAM addin for free right inside Inventor..
    Its only free if you already have Inventor..
    I think I mentioned it already by thats why I asked if you were a student or teacher or had access to a school email account.. (because you get ALL Autodesk software for free.. including Inventor and HSM express)
     
  15. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
    Interesting. I am very interested in the G-Code question, since there are several machines I would like to learn at Dallas Maker Space, including a hass mill.
     
  16. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    G-code is a VERY simple language.. It includes G and M codes..
    Its really all about knowing the specific M codes for your machine.. (on/off for coolant/spindle/tool changer,etc... functions)
    The G-codes are standardized (for the most part except for the DIY community not following established professional standards.. like not having G3 be modal..damn you smoothie programmers :p) across all machines..

    But as I said above its absolutely silly to write code by hand.. Too many tools out there to do it for you..
    The ONLY reason our Haas guy wrote them by hand was because he was old and refused to learn anything new in the 20+ years he was here..
    I tried numerous times to get him to learn something.. He was never interested in anything but Solitaire on the computer...

    Learn CAD.. the CAM part is done automatically based on the CAD data..
    Draftsight is the best free 2D tool.. Its almost identical to Autocad (the standard for 2d)

    @spinnaker
    oh and now that I think about it Autodesk has fusion 360 which has HSM built into it also and is available for hobbyists (free for 1 year and may be continued)..
    That gets you FREE 3D CAD + HSM Express for the CAM portion.. (assuming you don't mind a cloud based application.. internet required..)
    Its "fairly" similar to Inventor.. (made easier for the DIY crowd)
    http://www.autodesk.com/products/fusion-360/overview
     
  17. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,510
    2,369
    For myself, learning to write G code is very useful even if you use a CAM program, there always comes the point when you want to either trouble shoot or tweek a program, to ignore it completely will be frustrating IMO.
    Max.
     
  18. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    yes absolutely.. Knowing it is good.. but it is a simple structure... just look at a few known programs and you know all you need..
    Since using a "proper" CAM program I have never had the need to "troubleshoot" anything though.. it does EXACTLY what I tell it to.. and if I screw up I just open the part back up.. find where I goofed and generate the program again..
     
  19. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    You also have to do a quick review of trigonometry, linear interpolation and circular interpolation. Learning "G-code" programming is well worth the effort. It also helps if you avoid running a non cutting edge into the workpiece. Believe me the mill or the lathe will try to go there.
     
  20. spinnaker

    Thread Starter AAC Fanatic!

    Oct 29, 2009
    4,866
    989

    Cool thanks for the tip. I will check it out. I am a newbie at all of this. Forgive the ignorance. So the CAM portion is what produces the Gcode?

    Will HSM Express do the isolation routing for PCBs too? I am really trying to avoid PCBGcode because I am forced to use Eagle. I really like Diptrace. I find Eagle confusing. I wish they would not have coupled PCNGcode so tightly to Eagle.
     
Loading...