Hello Guest it is December 26, 2024, 03:40:38 PM

Author Topic: ATC error "Wait Brush Position Limit Signal"  (Read 2199 times)

0 Members and 1 Guest are viewing this topic.

ATC error "Wait Brush Position Limit Signal"
« on: December 12, 2016, 09:15:20 PM »
Hi, we just got a new 4x8 China router (from a US seller) which fortunately has Mach3 on it (not Syntec like our older router).  The Y axis had been set up reversed so it was cutting mirror images of our parts, and I'm in the middle of sorting that all out.  I believe I've got the axis issue resolved, but now the tool change function is a bit wonky.   I've run other machines with Mach3 in the past (a K2 router and a Tormach mill), but I don't have any programming/troubleshooting experience with it, just button pushing. 

Anyway, it's a 8 tool bar type ATC, and I've updated the M6Start.m1s macro to reflect the new Y locations for the tool holders, but I'm now getting an error when it's most of the way through a tool change. Example- T1 is in the spindle. I input T3 M6 into MDI, press start. T1 returns to the T1 fork, releases as normal. Head goes over to T3 fork, picks up T3 as expected, the head raises. At this point, I get an error message that says "Wait Brush Position Limit Signal" and 3 or 4 seconds later it changes the error message to "EStop Button Pressed".

The ATC did work fine without error before I corrected the reversed axis, and the only changes to the M6Start.m1s file were the "TxYpos =" values. I've copied the file below.

Any ideas?
Thanks,
James




'chengdu xhc technology ,all right reserved |
'please don't modify these code if you don't know what you doing |
'
'8直排换刀程序 |
'----------------------------------------------------------------|

Dim XWork,YWork,z,a,b,c
Dim OldTool,NewTool,tool,MaxToolNum,ToolDown,ToolUp,ToolSafe
Dim Xpos,YPos,ZPos
Dim ToolYaxisAdd
Dim BrushWaitTime,ToolReleaseWaitTime,ToolClampWaitTime
Dim CurrentFeed,CurrentAbsInc,CurrentGmode
'ToolChange Macro For Bed type tool changer 11/05 Brian


Sub main
DoSpinStop() 'stop spindle

Call GetCurrentMachineState() 'Save our current machine state
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
XWork = GetOEMDRO(800) ' Get Current X Work Coordinate
YWork = GetOEMDRO(801) ' Get Current Y Work Coordinate
Code "G90"

tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 8 'Max number off tools for the changer
ToolSafe =-10 'GetOEMDRO (1240) 'Tool Safe Position
ToolUp = -80 'GetOEMDRO (1241) '-1.0'Z Hieght to Rapid from tool to tool
Spd =10000 'GetOEMDRO (1242) '10000'speed
ToolXaxisAdd =80 'GetOEMDRO (1243) 'X轴安全距离100'X Avoid Position Add
If NewTool = OldTool Then
Message"Tool No Change"
Exit Sub
End If

'SetUserLED(53, 1)

'------------------------------------------
' Brush Control
'------------------------------------------
ActivateSignal(Output7)
Message"Wait Brush Position Limit Signal "
BrushWaitTime = 0
while not IsActive(Input3)
Code "G4 P0.1"
While IsMoving()
sleep(20)
Wend
if BrushWaitTime > 25 Then
DoOEMBUTTON(1021)
Message"Brush Wait OverTime"
Exit Sub
End If
BrushWaitTime = BrushWaitTime +1
wend
'-------------------------------------------
'-------------------------------------------


Message"Tool Change"
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolSafe
While IsMoving()
sleep(20)
Wend
Call MovePos(OldTool)
While IsMoving()
sleep(20)
Wend
Code "G01 G53 Y" & YPos & "X" & (XPos - ToolXaxisAdd) & "F" & Spd
Code "G4 P0.1"
While IsMoving()
sleep(20)
Wend

Code "G4 P0.5"
While IsMoving()
sleep(20)
Wend
Code "G0 G53 Z" & ZPos
Code "G4 P.75"
While IsMoving()
sleep(20)
Wend
Code "G01 G53 X" & XPos & "F" & Spd
Code "G4 P.75"
While IsMoving()
sleep(20)
Wend


'------------------------------------------
' Tool Release Control
'------------------------------------------
ActivateSignal(Output6) 'Turn On Draw bar to release the tool
Message"Wait Tool Release Signal "
ToolReleaseWaitTime = 0
While Not IsActive(input1) 'OEM INPUT1
Code "G4 P0.1"
While IsMoving()
sleep(20)
Wend
If ToolReleaseWaitTime > 25 Then
DoOEMBUTTON(1021)
Message"Tool Release feedback Signal Wait OverTime"
Exit Sub
End If
ToolReleaseWaitTime = ToolReleaseWaitTime +1
Wend
'-------------------------------------------
'-------------------------------------------

Code "G4 P1.0" 'Wait for the tool to release
Code "G0 G53 Z" & ToolUp
Call MovePos(NewTool)
While IsMoving()
sleep(20)
Wend
Code "G01 G53 Y" & YPos & " X" & XPos & "F" & Spd
Code "G4 P.75"
While IsMoving()
sleep(20)
Wend
Code "G0 G53 Z" & ZPos
Code "G4 P.75"
While IsMoving()
sleep(20)
Wend

