You are on page 1of 31

G-Codes

G0- Rapid
G00- (I hope you already know this one!)
A new feature is also available. G0Z0,I.1 . This is in-position
check. This might be used to save time not needing accuracy during
rapid motion. If you use 'G0 Z' without ',I' then rapid is back
to normal.

G1- Linear interpolation


G01- (I hope you already know this one too!)

G2- Circular interpolation clockwise direction.


G02- When viewing the #1 gang tools, X1 and Z1 G2X.5W.01R.01
You can also use I J K giving the center of the arc from the
position
you start at before the G2. I=X J=Y K=Z G2X.5W.01K.01I0
I,J,K is used when more than a 90 deg arc is needed, usually
milling
or turning a ball type part.

G1X.4Z0F.002 or G1X.4Z0F.002
G2X.5W.05R.05 G2X.5Z.05K.05(center of rad is .05 over in
Z)
G1Z__ G1Z__

Circle Example...
When milling with or without cutter comp(G41/G42), the feed rate
given is not true. To get a proper feed rate you have to
calculate
using the radius desired and the tool radius. Cutting outside
corners are different then inside pockets. Use this formula...

Outside cutting:
DesiredFeed=10 IPM CutRadius=.25 ToolRadius=.125
Feed=DesiredFeed * ((CutRadius+ToolRadius)/CutRadius)
Feed= 10 * ( .375 / .25)
Feed=10 * 1.5
Feed=15

G19
G41G1Z.5Y0 F10.
G2Z.5Y0K.25 F15. (CUT A CIRCLE F15.=F10. at cutting point)
G1Y-.1 F10.
G40
G18

Inside pocket cutting:


DesiredFeed=10 IPM CutRadius=.25 ToolRadius=.125
Feed=DesiredFeed * ((CutRadius-ToolRadius)/CutRadius)
Feed= 10 * ( .125 / .25)
Feed=10 * .5
Feed=5

G19
G42G1Z.5Y0 F10.
X??
G2Z.5Y0K.25 F5. (CUT A CIRCLE F5.=F10. at cutting point)
G1X?? F10.
G40
G18

Also Helical Interpolation: Same as Circular interpolation


but while 2 axis are circular interpolating, another axis
moves linear. This is mainly used for thread milling, having
to arc Z-Y around the thread in circles and move X down in the
part.

(face off center thread mill)


(center of drilled hole is X.3 Y0 and desired to thread mill 4-40
.112OD)
G98G17
G0X.3 Y0 Z-.05T--
Z.2
G42G1X.412(.3+.112)F3.(G41 and G3 are reversed from G17)
G2 X.412 Y0 Z-.025 I-.056 J0 P9 F3.
G40G1X.3Y0
G0Z-.05U0V0T0
G18

(cross thread mill)


(center of drilled hole is Z.5 Y0 at .625 diam and desired to thread
mill
1/4-20 .25OD)
G98G19
G0X.725 Y0 Z.5T--
X.2(DEPTH TO START AT)
G41G1Z.625(.5+.125)F5.(G41 and G3 are NORMAL from G19)
G3 Z.625 Y0 X.05 K-.125 J0 P9 F5.
G40G1Z.625 Y0
G0X.725V0W0T0
G18

X = X position to go to circular
Y = Y position to go to circular
Z = Z position to linear or if using P then set Z to one pitch.
I = Center of hole from X in radial value.
J = Center of hole from Y in radial value.
P = Number of pitches or threads. Whatever Z is times P
F = Feed rate to cut.

G3- Circular interpolation counter-clockwise direction.


G03- When viewing the #1 gang tools, X1 and Z1 -See G2
G4- Dwell
G04- G4 can be used 3 different ways...

G4 U1. (must have . or 1 = .0001)


G4 X1.
G4 P1000 (all three dwells = 1. second)

G9- Exact stop mode


G09- G9 will make the axis stop after the program line. Used when no
radius is allowed on an outside or inside corner.
G1 G9 Z1. F.002

G10- Offset input from RS232C or program


The way Mitsubishi worked this one is much better than Fanuc. If you
choose I/O OUTPUT function and download "OFFSET" this
will send a bunch of G10 and G11 commands to a file. This is all the
offsets in a special code. To send it back to the machine later just
pick I/O "tool data" and INPUT, and the offsets are loaded into the
machine from the RS232, no need to run a program.

G10 L11 P1 X.001 Z.005 R.002


(P=offset number)

You can also use G10 to set parameters. Please see the Mitsubishi
manual for more details.

G12.1- Converts C axis degrees and X axis movement to work like


a milling machine. Program X-Y axis and the control converts all
the
commands to degrees automatically. X and Y are programmed in radius
values and zero is at the center of the part, like a milling
machine.
Tool nose rad comp is also needed to use G12.1 correctly. Thinking
about the direction for G2/G3 and G41/G42 is backwards! You have to
imagine you are back behind the guide bushing looking to the
cutter.
If you can't do this, then just do everything opposite!

There are some new options while calling G12.1. We used to have to
change parameters to use G12.1 #1125 Mill_AX and #1126 MillC ,
now
we can set these while calling G12.1 . See also G16 below.

G12.1 (no arguments uses C commands same as G12.1 D1 E=C)

G12.1 D0 E=C

D0 -You can use "C" or "Y" as the virtual axis while in G12.1
The manual suggests using "D1" to use "C" but I don't
agree.
If in G17 X-Y plane, then I suggest you use "D0" to use Y".
Your choice, it makes no difference which you use! If D is
not on the G12.1 line then "C" is default.
Always have "D" first on the G12.1 line!
E=C -This will set the axis number of the system to use as the
polar axis. This depends if you are using the gang plate in
$1 or the U121B option in $2 or $3. Setting E=C will set
the
proper axis automatically. If you don't use E=C on the line
then
$1 C axis is default. For safety, always use E=C

(MILL A .3 SQUARE WITH .02R CORNERS)


T1300(Live face mill/.25" cutter /1/2"bar)
(M5)
M18C0
G98M80S3=1200 (GSE1110 is reverse rotation)
G0X.8Z.1T13
G12.1 D0 E=C
G17
G41G0X.15Y.3
G1Y-.15,R.02F8.(or use G2)
X-.15,R.02
Y.15,R.02
X.15,R.02
Y.1
G40G0X.4Y0
G13.1
G18G99M82

