Step 1: Write the Introduction
Step 2: Saftey...Second?
Once the program has a name its time to think about safety, the third line. It will be in rapid so we program 'G00' this tells the machine that it should move as fast as it can or is programmed to. Following that I have:
G90, for absolute position mode.
G80, to cancel any previously used canned cycles.
G28, to rapid to the home position.
G17, to select the x, y circular motion field.
G20, to select the inch coordinate system. (G21, to select metric)
G40, to cancel cutter compensation.
G49, to cancel the cutter height compensation.
Now this leaves us safely at the machine home position.
Step 3: Get Your Tools Ready
On cnc lathes it will be trailed by an off set number like 'T0101'. This calls up tool number 1 and applies off set 01 to it, before a tool change you'll need to program 'T0100' to clear the offest before the next tool. Haas lathes dont use the offset number, instead they use the mill format 'T01' and 'T1'.
So far we've brought the tool changer to position #1 but the tools not in the spindle yet. M codes tell the machine what to do, M01 is an optional stop, M03 starts the spindle. For this we'll use M06, this specifies that the machine will trade the tool it currently has with the tool in the currently called up ATC position.
On the lathe M06 spins the turret to that position.
The line after this is where to put an M01 if you dont have a turret or ATC.
Step 4: Getting closer
G41 and G42 are similar in their uses but not in their functionality. G41 is tool radius off set to the left of the center. G42 is to the right. They position the tool so that on contouring operations any number of end mills can be used without rewriting the program and doing the math yourself. All you have to do it tell the machine 'D01' or whatever tool number needs the off set.
G43 and G44 offest the length of the cutter the positive(G43) and negative(G44) directions. This is for multiple set ups using different cutters or the same cutter on a different cutting plane. Primarily G43 will be used. This needs a height command such as 'H01' or whatever tool number needs the offset.
Step 5: Common Commands
G01, linear cut from current position to programmed X, Y, Z
G02, moves the cutter along a clock wise arc until the current position is the new programmed position
G03, moves the cutter along a counter-clock wise arc until the current position is the new programmed position
G04, just like G01 but with a dwell command
All these commands are modal meaning that the machine will keep going rapid until a different one is programmed or will keep cutting unless G00 is called.
Step 6: Explore!
Step 7: If I had a 3D Printer
So now if Iwon a 3D printer I would create prototypes of things I have created in my head and post them on here to share what I know and hopefully learn a bit from others.