MFG 230 homepage MFG 230 - Computer Aided Manufacturing
 


Complete
site menu:

  Blackboard portal 

   Provides access (through your Route-Y account) to homework, syllabus, etc. (for current students only).

Blackboard FAQs HERE
Getting started tutorial HERE.

  Projects and labs
 

-

Wire EDM project  
  - CNC lathe chessmen
  - Gibbs projects

  Machine tutorials
    and CNC code

-

Code blocks and  

-

G&M code indices

- Sodick tutorial

 Example syllabus 

-

includes complete class description and reading / homework schedule.

   Okuma lathe code blocks, etc:                 

  

  

1

program name / graphics data

2 startup block
3 tool change command
4 end of program
1 NLAP (rough OD)
2 NLAP (finish OD)
3 drilling (along z-axis,
   into center of stock)
4 grooving
5 threading
1 arc cutting (type 1)
2 arc cutting (type 2)
3 drilling (x-axis, deep)
4 drilling (z-axis, off-center
               pattern)
5 squaring the end face
6 keyway end face
7 keyway longitudinal
8 longitudinal thread angle
9 longitudinal thread
10 offset circle
11 straight lines

The one and only 
COMPLETE PROGRAM EXAMPLE
(uses several of the blocks of example code, including an extra live tooling thread block).

1:
program name & control panel graphics data

   

$______.MIN% (the name of your program goes in the blank)
DEF WORK
PS LC,[-40,0],[40,20]
END
DRAW

 --- NOTES --- 

 

[-40,0] gives a Z shift of -4.0" and X shift of 0"
[40,20] means a part length of 4.0" and diameter of 2.0"


2:
startup block

  G00 X20 Z20 (rapid move to the home position)
G50 S2500 (upper limit on the RPMs)
X___Z___S1000 T010101 M03 M42 M08
G96 or G97 S___
 

...continue program...

 

 ---NOTES --- 

Fill in the blanks for the X and Z values with the clearance position of the first cut.
If you use G96, you'll get a constant surface speed; S = CSS.
If you use G97 you need to specify a RPM value; S = desired RPM.


3:
tool 
change command

 

G00 X__ Z__ M9 (move for workpiece clearance)
G97 S1000 (direct control of RPM)
G00 X20 Z20 (tool change position)
X__ Z__ S1000 T020202 M03 M08
G96 or G97 S____ (back to CCS or direct control of RPM - see
                                notes for the startup block of code for details)

...continue program...

 --- NOTES --- 

The X & Z right before the "G96 or G97" line should 
be the clearance position for the new tool.

4:
end of program

 

G97 S1000
G00 Z___ (rapid return to clearance position)
X20 Z20
M02
%


1:

rough OD barstock NLAP

  (start at rough stock clearance position)
G96 (constant surface speed setting)
G85 NLAP1 D__ F__ U__ W__
NLAP1 G81
G00 X0
G01 Z0 G42 F___
___________ (profile code)
G40 X______ (X -clearance posistion)
G80

 --- NOTES --- 

  

     The G85 command triggers the rough cut subroutine - NLAP1 means that its the subroutine #1, and the D value is the depth of the cut (the depth as diameter).
The F value is the roughing feedrate in inches per revolution (IPR), the U value is the OD of the finish (0 .030 typ.), and the W value is the shoulder finish (0 .004 typ.).
     The G81 command is for longitudinal profile cuts.
     The G42 command sets tool compensation right - the F value is the finish feedrate.
     The G40 command turns the tool compensation off.
     The G80 command signals the end of the subroutine.

 

2:
finish OD barstock NLAP

(start at rough stock clearance position)
G96 (constant surface speed setting)
G87 NLAP1

 --- NOTES --- 

 

     The G87 command calls the finish subroutine - this NLAP number matches with the rough NLAP number, thus "NLAP1".


3:
drilling operation

G97 S_______ (direct control of RPM)
G00 X__ Z__ (rapid move to start of drill position - be sure to allow for clearance)
G74 X0 Z-__ D__ L__ F__ E__
G00 X__ Z__ (move to clearance position)

  --- NOTES --- 

       The G74 command signals the start of the drilling cycle.  The Z value is the depth value, the D value is the dwell increment (for chip break), the L value is the retraction increment (clearance for the broken chips), the F value is the feedreate in inches per revolution (IPR), and the E value is the dwell time (in seconds).

