0% found this document useful (0 votes)
417 views93 pages

Lathe Programming Manual Guide

The document presents a programming manual for the Okuma lathe. It explains basic concepts such as the Cartesian coordinate system and how it applies to the lathe, with the Z axis as the tool's centerline and the X axis for diameters. It also covers G commands such as G00, G01, G02/G03 for movements and circular contours, and fixed cycles like G32-G35 for threading. The manual provides programming formats and examples to help users create.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
417 views93 pages

Lathe Programming Manual Guide

The document presents a programming manual for the Okuma lathe. It explains basic concepts such as the Cartesian coordinate system and how it applies to the lathe, with the Z axis as the tool's centerline and the X axis for diameters. It also covers G commands such as G00, G01, G02/G03 for movements and circular contours, and fixed cycles like G32-G35 for threading. The manual provides programming formats and examples to help users create.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROGRAMMING MANUAL

FOR LATHE READING


Programming

INDEX

SECTION 1

Machine specifications .................................................................................... 5


Cartesian coordinate system 6
The coordinate system 7
Lathe coordinate system 8
Machine and the "floating" zero 10
Absolute coordinates versus incremental coordinates 11
Machine coordinate system 12
Typical Part of the Lathe 13
Exercise No.1.................................................................................................................... 14
Explanation of Character Codes Used in Programming 16
Preparatory Functions and Miscellaneous 17
Sequence Number Or Sequence Name 18
Format of the X Axis 19
Format of the "Z" Axis 19
G00 - Rapid Movement ............................................................................................. 20
G01 - Linear Interpolation 21
G02. Circular Contour Clockwise 21
G02 - Considerations for 'I' and 'K' 22
Example Program 22
Exercise No. 2 23
G03 - Circular Contour Counterclockwise 24
Exercise No 3 25
Angular Command ......................................................................................................... 26
Examples of Use of Angular Command 26
Radio Command of an Arch 27
G04 - Waiting Time 27
G13 and G14 Turrets (Upper and Lower) 28
G32- Fixed Threading Cycle (Face) 29
G33- Fixed Threading Cycle (Longitudinal)....................................................................... 31
G33- Sample Program 32
G34- Variable Rosco, Increasing (Non-Fixed Cycle) 33
G34 - Example Program 34
G35- Variable Decrease, Decreasing (Non-Fixed Cycle) 35
Precautions When Programming a Threading Cycle 35
Example Program For Okuma Lathe 37
G40, G41, G42 - Tool Nose Radius Compensation 38
G50 - Spindle Speed Limit 44
G90, G91 - Absolute and Incremental Programming ......................................................... 44
G94, G95 - Inches Per Revolution Or Inches Per Minute 45
G96, G97 - Constant Surface Speed or Direct RPM Programming 46
Precautions When Programming With G96 And G97. 46

Department of Engineering and Applications 2


Programming

Format of the letter 'S' - Spindle speed 46

SECTION 2

Introduction to Complex Fixed Cycles


G71 - Longitudinal Threading Cycle (Fixed Cycle) 48
M32, M33 and M34 - Attack Route 50
G72 - Cross Tapping Cycle (Fixed Cycle) 52
G73- Longitudinal Grooving (Fixed Cycle) 53
G74 - Cross Grooving (Fixed Cycle) 54
G74 - Tapping (Fixed Cycle) 56
G75- Automatic Chaflan (Fixed Cycle) ........................................................................... 57
G76- Automatic Radio (Fixed Cycle) 58
G75 - Automatic Function for Chamfering at Any Angle 59
G76 - Automatic Function for Bevel (Radius)
At Any Angle
G77- Right Machining Cycle 60
G78 - Left Machining Cycle. 63
Automated Lathe Programming (Lap) - Description and 'G' Codes 63
Cutting Modes Graph Lap- I, II, III 64
Lap Format: For G85 and G81 65
Example of Programming for G85 and G81..................................................................... 66

SECTION 3

Rules When Using Linear Programming


Lap Format: For G85, G81, and G84 68
Example of Programming for G85, G81, and G84 69
Lap format. For G85 and G82 71
Lap Format: For G86 and G81 72
Example of Programming for G86 and G81 .................................................................. 73
Lap Format: For G86 and G82 74
Example of Programming for G86 and G82 74
Lap format. For G88 and G81 75
Example of Programming for G88 and G81 76
Lap Format: For G88 and G82 77
Example Of Programming For G88 And G82 ................................................................... 77
Programming Precautions LAP 78
Lap Format: For G85, G83, and G81 79

SECTION 4

Subroutines ......................................................................................................... 81
Rules for Subroutines 82
Subroutine Application 84
User Task; control, variables and arithmetic operations 85
GOTO Statement - Unconditional Jump 86

Department of Engineering and Applications 3


Programming

IF Statement - Conditional Jump ................................................................................. 87


Variables 88
Four-axis turning 89
Four-axis turning - synchronization code p 90
Four-axis turning - interference zones 92
Operation; zero work registration ........................................................... .......... 93

MODEL VOLTEO SPINDLE SPINDLE H/PCONTROL MEMORY RPM MIN RPM MAX
CARET 15.75 ASA A2-6 10 60 M 75 (2) 4200
CAPTAIN 15.75 ASA A2-6 10 15 20 60 M 75 (2) 4200
LAW-S 24.4 JIS A2-8 55 60 M 164 (1) 2500

Department of Engineering and Applications 4


Programming

LB9 11.02 FLAT 7.5 60 M 210(1) 7000


LB12 13.78 ASA A2-6 10 60 M 75(1) 4200
LB15 15.75 ASA A2-6 15 60 M 75(2) 4200
LB15II 340 MM JIS A2-6 15 60 M 45(2) 400
LB25 25.59 ASA A2-8 20 60 M 65(1) 3500
LB25II 16.54 JIS A2-6 15 60 M 65(2) 3500
LB35 13.39 JIS A2-8 30 60 M 14(4) 3200
LB35II 16.93 JIS A2-8 30 60 M 14(2) 3200
LC20-1ST 15.75 ASA A2-6 20 60 M 75(2) 4200
LC20-1SC 15.75 ASA A2-6 20 60 M 75(2) 4200
LC20-2ST 15.75 ASA A2-6 30 60 M 75(2) 4200
LC20M 15.75 ASA A2-6 20 60 M 75(2) 4200
LC30-1SC 19.69 ASA A2-8 30 60 M 15(4) 3000
LC30-2ST 19.69 ASA A2-8 30 60 M 15(4) 3000
LC30-2ST 19.69 ASA A2-8 30 60 M 15(4) 3000
LC40-1ST 23.62 ASA A2-8 40 60 M 10(4) 2500
LC40-1SC 23.62 ASA A2-8 40 60 M 10(4) 2500
LC40-2ST 23.62 ASA A2-8 50 60 M 10(4) 2500
LCM40M 23.62 ASA A2-8 40 60 M 10(4) 2500
LC50 31.5 ASA A2-15 30 60 M 5(4) 1000
LCC-15 17.71 JIS A2-6 10 60 M 35 4200
LCC-15-2S 17.71 JIS A2-6 10 60 M 35 4200
LH35-N 24.02 ASA A2-8 20 60 M 20 2200
LR10 (28 X 200) 15.75 FLAT 7.5 60 M 15 6000
LR10 (28 X 450) 15.75 FLAT 7.5 60 M 15 6000
LR15 (28 X 250) 17.72 JIS A2-6 20 60 M 75 4200
LR15 (28X 600) 17.72 JIS A2-6 20 60 M 75 4200
LR15-CAM 8.27 JIS A2-6 20 60 M 75 4200
LR15-M 17.72 JIS A2-6 22 60 M 75 4200
LR25-M 14.57 JIS A2-8 40 60 M 40 3500
LR35-M 23.62 JIS A2-8 37 60 M 14 3200
LR45-M 27.56 JIS A2-11 45 60 M 12 2800
LT15-M 18.9 JIS A2-6 15 60 M 45 4500
LT25-M 21.26 JIS A2-8 27 60 M 38 3800
LU15 14.96 JIS A2-6 30 60 M 75 4500
LU25 16.54 JIS A2-8 40 60 M 65 3500
LU35 18.9 JIA A2-8 50 60 M 14 3200
LU45 22.05 JIS A2-11 60 60 M 12 2800

Department of Engineering and Applications 5


Programming

PLANO Y
PLANO Z

ORIGEN (0,0,0)

PLANO X

The mathematician and philosopher Rene Descartes developed the rectangular coordinate system, also known as
Cartesian coordinate system, more than 300 years ago. The system is based on the intersection of two or three
mutually perpendicular axes.

The intersection of these planes or axes is called ORIGIN, or zero.

This same concept is used in today's machine tools, if the machine tool has two or three axes.
mutually perpendicular movements, such as a CNC lathe or a CNC milling machine.

+AXIS "Z"

Department of Engineering and Applications 6


Programming

AXIS 'Y'

quadrant V Quadrant III

AXIS 'X'

Quadrant I quadrant II

Quadrant I is limited by: The axis (-) minus 'X' and the axis (-) minus 'Y'
All values of the 'X' axis will be negative.
All the values on the "Y" axis will be negative
The values of the "Z" axis can be negative or positive.

Quadrant II is bounded by: The positive axis 'X' and the negative axis 'Y'
All values on the 'X' axis will be positive
All values on the Y axis will be negative
The values of the "Z" axis can be negative or positive.

Quadrant III is bounded by: The positive axis 'X' and the positive axis 'Y'
All values on the 'X' axis will be positive
All values on the 'Y' axis will be positive
The values of the 'Z' axis can be negative or positive.

Quadrant V is limited by: The negative axis 'X' and the positive axis 'Y'
All values on the 'X' axis will be negative
All values on the 'Y' axis will be positive.
The values of the 'Z' axis can be negative or positive.

Until now, we have been using the Cartesian coordinate system as can be seen in the center of
3-axis machining. Note that the Z axis is the centerline of the spindle tool.

Department of Engineering and Applications 7


Programming

EJE Z

EJE Y

EJE X

To use the Cartesian coordinate system for a horizontal lathe, the system
Coordinates must be rotated and you set the system rules again as positive and negative directions.
It should be remembered that the Z axis is identical to the centerline of the machine tool, thus a logical choice.
is to make the Z axis the centerline of the machine tool. This means that all lengths of a
pieces (positive or negative) will be identified as dimensions on the Z axis. It also means that all the
diameters of a part will be given in dimensions of the X axis. It is also important to remember that all lathes
CNC are machines that have a 2-D system, so only data from the two axes (X & Z) is needed.

X Axis

PART

+ Z Axis
Z Axis

X0, Y0, Z0

CHUCK
Gags + Y Axis

Department of Engineering and Applications 8


Programming

Now that we have rotated the coordinate system, to choose a coordinate system for a horizontal lathe,
We will examine the coordinate system to see how it has changed.

First, we currently do not have a 'Y' axis, but the other axes will still be called 'X' and 'Z'.

Secondly, the axis called 'X' which used to be horizontal is now vertical, and the axis 'Z' which used to be vertical is now
it will be horizontal.

Third, the intersection of these two axes 'X' and 'Z' will continue to be considered as zero or origin and the sign of the
values are in relation to this point.

“Eje + X ” Diámetro

Quadrant IV Quadrant III


X+ X +
Z - Z +

Axis - Z Axis + Z
Length -8 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 8 Length

Quadrant I Quadrant II
X - X -
Z - Z +

“Eje – X ” Diámetro

The limits of each quadrant can be seen in the drawing on page H1.2.

AXIS + X

Department of Engineering and Applications 9


Programming

Zero of the
machine Valor de Z

FLOATING ZERO
X0, Z0
Valor de X

AXIS - Z

SPINDLE

Gags

PIEZA

AXIS - X

As you can see now, the Cartesian coordinate system can be placed on a piece. The X0 and
The origin, Z0, of the Cartesian system can be placed anywhere you want or need to place it.

