Page 1 of 1

G code

Posted: 15 Oct 2009, 08:38
by Mr Bean
Could anyone on here get me started writing simple G code for a lathe?
Cheers
Wolfie

Re: G code

Posted: 15 Oct 2009, 11:45
by silverbullet
What are you running Wolfie?
We've just got the one Hardinge CNC lathe with a Siemens control. Everything else is Heidenhain milling.
Would a general list of G commands do? You could pull that off Wiki.

Ian

Re: G code

Posted: 15 Oct 2009, 12:26
by VERAT25
wolfie.

you have a pm

verat25 :ok

Re: G code

Posted: 15 Oct 2009, 12:57
by badger
It's ages since i've written anything in machine code - did C&G in NC/CNC Part Programming in late eighties. Loads of sites on internet with G & M code listings - might be worth trying to get hold of an old machine tool manual from somewhere; i had a good one which went into detail on setting up thread cutting/drill pecking cycles and suchlike, think i left it at the last machining shop i worked at though.

Re: G code

Posted: 16 Oct 2009, 09:08
by Mr Bean
My CNC foamcutter uses software called Foamworks which drives two pairs of stepper motors in X & Y . I am also building a three axis machine whose three steppers will be driven by STL files>Meshcam>Linux EMC2. I want to fit a couple of steppers to a now redundant bench top lathe and will be using EMC2 as this seems to be right and has a similation facility. I have the list of G & M functions from the internet but just need to work out the sequence if any, of the way the speeds, feeds etc are set up presumably in the first couple of lines of code. I will probably get there by experimentaion but wonder if there is a convention or does it work regardless of order just based upon the G or M info? At the end of this message is some code from forEMC2 for three axis machining which may enable me to fiddle by changing numbers and deleting any reference to the verticle axis which I know would normally be Z but some lathe codes I have seen seem to use y and z! anyway
Cheers
Wolfie
%
(FILENAME: fuzingel2.nc)
(TOOL/MILL,0.1,0.05,0.000,0)
G21
(STOCK/BLOCK, 477.652, 60.639, 30.312, -0.000, -0.000, 30.312)
(TOOL/MILL,10.0000,5.00000,30.0000,0)
M6 T6
G0X0.0000Y0.0000Z152.4000
G0Y0.5556
G1Z-4.8853F5.0
G1X476.6667Y2.7778F5.0
X462.7778Y60.0000
X0.5556

Re: G code

Posted: 16 Oct 2009, 11:10
by silverbullet
Common sense applies e.g. select tool and start spindle, coolant on before moving z axis; stop tool before changing etc. and yes convention is that z is always the spindle axis!