Hello Guest it is May 11, 2021, 10:10:59 AM

Author Topic: CNC Lathe turret tool changer help?  (Read 12355 times)

0 Members and 1 Guest are viewing this topic.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #10 on: October 09, 2015, 09:17:50 AM »
Thanks will try it soon!

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #11 on: October 09, 2015, 01:05:48 PM »
Seems to be working great here, can you put in 2 things?

1. There is a switch (oemtrigger1) when it is active low the turret is not seating properly, can you put this in after each tool change, if it does not sense the HI then try again, but if it does not sense the HI then estop the machine and msg box "Turret not seating!"

2. Can you put an estop in after ther turret timeout, to 3stop the machine? and msg box "Turret could not find tool ESTOP machine"?

You are awesome my friend!!

Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #12 on: October 09, 2015, 03:07:55 PM »
ok,
maybe tomorrow.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #13 on: October 09, 2015, 03:35:18 PM »
Sweet thank u, I'll try it on my lathe shortly and upload a vid! ;)

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #14 on: October 10, 2015, 07:45:49 AM »
Hi TPS, I am running into a challenge, I cant get the turret to stop accurately

...So...I was thinking... can we put a deactivate output 5 before the deactivate output 6 with a time delay (that I can adjust)?

So that when output 5 disables (engages the stop dog) keep output 6 active for like 1 second until the stop dog stops the turret.

The stop dog is NOT a pin, its like a finger, and when output 5 is disabled...the finger grabs onto the bottom turret and when the turret spins, it will then stop to the next tool. Then we can deactive output 6 (after 1 second), which stops the air and drops the turret (the finger from the stopdog will stop the turret, and then output 6 will just stop the air to the air motor and then drop the turret)

I believe this will make it work perfectly...

So...

activate output 5 ' unlocks stop dog

wait for a second

activate output 6 ' raises turret and spins

wait for case command

when case is true for right tool

deactivate output 5 'locks the stop dog
wait 1 second
then
deactivate output 6 ' stops the turret and lowers it

continue program...

:D

Could we put this in? Along with estop and time outs?

Is there anything I can do in return for your help? 

Thank you!

Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #15 on: October 12, 2015, 02:25:22 AM »
Hi,

ok here with stop dog

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015 
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4


'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
   
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air otor off
        End
      End if
   Wend
   
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air otor off

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
   
End Sub

 

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
   
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
   
End Function
   


Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #16 on: October 12, 2015, 08:05:55 AM »
That works great thomas! May I ask one last thing? Also can I paypal you some money for helping me?

1. Can I put in a command that, after output 6 deactivates wait 1 second, then the macro looks for oemtrigger1 and if it is low, then estop the machine and msgbox 'Tool changer not seated!

2. Can we put in, only tools 1-8 are valid, if >8 and <1 dont proceed, kinda like this

If  NewTool > 8 Or NewTool < 1 Then
MsgBox" Tool # not a valid Number 1-8 ONLY, ENDING Program RUN "
DoButton(3)
End
End If

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D :D :D :D :D :D :D :D :D :D :D :D

Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #17 on: October 12, 2015, 04:22:35 PM »
OK something like this should work,
##

oemtrigger1 is not ok input5 would be great

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015  
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4
' oemtrigger1 is mapped to input5

'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
If  tool > 8 Or tool < 1 Then 'check tool number to be in range
    Message (" Tool " & tool & " is not a valid Number 1-8 ONLY, ENDING Program RUN ")
    DoButton(3)
    End
End If

 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
  
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air otor off
        End
      End if
   Wend
  
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air otor off

sleep(1000)
    'look for Input5
    if not IsActive(Input1) then
        DOButton(3)
        Messagebox("Tool changer not seated!")
end
    End If    

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
  
End Sub

  

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function
    

Thomas
« Last Edit: October 12, 2015, 04:25:41 PM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #18 on: October 12, 2015, 06:48:38 PM »
I looked in mach3 for inputs and they only have inputs 1-4 that's why I mentioned oemtrigger1

Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #19 on: October 13, 2015, 04:40:56 AM »
Sorry my fault.

here the version with OEMTRIG1

Code: [Select]
Sub Main()
' -------------------------------------------------------------------------------
' TPS 09.10.2015  
' simple Test for Toolchange
' -------------------------------------------------------------------------------

' pin2 is mapped to Input1
' pin3 is mapped to Input2
' pin4 is mapped to Input3
' pin5 is mapped to Input4
' charger seated is mapped to OEMTRIG1

'get the new tool ---------------------------------------------------------------
tool = GetSelectedTool()

' nothing to do
If GetSelectedTool() = GetCurrentTool() Then
     message("Tool is the same NO tool change needed")
   END
End If
 
If  tool > 8 Or tool < 1 Then 'check tool number to be in range
    Message (" Tool " & tool & " is not a valid Number 1-8 ONLY, ENDING Program RUN ")
    DoButton(3)
    End
End If

 
Dim ActTurretPos as long
ActTurretPos = 0

'get actual starttime
Starttime = Timer

Message "Moving to Tool# " &GetselectedTool()

   ActivateSignal(output5)  'unlocks stop dog
   Sleep(1000)              'wait for a second
   ActivateSignal(OutPut6)  'turn air motor on
  
   While ActTurretPos <> tool 'turn until we are in the wright position
      ActTurretPos = GetTurret()
      Akttime = Timer
      If Akttime - Starttime > 20 then 'Timeout 20s
        Message("Turret timeout")
        DeActivateSignal(output5)    'locks stop dog
        Sleep(1000)                  'wait for a second
        DeActivateSignal(OutPut6)    'turn air motor off
        End
      End if
   Wend
  
   DeActivateSignal(output5)    'locks stop dog
   Sleep(1000)                  'wait for a second
   DeActivateSignal(OutPut6)    'turn air motor off
   sleep(1000)

    'look for OEMTRIG1
    if not IsActive(OEMTRIG1) then
        DOButton(3)
        Messagebox("Tool changer not seated!")
        End
    End If    

    Message("Tool " & tool & " Loaded")
   SetCurrentTool( tool )
  
End Sub

  

'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function
    

« Last Edit: October 13, 2015, 04:43:01 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.