Hello Guest it is January 24, 2020, 12:48:35 PM

### Author Topic: ATC Geneva wheel for mill  (Read 2933 times)

0 Members and 1 Guest are viewing this topic.

#### jve

• 128
##### ATC Geneva wheel for mill
« on: April 04, 2018, 11:19:19 AM »
HI Guys,

I need some help, I am doing a retrofit in a mill that have a ATC with a geneva wheel
It  is working fine with the inputs and output the problem that i have is the count and i cannot figerout what is the problem
when the ATC is in tool1 for example and i insert T2M6 the ATC go to tool 2 but when the ATC is in tool 1 and i insert T3M6 it go to tool 2 so it is only counting 1

#### TPS

• 1,452
##### Re: ATC Geneva wheel for mill
« Reply #1 on: April 04, 2018, 12:21:41 PM »
Hello,

i think the Problem is in this Sub:

'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
NTool = 16 ' Number of tools changer holds
CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
CWPos = CWPos + NTools
End If
CCWPos = NTools - CWPos
If CWPos < CCWPos Then
call CW()
Else
call CCW()
End If
End Sub

should be IMHO

'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
NTools = 16 ' Number of tools changer holds
CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
CWPos = CWPos + NTools
End If
CCWPos = NTools - CWPos
If CWPos < CCWPos Then
call CW()
Else
call CCW()
End If
End Sub

« Last Edit: April 04, 2018, 12:23:19 PM by TPS »
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### jve

• 128
##### Re: ATC Geneva wheel for mill
« Reply #2 on: April 05, 2018, 12:52:54 AM »
I Change the Ntools to Ntool and vice versa but no luck i think that the problem is in the count of OEMTrig 9 it is only counting 1 , i spend long hours but i cannot see the mistake

'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
NTool = 16 ' Number of tools changer holds
CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
CWPos = CWPos + NTool
End If
CCWPos = NTool - CWPos
If CWPos < CCWPos Then
call CW()
Else
call CCW()
End If
End Sub

Function CW()'Rotation CW
Dim x As Integer
Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
CTPos=0
ActivateSignal(OUTPUT9)'Turns the AC Motor On cw

Sleep(50)

For x=0 To CWPos
While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
Sleep(10)
Wend
While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
Sleep(10)
Wend

x=x+1
Next x
CTPos=x
DeactivateSignal(OUTPUT9)

End Function

Function CCW()'Rotation CCW
Dim y As Integer
Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
CTPos=0
Activatesignal(OUTPUT9)'atc motor revirsing relay
ActivateSignal(OUTPUT10)'Turns the AC Motor On
Sleep(50)

For y=0 To CCWPos
While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
Sleep(10)
Wend
While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
Sleep(10)
Wend

y=y+1
Next y
CTPos=y
DeactivateSignal(OUTPUT9)
Deactivatesignal(OUTPUT10)'atc motor revirsing relay
End Function

Function AtcUp()'MAG UP
DeActivateSignal(OUTPUT11)'relay for solonoid to lower/MAG UP
code("G04 p01")'pause
While IsActive(OEMTrig5)'Wait for OEMTrig5 is off Mag up
Sleep(10)
Wend
While NOT IsActive(OEMTrig5)'Wait for OEMTrig5 is on Mag up
Sleep(10)
Wend
End Function

#### TPS

• 1,452
##### Re: ATC Geneva wheel for mill
« Reply #3 on: April 05, 2018, 01:27:32 AM »
try to use a Input instead of OEMTrig.

what Controller are you using?
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### jve

• 128
##### Re: ATC Geneva wheel for mill
« Reply #4 on: April 05, 2018, 03:46:08 AM »
Hi ,
I am Using CSMIO IPS

#### TPS

• 1,452
##### Re: ATC Geneva wheel for mill
« Reply #5 on: April 05, 2018, 03:50:34 AM »
so why do you not read the Input drectly.
this work 100%, if have used it many times.

for eample

While GetCsmioIn(91,15) = False
Sleep(20)
Wend

Public Function GetCsmioIn (ByVal adr As Integer, ByVal n As Integer) As Boolean
GetCsmioIn = true
Else
GetCsmioIn = false
End If
End Function

« Last Edit: April 05, 2018, 03:52:31 AM by TPS »
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### jve

• 128
##### Re: ATC Geneva wheel for mill
« Reply #6 on: April 05, 2018, 04:13:53 AM »
i Try with INPUT4 but still no luck i cannot understand why it is count 1 pulse on input4

#### jve

• 128
##### Re: ATC Geneva wheel for mill
« Reply #7 on: April 05, 2018, 04:24:35 AM »
Hi I Can see the input is reading i can see from csmio input21 and from mach3 it is true input 4 i can see the led on and off

i dont know if it is from the logic since for example input 4 if the ATC jump for 2 tools it need to count 2 pulse in input 4 and it is always counting 1

#### TPS

• 1,452
##### Re: ATC Geneva wheel for mill
« Reply #8 on: April 05, 2018, 04:24:43 AM »
if you put some Addition MSGBox instruction to your CW Routine you can how often
Input gets triggered

Function CCW()'Rotation CCW
Dim y As Integer
Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
CTPos=0
Activatesignal(OUTPUT9)'atc motor revirsing relay
ActivateSignal(OUTPUT10)'Turns the AC Motor On
Sleep(50)

For y=0 To CCWPos
While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
Sleep(10)
Wend
MSGBox "Input is off"
While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
Sleep(10)
Wend
MSGBox "Input is on"
y=y+1
Next y
CTPos=y
DeactivateSignal(OUTPUT9)
Deactivatesignal(OUTPUT10)'atc motor revirsing relay
End Function
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

#### TPS

• 1,452
##### Re: ATC Geneva wheel for mill
« Reply #9 on: April 05, 2018, 04:31:48 AM »
sorry seems i going to get bild

Function CW()'Rotation CW
Dim x As Integer
Dim CTPos As Integer 'Carrousel Tool Position Relative to OldTool Position
CTPos=0
ActivateSignal(OUTPUT9)'Turns the AC Motor On cw

Sleep(50)

For x=0 To CWPos
While IsActive(OEMTrig9)'Wait for OEMTrig9 is off
Sleep(10)
Wend
While NOT IsActive(OEMTrig9)'Wait for OEMTrig9 is on
Sleep(10)
Wend

x=x+1
Next x
this is wrong,not needed, the for next Loop is counting itselv.
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.