Due to this ability, the ZERO coordinate system is called floating zero. This means that a
the piece is programmed as if it were floating in space, with no problems for the machine
tool.

In the real world, we know that there must be a relationship between the floating zero (zero of the piece) and zero.
of the machine or origin of the machine. This relationship is established in the ZERO SET menu in the mode
manual operation. (See the operating guide for your machine.)

Understanding this concept allows us to understand that the Cartesian coordinate system is used for
to show the particular geometry of the parts that make up a piece to the computer within it
CNC control. This is used by lathes and 2 and 3 axis milling machines.

So far we have come a long way working with the coordinate system, the values of X and Z are called
absolutes when measured with respect to the origin or zero point. The best (and the only) way to

Department of Engineering and Applications 10


Programming

to consider an absolute value is that it is a unique point. This means that there can be a point and
a single point that has the value of X4, Z4 for example within the coordinate axis.

We can program a movement from one absolute point to another absolute point within the same.
quadrant or any quadrant at any time.

The distance between absolute points is called incremental value. All CNC controls now
they have the ability to accept both absolute input values and incremental ones in the same
program. Care must be taken when entering values, because when doing a
incremental movement and this written as an absolute movement can bring results
disastrous for your machine tool.

To illustrate this point, we will recreate the coordinate system using the X axis and the Z axis. Note that the
absolute position of the points and the incremental distances between those points. To program a
incremental movement, the distance between absolute points must be given with the sign that
mark your address (+) positive or (-) negative.

Absolute point 1
X+12, Z+7
+ 8
Z-5, incremental
+ 6

+ 4 X-8, incremental

+ 2

+ 2 + 3 + 4+ 5 + 6 + 7

Absolute point 2
X+4, Z+2

To program a movement from the absolute point to absolute point 2 in incremental mode would be:

X-8, Z-5

Department of Engineering and Applications 11


Programming

Department of Engineering and Applications 12


Programming

TYPICAL PART OF A LATHE

2.0
Day. 1.50
Day.

4.0
1.0

Now we can take this example and show a typical program of a lathe, this may include
show the part, jaws, and screw. Starting with this drawing, you will see this symbol
Shown on the piece, this icon is to indicate where the floating zero has been set by the
programmer.

HUSILLO

PIEZA

MORDAZAS

Department of Engineering and Applications 13


Programming

2.0
Day. 1.50
Day.

4.0
Now we can take a typical lathe part and go through the points of the geometry that are needed.
to program this part.

Please note that all dimensions in 'X' will always be given as diameters, even though
if the diameter is below (negative) or above (positive) the center line.

Eje + X
Punto 4
Punto 3 Punto 2

Punto 1

Eje - Z Eje + Z

The values for this point are:


X Z
Point 1
Eje - X
Point 2

Point 3

Point 4

BLOCK DELETE: This feature provides a way to skip certain lines in a program.
inserting a slash (/) before or after the sequence number or at the beginning of a line that does not

Department of Engineering and Applications 14


Programming

it has a sequence number. This feature becomes effective when the button is pressed
marked as BLOCK DELETE. A light at the top left indicates whether the button is
activated or deactivated.

Examples of programmed lines of BLOCK DELETE

/N11G00X6.Z-5. N11/G00X6.Z-5. /GOOX6.Z-5.

BLOCK BLOCK
DELETE DELETE

With BLOCK DELETE turned off With BLOCK DELETE turned on


The lines with flash are active. The lines with slashes are inactive.

SIGNS: If the scalar value follows the letters X, Z, I, K, D, F, and F is positive, the plus sign does not
It needs to be programmed. On the other hand, if the value is negative, then it must be programmed.

ZEROS TO THE LEFT: If a number is preceded by a zero, the zero does not need to be there.
scheduled
G00 (G0) G01 (G1) M00 (M0) M03 (M3)

ZEROS TO THE RIGHT: The zeros that are found to the right of a number must be
programmed.
G40 IS NOT G4 G80 IS NOT G8 M30 IS NOT M3

COMMAND MODALITIES: When a word or command is programmed, it is not necessary for it to


repeat the command or word in the following blocks.
N11 G00 X6. Z-5 N11 G0 X6. Z-5.
N12 G00 X6. Z-5.2 N11 Z-5.2

PREPARATORY FUNCTIONS: Any number of preparatory or miscellaneous functions can


ser programadas en una línea, mientras estas no se contradigan.

N11 G00 G90 G96................. M03 M08 M42.

EXPLANATION OF CHARACTER TYPE CODES USED FOR PROGRAMMING.

Department of Engineering and Applications 15


Programming

A Determine the angle of a conical thread, in thread cycles.

B Determine the angle between the flanks of a thread, in threading cycles.

C This command in degrees describes the rotation position of the spindle for the C axis, rotation of
spindle.

D Specify the cutting depth in fixed cycles.

E Specify the waiting time in fixed cycles.


In a G01, the feed set by F changes.

F Determine the tool advancement in mm/rev, mm/min, IPR, IPM.


Determine the pitch of the thread in threading cycles.
Determine the wait time in a G04

H Specify the height or depth of a thread.

I In fixed threading cycles, determine the radial difference of a tapered thread, in diameter.
In shaving cycles, determine the distance between slots.
Determine the distance from the starting point to the center of an arc in X, in a G02 and
G03.

K Determine the number of slots in shaving cycles in Z.


Determine the distance from the starting point to the center of an arc in Z, in G02 and G03

L Determine the radius measurement in G02 and G03


Determine the number of times the tool will make the cut before removing the point of
start.

N Determine the line number if these are numbered.

O Indicate the name or number of a subprogram.

P Determine the waiting time in a G04.


Coordination of towers in 4-axis programs.

Q Determine the number of entries in threading cycles.

S Determine the number of revolutions in a G97.


Determine the cutting speed in a G96.

T Determine the number of the tool.

U Specify the excess material unit for finishing in X.


W Specify the amount of excess material for finish in Z.

Department of Engineering and Applications 16


Programming

X Value of a coordinate on the X axis. Value in diameters.

Z Value of a coordinate on the Z axis. Value in length.

T 01 01 01
Compensation of the insert radio.
Tool number in the turret.
Radio compensator.

PREPARATORY FUNCTIONS.

G00 - RAPID POSITIONING


G01 - LINEAR INTERPOLATION
G02 - CLOCKWISE CIRCULAR MOVEMENT.
G03 – CIRCULAR MOVEMENT COUNTERCLOCKWISE.
G04 – DELAY OR WAIT TIME.
G13 – TURRET A SELECTION
G14 – TURRET SELECTION B
G40 - CANCELLATION OF RADIO COMPENSATOR.
G41 - LEFT HAND RADIUS COMPENSATOR.
G50 – LIMIT OF SCHEDULED RPM.
G71 - AUTOMATIC LONGITUDINAL THREADING CYCLE.
G73 – AUTOMATIC RAMPING CYCLE.
G74 – AUTOMATIC DRILLING OR FRONT GROOVING CYCLE.
G75 – AUTOMATIC CHAMFER AT 45°.
G76 - AUTOMATIC RADIO AT 90°.
G77 - AUTOMATIC THREAD MACHINING RIGHT THREAD.
G78 - AUTOMATIC MACHINING LEFT THREAD.
G80 – CANCEL G81 AND G82.
G81 - START OF THE DEFINITION OF THE PIECE LONGITUDINALLY.
G82 - START OF THE DEFINITION OF THE CROSS SECTION.
G83 – DEFINITION OF THE MATERIAL TO BE REMOVED.
G85 – AUTOMATIC ROUGHING CYCLE.
G87 – AUTOMATIC FINISHING CYCLE.
G90 - ABSOLUTE POSITIONING SYSTEM.
G91 - INCREMENTAL PROGRAMMING SYSTEM.
G94 - SETS THE FEED IN INCHES PER MINUTE (IPM).
G95 - DETERMINES THE FEED IN INCHES PER REVOLUTION. (IPR)
G96 - PERIPHERAL SPEED IN FEET PER MINUTE.
G97 – CANCEL G96 AND CHANGE TO RPM
G110 - PRIORITY FOR TURRET A
G111- PRIORITY FOR TOWER B.

MISCELLANEOUS FUNCTIONS

Department of Engineering and Applications 17


Programming

M00 - PROGRAM STOP


M01 - OPTIONAL PARENTHESIS.
M02 - END OF THE PROGRAM.
M03 – SPINDLE ROTATION CLOCKWISE
M04 – SPINDLE TURNING COUNTERCLOCKWISE.
M05 - SPINDLE STOP.
M08 – TURNING ON THE REFRIGERANT.
M09 – TURN OFF REFRIGERANT.
M22 - CHAMFER OPERATION TURNED ON.
M23 – CHAMFER OPERATION OFF
M30 - END OF PROGRAM.
M32 - TOOL PENETRATION SHAPE ATTACKING FROM THE LEFT.
M33 - TOOL PENETRATION SHAPE IN ZIG-ZAG.
M34 - TOOL PENETRATION SHAPE FROM THE RIGHT.
M40 – NEUTRAL POSITION OF THE SPINDLE.
M41 - LOW SPEED RANGE. FROM 100 TO 1100
M42 – HIGH SPEED RANGE. FROM 1001 TO 4200.
M55 – ACTIVATE THE COUNTERPOINT SPINDLE TOWARDS THE PIECE
M56 - DISABLE THE COUNTERPOINT SPINDLE OF THE PIECE.
M60 - CANCEL M61
M61 - DO NOT IGNORE SPINDLE SPEED.
M73 – CUTTING DEPTH PER PASS IN THREADING CYCLES.
M74 - CUTTING DEPTH PER PASS IN THREADING CYCLES.
M75 - CUTTING DEPTH PER PASS IN THREADING CYCLES.
M83 – UNLOCK THE MUZZLES OF CHUCK
M84 - OPEN THE CHUCK'S JAWS.
M90 – OPEN THE MACHINE DOOR.
M91 – CLOSE THE MACHINE DOOR.
M157 – IGNORE THE COUNTERPOINT PARAMETER.

SEQUENCE NUMBER

FORMAT: N1 TO N9999

The only function of the sequence number is to locate a line or block within the program.
para hacer alguna modificación.

A program can be typed if a sequence number and the control is used to return to
request a sequence number.

Trailing zeros can be omitted, while leading zeros must be programmed.

EXAMPLE.
N0001 CORRECT
N1 CORRECT

Department of Engineering and Applications 18


Programming

NOTE: You cannot leave spaces between the N and the first number.

N**** can also be a sequence name. The first character after the N must be a letter,
And the other three can be combinations of numbers and letters. Just like with the sequence number either.
There may be spaces between the N and the other characters.

X AXIS
Axis X
Format in inches: X +/- ****.****
Format in metric system: X +/- *****.***
Zero Programmed

(+) Positive.

center line
from the machine

Negative

Piece

Gags

This axis specifies the location of the tool tip in relation to the programmed zero, the
What is always the centerline of the machine.
Remember that the numerical value for the x-axis is always designated in diameters.

AXIS Z

The programmed zero can be in any position on the Z axis.


Programmed Zero

Negative (+) Positive.

PREPARATORY FUNCTIONS

Department of Engineering and Applications 19


Programming

FORMAT: G00 RAPID POSITIONING.

It is used to position the cutting tool from one programmed point to another programmed point.
that is within the limits of the axes.

G00 or G0 activates each independent movement on each axis and chooses the fastest path to reach it.
to the final point.

Punto “A” X8. Z.10

Punto “B” X6.Z-5.

Camino de la herramienta

To move from Point 'A' to Point 'B', the line to program could be:

N21 G00 X6. Z-5.

FORMAT: G01 LINEAR INTERPOLATION.

Department of Engineering and Applications 20


Programming

This command is used to move the cutting tool from a starting point to an ending point
at a desired speed, on both axes.

G01 (G1) activates sliding on each axis using the information contained in a line, to
move the tool along a straight path to an axis or an angular line.

The speed at which the tool is desired to move is controlled by the letter F.