4:
grooving operation - plunge

G97 S_______ (direct control of RPM)
G00 X__ Z__ (rapid move to start of groove position - be sure to allow for clearance)
G73 X__ Z__ K__ D__ L__ F__

  --- NOTES --- 

       The G73 signals the start of the grooving cycle.  The X value sets the groove depth diameter, the Z value is the finish point z coordinate, the K value specifies the shift amount in the z direction, the D value sets the dwell increment (for chip breakage), the L value is the retraction increment (clearance for the broken chips), and the F value is the feedreate in inches per revolution (IPR).

5:
threading operation

G97 S_______ (direct control of RPM)
G00 X__ Z__ (rapid move to start of threading position - be sure to allow for clearance)
G71X__ Z__ B__ D__ U__ H__ F__ M33M73

  --- NOTES --- 

       The G71 command signals the beginning of a thread cutting cycle.  The X value is the minor diameter of the thread, the Z value is the termination point of the thread, the B value is the thread angle, the D value is the depth of the first cut (diameter), the U value is the finish allowance (also in diameter), the H value is the thread height (again in diameter), and the F value is the thread lead (the feed rate in inches per minute).
     The M33 means that there will be a zigzag inffed cutting pattern, and M73 sets the infeed depth to pattern #1. (See manual.)
 


1:
live tooling arc 
example
 #1

   

G00X       C       T1111SB=400
G94 Z.5M13
G01Z         F10.0
G102C        L       F20.0
G00X       C       
G01Z       F10.0
G102C       L       F20.0

 

  --- NOTES --- 

Open window with the program used
 to make the above sample.
G00X C: Positioning (C = angle).
G94: Feed per minute mode (inch/min).
F10.0: Z-direction tool feed rate (see also just above).
G102: Circular interpolation in contour generation (face, CW).  C__ L__: End point (C = angle, L = arc radius).


2:

live tooling arc 
example
 #2

  G00X___ C___ T1111SB=3000
G94Z.5M13
G01 Z-.125F10.0
G103C330L1.125F20.0
C270L1.125
C210L1.125
C150L1.125
C90L1.125
C30L1.125
G00X2.90Z.5C30
G01 Z-.125 F10.0
G103C330L1.325F20.0
C270L1.325
C210L1.325
C150L1.325
C90L1.325
C30L1.325...

 

Open window with the program used
 to make the above sample.

  --- NOTES --- 

X___ C___ : Positioning (C: Angle)
G94: Feed per minute mode (inch/min)
F10.0: Z-direction Tool Feed rate
G103: Circular interpolation in contour generation (Face) (CCW)
C ___ L ___ : End point (C: Angle, L: Arc radius)

 

3:
drilling x-axis 
(deep)

G94 X1___ Z___ T1010 SB=1500
G183 X__ Z__ C__ I__ D__ E__ F__
C60
C120
C180
C240
C300
G180

Open window with the program used
 to make the above sample.

  --- NOTES --- 

 

G183: M-tool compound fixed cycle: Deep-hole drilling.
C: Starting hole angle
I: Rapid feed from X1 to I (X1 - I), and then feed rate follows F___.
D: Peck feed stroke
E: Duration of dwell motion (second)
F: F value is the feed rate in inches per minute (IPM).


4:
drilling end face (off center)

G94 X___ Z1___ T1111 SB=1500
G181 X___ Z___ C___ K___ F___
C60
C120
C180
C240
C300
G180

Open window with the program used
 to make the above sample.

   --- NOTES --- 

  G181: M-tool compound fixed cycle: Drilling.
C: Starting hole angle
K: Rapid feed from Z1 to K (Z1 - K), and then feed rate follows F___.
F: F value is the feed rate in inches per minute (IPM).
G180: M-tool compound fixed cycle: Cancel.


5:
squaring 
the 
end face

G00X2.40C0T1111SB=3000
G94X2.4Z.5M13
G01 Z-.125 F10.0
G101C90F20.0
C180
C270
C0
G00X2.60C0
G94X2.6Z.5M13
G01 Z-.250 F10.0
G101C90F20.0
C180
C270
C0

Open window with the program used
 to make the above sample.

  --- NOTES --- 

  G00X C : Positioning (C: Angle)