G13.1- reverses G12.1 by setting control of the C axis back to C and H

G16- Plane select Y-Z cylindrical machining. To use this plane you need
the
option of G12.1 milling interpolation. G16 is used to convert polar
C axis degrees to linear Y when machining "J" slots or cylindrical
cams. Most of these part prints are dimensioned with linear and
radial
values, not degrees. Also the prints usually show the part cut and
spread flat. Radii are hard to program and adjust without G16 and
tool
nose radius comp. G41-G42. Programming would be linear "Z Y".
The polar "C" axis is converted to a linear "Y" axis. Another use of
G16
is to chamfer a cross hole equaly all the way around the hole.

G16C.15
C= Position of X axis to calculate from if the actual cutting
position is different. This is in radial value. C.15 = X.3

(MILL A J SLOT Sample program not tested yet but should work)
T1100(.125" cutter / 1/2"bar/ to cut .156 slot)
(M5)
M18C0
G98M80S3=2500
G50W-.59
G0X.6Z-.1T11
X.3(to depth of J slot)
G12.1 D0 E=C
G16 (C.15)
G41G1Z-.02Y.078F6.
G1Z.1,R.02(or use G2)
Y.187
G3Z.256K.078
G1Y-.078,R.078
Z-.02
G13.1
G40G0X.6Y0
G50W.59
G18G99M20M82

G17- Plane select X-Y -When viewing this plane from the guide bushing you
need to be looking from the spindle to the GB and this is difficult.
So
swap your G2/G3 and G41/G42.

G18- Plane select X-Z normally used. G18 is when power on. View looking
at
The GB

G19- Plane select Y-Z. View looking down from milling tools at the GB.

G28- Automatic reference return. Usually use the incremental command for
each axis. "G28 U0 W0". You probably won't use G28

G32- Threading- G32 locks the feed-rate override at 100% and turns off
the single block mode. Then G32 looks to find an exact spot on the
spindle to start feeding. G32 is canceled by a G00 command. It's
uses are for multiple angle threads (bone screws, worm gears) or
we commonly use G32 when we tap a part with the main spindle, or the
PO spindle. G32 won't work on the secondary spindles because there
is no encoder on S3 or S4.

If you are cutting a special OD thread always start G32 on a Z move.


If you start G32 on an X move, the spindle zero will pick up in a
different Z position each time. Position "X" first then "G32 Z"

G32 can also adjust the spindle zero for double start threads.
G32 Q180. =180 deg from spindle zero.

tap example(floating holder)-

T2300 (tap example 1/4-20 .5 deep)


G0 Z-.05 T23 S1=500
G32 Z.4 F.04 (locks feed-100%,turns off single block, 80% F&Z)
Z-.05 F.05 M4(still locked feed and no single block, 100% F&Z)
G4U1.
G0 Z-.1 (feed and single block are usable again)
M3
G34-Variable lead threading. This command is the same as G32 but
has the "K" value for the amount of pitch change per revolution. See
G32-

G34 X Z F.03 K.05

X= Position to go to in X
Z= Position to go to in Z
F= Feed rate in IPR
K.05= Amount of change in pitch per revolution. Can be growing pitch
if plus value or reducing pitch if minus value. First rev will
be F.03
2nd rev is (.03+.05) 3rd rev is (.08+.05) and so on.

G35-Arc threading (cw) Used to cut a radus while threading.

G35 X Z R F (Q) (IJK)


G32 X Z F

G36-Arc threading (ccw)


see above

G40- Tool nose radius compensation CANCEL. Turns off G41 or G42

G41- Tool nose radius compensation LEFT. Usually used when front
turning on Cincom machines in a Z positive direction. There are 8
sections of the radius to be used.

1= Boring
3= Back turning
4= Front turn (see manual for details)
8= Profile
0= Endmill

G42- Tool nose radius compensation RIGHT. Not used as often. G42
could be used when traveling in a Z negative direction. See G41

G43- Feed per revolution in $2 on S1. IPR and CSF is read off of the main
spindle. This is used when in G620 and programming from $2 but
feeding
IPR to S1. The default is G43 so feeding in $1 and $2 is IPR off the
main spindle.

G44- Feed per revolution in $2 on S2. IPR and CSF is read off of the sub
spindle. Used to single point thread with the pick-off spindle, tap,
or any IPR feeding needed to be done from the S2 spindle. This code
is
unique to each side $1 and $2. Probably you will only use G44 in $2
because you normally don't need to feed from S2 on the front side
program unless using G600 and TxxxxK2.

$1 $2
G44(G43 is default)
G99
G99 M23S2=1000
T0200 T3100
G0X Z T G0X.27Z-.05T31
G1 Z1.F.002(READ OFF S1) G92X.3Z.4F.05(READ OFF S2)
X.31
T0300 X.32
G0X Z T X.33
G1 X Z F.001 G0X.27
G43 (NEEDED IF USING G811/G620
DRILLING)

G50- Coordinate system setting. Used to either set the position of an


axis
absolutely to a known value, or to move the position of an axis
incrementally over a specified amount. The axis doesn't move but the
position screen changes. Also spindle speed clamp.

G50 Z0 makes current position of Z axis = 0 but no movement of Z


L programs only use one "G50Z" in each program at the
beginning to establish part zero.

G50Z.401 when a left hand cutoff is used. .5-.094-.005

G50 W-.59 shifts the coordinate system over for temporary use then
it
would be shifted back by G50 W.59 after tool is
finished.

G50 S4000 Q300 max RPM=4000 and min = 300

G53-Rapid to Machine position.