FORMAT: G02 CIRCULAR MOVEMENT IN THE DIRECTION OF THE HANDS OF A CLOCK,

The circular contour control uses the information from a block to move the tool to
clockwise, in the shape of a circular arc.

The speed at which the tool moves is controlled by the letter F.

All circles are defined and machined by the program in three parts of information,
these are

Starting point of the arc: this is defined before using G02, usually by a G01.
Final point of the arc: it is defined by the coordinates in X and Z within the G02 command.
Arc center: It is defined by the letters I and K or the letter L within the G02 command.

Los valores I y K son distancias incrementales desde el punto de inicio al centro del arco, para
90-degree arcs the values of I and K can be determined very easily.

Final Point. Starting point Starting point


I (-)

Center
K (+) from the arch
K (-)

I (+)

Final Point.

In the case of arcs other than 90 degrees or fillets, I and K are determined according to the examples of
Starting point
down.

K (-)

Department of Engineering and Applications 21


I (-)
Center
of the bow
Programming

I (-)

K (+)

K (-)

I (+)
I (+)

K (+)

It should be remembered that the direction in which the tool moves is clockwise.
watch

Below is how the program for the piece shown in the drawing might look.

N11 ..............
N12 G00 X0. Z.1 Movement to the front of the piece
N13 G01 Z0. (Advance to Z0, face of the piece)
N14 X2. (The tool stays at Z0, but moves to X2)
N15 Z-1. (I know it goes to X0, but it goes to Z-1, starting point)
N16 G02 X5. Z-2.5 I1.5 K0
(It has a radius of 1.5 and ends at X5 Z-2.5)
N17 G01 X6. (Make a Z-2.5 cut, at a diameter of X6.)
N18 ................

The drawing is shown on the following page.

1.5 RAD.

6 Dia.
2.00
Day.

Department of Engineering and Applications 22


5 Dia.
Spindle Gags 1.00
Programming

EXERCISES

Complete the piece program.

5,000

1.00 RAD

2,000

1.5 days

N84 G00 X1.5 Z5.1

N85 G Z

0.750 rad N86 G X Z I K

2.000 Day

Department of Engineering and Applications 23


Programming

5,000

For this piece, move the Tool to the face, then towards the starting point of a radius of
0750, machine the inner radius, and then machine to the end of the piece.

FORMAT: G03 COUNTERCLOCKWISE MOVEMENT.

This command has the same functions as G02, the difference is the direction in which it
tool moves.

As it was said, the command information is divided into three parts, these are

Starting point of the arc.


End point of the arch
Center of the arch.

The literals I and K are incremental values from where the tool starts to cut (Point of
start), and the center of the arc.

EXAMPLES FOR G01 AND G03

From the current position of the tool, program the path to move to the starting point in the
face of a radius of 1.00, machine the radius to the endpoint at X4.00 to finish the piece

1.000 rad
Department of Engineering and Applications 24
4.00
Day
4.500 rad.
Programming

N73 G00 X1. Z4.6


N74 G01 Z4.5
N75 X_____
N76 G___ X___ Z___ I___ K___
N77 G___ Z____

From the initial position of the tool, make a movement towards the face, then move the
tool to the count starts the slope at 45°, machine the angle to 45°, up to the point of
start of the radius, machine to a radius of 1.00, until reaching a diameter of 5.4216, and until the end of
the piece.
1.00 rad
.7071

.7071

5.4216 dia
1.25 dia.

N35 G00 X0. Z.1


N36 G01 Z____
N37 X____
N38 X_____ Z_____
N39 G___ X_____ Z___ I____K__
N40 G___ Z_____
ANGLE COMMAND. 2.500
5,000

For a conical shape, it is necessary to specify the angle of the face of the piece or its diameters,
With or without the help of trigonometry, the endpoint can be calculated.

Using the command 'A', the task of programmers can be simplified by giving the
coordinates in X and Z, of the endpoint, the angle is referenced with the Z axis. Examples.

A= +45 A= -315

Department of Engineering and Applications 25


Programming

Measurement
positive. (+)

Z axis

A= +135 A= -225
Measurement
negative (-)

The value of the angle has to come after A= +225 A= -135


the letter A.
the control will execute a conical cut as long as
the line of the program contains the literal X or Z,
together with command A.
In case of forgetting to put the X coordinates
An alert message may appear.

A= +135 A= -45

Final point Starting point


Center of the arch.

The letter L, in circular motion, is simple to program an arc of a radius, it only needs the
X and Z coordinates of the endpoint, and the letter L is the radius of the arc that is going to be machined.

When using letter L,


L functions G02 or G03 must accompany it.
L
The value of the arc's radius must always be positive, in case the coordinates of the point are omitted.
It can ultimately be an alarm.

Department of Engineering Starting


and Applications
point 26
Final point
G02
G03
Programming

PREPARATORY FUNCTION G04

This function is used to create a delay for a specified period of time.


The tool does not move but the spindle and the coolant remain on.

This function must be accompanied by the letter that specifies the waiting time. (F).

Example

N06 G04 F2. Wait time of 2 seconds.

Axis X +
NOTE: This function cannot be used in LAP mode.

Tower 'A'

PREPARATORY FUNCTION G13 AND G14

-
Axis Z +
G13- SUPERIOR TORRENT (A).
- TOWER (B).
G14- LOWER Axis X +

Axis Z +
Select which turret will be positioned for cutting. These functions must be programmed in
blocks by themselves.
Tower "B"

LATHE MODEL 2ST/1SC LATHE MODEL 1ST/1SC

Department of Engineering and Applications - 27


Z axis +
Axis X + -
Programming

FORMAT: G32 FIXED THREADING CYCLE.

Cutting depth
by step.

F
Starting point
X day.
Z length

Department of Engineering and Applications 28


Programming

X coordinate of
final point.

Definition of literals.

X: value of the coordinate (diameter) of the final threading point in the X-axis direction
Z: value of the thread pitch coordinate in the direction of the Z axis.
F: It is the inverse of the number of threads per inch (1/Number of threads), when the letter J is used,
the F would be 1.
K: Distance increases between the starting point and the endpoint for a tapered thread.
Note: The letter 'A' is not used
A: Tapered threading angle, measured from the zero of the positive Z-axis. The movement against the
hand is positive, while in favor is negative.
I: incremental value used to change the starting point of the threading cycle. The value must be
positive and can be used with the letters A or K. When the letter I is not programmed, the control
assume I = 0.
L: chamfer or distance from the end of the thread. This condition is only active when an M23
is placed in the command line G32.
It is equal to the number of threads per inch.
E: It is the variation of the thread, in case of variable threading.

EXAMPLES:

Letter K. Letter A

K +A

Department of Engineering and Applications 29


Programming

Letter I Letter L

Starting point,
changed by I

Point of
start

Example program

The face of the piece is Z zero, the starting point is X3. Z.1,
Final point is X1 and six passes of .10 in depth per pass.
The tool threads the distance L of the
In every step. final point of the X axis, then it is removed
G00 X3.Z.1 angularly
G32 X1.Z-.01 F.0
Z-.2
Z-.3
Z-.4
Z-.5
Z-.6
FORMAT: G33 FIXED THREADING LONGITUDINAL CYCLE.

"Z", full stop of


rosy

Point of
start
F

Depth of
step cut
X

Department of Engineering and Applications 30


Programming

DEFINITIONS:

X.- Value of the coordinate (diameter) of each thread step.

Z.- Value of the coordinate of the threaded endpoint in the direction of the Z axis.

F.- Thread pitch (1/number of threads per inch). If the letter J is used, the value for F should be 1.

K.- Incremental value used to change the starting point of threading. It must always be positive and
It can be used with the letters I and A. When K is not specified, the control assumes K = 0.

A.- Angle of conical threading, measured from the zero of the positive Z axis.

I.- Diferencia incremental entre el punto de inicio y el punto final de roscado, para roscado cónico.
I = large diameter - small diameter.
+ ... increasing cone.
-...decreasing conical.

L.- Chamfer or distance from the end of the thread. This condition is only active when M23 is
attached to the command line with G33.

J. The number of threads per inch is the same.

E.- It is the variation of the thread in the case of variable threading.

Letter I Letter L “L”

“I”

Letter E
(positive or negative)
((F - E) - E)
(F+ E) ((F + E) + E)
(F-E)

F F

Department of Engineering and Applications 31


Programming

EXAMPLE PROGRAM
¾ twist, of 10
.620 diameter. Smaller
1.00 long

2 days.

1,200
10 thread roscado, with zero Z on the face of the piece, length of
roscado 1.00.
F = 1/10 or 0.1 inches

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.2 Z.2 G97 S1018 T0101 M08 M03 M41
N4 G33 X.7216 Z-1. F1 J10
N5 X.7042
N6 X.6904
N7 X.6786
N8 X.6682
N9 X.6588
N10 X.6500
N11 X.6420
N12 X.6342
N13 X.6270
N14 X.6200
N15 G00 X20 Z20. M09
N16 M02

FORMAT: G34 VARIABLE GROWTH THREAD.

Department of Engineering and Applications 32


Programming

DEFINITION OF LITERALS.

When using a G34, it should be remembered that it is not a fixed cycle. The tool MUST be
positioned over the X axis and the Z axis of the desired threading pass to use this cycle, once
positioned, any path of the tool can be programmed, vertical, horizontal or
inclined.

E.- It is the variation of the thread in case of increasing variable threading, only positive values.

F.- Thread pitch or (1/ number of threads per inch).

J.- Number of threads per inch.

Example program.

The following program was written to show a step in the threaded piece.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.2 Z.2 G97 S200 T0101 M08 M03 M41
N4 3,000
G34 X1.8 Z-1.6 F1 J11.5
N5 Z-3. F1 J4.5 1,600
.200
N6 G00 X2.4
N7 X20. Z20. M09
N8 M02

1.800 days.

Thread of 1.0- 11.5


Department of Engineering and Applications 1.200 dia. 33

Thread of 2.0- 4.5


Programming

This program is used as needed for special threadings such as combined threads, threads
normal, tapered threads, variable pitch threads, and constant pitch threads.

FORMAT: G35 THREADED WITH DECREASING VARIABLE PITCH.

The definition of this command is similar to the previous one, the only thing that changes is the literal E.

E.- Thread pitch variation, for each step taken, decreasing, only negative values.

PRECAUTIONS WHEN PROGRAMMING THREADING CYCLES.

Threading tool movement.

Cuando se usa un ciclo de roscado, G32 o G33, la ruta de la herramienta (1) y (4) son ejecutadas
by a quick movement, while the progress in (2) is determined by the literal F, and (3) is
determined by a parameter.
Long Word Parameter No.8

(3)

(1
)
Department of Engineering and Applications 34
(2)
Programming

In tapered threading.

When a conical threading is done, the threading is parallel to the X axis when using the G32 cycle, and the
parallel to the Z axis in a G33 cycle.

When using cycle G34 and G35, an M code is used to designate the thread direction.

M26.... Cancel M27, parallel thread to the Z axis.


M27.... Thread parallel to the X axis.
In the absence of specifying an M code in G34 and G35, the control assumes M26, parallel to the Z axis.

Number of threading passes.

Determine the number of passes to complete the threading, according to the material of the
workpiece, thread direction, etc.

Spindle speed change during threading cycles.

If a change in spindle speed is programmed in a threading cycle, it will have to


Change the starting point of the threading cycle to avoid damage when performing the operation.

NOTE: Never change the spindle speed during a threading cycle.

The feed rate does not operate during a threading cycle.

Chaflanes:

To produce the end of a thread, a M23 can be programmed. When the M23 is active, the
threading tool retracts from the end point of the thread at an angle of 45 degrees. The
the distance of the X and Z axis will be equal to the letter L. If a value of L is not programmed, the control will assume
default the letter F or the value equals a step.

M22... Chaflan OFF (turned off)


M23... Chaflan ON (on)

45
gra Axis X
do
s
Department of Engineering and Applications 35
"L" equals to a
Axis Z step
Programming

