P-codes are timing. If you want both turrets together, use the same P number IE G13T0101 X4.Z0P10
G14T0202X4.Z0P10
Hi all,
I'm currently figuring out how to use the LC40 in our workshop. I got the program down pat (G13's and G14's where they should be, etc) but i dont know how to run both turrets in the program to complete a finished part. (T1 from A turret comes down, turns, goes home - then T1 from B Turret comes up to drill a hole, etc) unfortunately i cant post the program as of yet but from having a nosey at old programs the old operator used to write theyre full of "P10" and "P11". What are these codes and are they relevant to what i'm trying to do?
Thanks for your help in advance.
Brisbanite![]()
P-codes are timing. If you want both turrets together, use the same P number IE G13T0101 X4.Z0P10
G14T0202X4.Z0P10
directly relevant. P10 and P11 desrcibes synchronisation of turrets - which is master, wich follows. It describes "balanced cut" conditions also.
How you use synchronisation takes practice to optimise the program, all you can do is study some programs and start by writing simple programs to gain confidence.
When I worked for Okuma, they did produce a training manual for this type of programming, Contact Ellison Machine Technologies for some advise.
Maybe they have a copy you could buy.
Welcome to the Zone Brisbanite!
P codes are, as others have stated, Synchronisation codes.
As you have already discovered, you can control the order of execution of processes on each turret by way of using the "P" code numbers.
"P" codes will always be increasing in value (there is an exception to this a per usual!) through out the program, i.e. P20 will always be after P10 otherwise an alarm will occur.
"P" codes can be of a smaller value than the last one used, only within a shape designation section of the program...
i.e. between G81/G82 and the matching G80
This is used to synch turrets when using balanced cutting (two tools machining the same shape, usually the OD) and you need to make sure that both tools are kept synchronised.
To commence cutting simultaneously between upper and lower turrets you must use the same P code on both turrets.
P codes can give you a range of alarms and I usually found it best to not bother trying to look for a solution to the alarm by looking at the program first! Check the alarm manual First, this will tell you what problem is actually present, i.e. maybe the problem is different spindle speeds commanded, or maybe different gear ranges commanded... you can spend lots of time looking for the problem if you do not know exactly the cause of a "P" code alarm first!
I used to program my old LC20 like this:
For example the order of operations was thus:
Face
Drill
Rough OD / Rough ID
Finish OD / Finish ID
Part off and Catch
End
Tooling would be setup thus:
Turret A (G13)
T5 Rough ID
T6 Parting tool
T7 Finish ID
Turret B (G14)
T1 Facing tool
T2 Rough OD
T3 Finish OD
T5 Drill
T6 Parts Catcher (Usually a piece of Nylon of appropriate Diameter and Length to fit down the bore and allow the part to fall onto during machining).
A sample program for machining a 'Bush' from solid, 100mm long, 120mm OD, 80mm ID
would be something like this...
(program listing has been only roughly checked for accuracy, no responsibility taken for any mistakes made!)
$TEST.MIN%
G13
P10 (EXECUTE FIRST)
M90 (DOOR CLOSE)
G0 X300 Z800
G14
P20 (EXECUTE SECOND)
G0 X300 Z800
G50 S3000
NOEX (FINISH FACE)
NSTRT X122 Z102 TG=1 OG=1 G97 S636 M3 M8 M63
G96 G111 S200 (G111=TURRET B USED FOR SURFACE SPEED CONTROL)
G85 NFF D1.5 F0.2 W0.2
NFF G82
G1 Z100 G41
X0
G40 I-0.02
G80
G0 Z800
NOEX (DRILL ID)
NDRIL X0 Z800 G97 S540 TG=5 OG=1 M65 M66
X0 Z102 TG=5 OG=1
G74 X0 Z-6 D154 L154 F0.10 E0.17
G0 Z800
N1 X300 Z800 TG=2 OG=1 M65 M66 M63 G97 S624
G13
NOEX (ROUGH BORE)
NRID G0 X56 Z102 TG=5 OG=1 G97 S521 M63 P30 (SYNCH WITH B TURRET AT P30)
G85 NLAPB D5 F0.3 U0.5 W0.1 P35 (SYNCH THE START OF THE ROUGHING CYCLE AT P35)
NLAPB G81
G0 X82
G1 Z100 G41 F0.18
X80 Z98
X80 Z-5
G40 I-0.01
G80
G0 X[V6-2]
Z400
X82 Z400 TG=7 OG=1 M65 M66
M1 P38 (SYNCH OPTIONAL STOP)
G14
NOEX (ROUGH TURN)
NROD G0 X400 Z102 TG=2 OG=1 G97 S521 M63 P30 (SYNCH WITH A TURRET AT P30)
X122
G85 NLAPT D5 F0.3 U0.5 W0.1 P35 (SYNCH THE START OF THE ROUGHING CYCLE AT P35)
NLAPT G81
G0 X118
G1 Z100 G42 F0.18
X120 Z98
X120 Z-3.5
X122
G40 I0.01
G80
G0 X300
Z400
X300 Z800 TG=3 OG=1 M65 M66
M1 P38 (SYNCH OPTIONAL STOP)
G13
NOEX (FINISH BORE)
G0 X82 Z102 TG=7 OG=1 G97 S610 M63 M3 P40 (SYNCH WITH A TURRET AT P40)
NOEX M8
NFID G87 NLAPB P45 (SYNCH THE START OF THE ROUGHING CYCLE AT P45)
G0 G91 X-0.5 (MOVE TOOL 0.5MM CLEAR OF ID)
G90 Z800 (RAPID CLEAR ON Z)
G14
NOEX (FINISH TURN)
G0 Z102 TG=3 OG=1 G97 S610 M63 M3 P40 (SYNCH WITH A TURRET AT P40)
NFOD X120 Z102
G87 NLAPT P45 (SYNCH THE START OF THE ROUGHING CYCLE AT P45)
G0 Z101
G87 NFF2
NFF2 G82
G1 Z100 G41
X78
G40 I-0.02
G80
G0 X400 Z101
X400 Z400
X400 Z800 TG=6 OG=1 M65 M66 (INDEX TO PARTS CATCHER)
G13
NPART G0 X300 Z400 TG=PT OG=1 M65 M66 (PARTING TOOL)
P5001 (START SYNCHING THE PARTING TOOL MOVEMENTS WITH THE PARTS CATCHER)
G97 S390 M3 M63 P5002 (SYNCH THE SPINDLE SPEED)
G0 X500 Z800 P5010
X500 Z-3.1 TG=6 OG=1 G97 S390 M3 M8 M63 P5020 (SYNCH MOVEMENT TO THE CUT OFF POINT)
X122
G96 G110 S150 M61 P5030 (SYNCH CUTTING SPEED WITH OTEHR TURRET)
G1 X118 F0.1
G0 X122
Z-2.1
G1 X120
X118 Z-3.1 (CHAMFER PART)
X78 (CUT OFF PART)
G0 X122 P5040 (MOVE PARTING TOOL AWAY FIRST)
X400 Z800 (AND THEN TO HOME POSN)
X400 Z800 TG=5 OG=0 M65 M66 (INDEX TO ROUGH ID TOOL READY FOR NEXT PART)
X400 Z800 TG=5 OG=0
M5 M9 P9999
G14
NPC G0 X400 Z800 TG=6 OG=1 M65
P5001
G97 S390 M3 M63 P5002
G0 X500 Z800 P5010
X0 Z110 TG=6 OG=1 G97 S390 M3 M63 P5020 (SYNCH MOVEMENT TO FRONT OF PART, PART TOOL TO Z CUT OFF POSN)
Z0 (MOVE CATCHER INTO 'CATCH' POSITION WITHOUT WAITING FOR ANY SYNCH)
G96 G110 S150 M61 P5030 (SYNCH CUTTING SPEED WITH OTEHR TURRET)
(LOWER TURRET NOW WAITING IN PLACE WHILE TOP TURRET IS CUTTING OFF PART)
Z110 P5050 M5 M9 M63 (MOVE PART CATCHER BACK TO FRONT OF PART AFTER MOVING PARTING TOOL CLEAR)
M01 (OPTIONAL STOP TO KEEP CATCHER IN PLACE AT CHUCK)
X500 Z800
G0 X500 Z800
M5 M9 P9999
M91 (DOOR OPEN)
NEND M02
Hope this helps a little?
Cheers
Brian.
Thanks for the replies guys,
Currently doing another batch of ten (starting this arvo). The Program that i'm posting is the way i have to do the job. I want to do it exactly the way the program is written..... So here it goes:
Hopefully this helps!