2001
VB and the development of wizards / Re: manual tool change
« on: February 22, 2018, 09:55:52 AM »
see next post
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
code "M5" ' fermo il motore
' controllo se la macchina è stata referenziata
If Not GetLed (7) Then ' è referenziato X
vxled = 1
End If
If Not GetLed (Cool Then ' è referenziato Y
vyled = 1
End If
If Not GetLed (9) Then ' è referenziato Z
vzled = 1
End If
Tled = vxled + vyled + vzled
If Tled = 3 Then ' se non sono referenziati X, Y e Z esco
' parametri lavorazione
xzero = GetDRO (30) ' memorizzo la posizione iniziale ASSOLUTA di cambio utensile
yzero = GetDRO (31)
zzero = GetDRO (32)
xpos = GetDRO (0) ' memorizzo la posizione inizioale RELATIVA di cambio utensile
ypos = GetDRO (1)
zpos = GetDRO (2)
fpos = GetDRO (18) ' memorizzo il feedrate iniziale
' variabili del programma
fmax = 400 ' imposto il feedrate massimo
fmin = 100 ' imposto il feedrate per la palpata
zavv = -50 ' distanza rapida di avvicinamento al palpatore
zmin = -80 ' profondità oltre il palpatore
xcut = 0 ' posizione X per cambio utensile
ycut = 0 ' posizione Y per cambio utensile
xtool = GetUserDRO (1200) ' posizione X del palpatore (Settings -> Tool Change Location)
ytool = GetUserDRO (1201) ' posizione Y del palpatore
ztool = GetUserDRO (1202) ' posizione Z del palpatore
' inizio programma
code "G0 F" & fmax ' porto il feedrate al valore massimo
code "G53 G0 Z0" ' porto Z a ZERO macchina
While IsMoving()
Wend
Call SetDro (2,0) ' porto il contatore Z a zero
code "G53 G0 X" & xtool & "Y" & ytool ' mi allineo sul palpatore
While IsMoving()
Wend
code "G0 Z" & zavv ' scendo in avvicinamento (fino a zavv)
While IsMoving()
Wend
code "G0 F" & fmin ' porto il feedrate al minimo
If IsSuchSignal (22) Then ' scendo sul palpatore per vedere la misura della punta attuale
code "G31 Z" & zmin
While IsMoving()
Wend
End If
zorig = GetVar(2002) ' memorizzo il valore di Z della punta attuale
code "G0 F" & fmax ' riporto il feedrate al massimo
code "G53 G0 Z0" ' porto Z a ZERO macchina
While IsMoving()
Wend
code "G53 G0 X" & xcut & "Y" & ycut ' vado in una posizione comoda per il cambio utensile
While IsMoving()
Wend
MsgBox ("Ora si può cambiare la punta")
Response = MsgBox ("E' stata cambiata la punta?", 4 , "ATTENZIONE")
If (Response = 6) Then
i = 99
Else
MsgBox ("Riprendo il lavoro con la punta iniziale")
End If
If i <> 99 Then ' non faccio nulla
code "G53 G0 X" & xzero & "Y" & yzero ' torno alla posizione X Y zero pezzo
While IsMoving()
Wend
code "G0 X" & xpos & "Y" & ypos ' torno alla posizione X Y da dove ero partito
While IsMoving()
Wend
code "G53 G0 Z" & zzero ' riporto Z al valore zero pezzo
While IsMoving()
Wend
Call SetDro (2,0) ' porto il contatore Z a zero
code "G0 Z" & zpos ' riporto Z al valore di partenza
While IsMoving()
Wend
code "G0 F" & fpos ' riporto il feedrate al valore di partenza
MsgBox ("Per riprendere il lavoro premere il pulsante 'LAVORAZIONE'")
code "M3" ' riaccendo il motore e riprendo il lavoro da dove l'avevo lasciato
Else
code "G53 G0 X" & xtool & "Y" & ytool ' mi allineo sul palpatore
While IsMoving()
Wend
code "G0 Z" & zavv ' scendo in avvicinamento
While IsMoving()
Wend
code "G0 F" & fmin ' porto il feedrate al minimo
If IsSuchSignal (22) Then ' scendo sul palpatore
code "G31 Z" & zmin
While IsMoving()
Wend
znew = GetVar (2002) ' memorizzo il valore di Z della nuova punta
code "G0 F" & fmax ' riporto il feedrate al massimo
code "G53 G0 Z0" ' ritorno Z ZERO macchina
While IsMoving()
Wend
End If
code "G53 G0 X" & xzero & "Y" & yzero ' torno alla posizione X Y zero pezzo
While IsMoving()
Wend
code "G0 X" & xpos & "Y" & ypos ' torno alla posizione X Y da dove ero partito
While IsMoving()
Wend
code "M3" ' riaccendo il motore
zdif = zorig - (znew) ' controllo se l'utensile è più corto o piu lungo
code "G53 G0 Z" & zzero-(zdif) ' riporto Z al valore zero pezzo con la differenza utensile
While IsMoving()
Wend
Call SetDro (2,0) ' porto contatore Z a zero
code "G0 Z" & zpos ' riporto Z al valore di partenza (inizio programma)
While IsMoving()
Wend
code "G0 F" & fpos ' riporto il feedrate al valore di partenza
MsgBox ("Per riprendere il lavoro premere il tasto LAVORAZIONE")
End If
' riprendo il lavoro da dove l'avevo lasciato
Else
MsgBox ("Per poter cambiare l'utensile bisognava prima aver referenziato la macchina")
End If
ok yes the values are inside
zdif = zorig - (znew) ' controllo se l'utensile è più corto o piu lungo
code "G53 G0 Z" & zzero-(zdif) ' riporto Z al valore zero pezzo con la differenza utensile
While IsMoving()
Wend
Call SetDro (2,0) ' porto contatore Z a zero
code "G0 Z" & zpos ' riporto Z al valore di partenza (inizio programma)
While IsMoving()
Wend
I dont think this problem is a big as you think with sensorless vector VFD, I once built a pump with that kind of VFD and it ran reliably down to 18 rpm with a load, or 1/100 of base speed. My machines also had to stop and line up with rails that plugged in. Taper your drive dogs as much as you can too, so you dont need to be perfect. Run the motor at the lowest possible speed and tell it to stop on the sensor. Worse that will happen is that it will overshoot a bit. As long as the overshoot is reliably consistent you can adjust sensor position to accomodate.
Another thought about this issue. Things like this work much better when they are designed to be extremely tolerant of misalignment rather than being very accurately made. So I htink a better approach here is to have the tool gripper mounted to be spring loaded upward. You press it against the spindle and if the dogs are not lined up the compressing of the spring triggers a limit switch that causes the spindle to rotate until the dogs drop into the slot and the limit switch then indicates that the alignment has been achieved, fasten the tool and retract the gripper. No spindle switch needed.
Sorry I do not have any photos.The way my BTC-1 does it is to inch the spindle and drop a shot pin into a ramped slot and when the shot pin reaches the bottom of the ramp/can't rotate anymore it sends a signal to stop inching and the spindle is orientated properly.
Mike
that is also a way i was thinking about. any photos ?
If yiou really need them I could take some this weekend.
Mike
The way my BTC-1 does it is to inch the spindle and drop a shot pin into a ramped slot and when the shot pin reaches the bottom of the ramp/can't rotate anymore it sends a signal to stop inching and the spindle is orientated properly.
Mike