Model Valor Kv
LC10 35
LC20 30
LC30 30
LC40 25
Calculations for the starting point and endpoint of threading. LC50 25
LS30N 25
A certain length of an incomplete thread is normally
LH35 25
produced near the starting and ending cutting point during the
threading cycle. It may be necessary to add an amount, delta1 LH55 25
(d1) and delta2 (d2) at the starting and ending point of threading to ensure LB6 35
the desired threading shape. LB8 35
LB10 35
d1 = N * P / (Kv * 20) N .- Spindle speed. LB12 30
P.- Thread pitch. LB15 25
d2 = N * P / (Kv * 60) Kv. - Constant of that
it depends on the model.
LR15 25

d1 d2

Example program for shaping on Okuma lathes that are not equipped with fixed cycles.
of machined.
Care must be taken when tooling the Okuma lathe. Consult your agent.
Sales of tools to select the right taps.

The program of the sketch shown below would be:

N1 G50 S3000
N2 G00 X20. Z20.

Department of Engineering and Applications 36


Programming

N3 X0. Z.3 T0606 G97 S300 M03 M08 M41


N4 G34 Z-1. F.125
N5 M05
N6 Z.3 M04
N7 M05
N8 M03
N9 G00 X20. Z20.
N10 M02

.300

1.000

FORMAT: G40 CANCELS THE INSERT COMPENSATION.


G41 INSERT OFFSET (LEFT)
G42 INSERT OFFSET (RIGHT)

For profile and face cuts, the THEORETICAL edge of the tool nose and the actual ones
the tangent points of the tool's cutting radius are the same. This implies
that the compensation of the insert should not be used in the geometric machining which consists of
straight lines (vertical and horizontal)

When turning an angle or a radius, however, there is a difference in the localization of the
theoretical shape point and the current tangent points of the radius that need to be compensated. This
it is the function of the tool nose radius compensation.
Compensation). Typical view of an insert.

Current tangent point insert

The theoretical thread of the nose of the


Nasal radius
tool

Current tangent point


Department of Engineering and Applications 37
Programming

Example of a part where insert compensation is not needed for processes of


machining.

In the discussion about the compensation for the nose radius of the tool, the radius of the
tool can be shown as a circle within the insert. The circle represents the
diameter formed by the nose radius of any tool to remember that the control
consider the definition of radius on the TOOL DATA page to be a diameter.

Below are shown the proper and improper way of the tool's path caused by using or not.
use the tool nose radius compensation.

Note the position of the theoretical cutting edge point of the tool's nose in both examples.
Direction in which it moves the
tool.

Desired route

Direction in which it moves


tool.
Current route of the
tool.

The theoretical thread of the nose of the


tool
Current and desired route of the
tool.
Scheduled movement without radio compensation.

Department of Engineering and Applications 38


Theoretical strand of the nose of the
tool
Programming

Scheduled movement with the Nose tool radius.


radio compensation.

Theoretical edge point of the nose of


the tool

When the nose radius compensation of the tool is used, all programming is done
at the theoretical cutting edge of the tool's nose.

This means that the program of the piece is a reflection of its engineering drawing. It also saves
the cost and time spent on calculations necessary to compute the line alignments of
center of the tool for angles and arcs.

The consideration should now be given in relation to the sharp edge point of the nose radius.
tool and the surface where the cut will be made. This is determined by being aware of
that each direction of the surface is closely exploited and each direction in which the tool
It will move along the surface.

There are two G codes provided for this purpose, these are:

G41. Nose radius compensation or insert compensation - left

Department of Engineering and Applications 39


Programming

This code is compensation where the center line of the tool is to the left of the
working surface that will be machined, looking in the direction of the movement of the
tool.

G42.- Compensation of nose radius or insert compensation.- right.

This code is for compensation where the tool's center line is to the right of the
working surface that is going to be marinated, looking in the direction of the movement of the
tool.

Now we will look at some examples of typical cases of insert compensation.

G41 G42 G41 G42


Direction of
insert. Address of
insert.

Address of the
compensation.

Address of the
compensation.

G41 Address of G42


insert.

Direction of
insert.

Address of
compensation.
Address of
compensation.

Department of Engineering and Applications 40


Address of
G42 insert G41
Programming

G41 G42 G42

G41

G41
G42

Department of Engineering and Applications 41


Programming

Here are six examples of the application of insert compensation in a piece. Note
that the location of the tool centerline in relation to the geometry of the part and
the direction of the tool path. These two conditions determine the conditions of
right or left.

Do not try to make general rules. Like, when the workpiece is on the left of the
the tool's center line is always a right condition or when the piece of
The job on the right side of the center line is always a left condition.

UNDERSTANDING OF TOOL COMPENSATION AT THE START OF A


CONTOUR.

A common problem with tool compensation is making a starting block that


cancel the compensation, If we consider the following program, there will be an expected outcome and
a current result.

N1 G50 S3000
N2 G00 X20. Z20.
N3 G42 X0. Z.1 T010101 G96 S600 M03 M08 M42
N4 G01 Z0. F.01
N5 X2.
N6 Z-2.
N7 X3. G40
N8 G00 X20. Z20.
N9 M02

EXPECTED RESULT.

2,000 X20.Z20.

2.000 X20.Z20.

.100

The tool will make a


The tool for in a Z
Department of Engineering and Applications
of less than .25 and create a extra movement in the
first final point for the
inclined movement up to
amount saved for the
the diameter of X3.
radio de nariz de la
Programming

FORMAT: G50 Spindle speed limit.

N1 G50 SXXXX (It must always be on the first line)

Spindle speed, in any CNC lathe, is limited by the maximum permissible speed.
what does the chuck have. The effect of centrifugal force (outwards) is the gripping force, in
In the condition of the workpiece not being balanced, it may be necessary to program a G50.
at the beginning of the program.

The MAXIMUM speed of the spindle is designated by the letter 'S' and the combination of G50 and the
letter S must be used in a single block.
The maximum spindle speed, commanded by the G50 code, remains in effect until it is
canceled by another G50 with a new value of S.

Once the maximum spindle speed is established, any direct programming of


RPM in G97 (direct revolutions per minute) or RPM calculated by control of G96 (mode
surface constant in feet) that exceeds the RPM set in the G50 block will be
ignored and the speed established in item S of block G50 will be used.

NOTE: M02 (end of program) does not cancel the G50 command.

G90 Y G91 ABSOLUTE OR INCREMENTAL PROGRAMMING

FORMAT: G90- Absolute programming enabled (incremental programming canceled)

Department of Engineering and Applications 43


Programming

When the control is turned on, it starts in G90 mode, when it is turned on.
machine.

FORMAT: G91- Incremental programming on.


When the G91 code is programmed, the values of both coordinates X and
Z must be expressed in incremental values.

Example of programming: From point ONE to point TWO to point THREE to point FOUR.

FOUR

THREE
TWO

UNO
IN ABSOLUTE MODE IN INCREMENTAL MODE

UNO X-.062 Z0 X-.062 Z0


TWO X1. G91 X1.062
THREE Z-3.2 Z-3.2
FOUR X3.2 X2.2
G90

G95 Y G94: INCHES PER MINUTE OR INCHES PER REVOLUTION.

In cut mode, the reason why the Tortea or the X-axis and the Z-axis move is controlled by the
literal F or advancement letter.

The mode of the literal F (advance) is dictated by the G code selected by the programmer.

The options for advancement are:

G94.- Inches per minute.


G95.- Inches per revolution.

When the machine is turned on, it is activated in G95 mode.

The feed rate is used in conjunction with codes G95 and G94 to control the feed rate.
in linear or circular outline mode.

Department of Engineering and Applications 44


Programming

Most of the advances are set in inches per revolution, however, if needed
that the feed be set in inches per minute, use this formula to calculate the value:

IPM = ( IPR * RPM )

IPM - inches per minute


IPR - inches per revolution.
RPM - revolutions per minute.

It should be remembered that the use of F with the G04 code is to specify the waiting time.

G96.- VARIABLE SPEED (FEET PER MINUTE)

This code must be accompanied by the literal 'S' that determines the spindle speed.
En este código, la velocidad que se especifica es el limite de velocidad al que se quiere llegar.
Example:
N12 G96 S600

Normally, a G95 is programmed along with G96 which means that the feed literal F will have
the format F****.***

G97.- CONSTANT SPEED.

Cuando G97 esta en uso , G96 deja de estarlo y viceversa.


This code must also be accompanied by the letter 'S' which will be interpreted as the
direct revolutions per minute for the cutting condition.

The control turns on in G95, G97, and G90 mode when the machine is powered on.

PRECAUTIONS WHEN PROGRAMMING WITH G97 AND G97.

1.- If the spindle speed exceeds the maximum or minimum permitted speed within the range
selected by a code 'M' while in G96 it remains fixed at maximum or minimum
automatically permitted, the LIMIT indicator light on the control turns on but the
continuous scheduled operation.

2.- A block containing G96 or G97 must have the literal 'S' with the desired speed.

Department of Engineering and Applications 45


Programming

3.- Threading should not be done in G96 mode (variable speed).

4.- To activate the G96 mode on the B tortilla, you must specify with G111 and the G96 command.
return to the cake Again, it is necessary to specify with G110, and the command G96.

5.- To continuously execute the commands of two blocks, while it is controlled by the
G96 mode, without waiting for the spindle speed signal, specify M61 and to cancel it M60.

SPINDLE SPEED.

FORMAT: S****

The four digits following the letter S represent the specified RPM of the spindle.
when programming with G97 and in variable speed in feet per minute when programming with
G96.
Below are some rules about the literal S

G50 S(RPM)
G96 S (Variable speed in feet per minute)
G97 S (RPM)
INTRODUCTION TO COMPOUND FIXED CYCLES (SPECIAL FIXED CYCLES)

Overview.

This feature allows for a series of cyclical operations, which usually requires
commands that occupy more than ten blocks, which can be specified in a single block.

There are three types of fixed compound cycles: these are:

1.- Composite threading cycle (G71, G72)


2.- Fixed cycles composed of grooving/drilling (G73, G74)
3.- Fixed compound cycle for milling. (G77, G78)

1.- Fixed cycle composed of threading.

There are two threading modes available, G71 longitudinal threading and G72 transverse threading.
(finished in face). Also in combination with "M" codes, once the cutting mode is designated.
and other appropriate design selections allow the programmer to choose the most
desirable threaded mode of nine types of threading cycles available.

2.- Fixed cycle composed of Grooving/ Drilling.

There are two grooving/drilling modes available. As before, the G73 cycle is used for
Longitudinal cuts and the G74 cycle is used for transverse cuts (face finishing)
The G73 cycle simplifies the programming of external or internal grooving and piece cutting in
external threading. G74 is very helpful when there is a very deep drilling.

Department of Engineering and Applications 46


Programming

3.- Compound cycle for edging.

There are two cycles available for broaching. The G77 cycle is used for straight broaching,
in a line of parameters. The G78 cycle is used for left chamfering, in a line of
program.

FORMAT: G71 FIXED CYCLE OF LONGITUDINAL THREADING

DEFINITION OF LITERALS.

Department of Engineering and Applications 47


Programming

X.- Value of the coordinate (dia.) of the final diameter of the threading.
Minor diameter for external threading.
Major diameter for internal threads.

Z. - Value of the coordinate of the endpoint in the direction of the Z axis.

A.- Angle for conical threads, measured from the positive zero of the Z axis. Positive if measured in
counterclockwise, and negative in favor of the clockwise direction.
NOTE.- Do not use the command of the literal 'I'.

I.- Incremental radial difference between the starting point and the ending point of the threading, for a
conical roughness.

B.- Tool angle, the control assumes it as zero if not specified.

D.- Depth of cut for the first threading cycle. The value must be expressed as a value
, this means that if a cutting depth of .010 is desired, the value must be
program to be twice the amount or 0.020 of cutting depth.

U.- Cutting depth for an extra pass in threading must also be programmed in
diametral value, like in the previous literal.

