Code: Select all
IF M6_SV THEN ChangeToTool_W = SV_TOOL_NUMBER, SET ATCStage
If you need more I can of course provide it.
My M6 macro file looks like:
Code: Select all
;Skip if graphing or searching
IF #4202 || #4201 THEN GOTO 1000
IF #50001 ; Prevent lookahead
M109 /1/2 ; Disable overrides
M5 ; stop spindle
M9 ; Turn off coolant
G28 G91 Z0 ; Move Z to tool change position
M107 ; Send tool number
G4 P.1 ; wait .1 second
M94 /8 ; Set M6_SV to start tool change stage
G4 p1 ; wait 1 second (can I shorten this wait?)
M100 /60018 ; ATCUnlock_O off is locked
M100 /60017 ; ATCMotor_O off
M95 /8 ; reset M6_SV to stop tool change stage when done
N1000 ; end of program
My two questions would be why isn't my M5 stopping the spindle prior to going to Z0?
My second has to do with the fall back since Z 0.0 - Z -2.1(ish) is actually inside the tool changer I need to make sure the spindle is not spinning in that range. I have an input that does track it `ATC_Z_ClearedToolChanger_I` it is enabled when the Z is outside the tool changer and spindle is good to go.
the code:
Code: Select all
; Acroloc Make sure spindle stops before entering tool changer
IF !ATC_Z_ClearedToolChanger_I THEN
RST SpindleEnableOut_O
basically I need something like:
Code: Select all
If !ATC_Z_ClearedToolChanger_I THEN
stop z movement <- how to do this
RST spindleEnableOut_O
If !ATC_Z_ClearedToolChanger_IO && spindle_at_zero_speed THEN
contine z movement <- how to do this