G94: Feed per minute mode (inch/min)
F10.0: Z-direction Tool Feed rate
G101: Linear interpolation in contour generation
C : End point (C: Angle, L: Arc radius)


6:
keyway end face

G94 X __ Z __ T1111 SB=3000
X __ Z __
G190 X__ Z__ C__ K__ D__ W__ E__ F__ M211M213
C210
C330
G180

Open window with the program used
 to make the above sample.

   --- NOTES --- 

  G94: Feed per minute mode (inch/min)
G190: M-tool compound fixed cycle: Keyway Cutting Cycle
C: Angle
K: Arc Contour Offset
D: The Depth Cut/pass
W: Finish Cut Left
E: Secondary Feed rate
F: Feed rate
M211: Keyway Cutting cycle: Minus direction
M213: Keyway Cutting cycle: Designated depth infeed
G180: M-tool compound fixed cycle Cancel


7:
longitudinal keyway

  G94 X__ Z__ T1010 SB=3000
X2.50Z-.5
G190 X__ Z__ C__ I__ D__ U__ E__ F__ M211 M213
C45
C90
C135
C180
C225
C270
C315

 

Open window with the program used
 to make the above sample.

  --- NOTES --- 

  G94: Feed per minute mode (inch/min)
G190: M-tool compound fixed cycle: Keyway Cutting Cycle
C: Angle
I: Contour Offset
D: The Depth Cut/pass
U: Finish Cut Left
E: Secondary Feed rate
F: Feed rate
M211: Keyway Cutting cycle: Minus direction
M213: Keyway Cutting cycle: Designated depth infeed
G180: M-tool compound fixed cycle: Cancel


8:
longitudinal thread at angle

  G95 X__ Z__ T1010 SB=1000
G185 X__ Z__ C__ F__ SA=20
X2.05 C90
X1.95 C180
X1.85 C270
G180

 

 
 

Open window with the program used
 to make the above sample.

   --- NOTES --- 

  G95: Feed per revolution mode (IPR)
T1010: M-tool number
G185: Longitudinal thread cutting (M-tool)
SB=1000: Live spindle (RPM)
SA=20: C-Axis spindle (RPM)
C0: Start point angle 0o
F: Cutting speed (IPR)
G180: M-tool compound fixed cycle: Cancel


9:
longitudinal thread

  G95 X__ Z__ T1010 SB=1000
G185 X__ Z__ C__ F__ SA=20
X2.05 C0
X1.95 C0
X1.85 C0
G180

 

 
 

Open window with the program used
 to make the above sample.

  --- NOTES --- 

  G95: Feed per revolution mode (IPR)
T1010: M-tool number
G185: Longitudinal thread cutting (M-tool)
SB=1000: Live spindle (RPM)
SA=20: C-Axis spindle (RPM)
C0: Start point angle 0o
F: Cutting speed (IPR)
G180: M-tool compound fixed cycle: Cancel


10:
offset circle

  G00X__ C__ T1111SB=3000
G94 Z.5 M13
G01 Z-.125 F10.0
G103X__ C__ L__ F20.0
X2.0C0L0.75
G01 Z-.250 F10.0
G103X1.0C180L0.75F20.0
X2.0C0L0.75

 
 

Open window with the program used
 to make the above sample.

   --- NOTES --- 

  X__ C__ : Positioning (C: Angle)
G94: Feed per minute mode (inch/min)
F10.0: Z-direction Tool Feed rate
G103: Circular interpolation in contour generation (Face) (CCW)
C__ L__ : End point (C: Angle, L: Arc radius)
T1111: M-tool number
SB=3000: Live spindle (RPM)
F: Cutting speed (IPR)


11:
 straight lines on end face

  G00X__ C__ T1111SB=3000
G94Z.5M13
G01Z__ F10.0
G101C__ F20.0
G00X__ Z__ C__ .
G01Z-.250F10.0

 

 
 

Open window with the program used
 to make the above sample.

  --- NOTES --- 

  X__ C__ : Positioning (C: Angle)
G94: Feed per minute mode (inch/min)
F10.0: Z-direction Tool Feed rate
G101: Linear interpolation in contour generation
X__ Z__ C__ : End point (C: Angle)

 

     

other links... 

     
 

 

[ Professor Kohkonen's page ] [the School of Technology page] [the MFG program page]


Question or comments concerning this site may be directed to MET webmaster.   Last update: 17 Jul 2003