H.- Thread height is the difference between the major and minor diameters of the thread. It must be
expressed as a diametrical value.

L.- Withdrawal distance in z from the threaded end point. When the value is not specified
L the control assumes that it is equal to a progress specified at the beginning by F. This condition L
It can only be active when M23 is set in the program line with G71.

E. - It is the variation of thread in the case of variable threading.

F.- It is equal to the inverse of the number of threads per inch. If the letter J is used, F can be worth 1.

It is equal to the number of threads per inch.

Used to select the cutting mode (M23, M33, M34) or also to select the
threading cutting depth (M73, M74, M75).

Used to program a multiple start of threading.

NOTE.- It cannot exceed 276 RPM in the threading cycle. The formula to calculate the
IPM is:

IPM = ((1/Number of threads per inch) * RPM)

If no M code is selected in the cycle definition, the control will default to M32 and M73.

Department of Engineering and Applications 48


Programming

For a metric threading F1. J [25.4 / pitch]


Pitch is the distance from a threaded point of the screw to the corresponding point on the next one.
thread height, measured parallel to the thread axis.

Additional examples.
“A” +
“I”

“A” --

M32 CUTTING PATTERN

Cut-off point

M33 CUTTING PATRON

Department of Engineering and Applications 49


Programming

M34 CUTTING PATTERN

CUT SPECIFICATIONS AND CUTTING PATTERNS OF CODE 'M'

In the block with G71 FIXED THREADING CYCLE, the M codes specify the cut and the
pattern of the trajectory they will follow, and these should be scheduled.

M codes for cutting patterns.


M32.- cut on the front face of the thread.
M33.- make the zig-zag cut.
M34.- cut at the back of the thread, with respect to the z-axis.

If none of these M codes are programmed, the control automatically assumes the selection of
M32.

M codes for cutting modes (cutting depth)

M73.- Cutting mode, the control will calculate the necessary depth and the number of passes.
based on the diameter X, the thread height H, the extra pass U, and the cutting depth D.

Con este código, el controlador calculara los avances de la siguiente manera, para un roscado
exterior.

First pass: major diameter - "D"


Second pass: First pass - 'D'
Third pass: Second pass - 'D'
Etc.....

The control continues in this manner until it reaches a calculated diameter at which only a few are missing.
six passes for the final diameter. The six passes are calculated in this way

Department of Engineering and Applications 50


Programming

X + U + D
X + U + (D/2)
X + U + (D/4)
X + U + (D/8)
X + U
The last pass on the final diameter X (smaller diameter on the outside, larger diameter on the inside)

M74.- Cutting method, the control calculates the necessary depth and the number of passes.
based on the diameter, the thread height, the extra pass, and the cutting depth.

The way to calculate the passes or advances is the same as the previous code M73, the control
continue in that way until it reaches a diameter where it can no longer subtract the D, without violating the
At the U pass. At that point, it is transferred to the U diameter pass, giving a smaller pass.
diameter D.

M75.- the way the control will calculate the passes is as follows.

First pass: major diameter - D


Second pass: major diameter - (square root of 2 * D)
Third pass: major diameter - (square root of 3 * D)
Etc.................

G72 FIXED CYCLE FOR CROSS THREADING.

Definitions.

A.- Cone angle, measured from the positive Z axis, counterclockwise is


Positive and in favor is the negative value of the angle.

K.- Length between the starting point of the thread and the endpoint. Note do not use together with code A.

B.- The angle of the insert point is assumed to be zero if not specified.

D.- Cutting depth for the first threading cycle, this value must be expressed as the
value of a single side, this means that if a depth of .010 is desired, it must be programmed.
0.010 deep.

W. - Cutting depth for the extra pass of threading, the value must be expressed from a
only side.

H.- Thread height, expressed as the difference between the crest and the valley of the threading.
as incremental diameter.

Department of Engineering and Applications 51


Programming

L.- Distance of exit at the final point at 45º degrees, when this literal control is not specified.
assume the L equal to the width of a thread.

E.- Threading variation in case of variable threading.

F is equal to 1/number of threads per inch when the literal J is specified, F can be 1.

It is equal to the number of threads per inch.

M. - It is used to select the cutting mode or pattern or to select the threading depth.
(M73, M74, M75).

NOTE.- It cannot exceed 276 RPM in a threading cycle, the formula for calculating IPM
es:

IPM = (( 1/ Threads per inch ) * RPM )

If no "M" mode is selected in the cycle, the control defaults to M32 and M73.

FORMAT: G73 LONGITUDINAL GROOVED.


DEFINITIONS:

X. - Coordinate on the X axis, groove depth.


Z.- Coordinate on the Z axis of the left side of the groove.

D. - Cutting depth, measured from the tip of the tool to the starting point.

F.- Feed rate, expressed in IPM or IPR.

E.- Delay, expressed in seconds, at the end of the slot.

D.- This code is used to "snip" until the desired diameter in X.

I.- This literal is used for the tool's advance, from the starting position in X to a
safe distance for the start of drilling.

Sample Program

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.6 Z-1.2 G97 S400 T0606 M03 M08 M41
N4 G73 X1.0 Z-1.2 I.18 D.1 F.015 E.5
N5 G00 X20. Z20.
N6 M02

Department of Engineering and Applications 52


Programming

1 1.60 2 1.42 3 1.32 4 1.37

5 1.22 6 1.27 7 1.12 8 1.17

9 1.02 10 1.07 11 1.00 12 Wait

13 1.60

Definition:

It is used to make the tool fully retract to the starting point for the
Chip removal, this function is controlled by the literal D. If L is greater than D then the
function D will occur many times while L is in operation. If L is less than or equal to D
the tool will always retract completely.

T.- New compensation on the right side of the tool.

FORMAT: G74 GROOVED TRANSVERSE (FIXED CYCLE)

100 starting point

.200

1.60 dia. X Axis Tool tip of


.200 grooving

Department of Engineering and Applications 53


Programming

DEFINITIONS.

X.- Diameter in X of the slot bottom (starting point).

Z.- Depth of the groove from the program zero.

D.- Cutting depth measured from the tip of the tool in the starting position.

F.- Feed rate, expressed in IPM or IPR.

E.- Delay, expressed in seconds in the final position of some cut.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.6 Z.1 G97 S400 T0606 M03 M08 M41
N4 G74 X1.6 Z-.2 D.3 F.015 E.5
N5 G00 X20. Z20.
N6 M02
Continuation G74

The function D can be leveraged by adding the function of the literal K.

D.- It is used to "jiggle" on the Z axis. The jiggling value is assigned with the literal D.

K.- This function is used for the advance of the tool, for rapid positioning on the Z axis.
at a safe distance from the workpiece during a rapid advance.

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.6 Z.1 G97 S400 T0606 M03 M08 M41
N4 G74 X1.6 Z-.2 K.09 D.05 F.015 E.5
N5 G00 X20. Z20.
N6 M02

You can add another function, in this case of the literal L, and that's what it does.

It is used to make the tool fully retract at a certain point to the point of
start for chip removal, like the G73 code is also controlled by the function of the
literal D.

Department of Engineering and Applications 54


Programming

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.6 Z.1 G97 S400 T0606 M03 M08 M41
N4 G74 X1.6 Z-0.2 K0.09 D0.05 L0.1 F0.015 E0.5
N5 G00 X20. Z20.
N6 M02

This literal is used for a new compensator on the right side of the tool.

I.- Value of movement on the X axis in case of having a slot larger than the tool,
it is specified as a diametrical value always positive.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.1 Z.1 G97 S400 T0606 M03 M08 M41
N4 G74 X2 Z-.2 K.09 I.15 D.05 L.1 F.015 E.5 T0616 ô T16
N5 G00 X20. Z20.
N6 M02
FORMAT: G74 DRILLING (FIXED CYCLE)

This code is the same as the grooving one with the only difference being the tool that is being used.
using and the elements that must be taken into account when it is a drill that is being used,
Below is a drawing with the letters that change with the tool.

.100 axis Z
4.000

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X0. Z.1 G97 S760 T0505 M03 M08 M41

Department of Engineering and Applications 55


Programming

N4 G74 X0. Z-4.4 K.09 D1. F.010


N5 G00 X20. Z20.
N6 M02

The program shown below contains the literal L that is used to retract the
totally tool.

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X0. Z.1 K.09 D1. L2. F.010
N4 G74 X0. Z-4.4 K.09 L2. F.010
N5 G00 X20. Z20.
N6 M02

FORMAT: G75 AUTOMATIC CHAMFER. (FIXED CILCO)

G01.- The G75 command can only be used with G01. When G75 and G01 are used together in the same
line and the first is G01, G75 must be programmed first or it will result in an alarm.

G75.- Chamfers can be cut using this command, if:

There is a straight line movement before the chamfer movement.


If the straight-line movement is shorter in length than the chamfer, an alarm state
It will turn out.
This command can be used for 45º angles and only for 45º angles.
The information of this code is only programmed in one line.
It can only contain a movement in a single axis X or Z.
This code can be used with LAP and tool radio compensation.

X.- Use X when the final point is on the X axis.

Z. - Use Z when the endpoint is on the Z axis.

L.- Especifica el largo del chaflán, el valor puede ser positivo o negativo dependiendo del
movimiento directamente antes del chaflán.

F.- Progress, expressed in IPM or IPR.

Department of Engineering and Applications 56


Programming

4,000
2.25
.08 x 45º
.20 x45º

.10 x 45º
3.50

2.00

The program for this piece could be the one shown on the following page.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X-.015 Z.1 G96 S800 T010101 M03 M08 M41
N4 G42
N5 G01 Z0. F.015
N6 G75 X2. L-.1
N7 G75 Z-2.25 L.2
N8 G75 X3.5 L-.08
N9 Z-2.331
N10 X3.7
N11 G40
N12 G00 X20. Z20.
N13 M02

FORMAT: G76 AUTOMATIC RADIO (FIXED CYCLE)

This command is similar to the previous one, with the difference that it will now create a radius instead of a chamfer.
and with the literal L the value of the radius is specified, the value can be positive or negative,
depending on the directly preceding movement before the radius.

Department of Engineering and Applications 57


Programming

4,000
2.25
.08 rad. .10 rad.
.20 rad.

3.50 dia.
2.00

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X-.015 Z.1 G96 S800 T010101 M03 M08 M41
N4 G42
N5 G01 Z0. F.015
N6 G76 X2. L-.1
N7 G76 Z-2.25 L.2
N8 G76 X3.5 L-.08
N9 Z-2.331
N10 X3.7
N11 G40
N12 G00 X20. Z20.
N13 M02
USE OF G75 WITH THE FUNCTION FOR ANGLES (SQUARES) AND G76 FOR
SLOPES RADIOS

These codes are used for when chamfers are made on plans at a certain angle, the secret of this
The function is to set the exact position of the vertex in X or Z on the first line with G75 and then
define the required endpoint for the angle on the following line with G75. The value of L must
be programmed, whether for square chamfers or radius chamfer.

A1
A
Vértice

L
4.000

( Seno A1x L) L 30º 1.500


Distance from the vertex
the end in Z Vertex
EXAMPLE .20 x 45º
3.50 dia.
Department of Engineering and Applications 58
2.00 dia.
Programming

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 X-.062 Z.1 T010101 G96 S600 M03 M08 M42
N4 G42
N5 G01 Z0. F.012
N6 G75 X2. L.2
N7 G75 Z-1.5 L.3 (Z-1.5 DEFINES THE VERTEX)
N8 G75 A120. X3.5 L.3 ( A = 90 + 30)
N9 Z-2.8
N10 X3.7
N11 G40
N12 G00 X20. Z20.
N13 M02

FORMAT: G77 CYCLE FOR RIGHT HAND THREAD MACHINING.

¾ inch, 10
threads

.500
1.000

{"DEFINICIONES":"DEFINITIONS"}

X.- Diametral coordinate, must have a value of zero, it has to be programmed, even if the line of
previous programming specified X as zero.

