G code

Post it here, if it doesn't fit any of the above.

Moderators: User administrators, Moderators

Locked
User avatar
Mr Bean
R.I.P.
Posts: 3532
Joined: 11 Jun 2008, 06:49
80-90 Mem No: 5485
Location: Hertfordshire

G code

Post by Mr Bean »

Could anyone on here get me started writing simple G code for a lathe?
Cheers
Wolfie
Well-timed silence hath more eloquence than speech.
"A quiet shy boy who took little part in games or sport"
88 High top 2.1 WBX

silverbullet
Trader
Posts: 16343
Joined: 08 Jun 2009, 09:51
80-90 Mem No: 6908
Location: Surrey Syncronaut #156
Contact:

Re: G code

Post 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

User avatar
VERAT25
Registered user
Posts: 231
Joined: 02 Jun 2009, 09:41
80-90 Mem No: 6882
Location: CARDIFF SOUTH WALES

Re: G code

Post by VERAT25 »

wolfie.

you have a pm

verat25 :ok

User avatar
badger
Registered user
Posts: 242
Joined: 08 Oct 2005, 18:34
80-90 Mem No: 2025
Location: Astley, Manchester

Re: G code

Post 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.
89 California TD

User avatar
Mr Bean
R.I.P.
Posts: 3532
Joined: 11 Jun 2008, 06:49
80-90 Mem No: 5485
Location: Hertfordshire

Re: G code

Post 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
Well-timed silence hath more eloquence than speech.
"A quiet shy boy who took little part in games or sport"
88 High top 2.1 WBX

silverbullet
Trader
Posts: 16343
Joined: 08 Jun 2009, 09:51
80-90 Mem No: 6908
Location: Surrey Syncronaut #156
Contact:

Re: G code

Post 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!

Locked