Sometimes used after running multiple parts per chucking.
G53Z-[#818*#819] #818= mach len #819= parts per chucking

G53 Z-1.5(Rapid Z to machine position -1.5 not program position)

G53 Z3. ,F80.

The ",F" is a new feature that enables a feed rate command for G53.
If used the ",F" is a one shot feed rate cammand, not changing
modal "F".

G65- Calling a macro program. Same as M98 but we pass variables to a


macro
sub-program. You would have to learn macro's to make macro programs
but I have a macro for Peck Drilling you might want to use. Instead
of the G83 option.

Example for my peck drilling macro...

Z-AXIS ALL ARE IN RADIUS VALUE

G65 P8999 A.05 B.03 C.02 S0 R-.03 Z1. W.01 F.0005 D.5 E3.
X-AXIS A,B,C,U IN RADIUS VALUE S,R,X IN DIAMETER VALUE

G65 P8999 A.05 B.03 C.02 S1. R1.1 X.1 U.01 F8. D.5 E3.

A. FIRST PECK
B. SECOND PECK
C. THIRD AND ALL FINAL PECKS
S. START POINT
W/U. RETURN POINT (RAPID IN)
Z/X. ENDING Z POSITION OR X POSITION
R. RETREAT POINT (OUT OF HOLE)
F. FEED RATE
D. DWELL
E. DWELL EVERY ? PECKS

P8999 is the macro sub-program O8999 and the rest is information


passed to the macro to drill the hole.

G66
G66.1 Special modal macro commands. See the blue Mitsubishi manual.
G67

G76- Canned threading cycle

G76 P010060 Q.002 R.0005 (first G76 sets parameters for


threading)
G76 X Z P Q F R (cuts the thread)

The first G76 isn't needed but is recommended.


- G76 P Q R

P010060 sets 3 things


- first 2 digits is the amount of finish passes - 01

- second 2 digits is % of the lead or pullout exiting the thread-


00
00 = almost no angle at pullout and 99 = 9.9 leads away start out

- third 2 digits are the angle of infeed - 60


0,29,30,55,60,80 are usable (0-90 is ok)
The actual cutting infeed =(value/2)-.5 so a value of 60 = 29.5
infeed

Q.005 sets the minimum cut amount during threading

R.0005 sets the cut amount of the last pass

The second G76 cuts the thread.


-G76 X.1876 Z.3 P.0302 Q.01 F.05 (R-.002) FOR 1/4-20

X.1876 =Minor Dia. of thread

Z.3 or (W) =The ending Z of the thread


P.0302 =Height of thread in radius (Maj-Min)/2

Q.01 =Amount of the first cut. All the rest of the cuts are
calculated.

F.05 =Feed-rate 20 TPI 1/20=.05

R = R is optional for tapered threading. R is the amount of


difference in X from start to finish in Z. When cutting threads
moving Z and X in a positive direction R is a negative value.

G80-Cancel G8? series codes. If only using G83 we don't need G80

G83-Peck drilling cycle. There are (2) parameters related to G83.


Control Param #8125 "G83 Rapid" if ON then the pecks do NOT come out
of
the hole, they only back up the amount of Setup1 Param "G83 Retract"
to break the chip and then start feeding again.

Setup1 Param "G83 Retract .02" is the amount to rapid back into the
hole from the last peck for clearance.

I suggest...
Setup1 Param "G83 Retract"=.02
Control Param #8125 "G83 Rapid"=OFF

Example-
G0 Z-.05 T22
G83 Z1. F.001 R.03 Q.04 P0

Z1. =Z position of the bottom of the hole

F.001 =Feed in IPR or IPM

R.03 =Rapid from current Z position the R amount incrementally.


If starting at Z-.05 and R=.03 then the Z axis rapidly
positions to "Z-.02" and after every peck Z retracts to
the same position "Z-.02". If you use "R-.03" it is the same
as "R.03". Leave R out to start from current Z position.

Q.04 =Peck amount

P0 =Dwell amount at the bottom of the hole. You can just leave
P off the command line if you want

K4 =If face off center drilling use K for the amount of holes
Just leave K off the command if only one.

H90. =If you have C axis option and using K

,F30= This was added! Now you can change the rapid moves to a feed
if desired.
G84-Rigid tapping. Main Z1-S1 or sub Z2-S2

T2300
M97
M3S1=500
G0x0Z-.05T23
G84 Z.5 R.03 D1 F.05 S500 ,R1
G80

or

T1300 (T1300/T1300R1/T1400 face live)


M82
G0X0Y0Z-.05T33
G84 Z.5 R.03 D3 F.05 S500,R1 (may need D-3 for diff spindles)
G80

or

T3300 (Back side stationary)


M95
M23S2=500
G0X0Z-.05T33
G84 Z.5 R.03 D2 F.05 S500,R1
G80

or

T3300 (Back side live U153B)


M180S5=500
G0X.3Z-.05T33
G84 Z.5 R.03 D2 F.05 S500 K4 H90. ,R1
G80

G84 Z1. F.001 D2 R.03 S500,R1

Z1. =Z position of the bottom of the hole

D2 =spindle S1,S2,S3 or S4 -1 for for left hand taps

F.001 =Feed in IPR

R.03 =Rapid from current Z position the R amount incrementally.


If starting at Z-.05 and R=.03 then the Z axis rapidly
positions to "Z-.02"
the same position "Z-.02". If you use "R-.03" it is the same
as "R.03". Leave R out to start from current Z position.

S500=RPM

K4 =If more than one use K for the amount of holes.


Just leave K off the command if only one.
H90. =If you have C axis option and using K

,R1=Synch. tap ,R0=Non Synch. tap ,R2=Re-Synch. tap with phasing

,F30= This was added! Now you can change the rapid moves to a feed
if desired.

G87-Peck drilling cycle X axis. See G83

G87 X.1 Q.2 F5. K4 H90.

G88-Cross rigid tapping.

T800
M82
G50W-.59
G0X.8Y0Z1.5T8
G88 X0 R.05 F.05 D3 S500 K4 H90. ,R1
G80

or

T800
M82
G50W-.59
G0X.8Y0Z1.5T8
G88 X.4 R.05 F.05 D3 S500 K4 H90. ,R1
X0 (,R1)(second peck tap)
X-.4 (,R1)(third peck tap)
G80

X0 =Ending X position of tap

R.05 =Distance from position point to tap start point in radius.


Leave R out to start from current X position.

F.05 =Feed rate.

D3 =spindle 3 use -3 for left hand taps.

S500 =RPM

K4 =If more than one use K for the amount of holes.


Just leave K off the command if only one.

H90. =If you have C axis option and using K

,R1=Synch. tap ,R0=Non Synch. tap ,R2=Re-Synch. tap

,F30= This was added! Now you can change the rapid moves to a feed
if desired.

G90- Rough turning cycle used like G92


G94- Facing cycle used like G92 but feeds down on X.

G92- Threading cycle. Straight infeed only.

G92 X.22 Z.3 F.05 (R-.002) FOR 1/4-20


X.21
X.2
X.19
X.188
X.1876
X.1876
G0 X.5 Z-.05 (ENDS G92 CYCLE. IF NO G0 THEN ALARM!)

X.1876 = Each cutting pass

Z.3 or (W) =The ending Z of the thread

F.05 =Feed-rate 20 TPI 1/20=.05

R = R is optional for tapered threading. R is the amount of


difference in X from start to finish in Z. When cutting threads
moving Z and X in a positive direction R is a negative value.

G96- Constant surface footage on.


It must be turned back off before any T???? code or you get an
alarm.
So index to the tool then turn on. When finished turn off, and then
index to the next tool.

SPINDLE S1-$1

G50 S5000 Q1000 (clamp max rpm and Q= min RPM)


M97
G96 S200 M3 (CSFM on at 200 SFM)
(TURNING)
G97 S1=2000 (CSFM off and spindle 2000 RPM)

SPINDLE S2-$2

G50 S5000 Q1000 (clamp max rpm and Q= min RPM)


M95
G96 S200 M23 (CSFM on at 200 SFM)
(TURNING)
G97 S2=2000 (CSFM off and spindle 2000 RPM)

G97- CSFM off. Maybe have at the beginning of your program as


a safety command.

G98- Feed commanded in Inch Per Minute designation. IPM used for milling.
IPM=RPM*IPR

G99- Feed commanded in Inch Per Revolution designation.


IPR used for turning. IPR=IPM/RPM
G113- SPINDLE SYNCHRONIZE CANCEL G114.1

G114.1- SPINDLE SYNCHRONIZE. Used to exactly lock the P.O. spindle


and the main spindle. G96 can be used also. We can also phase
shift
so we can pick up odd shapes while the spindles are running. See
G814 also.

G114.1 H1 D-2 R0 (if 'R' is used then 'M77' is needed)


(if 'R' is not used you can skip 'M77')

- H1= Commanding spindle 1 for S1 main spindle


- D-2= Following spindle 2 for S2 PO spindle - ROTATION like M24
- R0= Degrees of rotation -picking up odd shapes.

Example to pick-off a round part with CSFM...


T100
G50W-.094S5000 (MAKE SURE PO WONT GO OVER 5000 RPM)
G0X1.1Z4.T1
M97M95
M3S1=1000M24S2=1000
G114.1 H1 D-2 (not using G814 or M77 to save time)
G96 M3 S200(MAIN SPL COMES ON AND PO SPL ALSO COMES ON LIKE M24)
G650 (PO SPL COMES OVER THE PART -SEE G650)
!L1 (WAIT PO SPL CHUCK CLOSE)
(G231)
G1X-.05F.0015
X-.1F.003
G50W.094
G97M5M25
G113
(M96M94)
G600

Example to pick-off a HEX part or front/back phasing with CSFM ...


($1) ($2)
T100
G50W-.094S5000 (PO 5000 RPM)
G0X1.1Z4.T1
M97M95
M3S1=500M24S2=500
G114.1 H1 D-2 R0(or G814 -CHANGE R FOR OFFSET/ see G899)
(M77)
G96 M3 S200
G650 G650Z-.1
!L2 G98G1Z1.F50.
(G231) M77 (WAIT FOR
SYNCH)
G1X-.05F.0015 M15
X-.1F.003 !L2
G50W.094
G97M5M25
G113
(M96M94)
G600 G600

G814-Same as G114.1 but you don't need all the codes on the
command line. You can use the R command for phase shifting.
Citizen added this macro just to make it easier to use spindle
sync. See G114.1 and G113. You may save time by not using G814.
G814 even with no 'R' argument will internaly use 'R0' and this
will force a phase shift for spindle sync, needing also to use M77.
To save time use G114.1 without the R value.

G814 R10. same as G114.1 H1 D-2 R10.

G814 (no R) same as G114.1 H1 D-2 R0

G114.2-Polygon machining command. There are many unique ways to use


polygon machining. Not just for hex or square shapes. Side slots,
Phillips screw driver shapes and whatever else can benefit from the
live tool synchronized with the part while cutting. Use G113 to
cancel.

G114.2 H3 D1 E3 L6 (R15.)

H3 = Master spindle or S3(gang live tool) S4 U121B option


D1= Slave spindle. Could be 1,-1, 2, -1 - is for direction.
E3 = Rotation rate. Number of teeth of the cutter.
L6= Number of flats to be cut on the part.
R15. = Phase shifting amount in degrees.(only on 1:1 ratio
spindles)

G114.3-(option) Gear hobbing command. With a special holder this command


will
time the cutter(S3) and spindle(S1C1) to constantly hold position
so all we do is feed across the part as if we were turning and a
gear shape is cut. A "C" axis is also needed! Use G113 to cancel.

G114.3 H3 D-9 E1 L18 (P0) (Q1.)

H3 = Master spindle or S3(gang live tool)


D-9= Slave spindle or 9= Caxis -9 = reverse
E1 = Rotation rate. Always set to one. Not sure exactly why!
L18= Number of gear teeth to be on the part.
P0 = Helix angle -89.000 to 89.000 for helical gears. Leave off
or set to P0 for spur(straight) gears.
Q1.= Gear module. For helical gears only.

G115- Start point queuing (Type 1)


or Queuing during an axis movement (Type 1)

The programming system that G115 is in waits until the


other system reaches a specified axis position then continues.
See G116 below.
Example... getting P.O. spindle over the part while still turning.

$1 $2
(TURN CUT OFF SAME TOOL) T3000
G650 G650 Z-.1(SUPERIMPOSE Z2 TO Z1)
M24S2=4000M16
G0X.5Z.45T1S1=4000 G115 Z1. !L10 (WAIT FOR Z1 TO PASS POS
1.000)
G1X.4Z.5F.002 G1Z.75F.02(FEED Z2 OVER PART .75)
!L10 M15
Z1.3 G600
(G231)
X-.1 M25
G600

G116- Start point queuing (Type 2)


or Queuing during an axis movement (Type 2)

G116 puts into memory a queue but instantly starts the next
machining
command. When the position is met in the same system then a queue
is
sent to the other system to continue.

$1 $2
G1 X.2 Z.5 !1!2L10
G116 Z1. !1!2L10 (Z1. is greater than Z.5 and less than Z1.5)
G1 Z1.5 F.001

Z1. = let queue begin when Z axis of the programming line that G116
is in reaches Z1. while still moving to Z1.5 . Also position
Z1.
has to be passed on the next CNC command line.

!1!2L10 = just like queuing

Example... getting P.O. spindle over the part while still turning.

$1 $2
(TURN CUT OFF SAME TOOL) T3000
G650 G650 Z-.1(SUPERIMPOSE Z2 TO Z1)
M24S2=4000M16
G0X.5Z.45T1S1=4000 !L10 (WAIT FOR Z1 TO PASS POS 1.000)
G1X.4Z.5F.002 G1Z.75F.02(FEED Z2 OVER PART .75)
G116 Z1. !L10 M15
Z1.3 G600
(G231)
X-.1 M25
G600

G117- Execution of CNC codes during an axis movement. Usually an M code


G117 X.1 M?? D1

X.1 = when X passes .1 the M?? is automatically commanded. Also X.1


has to be passed on the next CNC line.

M?? = any M-code S-code B-Code

D1 = offset #. Normally not used

G140-Arbitrary Axis Change Command. Normally not used. G140 will assign
which
axis are programmed in each line $1-$2. Following is an example to
move control of "C" axis to $2 and back to $1 again. Any axis can be
called any name and used in any system. Very powerful!

$1 $2
!1!2L10 !1!2L10

G140X=X2Z=Z2C=C1

(programming C)

!1!2L20 !1!2L20

G140X=X1Z=Z1Y=Y1C=C1

(programming C)

G141-Cross Machining cancel. If you used a small sub with G140 to change
all
the axis around, you can use G141 to set it back.

$1
(before has X1-Z1-Y1-C1)
G140 X=X2 Z=Z1
(has X2-Z1)

G141
(has X1-Z1-Y1-C1 again)

G149-End position queuing during an axis movement. Similar to G116 except


G149 is smart and will calculate how long it will take to move to
the desired position and finish moving at the queuing point. G149 is
used in "M32 X.1" and will have Z2 and the catcher basket under the
part when X=.1 . Z2 won't start coming in at X.1 but will start
sooner to be there when X gets to .1 . You also need to add special
line lables to mark the lines to end at. "BNxxx"

$1 $2
!1!2L10 G149 Q100 X.1 !1!2L10 Q200
G1 X.3 F.002
BN100 G1 X-.1 F.002 BN200 G1 Z3. F50.(BN200 done when
X1=.1)
G156- Mirroring two axis. Used automatically in G821 to lock Y1 to X2 so
the drills can't hit the turning tools while using T2?00 stations.
You won't normally use G156. If you don't command the other axis,
it
just follows.

G156 Y1=X2 ON
G156 Y1 OFF

G156- Superimpose one axis onto another. G811/G650/G620 uses G156 to make
the Z2 axis follow Z1. You normally won't need G156. If you command
the other axis, it follows but also move simultaniously.
See also -G620/G650

G156 Z2=Z1 turns on Also queue $1 and $2 before G156

G156 Z2 turns back off

G160- Axis torque sensing command. (normally not used) This is used
internally by
Citizen for the auto collet adjusting and auto guide bushing
adjustment.
Possible uses could be to check the Z2 torque while positioning
over the
part when picking off. If the turning tool has failed and the size
is big,
the collet could jam on to the part! G160 will feed to the desired
position at the commanded feed but if the torque is reached the
axis will
stop short of the commanded position. We can then use macro to
determine
where it stopped. G160 is a one shot code and after G160 is done or
if the
torque was met, then 100% of torque is set back to the commanded
axis. I
tested and I used G160 with a shank of a tool and checked the
turned size
of a part and had .0003" repeating! Maybe this is not good for all
jobs
but could be used as part of an auto offset macro!
G160 will not work on a superimposed axis. So if you have a CAV, A7
is
superimposed on Z1 and G160 can not be used on Z1. Instead just use
Z2
for the motion if needed.(no problem)

G160 Q20. Z1. F20.


IF[#5022EQ1.] GOTO 10
#3000=1( ERROR -CHECK PART SIZE)

N10(GO ON)

Q = Torque % of motor to stop feeding. It takes 5-10% to get


moving.
Z1.= Axis and position. Could be X, Y, or C or even U, V, W .
F = Feed

#5021= Macro variable for "X" current axis "Machine" position


#5022= Macro variable for "Z" current axis "Machine" position
#5023= Macro variable for "Y" current axis "Machine" position
#5024= Macro variable for "C" current axis "Machine" position

#5041= Macro variable for "X" current axis "Relative" position


#5042= Macro variable for "Z" current axis "Relative" position
#5043= Macro variable for "Y" current axis "Relative" position
#5044= Macro variable for "C" current axis "Relative" position

Check a drill to see if broken by inserting a pin (drill chucked


backwards)
There was a gundrill from the front side drilled through and a
larger drill
drilled from the sub side. Used G160 to check both drills in one
motion.

T3300(CHECK-GUNDRILL/and Back Drill)


G0Z-.05
G98
G160Z.4Q30.F10.
#100=#5042 (set #100 to Z pos)
G0Z-.05T0
#523=0(reset broken gundrill flag)
IF[#100EQ.4]GOTO3300 (if it made it to .4 then both are good,
continue)
#523=-1 (set flag drill broke at end of cycle)
(#3000=999)(-GUNDRILL-IS-BROKEN) (didn't want to alarm here in
cycle)

IF[#100GE.14]GOTO3300 (check to see if back drill is broken)


#3000=999(-PRE-DRILL-IS-BROKEN)

N3300(GUNDRILL-OK/PRE-DRILL-OK)

G164-Spindle Superimpose. This is used for differential speed sync.


tapping.
The one spindle follows the other but can be commanded for example
500RPM and it would go 500 more than current. Use G113 to cancel
G164.

M182S5=0
G164 H1 D-5(5= optional spindle on T31-35 U153B)
G84 Z.2 F.0312 D6 S500, R1 (500 is 500 more than currant)
G80
G113

G173-Inclined rotation setting. Used with helical interpolation


to perform angled milling or angled thread milling. It will also
let you program angle peck drilling easier. While in G173 mode, all
axis are radius designation programming, like a milling machine.
After the G173 command the axis position remains the same position
as it was before the command but X becomes radial. Keep this in mind
while programming.

Offsetting: The Offset has to be commanded before G173 and this


makes
it more difficult to send a drill in .01 as you need to offset both
axis to the angle to get the movment you desire. Using macro, we
have
a way to utilize the offset data, and we G50 for the offset, see
below

G173 Y0 Z0 D5. or G173 X0 Z.5 D5.

G173 no arguments cancels the G173 command.

Y0 = Center of rotation position of Y


Z0 = Center of rotation position of Z
X0 = Center of rotation position of X
D5.= Angle of rotation.

Remember to use G173 again with no arguments to cancel.

(ANGLED DRILLING SAMPLE FROM A M32)


T2200(.187-DRILL)
(G140Z=Z3 if on sub side)
G50U.7024W-.8(to tip of tool)
G98M84S4=3000(REVERSE ROTATION HOLDER)
G17
G0X1.4Z.1103T22
G0X1.4Z0Y0C90.
G173X0Z.5603D45.(CENTER OF ROTATION X0 Z.5603)
(MY ZERO IS X.9 Z.1103)
(.9/2= .45 =.45 WITH .5603 @ 45DEG =.6364)
(.6364 = FROM CENTER OF ROT TO MY PRG ZERO ON THE ANGLE)
G50W.0761 (SHIFT FROM CENTER OF ROT = .6364-.5603=.0761)
X0Y0(T??- OFFSET CALL NOT ALLOWED)
G0Z-.05
G1Z.06F2.
G0Z-.05
G83Z.65Q.15F6.
G80G0Z-.05
G50W-.0761
G173
G0X1.4
G0X2.T0
M85
G50U-.7024W.8
(G140Z=Z2 if on sub side)

Here is a second example using a hole that starts off center in X and
we
used a G50 after G173 to make the hole start location (X0,Z0). Also a
creative way to use an offset.
(M316 example)
M18C180.
G610(Z-.560) G610 Z-.56
T2400
G612
T600(PRE-CALL-.156 MILL)
(T2400)(MSA-103 set 15-DEG)
G50U-.3886W0
(W0 because the tool extended past Z0 and was adjusted in the G610
Z-.56)
G98M83S4=6300
G0X1.Z.4T24
G173X.1342Z.5925D14.(X and Z are the start location of the hole
X=diam)
G50U-.0671W-.5925
(the pos= X.1342 Z.5925 but now X=radial so G50 to make hole X0,Z0)

(OFFSET)
#100=34(34= offset data we want to use for angular offset)
#101=#[11000+#100](get X offset)
#102=#[15000+#100](get Z offset)
G50U-[#101]W-[#102](G50 as to move the system like an offset but
inside of G173)
G0Z-.1
X0
G1Z.07F2.
G0Z-.05
G83Z.5Q.15F7.(if Z.5 needs to move deeper or move X location, use
Offset 34)
G80G0Z-.1
G50U[#101]W[#102](shift back like offset cancel)

G50U.0671W.5925(shift back as it was when entering G173)


G173
G0X3.T0
M85
G50U.3886W0 (Shift off for tool)

G610 G610

G231-(macro)Pick-off cancel. This was added to save time during the


ending
of the program. G231 is used after G650 and when done cutting off
G231
will automatically cancel the G650 superimpose and send the Z2 home,
all in one command. You then don't need to end with G600's. This can
save 1-1.5 seconds on each cycle!

G231 X-.1 F.002 A-.02 Z?

X= Cut-off end position


F= IPR feed rate for cut-off
A-.02= When the cut-off is at "X" axis position -.1 then automatically
bring the sub spindle Z2 away. This will cancel the G650
Z1.= If you want Z2 to go to some position, not all the way back. It
will position to the Z2 machine position specified. Z1. is 1"
from
return position.

Example...

$1 $2

T100(cut-off)
G50W-.125
M3S1=3000
G0X.5Z2.T1
G50W.125

G650 G650Z-.1

!1!3L650 G1Z1.F.05(feed over)


G50W-.125 M73M15(close collet)
(moving Z1) !1!3L650(let $1 continue)
"
G231X-.1A-.02F.001
(G600 NOT NEEDED) (G600 NOT NEEDED)
G50W.125
S1=1500M25
M7
G0X-.1Z-.005T0
M56
G999 G999
N999 N999
M2 M2
M99 M99

G600's-The G600's commands are Citizen's way of makeing a very complex


multi
axis machine, very easy to program. These G600's commands are
called
mode selections. G600,G610,G620,G630,G650,G660. All of these
commands
select each axis in each of the three systems. G620,G650 enable
superimposition. This is the ability of one axis to follow another
axis
but still be fully programmable. For example we can peck drill and
turn
simultaniously at different feed rates. Because all the G600's
mode are
working with all the axis, all systems are queued with each other
by
commanding the code in all systems for the mode change. There are
also
different arguments possible for each command that can change the
axis
movements as desired. See each code and it's arguments below...

G600- Cancel all G6xx commands. Also G600 is the default mode before the
program starts and after the G999 command at the end of the
program.
G600 will queue with both lines $1-$2 then X1-Z1-Y1-C1 are now
controlled from $1,and X2-Z2-C2 is controlled from $2.

Also when in MDI, Mode G600 is in affect.

$1 $2
G600 G600

G600 command options...

$1 G600 (no arguments are allowed in $1)

$2 G600 (No arguments means Z2 moves away to Z2 home position)


G600W0 (W0 means leave Z2 at the current position)

G610- Machining mode change to use the three drill stations T21-T23 in
the
$1 programming line. G610 will queue with lines $1-$2. All the
programming
is done in $1 and $2 must wait on G600. This replaces the L51620's
G821
command because G610 works deeply with the first T2x00 call to move
Z2 in while
changing the mode. This saves 1 second per use! X2-Z1-C1 are now
used in $1.
Because M140 is not used, you can use 'T2200 S-1.' on the first
T2x00 to change
the position of Z2 when brining in the drills.

Example...

$1 $2

G610 G610($1 takes control of


T21-T23)
T2200(S-1.)(Because first T2x Z2 moves in)
M3S1=3000 (M140 not needed)
G0Z-.05T22
G1Z.1F.002
G0Z-.05

T2300(Drill)
G1Z.5F.002T23
G0Z-.05
G600 G600($2 takes control of
T21-T23)
G50Z0(safety resets Z2
position)
G620- Machining mode change to superimpose Z2 onto Z1 . G620 will queue
with lines $1-$2 then make Z2 follow Z1 but Z2 can also be
programmed
independently. Example if we are drilling while turning.

Note- Any shift, "G50W-.125", on Z1 must be canceled, "G50W.125",


before
G620 or G620 won't find the face of the part!

G620 command options...


$1 G620 has no options
$2 G620Z?? Z= Rapid, drill tip or sub spindle face, to Z??
position of the part to start superimpose.

Example...

$1 $2

T0100(Turn) T2300(Drill while turning)


M3S1=3000
G0X.5Z0T01
G620 G620Z-.5(stop .5 away then follow Z1)
G1X-.05F.002
G116X.3!L1 !L1(Continue when X reaches .3)
X.5 G0Z-.03T23
Z1. G1Z.3F.002
G0Z-1.T0
G600 G600
G50Z0(safety resets Z2 position)

G630- Front Back paralle machining mode. Basicly G630 is the same as
G600.
But G630 will start moving X2Z2 before X1Y1 are finished. During
the
next T-code in system1 X2Z2 move saving time. This saves about .2
seconds from using G600! G630 will queue with both lines $1-$2 then
X1-Z1-Y1-C1 are now controlled from $1,and X2-Z2-C2 are controlled
from $2. You can not command Z in $2 until after T3x00.

$1 $2
G610 G610
T2200
"
"
G0 Z-.05T0
G630 G630
T300(X2-Z2 moveing also) T3200
G0 X Z G0 Z-.05 T

G630 command options...

$1 G630 (no arguments are allowed in $1)


$2 G630 (No arguments means Z2 moves away to Z2 home position)
G630W0 (W0 means leave Z2 at the current position)

G650- Machining mode change to superimpose Z2 on to Z1. G650 will queue


with both lines $1-$2 then make Z2 follow Z1 but Z2 can also be
programmed independently. Example -when we pick up a part and
chamfer
it while we have the back spindle collet closed on the part. Also
if we are using Z2 as a work support.

Note- Any shift, "G50W-.125", on Z1 must be canceled, "G50W.125",


before
G650 or G650 won't find the face of the part!

G650 command options...

$1 G650 (no arguments are allowed in $1)

$2 G650 (no W0 means Z2 moves away to Z2 home position then


superimposes)
G650W0 (W0 arguments starts superimposition from current position)

Example...

$1 $2

G600 G600

T100(cut-off) (eject part)


G50W-.125
!1!3L100 !1!3L100
M3S1=3000 M24S2=3000
G0X.5Z2.T1
G50W.125

G650 G650
G0 Z-.1(bring Z2 to
Z1 -.1)
!1!3L650 G1Z1.F.05(feed over)
G50W-.125 M73M15(close collet)
(moving Z1) !1!3L650(let $1
continue)
"
G1X-.1F.001(or G231)
(G231)
G600 G600(bring Z2 back)
G50W.125 M25
S1=1500
M7
G0X-.1Z-.005T0
M56
G999 G999
N999 N999
M2 M2
M99 M99

G660- Machining mode change to use the front ID tools (T11-T13) and also
the back side T51-T53) at the same time. G660 will queue with both
lines $1-$2 then set auto queuing between tool calls of T11-T51,
T12-T52, and T13,T53. After G660 $1 controls X1-Y1-Z1-C1 and $2 has
Z2-C2. The Z2 position is set to program the sub spindle part zero
to the back side drill zero.

G660 command options...

$1 G660 (no arguments are allowed in $1)

$2 G660 (no W0 means Z2 moves away to Z2 home position)


G660X2 (X2 superimposed X2 onto Y1 if you where for example boring
on the main gang and drilling on the back side)

Example...

$1 $2

G660 G660
T1100 T5100
G50X0 (needed to
add)
G0 Z-.05 T11 G0Z-.05T?
(peck drilling 8 sec) (peck drill 15 sec)

T1200 (queues with T5200) T5200


G50X0 (needed to
add)

T1300 (queues with T5300) T5300


G50X0 (needed to
add)

G600 G600

G999- Finish last part. Finishes the part in the P.O. spindle if you are
running in SINGLE CYCLE MODE. While the machine is running usually
the work on the P.O. spindle is completed while the front of the
part
is also working. When the counter is full or the bar stock is empty
or
if we are in ONE CYCLE MODE then we can finish the part by using
G999
and N999 in our program. If in regular CONTINUOUS CYCLE MODE then
the
CNC statements between G999 and N999 are skipped but if in ONE
CYCLE
MODE or the counter is full or there are other operator alarms then
the CNC statements between G999 and N999 are read and performed.
G999
has to be in all programming lines $1 $2. If using G999 and at some
time you want to turn off this function then turn off soft key in
auto
mode "Lastprt" and the codes between G999 and N999 are always
skipped no mater what MODE your in. Mode G700 is in affect at the
beginning of G999 by default. The code "M98 H_" was developed for
this command. See "M98 H"

$1 $2

M98H1
M56

G999 G999
M5M53 M98H1
T3000
N999 N999

M2 M2
M99 M99

N1
"(CODES FOR BACK WORK)
M99

!1!2L1- Queuing between lines $1-$2. Used as waiting commands to make $1


wait for $2 or $2 wait for $1.

!1= line $1

!2= line $2

L1= queuing reference #. 1-9999. Also "L" does not have to be in


order.

Example...

O1234(queuing example)
$1 $2

!1!2L5 (10 seconds of CNC commands)


!1!2L5 ($2 and $1 wait until on !1!2L5 then continue)

!1!2L1 !1!2L1 ($2 and $1 wait until on !1!2L1 then continue)

O1234(queuing example does the same as above)


$1 $2

!L5 (10 seconds of CNC commands)


!L5 ($2 and $1 wait until on !L5 then continue)
!L1 !L1 ($2 and $1 wait until on !L1 then continue)

T-Tool selection. Moves axis to position tools. Four digit is a tool


call.
Two digit is an offset.

std GTF3613= turning tools


T100 is 5/8" or 1/2" tool
T200-T500 is 1/2 tools

std live tools


T600-T700 GSC907 ER11
T800-T900 GSC1010 ER16 (T1000 also if remove GSE3010)

GSE3010 Block (this has many options of tooling, double holders use
R1)
T1100,T1100R1, back=T5100,T5100R1
T1200,T1200R1, back=T5200,T5200R1
T1300,T1300R1, back=T5300,T5300R1
T1400, back=T5400

Std Front Drill Block


T2100-T2300 3/4" round

Std Back Work Block


T3100-T3400 3/4" round or live

T0100 tool call


T0101 tool call with offset
T01 offset call
T0 cancel offset

T200 -This rapids above the bar stock (longest tool) then
positions tool
station 2 above the stock waiting for the next command.

Special options...

Main Gang T100-T1300 T0202 Q1 H X Z Y K2 E A R1 M1

T0202 X.2 Z.3 -This first rapids above the bar stock then goes to
a
position of X.2 and Z.3 and turns on offset #2
while
indexing to T200.

T0202 X.2 Z.3Y0 Q1 -Q1 tells the machine to go straight to position


X.2 and Z.3 while indexing. X doesn't go up
first.
This possibly saves time but is DANGEROUS.
BE CAREFUL!
T0200 H.5 -H.5 Rapids the current tool to stock size +.5
then
indexes to the new tool. Used to alter the
position point
for the one time index.

T0700 K2 -After the Tool is called, the Z2 axis is the


commanded
Z axis. Also the C2 axis is called up.
X1,Y1,Z2,C2 are
commanded from $1. The next T__00 call changes it
back.

T0700 E90. -While the Tool is called, the C1 axis is


positioned at
the same time to the E value.

T1200R1 -R1 is used to call the 2nd tool of a dbl holder


on the
GSE3010 block. R1 is the outside tool.

T1200R1 A1 -A1 A5 will allow the tool hidden zero data to be


chosen
when using G660 both ends drilling. A1 will use
the front
tool zero data and the back tool will be off. A5
will use
the back drill zero data and the front drill will
be off.
If no A is used or A0 then the zero data from
front and back
are split to make both off a little.

T400 M1 -If M1 is used it will not use the highest tool


set clearance.
This might be used to save cycle time but be
careful!

Main Gang Back side T5100-T5400 T5100 Q1 Q3 W X Y Z E R1


After T5x00 the axis programmed are X1-Y1-Z2-C2

T5200 X.2 Q1 -Q1 will keep Z2 axis where it is


for the tool change. If ommitted Z2 moves back
5mm or .1968"
first, then indexes the tool.

T5200 X.2 Q3 -Q3 will force Z2 axis to go home for the tool
change.
If ommitted Z2 moves back 5mm or .1968" first,
then indexes
the tool.
T5200R1 -R1 is used to call the 2nd tool of a dbl holder
on the
GSE3010 block. R1 is the outside tool.

T5200 W-.2 -If W is on the command then Z2 moves to W amount


from where
it was then calls the next tool. If no W then it
moves back
5mm or .1968"

T5100 Z.5 -If Z is on the command then Z2 moves to Z2


machine pos not
the part position. If no Z then it moves back
5mm or .1968"

T5200 X.5 -Use X to change the position of the X axis while


indexing.

T5200 E90. -While the Tool is called, the C2 axis is


positioned at
the same time to the E value.

Front ID tools T2200 Q1 W X Z E S

T2323 * -Don't put offset or Z pos on the T2?00 line use


T2300

T2300 Z-.05 Q1 -If in G620, Q1 will keep Z2 axis where it is


for the tool change. If ommitted Z2 moves back
first.

T2300 W-.1 -If in G620 mode and W is NOT on the line Z2 goes
to home position first then indexes and comes
back
in to work. If W is on the line, Z2 goes to W
amount incrementaly.

T2100 S-1. -If in G610 mode and you have a shifted tool (the
tool
is set diff. from normal tool set zero) it may
hit when
using G610 and T2100 high speed positioning
function.
Use the S argument to change the position of Z2
when calling
up this tool only used on the first T2x00 tool
after G610.

T2100 X.5 -Use X to change the position of the X axis while


indexing.

Back ID tools T3200 Q1 Q3 Z W X E

T3200 X.2 Q1 -Q1 will keep Z2 axis where it is


for the tool change. If ommitted Z2 moves back
13mm or .5118"
first, then indexes the tool.

T3100 Q3 -Q3 will force Z2 axis to go home for the tool


change.
If ommitted Z2 moves back 13mm or .5118" first,
then indexes
the tool.

T3200 W3. -If W is on the line, Z2 goes to W amount


incrementaly. Then
calls the tool.

T3200 Z.3 -If Z is on the command then Z2 moves to Z2


machine pos not
the part position. If no Z then it moves back
13mm or .5118"

T3200 X.5 -Use X to change the position of the X axis while


indexing.

T3131 **-Don't put offset on the T3?00 line use T3100

*Tool call note T2?00.


T2200 (don't use T2222Z-.05, this moves Z2!)
G0Z-.05T22

**Tool call note T3?00.


T3100 (don't use T3131Z-.05)
G0Z-.05T31
""
G0X0Z-.05T0 (If T0 is left out offsets will add together!!)

Note- Any other codes must be before the T command on the line. Also if
you are using G96 you must cancel with G97 before any T????
command.

S1=2000 T202 X.3 Z.15 Q1 (T202 S1=2000 NO GOOD)


G96 S300
"
"
"
G97

T303
G96 S250
"
"

A- The Mitsubishi control can use commands with angles instead of X Z

G1 X.025
X.5 A30. (control calculates the Z position)
Z1.

G1 Z.7
Z1. A10. (control calculates the X position)
X.625

,R- Put a radius on the part but the control does all of the
calculations.

X.2 F.004
G1 X.5 E.001 ,R.015 (The radius feeds at F.001)
Z1. (feeds at F.004)

G1 X.5 A30. E.001 ,R.05


Z1.

G2 X.5 Z1. R.1 F.002 E.001, R.05(The G2 feeds at .002 and ,R feeds
.001)
G1

(END OF PROGRAM)
E0 (Setting E to 0 will make the default feed of chamfer back to
modal F feed)

,C- same as ,R but chamfers instead.

You might also like