And here is the code we are using. Running this via MDI always 'resets' the distance to go to 0 for the A Axis. Running it in a program, does not, so the calcs do not remain consistent. M0 in the code, or in the macro, solves the issue but the machine will wait for cycle start on tool change.Centroid_Tech wrote: ↑Mon Jun 11, 2018 10:11 am Please post a current report from your system. You should not need to "unwind" a turret axis. Performing a tool change in MDI should be exactly the same as when running it from a program. Please also provide a copy of the program that you are running.
;------------------------------------------------------------------------------
; Filename: cnctch.mac
; Description: Axis driven tool change macro for lathe
; Notes: Turns/rev must be configured 1 = 1 turret position change
; Turret is on 3rd axis, positions are in machine position.
; Requires: Machine home must be set prior to use.
;
;#100 = 8 ;Number turret positions
;#101 = ;Calculated position to move to when requested position < current position.
;#4120 = requested tool
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;------------------------------------------------------------------------------
follow with a block that skips if graphing or searching
IF #50001 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
If not searching or graphing, check to make sure the turret is not already
at the requested position. If it is, skip the macro
IF [ABS[#4120-#5023] < .002] THEN GOTO 1000
; Notes: Turns/rev must be configured 1 = 1 turret position change
; Turret is on 3rd axis, positions are in machine position.
; Requires: Machine home must be set prior to use.
;
;#101 = ;Calculated position to move to when requested position < current position
;#20601-#20604 = Counts per unit for axes1-4
;#5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;#4120 = requested turret position from g code
IF #5023 > #4120 THEN #101 = [8 + #4120] ELSE #101 = #4120
G53 A[#101 + 0.5]
G53 A[#101 - 0.5]
M26 /A L[#4120*#20603]
N1000 ;Macro finished