Department of Engineering and Applications 59


Programming

Z.- Z coordinate of the depth of the milling, from the program zero.

K.- This literal is used for the advance of the tool, from the Z position where it is positioned at
a safe distance from the workpiece during a rapid movement. This function is used to
reduce the air cut, this value should be incremental.

F.- Feed rate, expressed in IPM.

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 G94 X0. Z.5 T0606 G97 S150 M03 M08 M41
N4 G77 X0. Z-1. K.45 F15.
N5 G00 X20. Z20.
N6 M02

Description of the cycle.

1.- The spindle should be at M03, spindle in the direction of clock hands, the spindle must
to be on with the designated speed before using the G77 command, otherwise the penetration
In Z it will not occur, because the spindle must rotate, and if not, the cycle will stop.

CHUCK
M03

2.- In line N3 of the previous program, the latch will be positioned concentrically.
clear safe distance in Z.

Department of Engineering and Applications 60


Programming

3.- In line N4, in line G77 the first movement in the Z axis at the value set in K
for the rapid movement to cut through the air.

4.- In line N4, the line with G77, the next movement will be to the required depth in Z.
with the required progress.

.05

1.000

5.- At depth Z, the spindle will stop and then it will rotate again this time in the direction
opposite to the same RPM used for the machining in step 4.

CHUCK
M04

Department of Engineering and Applications 61


Programming

6.- The owl will retreat in the positive Z direction to the point specified by the value of K, with the
same progress used in step 4, to then remove the starting point in a movement
fast.

.05
FORMAT: G78 LEFT MACHINING CYCLE.

The description of the literals is the same as the previous code, in this case the only thing that
Change is the thread, this command makes the left thread.
Therefore, the spindle rotation is opposite to the previous command, it is first started in mode
M04, counterclockwise, makes the thread for the spindle and finally the
spindle in M03 mode, clockwise direction.

PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.
N3 G94 X0. Z.5 T0606 G97 S150 M04 M08 M41
N4 G78 X0. Z-1. K.45 F15.
N5 G00 X20. Z20.
N6 M03

Como se puede ver el programa es casi idéntico al anterior, lo único que cambia es el comando
G78, since the example for this code is the same as the previous one.

LATHE AUTO-PROGRAMMING FUNCTION (LAP)


Auto-programming function of the lathe.

Overview:

Department of Engineering and Applications 62


Programming

LAP is the function with which the processing capacity at high speed is maximized, that
characterizes OSP-CNC systems.

When using this LAP function, the programmer specifies the following information:

Roughing conditions (feed, speed, allocation for the finishing pass, and depth)
cutting by pass for roughing

Starting point, which, when compared to the final outline, allows the control to calculate
how much material will be removed.

To control the start and end points, the programmer can use (LAP) for large
amounts of material removal in internal or external diameters of the piece.

The programmer has the choice to perform roughing and finishing with the same tool, or,
roughing with one tool and changing the tool for finishing.

When defining (LAP), the programmer must specify whether the roughing and finishing passes
they are parallel to the X axis or to the Z axis.

G codes used to designate the cutting mode (LAP).

G80.- End of contour definition.


G81.- Start of the definition of the longitudinal contour.
G82.- Start of the definition of the transverse contour.
G84.- Change the roughing conditions when turning.
G85.- Used to call (activate) the rough turning cycle for bar. (LAP I)
G86.- Used to call (activate) the copying cycle. (LAP II)
G87.- Used to call (activate) the finishing cycle.
G88.- Used to call (activate) the continuous threading cycle (LAP III).
LAP I – CICLO DE ROTE DE BARRA

G85 & G81 G85 & G82

LAP II – CICLO DE COPIADO

G86 & G81 G86 & G82

Department of Engineering and Applications 63


Programming

LAP III - CICLO DE ROSCADO CONTINUO


G88 & G81
G88 &G82

LAP FORMAT: G85 & G81.

Example programming lines for G85 & G81 bar cutting.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X8. Z.1 T010101 G96 S600 M03 M08 M42
N4 G85 NTRY1 + D.2 U.01 W.002 F.015
NTRY1 + G81

DEFINITION OF LAP CONTOUR

G80
G87NTRY1
N5 G00 X20. Z20.
N6 M02

Definitions

N3.- Sequence number.


X8..- Starting point at X
Z.1.- Starting point in Z
T010101.- Tool called for roughing.

N4.- Sequence number.


G85 - G code for bar cutting cycle.

Department of Engineering and Applications 64


Programming

ENTRY1.- Name of LAP that will be defined, must be in the same block as G85.
. - Space must always follow NTRY1.
D.- Cutting depth, expressed as a diametral value.
U.- Amount of material for the finish, expressed in diametral value. (X axis)
W.- Amount of material of .002 for all faces. (Z axis)
F.- Advance for all the roughing.

NTRY1 .- Name LAP prior to the transverse or longitudinal definition.


+ .- Space should always follow NTRY1.
G81 - G code for longitudinal cutting.
G80.- G code to cancel the definition of LAP contour.
G87.- G code used to define the parameters for finishes.
NTRY1.- Name of the LAP definition that indicates the finishing pass.

Example Program for G85 & G81

8.0 dia
1.00 dia.

3.000

5.000

The LAP program, to remove the material indicated in the shaded areas, could be as follows:

N1 G50 S3000

Department of Engineering and Applications 65


Programming

N2 G00 X20. Z20.


N3 X8. Z.1 T010101 G96 S600 M03 M08 M42
N4 G85 NTRY1+ D.2 U.010 W.002 F.015
NTRY1+ G81
G00 X1. Z0.1
G42
G01 Z-3. F.008
X8.1
G40
G80
G87 NTRY1
N5 G00 X20. Z20.
N6 M02

RULES WHEN PROGRAMMING IN LAP

1.- In the line with G85, the literals that may not be programmed are:
S RPMs, variable speed.
Tool change.
"M" Miscellaneous Functions.

Using these literals in the block containing G85 can cause the control to stop.
process, inhibit the movement of the machine tool and display an alarm message in the
screen.

2.- The literal 'D' is used to specify the cutting depth for roughing portions in
the LAP cycle.

When the G84 command is programmed, it indicates a change in cutting conditions, the literal
The specified 'D' in G85 is now replaced due to the new values of XA or ZA set in
the block with G84.

The literal 'D', programmed in the block with G85, must always be a positive value. If the
the numeric value of D is omitted, it is zero or negative, the control will stop the process, inhibit the
movement of the machine tool and display an alarm message on the screen.

3.- The literal 'F' or feed, programmed in the block with G85, is used to specify the feed.
from the tool for all roughing movements. Yes, a feed is used in the
definition of LAP contour, this advance is applied to the finishing tool or pass
finished.

Department of Engineering and Applications 66


Programming

When the G84 command is programmed, it indicates a change in the cutting conditions, the 'F'
specified in the block with G85, the last known advance is made effective and all cuts
This is due to that advancement. Literal F must be positive; a value of zero or negative will cause a
state of alarm.

4.- In block G85, if either of the literals 'U' and 'W' are not programmed, their values
they will be assumed as zero by the control. The 'U' and 'W' must be positive or zero, a value
negative will cause an alarm condition.

LAP FORMAT: G85 & G81 USING G84 (CHANGE OF CUTTING CONDITIONS).

example programming line for G85, G81 & G84.

N1 G50 S3000

N2 G00 X20. Z20.

N3 X8. Z.1 T010101 G96 S600 M03 M08 M42

N4 G85 NTRY1+D.2 U.01 W.002 F.015

$ G84 XA = 7. DA = .4 FA = .030
$ XB = 5.8 DB = .2 FB = .015

NTRY1+G81

G80

G87NTRY1

N5 G00 X20. Z20.


N6 M02

Definitions

N4.- Sequence number.


G85 - G code for bar cutting cycle.

Department of Engineering and Applications 67


Programming

NTRY1 .- Name LAP that will be defined, must be in the same block as G85.
+ .- Space, it should continue from the word NTRY1
D.- Cutting depth, expressed in diametral value.
U.- Amount of material for finishing, expressed in diametral value. (X axis)
W.- Amount of material for finishing, for all sides. (Z axis)
F.- Progress for all roughing.

The lines containing the changes in cutting conditions given by G84 must start with
the symbol '$' and can affect the cutting depth and the feed at the specified diameter, only
twice. The command G84 is a mode and needs to be programmed once.

ZA = First length DA = Change in cutting depth FA = Change of advance

ZB = Second length DB = Cambio de profundidad de corte FB = Change of progress

EXAMPLE PROGRAM FOR G85, G81 & G84.

When it reaches 7 in diameter, the cutting depth will be .20.


for each side and the advance is now .03 IPR.

When it reaches a diameter of 5.8, the cutting depth will be


0.10 on each side and the advancement is now 0.015 IPR

The example is the same as the example for G85 and G81 only, the purpose of this is to observe the
changes in cutting conditions.
The program could be as follows.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X8. Z.1 T010101 G96 S600 M03 M08 M42

Department of Engineering and Applications 68


Programming

N4 G85 NTRY1+D.2 U.010 W.002 F.015


$ G84 XA = 7. DA = .4 FA = .030
$ XB = 5.8 DA = .2 FB = .015
ENTRY1+G81
G00 X1. Z0.1
G42
G01 Z-3 F.008
X8.1
G40
G80
G87 ENTRY1
N5 G00 X20. Z20.
N6 M02

Radius of .06
Class LAP exercise.

.06

2.250
1.00 day.
day.

1.750
day. 3,000
day.

1.00

1.750 .06

2.500

Now try to make a program for roughing and finishing in interiors, the scratched area is the
material that will be machined.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X___ Z___ T________ G_____ S______ M____ M____ M____
N4 G___ Z____ F_____
N5 X____
N6 Z_____
N7 G00 X____ Z____

Department of Engineering and Applications 69


Programming

N8 G85 N_______ D_____ U____ W_____ F______


N_______ G81
G_____ X_____ Z_____
G41
G01 Z_____ F_____
G02 X______ Z_______ L_____
G76 G01 Z_____ L_____
G76 X_____ L______
G76 Z_____ L______
G76 X_____ L______
Z______ X______
G40
G80
G87 N_____ G00 Z______
N9 G00 X20. Z20.
N10 M02
LAP FORMAT: G85 & G82.

example programming line for G85 & G81.

N1 G50 S3000

N2 G00 X20. Z20.

N3 X8.1 Z.1 T010101 G96 S600 M03 M08 M42

N4 G85 NTRY1+ D.2 U.01 W.002 F.015

NTRY1+G82

DEFINITION OF LAP CONTOUR

G80

G87NRTY1

N5 G00 X20. Z20.

N6 M02

In the line with the sequence number N· the starting point X and Z is specified, it is also called
to the tool.

Definitions:

Department of Engineering and Applications 70


Programming

N4.- Sequence number


G85 - G code for bar cutting cycles
ENTRY1.- Name LAP that will be defined, must be in the same block as G85
+ .- Space, always after the word NTRY1
D.- Cutting depth is NOT a diametral value.
U.- Amount of material for the finish, expressed in diameter value (X axis)
W.- Amount of finishing material of .002 for all faces. (Z axis)
F.- Advance for all the roughing.

G82.- G code for transverse cuts.


G80 - G code to cancel the contour definition LAP
ENTRY1.- Name of the LAP definition that indicates the final pass.

LAP FORMAT: G86 & G81

Sample programming lines for G86 & G81 copied.

N1 G50 S3000

N2 G00 X20. Z20.

N3 X1.5 Z.35 T010101 G96 S600 M03 M08 M42

N4 G86 NTRY1+D.2 U.01 W.002 F.015

NTRY1+G81

DEFINITION OF LAP CONTOUR

G80

G87NTRY1

N5 G00 X20. Z20.

N6 M02

Definitions:

N3.- Sequence number.


X1.5 - Starting point at X
Z.35.- Starting point in Z
T010101.- Call for the roughing and finishing tool.

Department of Engineering and Applications 71