'------------------------------------------
' Tool Clamp Control
'------------------------------------------
DeActivateSignal(Output6) 'Turn Off Draw bar to Clamp the tool
Message"Wait Tool Release Signal "
ToolClampWaitTime = 0
While Not IsActive(input2) 'OEM INPUT2
Code "G4 P0.1"
While IsMoving()
sleep(20)
Wend
If ToolClampWaitTime > 25 Then
DoOEMBUTTON(1021)
Message"Tool Clamp feedback Signal Wait OverTime"
Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Exit Sub
End If
ToolClampWaitTime = ToolClampWaitTime +1
Wend
'-------------------------------------------
'-------------------------------------------

Code "G4 P1.0" 'Wait for the tool to Clamp
While IsMoving()
sleep(20)
Wend

Code "G01 G53 X" & (XPos - ToolXaxisAdd) & "F" & Spd
Code "G4 P1"
While IsMoving()
sleep(20)
Wend

Code "G0 G53 Z" & ToolSafe
While IsMoving()
sleep(20)
Wend
'Code "M1801"
DeActivateSignal(Output7)
Message"Wait Brush Position Limit Signal "
BrushWaitTime = 0
While Not IsActive(Input4)
Code "G4 P0.1"
While IsMoving()
sleep(20)
Wend
If BrushWaitTime > 25 Then
DoOEMBUTTON(1021)
Message"Brush Wait OverTime"
Exit Sub
End If
BrushWaitTime = BrushWaitTime +1
Wend

Call SetUserDRO (1200,NewTool)
SetCurrentTool( NewTool )
Sleep(200)
Call ReturnToInitialState()
Sleep(100)
XWork=0
YWork=0
'Code "G0 X" & XWork & " Y" & YWork 'Move back to where the tool change was prompted
Code "G0 X" & XWork & " Y" & YWork 'Move back to where the tool change was prompted
While IsMoving()
sleep(20)
Wend

Message"Tool Change Finish"
'-------------------------------------------
'-------------------------------------------
'------------------------------------------
' auto start
'------------------------------------------
If Not FileName() = "No File Loaded." Then
If GetOEMLED(1865) Then
MsgBox "Start Spindle, then press OK to Continue",48,"Start Spindle"
End If
DoSpinCW()
DoOEMButton(1000) ' Cycle Start
End If
End Sub
'------------------------------------------
' Tool Postion
'------------------------------------------
Sub MovePos(ByVal ToolNumber As Integer)
'根据不同的用户,只需要修改以下=号内的刀具偏移位置,其它不用更改
'==========================================================================
TlXPos=2692.2535 ' 刀具1X轴偏移,是机器坐标
TlYPos=1154.1272 ' 刀具1Y轴偏移,是机器坐标
TlZPos=-214.7140 ' 刀具1Z轴偏移,是机器坐标
T2XPos=2692.6675 ' 刀具2X轴偏移,是机器坐标
T2YPos=1004.1340 ' 刀具2Y轴偏移,是机器坐标
T2ZPos=-214.7140' 刀具2Z轴偏移,是机器坐标
T3XPos=2692.7275 ' 刀具3X轴偏移,是机器坐标
T3YPos=854.4649 ' 刀具3Y轴偏移,是机器坐标
T3ZPos=-214.7140 ' 刀具3Z轴偏移,是机器坐标
T4XPos=2692.0616 ' 刀具4X轴偏移,是机器坐标
T4YPos=703.5398 ' 刀具4Y轴偏移,是机器坐标
T4ZPos=-214.7140 ' 刀具4Z轴偏移,是机器坐标
T5XPos=2692.8035 ' 刀具5X轴偏移,是机器坐标
T5YPos=556.0724 ' 刀具5Y轴偏移,是机器坐标
T5ZPos=-214.7140 ' 刀具5Z轴偏移,是机器坐标
T6XPos=2693.5714 ' 刀具6X轴偏移,是机器坐标
T6YPos=404.3474 ' 刀具6Y轴偏移,是机器坐标
T6ZPos=-214.7140 ' 刀具6Z轴偏移,是机器坐标
T7XPos=2693.2695 ' 刀具7X轴偏移,是机器坐标
T7YPos=252.4544 ' 刀具7Y轴偏移,是机器坐标
T7ZPos=-214.7140 ' 刀具7Z轴偏移,是机器坐标
T8XPos=2693.6054 ' 刀具8X轴偏移,是机器坐标
T8YPos=105.8769 ' 刀具8Y轴偏移,是机器坐标
T8ZPos=-214.7140 ' 刀具8Z轴偏移,是机器坐标
'=============================================================================
Select Case ToolNumber
Case Is = 0
Xpos =TlXPos
YPos = TlYPos
ZPos =TlZPos
Case Is = 1
Xpos = TlXPos
YPos = TlYPos
ZPos = TlZPos
Case Is = 2
Xpos = T2XPos
YPos = T2YPos
ZPos =T2ZPos
Case Is = 3
Xpos = T3XPos
YPos = T3YPos
ZPos =T3ZPos
Case Is = 4
Xpos = T4XPos
YPos = T4YPos
ZPos =T4ZPos
Case Is = 5
Xpos = T5XPos
YPos = T5YPos
ZPos =T5ZPos
Case Is = 6
Xpos = T6XPos
YPos = T6YPos
ZPos =T6ZPos
Case Is = 7
Xpos = T7XPos
YPos = T7YPos
ZPos =T7ZPos
Case Is = 8
Xpos = T8XPos
YPos = T8YPos
ZPos =T8ZPos
End Select
End Sub

Sub GetCurrentMachineState()
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentFeed = GetOemDRO(818) ' Get the current feedrate to return to later
End Sub

Sub ReturnToInitialState()
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If

Code "F" & CurrentFeed ' Reset to original feed rate

End Sub