hello everybody i have added 2 things :
... M01 optional stop, to make it easier for the operators to stop the lathe between operations; M01 is better than step-by-step, because it can be pressed anytime, while step-by-step requires the operators to be more sharp
... preferential turret positioning; examples for rough turning :
...... OD towards Z- ( P3 ), turret is approaching from X_up & Z_right
...... OD towards Z+ ( P4 ), turret is approaching from X_up & Z_left
...... ID towards Z- ( P2 ), turret is approaching from X_down & Z_right
......... P2,3,4 are quadrants for nose-rad comp; see attached
as a result, effects caused by backlash are eliminated, at least at the begining of the operation; if there is no backlash, then the servo-loop will react prompt, only to cutting forces; otherwise, it will react later this thing is the lathe equivalent for "Uni-directional Positioning" function, available on mills
i dont use it always
... examples for "using it" :
...... rough turning ( or milling )
...... finishing with tight tolerances
... examples for "not using it" :
...... when the clearance is long enough, to neutralize the backlash
real code example :
Code:
CALL ODYNX LPOS=60 LCTR=1 LDS=+1 ( it means that next operation is turning, it begins at X60, and i wish for the turret to approach from above )
T M66 G97 S M42 M03 M08 G00 X60 Z2.500 M63
// rough od toolpath
CALL ODYNX LPOS=30 LCTR=1 LDS=-1 ( it means that next operation is turning, it begins at X30, and i wish for the turret to approach from below )
T M66 G97 S M42 M03 M08 G00 X30 Z2.500 M63
// rough id toolpath
CALL ODYNX LPOS=40 LCTR=1 LDS=0 ( it means that next operation is turning, it begins at X40, and i dont care if the turret is approaching from above or below )
T M66 G97 S1 M42 M03 M08 G00 X40 Z-9 M63
// finish od toolpath
CALL ODYNX LPOS=2*SQRT[V6*V6+V7*V7] LCTR=2 LDS=+1 ( it means that next operation is milling, it begins at x=V6 and y=V7, and i wish for the turret to approach from above; X will be 2*SQRT[V6*V6+V7*V7]; this eliminates unnecessary movements )
G137
SB M13 M08 G00 X+V6 Y+V7 Z_whatever M63
// milling toolpath
G136 M12
CALL ODYNZ LPOS=-50 LCTR=1 LDS=-1 ( it means that next operation is turning, it begins at Z-50, and i wish for the turret to approach from left )
T M66 G97 S M42 M03 M08 G00 X40 Z-50 M63
// finish od toolpath
G00 safe_position
this code below delivers the dynamic indexing behaviour + adaptive CTR + preferential positioning + M01
Code:
ODYNX ( position ** ctr ** approaching among X axis *3 )
CALL ODYNC
NOEX LDEM = 0 (*4) (*5a)
NOEX LDYZ = LVZP - VETFZ
NOEX LDYX = LPOS + VTOFX [ LINK ] + VTWOX [ LINK ] - VETFX + 2*5*LDS
IF [ LDYX GE VSIOX ] NEND
IF [ LDS NE -1 ] NJUMP (*5b)
NOEX LDEM = 1 (*5b)
NOEX LDEX = LDYX ( local dynamic : extra X ) (*5b)
NOEX LDEZ = LDYZ ( ... ... ... ... ... Z ) (*5b)
NJUMP NOEX LDYX = VSIOX
NEND CALL ODYNA
RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
ODYNZ ( position ** ctr ** approaching among Z axis *3 )
CALL ODYNC
NOEX LDEM = 0 (*4) (*5a)
NOEX LDYX = LVXP - VETFX
NOEX LDYZ = LPOS + VTOFZ [ LINK ] + VTWOZ [ LINK ] - VETFZ + 1*5*LDS
IF [ LDYZ GE VSIOZ ] NEND
IF [ LDS NE -1 ] NJUMP (*5b)
NOEX LDEM = 1 (*5b)
NOEX LDEX = LDYX ( local dynamic : extra X ) (*5b)
NOEX LDEZ = LDYZ ( ... ... ... ... ... Z ) (*5b)
NJUMP NOEX LDYZ = VSIOZ
NEND CALL ODYNA
RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
ODYNA ( LCTR > 1:S , 2:C , 3:puller , 4: *1 )
IF [ LCTR EQ 1 ] N1
IF [ LCTR EQ 2 ] N2
IF [ LCTR EQ 3 ] N3
GOTO N4
N1 G00 X+LDYX Z+LDYZ M203 M109 M01 ( M18 )
IF [ LDEM EQ 0 ] NOUT
G00 X+LDEX Z+LDEZ
GOTO NOUT
N2 G00 X+LDYX Z+LDYZ M203 M05 M63 M01 ( M18 )
IF [ LDEM EQ 0 ] NJUMP2
G00 X+LDEX Z+LDEZ
NJUMP2 M110 T + LINK * 10101 M66
GOTO NOUT
N3 G00 X+LDYX Z+LDYZ M203 M05 M63 M01 ( M18 )
IF [ LDEM EQ 0 ] NJUMP3
G00 X+LDEX Z+LDEZ
NJUMP3 M19 T + LINK * 10101 M66
GOTO NOUT
N4 G00 X+LDYX Z+LDYZ M203 M05 M63 M01 ( M18 )
IF [ LDEM EQ 0 ] NOUT
G00 X+LDEX Z+LDEZ
GOTO NOUT
NOUT NOEX
RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
ODYNC ( DYNamic lds Check )
IF [ [ [ LDS EQ -1 ] OR [ LDS EQ +1 ] OR [ LDS EQ 0 ] ] EQ 1 ] NEND
NLOOOP M0 ( undefined LDS value )
GOTO NLOOOP
NEND NOEX
RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
(*1) ( S_reverse, S_stop, 2nd spindle )
(*3) ( ODYNX : +1:from X+ , -1:from X- , 0:indifferent )
( ODYNZ : +1:from Z+ , -1:from Z- , 0:indifferent )
(*4) ( local dynamic : extra movement )
such codes require time to be created, and they are reducing non-cuting durations; things can be futher improved, but at this moment i dont have the tools to do so the CALL ODYN* can be implemented inside a CAM post, and the ODYN* soubroutine can be treated as a *.lib file
in the end, is not the code, but what it delivers / kindly !
ps : however, this technique has a hidden enemy : inertia ! but this is a story for another time