Programming

N4.- Sequence number.


G86 - G code for copying cycles.
ENTRY1.- Name LAP that will be defined, must always be in the same block as G85.
.- Space, always after the word NTRY1
D.- Cutting depth, expressed in diametrical value.
U.- Amount of finishing material, expressed in diametral value. (X axis)
W.- Amount of material for finishing of .002 for all sides. (Z axis)
F.- Progress for all roughing.

ENTRY1.- Name LAP for the transversal or longitudinal definition.


+ .- Space, always after the word NTRY1
G81.- G code for longitudinal cutting.
G80.- G code to cancel the contour definition LAP
G87.- G code used to define the statuses for finishes.
ENTRY1.- Definition name LAP that indicates the final run.

.25 Cantidad a remover

8.0 day 1.00 day.

3,000

5,000

The LAP program to remove the indicated material in the shaded area could be as follows:

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.5 Z.35 T010101 G96 S600 M03 M08 M42
N4 G86 NTRY1+D.2 U.010 W.002 F.015

Department of Engineering and Applications 72


Programming

NTRY1+G81
G00 X1. Z.1
G42
G01 Z-3. F.008
X8.1
G40
G80
G97 NTRY1

N5 G00 X20. Z20.


N6 M02

LAP FORMAT: G86 & G82

Example programming lines for G85 & G82

N1 G50 S3000

N2 G00 X20. Z20.

N3 X8.1 Z.1 T010101 G96 S600 M03 M08 M42

N4 G86 NTRY1+D.2 U.01 W.002 F.015

NTRY1+G82

DEFINITION OF LAP CONTOUR

G80

G87NTRY1

N5 G00 X20. Z20.

N6 M02 .25 Amount to remove

8.0The 1.00 day.


day definitions of the literals are the same, the only thing that changes in this case is the G82 code.
which is used for crosscuts, the structure of the program is the same as the previous ones,
so the definitions of the literals will be omitted, if needed, you can consult them in
any previous page, as long as it is from G85 codes onwards. The program
The following example is shown on the following page.

Department of Engineering and3.000


Applications 73

5,000
Programming

N1 G50 S3000
N2 G00 X20. Z20.
N3 X8.5 Z-2.75 T010101 G96 S600 M03 M08 M42
N4 G86 NTRY1+D.2 U.010 W.002 F.015
NRY1+G82
G00 X8.2 Z-3.
G41
G01 X1. F.008
Z.1
G40
G80
G87 NTRY1
N5 G00 X20. Z20.
N6 M02

LAP FORMAT: G88 & G81

The G88 command is used to perform a continuous threading operation which means, upon doing
a piece with two or more different threads by pitch or number of threads, which are adjacent, and for
make the machine perform both adjacent threads in one operation, as shown below
an example program to see what the structure of the program is like.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X1.6 Z.2 T0707 G97 S400 M03 M08 M42
N4 G88 NTRY1+D.02 H.12 B60 U.002 M32 M73
NTRY1+G81

DEFINITION OF LAP CONTOUR


G80

Department of Engineering and Applications 74


Programming

N5 G00 X20. Z20.


N6 M02

Definition of new functions:

H .- Height of the thread (major diameter - minor diameter).


B .- Included angle of the threading tool.

M32 - Cutting pattern for threads.

M73 - Cutting depths for threading.

3.000
1.600

.200

1.200 dia. 1.800 dia.

1.0 – 11.5 NPT

2.0 – 4.5 Thread


1.88 less diameter

The program for the part shown above had been addressed when G34 code was seen in
the one that only had a roughing cut to create the thread. To achieve the total depth of the
Ring, many passes will have to be given to achieve what is desired.

The LAP program for machining the thread to its full depth could be as follows:

N1 G50 S3000

Department of Engineering and Applications 75


Programming

N2 G00 X20. Z20.


N3 X2.4 Z.2 T0707 G97 S400 M08 M03 M41
N4 G88 NTRY1+D.02 H.12 B60 U.002 M32 M73

NTRY1+G81
G00 X1.2 Z0.2
G34 X1.8 Z-0.16 F1. J11.5
G00 X2.2
G80

N5 G00 X20. Z20.


N6 M02

LAP FORMAT: G88 & G82

Example lines for programming G88 & G81 continuous tapping mode.

N1 G50 S3000

N2 G00 X20. Z20.

N3 X5.2 Z1.8 T0707 G97 S400 M03 M08 M41

N4 G88 NTRY1+D.01 H.1 B60 W.001 M32 M73

NTRY1+G82

Definition of LAP Contour

G80

N5 G00 X20. Z20.

N6 M02

Definition of literals for this cycle.

D .- Cutting depth, expressed in diametral value.


H .- Linear height of the thread.
B .- Tool threading angle.
W .- Amount of excess material of .001 for all sides (Z axis)

G82 - G code for cross-cutting.

Department of Engineering and Applications 76


Programming

Programa de ejemplo

N1 G50 S3000
N2 G00 X20. Z20.
N3 X5.2 Z1.8 T0707 G97 S400 M03 M08 M41
N4 G88 NTRY1+D.01 H.1 B60 W.001 M32 M73
NTRY1+G82
G00 X5.2 Z1.05
G34 X3.2 Z1.5 F1 J7
X1.62
G00 Z1.8
G80
N5 G00 X20. Z20.
N6 M02
Precautions when programming with LAP

1.- Make sure to designate the name or sequence number of the contour definition.
correctly after the G code called for the execution of the LAP program: G85, G86,
G7, G88.

2.- G codes (G81 & G82) are used to indicate the start of contour definition
LAPs must be programmed with a number or sequence name.

3.- If G codes G64, G65, G94, G95, G96 or G97 are set before using G85, G86,
G87 or G88, these will be active during the LAP cycle. Once established, however, these
They cannot be changed in the LAP contour definition.

4.- If the codes G00, G01, G02, G03, G32, G34, G35, G64, G65, G90, G91, G94, G95, G96 or
G97, are established before using G85, G86 or G88, the codes are activated after completing
the LAP mode.

5.- The selected mode, G90 absolute or G91 incremental, must be activated before the definition.
LAP contours remain active for LAP mode. The mode can be changed in the
definition of LAP contour, programming G90 or G91.

6.- If a G code is programmed, called by the LAP contour definition (G85, G86, G87 or
G88), while the nose tool radius compensation is active, a condition
de alarma podrá ocurrir en el control.

7.- The nose radius compensation of the tool can be programmed in the definition
of contour LAP. However, it must be canceled before the block that contains G80, which indicates
the end of the LAP contour definition.

EXAMPLE

NTRY1 G81

Department of Engineering and Applications 77


Programming

G00 X___ Z____


G41 K-0.1
G01 Z___ F____

DEFINITION OF LAP CONTOUR

G40 I.1
G80

LAP FORMAT: G85, G83 and G81.

Example programming lines for G85, G83, and G82 for defining raw material.

N1 G50 S3000
N2 G00 X20. Z20.
N3 X8. Z.3 T010101 G96 S600 M03 M08 M42
N4 G85 NLAP1+D.3 U.01 W.002 F.015

NLAP1+G83

DEFINITION OF RAW MATERIAL

G81

DEFINITION OF LAP CONTOUR

G80

N5 G87NLAP1
N6 G00 X20. Z20.
N7 M02.

The first line of the definition of raw material must begin with the preparatory function
G01.

Department of Engineering and Applications 78


Programming

The contour of material can be defined using G01, G02, and G03; G75 and G76 cannot be.
used.

When using G02 or G03, the center of the arc must be defined using the letters I and K. If the
L is used to represent the radius where an alarm will occur.

At the end of the material definition, a G81 must be programmed on a single line to indicate
that the definition of material is complete and that the outline of the piece will begin to be defined.

Use parameter long Word number 46 to clearly establish the dimensions of the contour
of the material. The value must be set as a metric value, the metric value of 25.40 mm is what
the same as 1,000 in the English system.

3.95
.70

.50

45º
8.00
day 1.05 rad
7.5
7.10
4

Using G83 with G81 .20

N1 G50 S3000
N2 G00 X20. Z20.
N3 X8. Z.3 T010101 G96 S600 M03 M08 M42
N4 G85 NLAP1 D.3 U.01 W.002 F.025
NLAP1 G83 ****** MATERIAL DEFINITION *******
G01 X4. Z.3
Z-.3
Z-.5 A135
X5.
G03 X7.1 Z-1.55 I0. K-1.05
G01 X7.5 Z-3.75
X8.
G81 *******END OF THE DEFINITION*******
G00 X1. Z.3

Department of Engineering and Applications 79


Programming

G42
G01 Z0. F.02
G76 X3.5 L.12
G75Z-1. L.25
G76 X6.5 L.75
Z-2.5
X7.5 Z-4.25
X8.2
G40
G80
N5 G87 NLAP1
N6 G00 X20. Z20.
N7 M02
SUBROUTINES

Our task throughout this book has been to learn the CONTROL OKUMA OSP code.
as well as the specific rules and formats.
When we type our programs, with a file name, the control does
decisions for us, such as where to store the program or file for us. If you
remember, when we request a directory list to the control, all the names of
Files now have an extension that was set by the control, and it has this format:

(File_name).MIN

The '.MIN' is known as an extension and is important for control, this is how the
The control computer knows where I store the files for later use. That use can be
to run a program, edit a program or send the file to an external device for
guard it.

There are six extensions in the Okuma OSP control, we usually use two. The six
extensions are:

(File name). MIN Main program file.


(File name). SSB System subprogram file.
(File name).SUB Subprogram file (*)
(File name).MSB File for subprograms (*)
(File name).LIB Library program file (*)
(File name).SDF Agenda program file (*)

(*) Indicates that we do not normally use these files every day. In fact, one must have
Be careful when using them because some are reserved for exclusive use of OKUMA.

Much of what we do in normal programming is repetitive, in this we program the


same movement of the tool time and time again. This is the way to capture that program and
use it again in particular cuts, without having to write it and store it in the control again.

Department of Engineering and Applications 80


Programming

This is called SUBROUTINE PROGRAMMING and to take advantage of this option the
the file name must have the .SSB extension and may appear in the directory as:

(File name).SSB

RULES FOR SUBROUTINES

When a group of movements is located, it is appropriate to need a


subroutine, this subroutine must be placed in the control as a separate program.

The name of the program must start with the letter O and may be followed by four characters, after
From O you can assign an alphanumeric name. The first row in the subroutine program must
contain that file name and only the file name, exactly as it was set in the
memory of control.

The last line of the program of the subroutine must have RTS this is understood by height of
return statement, or the code necessary to return to the main program.

To activate a subroutine, in the main program, a statement must be used, this is the statement.
CALL transfers from the main program to the subroutine, performs the movements of the subroutine
and then transfers control back to the main program. When CALL is used, it must be
leave a space between the word CALL and the desired subroutine name.

A graphical example of how subroutines work could be:

Main program

N1 G50 S3000

N2 G00 X20. Z20.

PROGRAM
Subroutine

N10 CALL+OSUB1 OSUB1

N11 G00 X2.5 MOVEMENTS

Department of Engineering and Applications 81


Programming

PROGRAM RTS

N22 G00 X20. Z20.

N23 M02

NESTED SUBROUTINES

With LAP routines, it is not possible to nest one routine inside another LAP routine.
subroutines, however, it is possible to nest one subroutine within another, in fact, it can be done
nests or branches of up to eight levels.

This is a graphic example of a nest of subroutines.

MAIN PROGRAM

N1 G50 S3000
N2 G00 X20. Z20.

PROGRAM OF
THE PIECE

SUBROUTINE

N10 CALL+OSUB1 OSUB1


N11 G01 X2.5 SUBROUTINE

CALL+OSUB2 OSUB2

PROGRAM OF
THE PIECE
RTS RTS

Department of Engineering and Applications 82


Programming

N22 G00 X20. Z20.


N23 M02

SUBROUTINE APPLICATIONS

