Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: mike^3 on February 07, 2015, 08:21:52 AM
-
;D
Hello, I am retrofitting a cnc knee mill with a tool changer that has some kind of switched logic, can anyone help me figure it out?
It is basically like a rotary encoder with logic from the switched that indicate tool position, there are 24 tools...
here is a small video I made https://www.youtube.com/watch?v=OsBAYHpI6es
thanks for any help!
-
That style tool changer with Dark logic encoding with SWITCHES will make you pull your hair out handfulls at a time (;-). Trust me on that (;-)
I would remove the old Drive motor assembly and switches and run the tool changer with a simple stepper motor . PUT 1 home switch in to set the Tool Changer HOME position, normally the tool #1 position.
Is that a single arm changer that changes one tool at a time OR is it a Hot Swap where it removes 1 tool and installs another in the same cycle. I can't tell from the Video what you have.
IF it is a HOT swap then you will have to develope the Macro Logic to do the Hotswap. (Remove 1 tool from the carasel slot and install a different tool back in the same slot.
Could you show some more video of the change arm and spindle area ?
(;-) TP
(;-) TP
-
Hi! Sure I can take some more video tonight, I think the operation of the tool changer is. Z to tool chage position(switch to indicate tool change position) then run swing arm motor till a switch is triggered, then stop tool changer motor arm, then activate tool changer fingers extension, then activate air cylinder that lowers arm (pulls out tool) then activate tool changer arm motor (moves to tool changer carousel) then de activate arm lowering cylinder (pulls tool into carousel) then deactivate fingers (restracts) then spin carousel to new tool, then reverse the previous steps.
I do also think it would be a lot easier to mount a stepper motor on the bottom with a home switch (one of the pre existing switches at the top! Lol), but the problem is that I have a csmio A driver for analog +-10 volt drives, which means I have to buy amother drive and motor :( just for the tool changer, I have a ton of steppers laying around, maybe a gecko drive and keling servo would work...?
-
If you are running the machine with the CSMIO then you cannot run the LPT driver so you have no where to hook another drive. You will have to run the Tool Changer servo from the CSMIO as well.
The other option would be to run a stepper from a PLC. BUT that can be as expensive and a lot harder to do(ladder logic) as the NEW driver/servo route.
(;-) TP
-
Could I just use 24 inputs? One input per tool position, then just run the tool changer till it hits the right input, the initiate tool change?
Scratch that only got 24 inputs :(
-
Having a tool changer on a knee mill is a blessing I would spring for a new drive and servo to run it. A good tool changer can be your BEST FRIEND spend a little cash on him he is worth every dollar. (;-)
(;-) TP
-
Thank u ;), any idea where I can get a good servo and drive that talKS +-10 volts for input? I
-
The original turret and toolposts on my lathe worked in a similar manner with regards the tool signals, ie there were 3 limit switches and depending on their sequence you knew which position it was at.
Mine was only 6 pos for the turret and 4 pos for the toolpost hence only 3 switches on each required for the position.
They were hydraulically driven so that side was a bit different but it worked extremely well with the exception of it having to lock at each position before unclamping and moving to the next before eventually getting to the desired position. That was because of the hydraulics as they were rack and pinion driven, so that would not be an issue with your setup.
I used a PLC as it is a lot quicker than VB and also because Ladder Logic is much easier for me than VB :)
Another option is to use an Indexing Servo drive but if going down the servo route, and as you have an IP-A, then I think just using a normal +/- 10v servo would be best.
If its a choice between a servo and a PLC then probably the Servo is the best option and you can usually pick them up on eBay at a reasonable cost second hand which will likely work out cheaper, or as cheap, as a PLC.
I have used Allen Bradley DSD drives, they can be used in Step/Dir or Analogue and if the Sercos or Indexing drive then can additionally be used as indexing drives. If going that route just make sure you get a motor and drive that are matched.
Hood
-
YEP on what HOOD said.
(;-) TP
-
My thoughts pretty spot on! :)
I would like to first try the VB, then if that doesnt work then just get a servo, the issue is that I love retrofitting machines, and always buying and putting servos on the tool changers are not always possible without heavy modification.
What size servo do you think I would need to move the umbrella? I was thinkinkg like a 200 watt motor? the current motor is a single phase motor with a gear reduction,
-
Work out what the original motors torque was then multiply by the reduction of the gearbox. If going direct drive then it may require a fair bit more than a 200w motor, if using the original gearbox then it may be fine.
Hood
-
Thanks hood ;) if I remember right u have a csmio also right?
-
Yes, have the IP-S on the wee lathe and the IP-A on the Chiron VMC. When threading gets sorted, either in Mach3 or probably have to wait for Mach4, I will be putting an IP-A on the big lathe.
Hood
-
Awesome, ya I'm gonna stick mach3 on the mill then when mach 4 is up and running then switch over..
-
hi
You can do as it Hurco magazine 20 tools
- Have a position sensor on the tool T20
- The engine turns 60W 200V and has a sensor that checks performed rotation of 360 degrees
the rest is just a VB macro that will look for the path to the tool change
-
Not sure how I could write that.... in vb
-
macro to return the tool from the spindle to the magazine
example, of course,
'---------------------------------------------------------------------------------------------------------------
' oddanie narzędzia z wrzeciona do magazynu
' andmar2005
'---------------------------------------------------------------------------------------------------------------
Dim a, b, c
' ----------------------------------------------------------------------------
magazyn_zbazowanie
powietrze_C
wrzeciono_0
T_wrzeciono = GetUserLabel(9)
pozycja_magazyn = GetUserLabel(10)
If (pozycja_magazyn = T_wrzeciono) Then
Sleep(50)
Message("Oddaje narzędzie")
Oddaje
SetUserLabel(9,0)
Sleep(50)
End
End If
If (T_wrzeciono =0) Then
Sleep(150)
Message("Co mam Oddać jest T" & nowe_T)
Sleep(150)
End
End If
a=GetUserLabel(10) 'pozycja magazynu
b=GetUserLabel(9) ' T w wrzecinie
c=20 'ilość narzędzi w magazynie
x= a-b
y= b-a
' ----------------------------------------------------------------------------
If x<0 Then
z= x+c
End If
If x>0 Then
z= x
End If
' ----------------------------------------------------------------------------
If y<0 Then
t= y+c
End If
If y>0 Then
t= y
End If
' ----------------------------------------------------------------------------
If t>z Then ' w lewo
W_lewo
End If
If t<z Then ' w prawo
W_prawo
End If
' ----------------------------------------------------------------------------
If t=z Then ' warunek specjalny poniewaz mamy parzysta wartosc narzedzi
W_prawo
End If
Oddaje
End
' ----------------------------------------------------------------------------
'Oddaje narzędzie do magazynu
Sub Oddaje()
Code "G53 Z4 F2000" ' pozycja wymiany narzędzia
While IsMoving()
Sleep(50)
Wend
Sleep(20)
Code "G90"
ActivateSignal(OUTPUT13) 'Magazyn w prawo
If(Not GetUserLed(1307)) Then 'Sprawdzam czy jest w prawo
While GetUserLed(1307) =0
Sleep(20)
Wend
End If
DeActivateSignal(OUTPUT13)
Sleep(20)
ActivateSignal(OUTPUT16)'Blokada narzędzia - odblokuj
If(Not GetUserLed(1305)) Then 'Sprawdzam czy odblokował
While GetUserLed(1305) =0
Sleep(20)
Wend
End If
ActivateSignal(OUTPUT15)'Magazyn w dół
If(Not GetUserLed(1309)) Then 'Sprawdzam czy jest w dół
While GetUserLed(1309) =0
Sleep(20)
Wend
End If
DeActivateSignal(OUTPUT16)'Blokada narzędzia - zablokuj
Sleep(20)
DeActivateSignal(OUTPUT15)
Sleep(20)
ActivateSignal(OUTPUT12)'Magazyn w lewo
If(Not GetUserLed(1306)) Then 'Sprawdzam czy jest w lewo
While GetUserLed(1306) =0
Sleep(20)
Wend
End If
DeActivateSignal(OUTPUT12)
ActivateSignal(OUTPUT14)'Magazyn w góre
If(Not GetUserLed(1308)) Then 'Sprawdzam czy jest w góre
While GetUserLed(1308) =0
Sleep(20)
Wend
End If
DeActivateSignal(OUTPUT14)
Sleep(20)
Message("ODDAŁEM NARZĘDZIE T" & T_wrzeciono)
Sleep(50)
SetUserLabel(9,0)
czekam_na_wykonanie
End Sub
' ----------------------------------------------------------------------------
'Magazyn obraca sie w lewo
Sub W_lewo()
While (Not Szukam_T)
nrT_M = GetuserLabel(10)
ActivateSignal(OUTPUT18)' rozładowanie kondensatora - wylączone
Sleep(50)
SetUserLabel(11,"L")
ActivateSignal(OUTPUT10)
Sleep(800)
If(Not GetUserLed(1301)) Then
While GetUserLed(1301) =1
Sleep(10)
Wend
End If
DeActivateSignal(OUTPUT10) ' obroty w lewo - wyłączone
Sleep(50)
DeActivateSignal(OUTPUT18) 'rozładowanie kondensatora - wlączone
Sleep(20)
ActivateSignal(OUTPUT11)' obroty w prawo - włączone w celu wychamowania silnika
Sleep(50)
DeActivateSignal(OUTPUT11)' obroty w prawo - wyłączone
SetUserLabel(10,(nrT_M - 1))
Sleep(15)
a=GetuserLabel(10)
If a=0 Then
SetuserLabel(10,c)
End If
SetUserLabel(11,"")
If(GetuserLabel(10) = T_wrzeciono) Then
Szukam_T = true
End If
Sleep(50)
Wend
End Sub
' ----------------------------------------------------------------------------
'Magazyn obraca sie w prawo
Sub W_prawo()
While (Not Szukam_T)
nrT_M = GetuserLabel(10)
ActivateSignal(OUTPUT18)' rozładowanie kondensatora - wylączone
Sleep(50)
SetUserLabel(12,"")
ActivateSignal(OUTPUT11)
Sleep(800)
If(Not GetUserLed(1301)) Then
While GetUserLed(1301) =1
Sleep(10)
Wend
End If
DeActivateSignal(OUTPUT11) ' obroty w lewo - wyłączone
Sleep(50)
DeActivateSignal(OUTPUT18) 'rozładowanie kondensatora - wlączone
Sleep(20)
ActivateSignal(OUTPUT10)' obroty w prawo - włączone w celu wychamowania silnika
Sleep(50)
DeActivateSignal(OUTPUT10)' obroty w prawo - wyłączone
SetUserLabel(10,(nrT_M + 1))
Sleep(15)
a=GetuserLabel(10)
If a=c+1 Then
SetuserLabel(10,1)
End If
SetUserLabel(12,"")
If(GetuserLabel(10) = T_wrzeciono) Then
Szukam_T = true
End If
Sleep(50)
Wend
End Sub
' ----------------------------------------------------------------------------
'Sprawdzam zbazowanie magazynu
Sub magazyn_zbazowanie()
If GetUserLed(1032) =0 Or GetUserLabel(10) = "" Then
okno = MsgBox("MAGAZYN BRAK ZBAZOWANIA"& Chr(10) &""& Chr(10) &">> ZBAZUJ MAGAZYN <<" ,16, "BAZOWANIE MAGAZYNU")
Sleep(50)
End
End If
End Sub
' ----------------------------------------------------------------------------
' Jesli narzedzie to T0 w wrzecionie
Sub wrzeciono_0 ()
If GetUserLabel(9) = 0 Then
okno = MsgBox("CO MAM ODDAĆ "& Chr(10) &""& Chr(10) &">> WRZECIONO JEST PUSTE <<" ,16, " **** T0 **** ")
Sleep(50)
End
End If
End Sub
' ----------------------------------------------------------------------------
' Jesli brak ciśnienia powietrza
Sub powietrze_C ()
If GetUserLed(1005) = 1 Then
okno = MsgBox("Brak ciśnienia "& Chr(10) &""& Chr(10) &">> POWIETRZA <<" ,16, " POWIETRZE ")
Sleep(50)
End
End If
End Sub
' ----------------------------------------------------------------------------
Sub czekam_na_wykonanie ()
While IsMoving()
Sleep(50)
Wend
End Sub
'------------------------------------------------------------------------------