
The lathe uses a ratchet and pawl style turret so it has to reverse to lock. its stepper driven, with a current limit set to 20% so it can stall on reverse and not break anything. for the macro, theres a snippet of it below. its just the OE axis driven tool macro with an M26 line added to keep wind up error in check. that little change fixed the previous issue it had with lock up.
The issue... It doesn't seem to like moving to the correct tool position when running a single program with multiple tool changes. its like when its in program, it cant read what the current tool position is so it assumes T0101, and moves the number of positions that corresponds with the next tool.. so lets say its on t0101, which is often the case, and t0303, is called.. it moves 3 positions to position 3, seems right, right?.. this is where it gets weird. lets say t0505 is the next tool, instead of moving 2 positions to get to tool 5, it moves 5 positions to tool 8.. with a simple program that basically just changes tools (created by my cam software, Fusion) this is the case for every tool change. calling T0404 next moves 4 positions (from position 8) and lands on T0303.. Calling T0707 (from t0303) lands on T0202. So on and so forth...
To make things more confusing.. calling tools via MDI works absolutely fine. Even breaking out my tools paths, grouped by tool and running each one individually works fine, even if the current tool isn't the requested tool. For these cases, its actually been flawless. Not a single wrong position.
I'm at a loss here so any help is greatly appreciated.
Output from the post processor;Check to ensure turret is not at requested position, if so then skip tool change.
IF [ABS[#4120-#101] < .002] THEN GOTO 1000
;If tool requested is not a valid tool, Skip macro and send message to operator.
IF #4120 < 1 || #4120 > #9161 THEN GOTO 500
;Calculate Requested Position to move Turret to.
IF #101 > #4120 THEN #102 = [#103 + #9161 + #4120 - #101] ELSE #102 = [#103 + #4120 - #101]
G53 A[#102 + #9853] ;Move past tool by P853 Amount
G53 A[#102 - #9854] ;Move back behind toold by P854 Amount
IF #50001
M26 /A L[#4120*#20604]
IF #50001 ;Prevent lookahead from parsing past here
G10 P1976 R[#4120] ;Set parameter 976 to tool number
;1001
;TEST
N10 G98 G90
N11 G20
N12 G50 S1200
N13 G28 U0.
N14 G28 W0.
;OD FINISH
N15 T0300
N16 G54
N17 M8
N18 G90 G99
N19 G97 S370 M3
N20 G0 X1.55 Z0.1969 T0303
N21 G50 S1200
N22 G96 S150 M3
N23 G4 P1.
N24 G0 Z0.0654
N25 X0.4201
N26 G1 X0.3838 F0.003
N27 Z-0.0146
N28 X0.4323 Z-0.0388
N29 Z-0.386
N30 X0.5675
N31 X0.6252 Z-0.4148
N32 Z-0.5378
N33 X0.75
N34 X0.8631 Z-0.4812
N35 X0.8754
N36 G0 X1.55
N37 Z0.1969
N38 G97 S370 M3
N39 M9
N40 T0300
N41 G28 U0.
N42 G28 W0.