Now we know what subroutines are and how to use them, a logical question would be: In what
Can we apply the subroutines? In the chapter on grooves (in the diameter and on the faces),
we found that with the automatic cycles (G73 and G74) we do not kill the edge and it creates a radius on
the shores of the grooves.

If we position ourselves in the right place to make a radius in the groove.


shores, we can use a program for the radios in incremental mode and put this in a
subroutine.

Example piece
.200

1.00

3.00 dia
2.00 dia.

1.6 dia

The program for this piece would be:

N1 G50 S3000
N2 G00 X20.
N3 X2.2 Z-1.2 G97 S400 T0606 M03 M08 M41
N4 G73 X1.6 Z-1.2 I.18 D.1 L.2 F.015 E2.
N5 G00 X20. Z20.
N6 M02

The fixed groove cycle is done, but we forgot that the piece needs more work, so we
will make the program for the two banks of the shores.
Radio de .005
OGRV1

Departamento de Ingeniería y Aplicaciones 83


Programming

G91
G00 Z-.005
G01 X-.2 F.015
G02 X-0.01 Z0.005 L0.005
G00 X.21
Z.005
G01 X-0.2
G03 X-0.01 Z-0.005 L0.005
G00 X.21
G90
RTS
USER TASK

PROGRAMMING WITH VARIABLES

The user task is a standard option for OKUMA controls. Although, the USER TASK is a
this option is aimed at providing a continuous automatic operation of peripheral equipment, such as the
They are bar feeders, robots, etc. A good use of this option can provide an advantage in the
work.

Now we will refer to the USER TASK as variable programming. The programming of
variables allow for high levels of computer operation, such as:

Functions of control statutes


Variables
Arithmetic functions.

Functions of control statutes

It has total control over the execution of programming sequences, or the ability to repeat.
Programming sequences can be made using the IF and GOTO statements.

Variables

This function provides versatility and flexibility in programming. On the production line, there is
pieces whose geometry only differs in measurements and not in shape, that the
Variable programming is of great benefit. Instead of numerical values followed by a
lyrics
X2.5
It can be replaced by a previously defined variable.
V01 = 2.5
And then express the letter as a function of a variable.
X = V01

ARITHMETIC OPERATIONS

Department of Engineering and Applications 84


Programming

This option has the ability to use standard mathematical expressions followed by the letters.
and along with the variables. The standard mathematical expressions:
+ Sum
- Remains
* Multiplication
/ Division

If we want to add .020 to a variable, it can be expressed like this:

X = V01 + .020

GOTO Statute – Unconditional Leap

It has the ability to go or jump from one part of the program directly to another part. The control
it will respond to a programmed GOTO statement, jumping to or going to the line number of
sequence assigned and execute the scheduled information on that line.

The command:
N10+GOTO+N28

Specify that it will skip the lines with sequence number N11 to N27, all the information
contained in those blocks was ignored.

RULES

Spaces must be between the words or letters when using the GOTO command. If we go back
to our example line:
N10+GOTO+N28
space

The first sequence number (N10) can be omitted in this line, the second number
sequence (N28) must always be programmed.

One must be careful when using the GOTO statement to avoid programming an infinite loop.

EXAMPLE:

N1 G50 S3000
N2 G00 X20. Z20.
N3 X.2 Z.1 T010101 G96 S300 M03 M08 M41
N4 G42
N5 G01 Z-2. F.015
N6 X3.5
N7 G40
N8 GOTO N5
N9 G00 X20. Z20.
N10 M02

Department of Engineering and Applications 85


Programming

A general rule for the use of GOTO is that the destination sequence number should be below
Where is the GOTO currently in the program.

In four-axis lathes, GOTO to make a request to transfer control of a turret to


another tower, it is not authorized.

IF Statute – Conditional jump.

Provide the ability to control, based on inputs in the programming, to decide whether the
IF logical conditions are met or not met. If the conditions or arguments of IF are
the control will continue with the following scheduled line, if the conditions or arguments of
IF not met, the control will jump to the specified sequence number. This is referred to
they are called conditional jumps, because you, as a programmer, have total control over these and can
modify the flow conditions.

Format:

N10
Sequence number - may not be scheduled

N10+

Space - not needed, there is no sequence number.

N10+IF

Indicates that the IF statute is now in action.

N10+IF+[V01

Predefined variable that will be compared against a numerical value

N10+IF+[V01+LE
There are six comparison expressions:
LT ( menor que) LE ( menor o igual que) EQ (Equal to)
NE (Not equal to) GT (greater than) GE (greater than or equal to)

N10+IF+[V01+LE+19]
Upper numerical limit, with which the variable V01 will be compared.

Department of Engineering and Applications 86


Programming

N10+IF+[V01+LE+19]+N2

Destination sequence number, if IF requires it.

Variables

A feature of OSP control is the ability to represent a geometric part as a


variable, using the letter 'V'. The main benefit of variable programming is the
ability to quickly incorporate engineering changes and alter a line of the program
when errors are discovered.

Format: V09
Vxx = valor escalar
3.5 V03

2.500 V02

.10 V07

.20 rad V04


.06 x 45° V01
3.2 V08

3 day V06 1.4 dia. V05

1.28 dia V10

The piece above can be programmed in different ways that we learned. As it can be
make with variables.

V01 =-.06 N11 G00 X20. Z20.


V02 = -2.5 N12 M02
V03 = -3.5
V04 = .2
V05 = 1.4
V06 = 3.
V07 = .1
V08 = 3.2
V09 = 0.
V10 = 1.28
V11 = -.04
N1 G50 S3000

Department of Engineering and Applications 87


Programming

N2 G00 X20. Z20.


N3 X = V11 Z = V07 T010101 G96 S400 M03 M08 M41
N4 G42
N5 G01 Z = V09 F.015
N6 X = V10
N7 X = V05 Z =V01
N8 G76 Z = V02 L = V04
N9 G01 X = V08
N10 G40
TURNING OF FOUR AXES

The term four-axis turning is applied to some OKUMA lathes, which have two turrets.
These turrets have the ability to move and are programmed independently of each other.
or having the OSP control uniting the programmed movement for each turret and having both
moving turrets and roughing at the same time. Cata turret is considered a machine of
two axes, that's why the word four axes.

TWO AXES + TWO AXES = FOUR AXES

The OSP control identifies which scheduled movement applies to which turret, searching in the
program one of the G codes, which are:

G13 - Upper turret


G14 - Lower tower.

When the control reads one of these codes, the immediate programmed movement of that code
is assigned to that turret.

Accepting the physical fact that we have an upper turret and a lower turret, both turrets are
programmed as if they were the superior. The G13 restricts the next movement of the turret
superior. The G14 restricts the following movement of the lower turret. The G14 takes the
scheduled information and 'mirrors' or changes that information 180 degrees around the
centerline of the machine, so you, programmer, do not have to calculate or program
negative values for cutting below the center line of the machine.

G13 torreta superior

Department of Engineering and Applications 88

G14 torreta inferior


Programming

As stated on the previous page, a four-axis lathe can be programmed to run a


tower at one time or run both turrets (upper and lower) in motion and cut the same.
time.

This is achieved by entering a code P in the program, to have control OSP in


synchronize the two towers for us
The P code is usually placed on the tool change line at the last part.

Format: Pxx

The P code consists of a numeric value after the P. IF the first tool of the turret
the upper and the first tool of the lower turret are simultaneously in cutting operation,
then, a P code should be placed on the tool change line of each
tool that is used.

The key to having selected tools in simultaneous mode is to have identical P codes.

Example program

N6 G13
N7 X2.23 Z-.415 T010101 G110 G96 S800 M03 M08 M41 P10

PROGRAM OF THE PIECE

N15 G14
N16 X2.23 Z-.664 T010101 G110 G96 S800 M03 M08 M41 P10

PROGRAM OF THE PIECE

N26 M02

The P10 in these lines will alert control to release both turrets simultaneously for the
four-axis turning.

Department of Engineering and Applications 89


Programming

A program for this piece with these dimensions on a four-axis lathe could be the
next

N1 G14
N2 G50 S3000
N3 G00 X20. Z20.
N4 G13
N5 G50 S3000
N6 G00 X20. Z20.

N7 X2.23 Z-.415 T010101 G110 G96 S800 M03 M08 M41 P10

N8 G01 X-95 F.015


N9 Z-.35
N10 X2.23 Z-.365
N11 Z-.475
N12 G01 X.95
N13 Z-.35
N14 G00 X20. Z20.

N15 G14
N16 G00 X2.23 Z-.664 T010101 G110 G96 S800 M03 M08 M41 P10

N17 X1.939
N18 G1 Z-0.35 F0.015
N19 G00 X2.037 Z-.664

Department of Engineering and Applications 90


Programming

N20 X1.744
N21 G01 Z-.35
N22 G00 X1.794 Z-0.541
N23 G01 X.950
N24 Z-.664
N25 G00 X2.23
N26 G00 X20. Z20.
N27 M02

Rules for using the synchronization code P:

Si G96 (Velocidad variable) con una S especifica a sido seleccionada en una torreta la otra tortea
It must also have the same G96 with the same S or an alarm will result.

If G97 (revolutions per minute) with a specific S has been selected in a turret, the other
the cake must also have the same specifications G97 with the same S as the other cake or
an alarm will result.

Only one mode of speed, either revolutions per minute or constant speed, or
Variable speed can be active when they are in simultaneous cutting. The G110 code for
Priority of the upper turret and G111 for the priority of the lower turret are for this purpose.

All M codes must match or an alarm will result.

PRECAUTIONS

Great care must be taken with the interference areas between the upper and lower towers.
during the simultaneous operation of four axes.

Interference between the bar and the chuck when using a tortea.

Torreta A
Chuck and Cutting direction of the
muzzles tower A

Cutting direction of the


turret A

Cutting direction of the


Interference between towers tower B

Department of Engineering and Applications 91


Programming

.
WORK ZERO REGISTRATION FOR X

This operation is usually done once, unless a strong blow occurs that can
move the alignment of the tortilla.

Mount a dial indicator in the chuck using soft jaws, a collet, or any device that
It would be used on a manual machine. Make sure that the indicator is located right on the line.
center of the spindle.

Mount a hollow bar for interiors in any tool position on the lathe, as it
show below.

Tower
Chuck Axis X

counterpoint
indicator

To begin the zero registration process, select the torta using the buttons that are on
the panel.

In the control panel, the manual mode is selected using the manual knob (PULSE
HANDLE), select the X or Z axis, select the scale factor 1 to 1, 10 to 1, 50 to 1. Move the
hollow bar inside the diameter to a position where the watch can be used
indicator.

Place the toolbar until the indicator shows a reading of 0 for 360 degrees.

If necessary, adjust the cam until the hollow bar inside the diameter is centered on the axis.
Y

On the control panel, select the zero set button (ZERO SET)

Department of Engineering and Applications 92


Programming

After pressing the ZERO SET button, on the page that appears, place the cursor on the
column X and the ZERO OFFSET row with the arrows to move to the next step.

In the F functions, located below the screen, press the key that indicates CAL, then
on the numeric keypad press zero (0) and finally press the WRITE key, you now have the
zero in X of work.
WORK ZERO REGISTRATION IN Z

Approach the tool until it touches the face of the previously machined part.

Now without moving the Z axis, press the ZERO SET mode, so that the screen displays
zero record.

Then place the cursor in column Z and row ZERO OFFSET.

Press the F3 (CAL) key of the monitor functions.

Type zero, this is for the purpose of locating the working zero.

Press WRITE to have the machine calculate the working zero.

Activate TOOL DATA mode.

Select with the cursor the tool number that I used for the ZERO SET calculation.

Press CAL from the monitor functions.

Press WRITE and the value of this tool should be adjusted to zero.

ZERO SET N O
Page 1 UNI 1mm
T X Z
ZERO OFFSET A 421.2658 965.3257
ZERO SHIFT A 125.5699 526.3258

SET
Department of ADD and CAL
Engineering Applications ITEM ITEM 93

You might also like