Hello Guest it is March 28, 2024, 12:30:32 PM

Author Topic: manual tool change  (Read 5367 times)

0 Members and 1 Guest are viewing this topic.

Re: manual tool change
« Reply #20 on: February 22, 2018, 03:45:44 PM »
ok, I try to explain
1 launch the script (0 piece)
2 the probe goes to x0 y0 z0 (all high)
3 drops down to touch
4 dates back to the tool change
5 changed tool drops up to touch
6 reposition to 0 piece, here the problem does not calculate the tool difference.
I hope I explained myself

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: manual tool change
« Reply #21 on: February 23, 2018, 01:58:36 AM »
hello,
this part is doing the lenght (height) correction

      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



when your are Debugging (stepping throught) the script,
and excecute this line:

      code "G53 G0 Z" & zzero-(zdif) ' riporto Z al valore zero pezzo con la differenza utensile


you should see a move from the z-axis with the difference of tool length

later in code, with this line:

      Call SetDro (2,0) ' porto contatore Z a Zero


z-axis dro gets zeroed.

and now, with this code:

      code "G0 Z" & zpos ' riporto Z al valore di partenza (inizio programma)


it will return to the z-height where it left for toolchange, but with the corrected z-axis.
(z-axis will Display the same value as before toolchange)
« Last Edit: February 23, 2018, 02:00:18 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: manual tool change
« Reply #22 on: February 23, 2018, 04:30:59 AM »
ok, if possible I would like to eventually correct the difference (without putting money!). it's possible to do it?

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: manual tool change
« Reply #23 on: February 23, 2018, 04:37:10 AM »
for the Moment i can not see the Problem.

in your Video you put a coin (or washer) for the probe of new tool,
so the toollength of new tool is LONGER (toollength = tool + thickness of coin),
and so it is locic that machine is stopping higher at the end.
this difference is the thickness of the coin.

----ok, if possible I would like to eventually correct the difference (without putting money!). it's possible to do it?

what do you mean with this?
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: manual tool change
« Reply #24 on: February 23, 2018, 04:57:31 AM »
ok I try to explain myself
1 from scratch piece macro launch
2 goes to position and makes the first palpate
3 change tip and second palpate
4 return to zero piece, here it goes to 0 piece but does not calculate the difference between the two tips, in practice it returns to zero piece with the measure of the first tip

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: manual tool change
« Reply #25 on: February 23, 2018, 05:02:21 AM »
then you have only to comment out These code


'      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


anyway this does not make sense to me.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: manual tool change
« Reply #26 on: February 23, 2018, 05:12:01 AM »
the machine returns to 0 piece the DRO scores 0
but the tip does not change the difference between the first palpate and the second
I try to explain better, if the second tip is 1mm shorter at the end the machine is positioned on zero piece x0 y0 z0 (the dro are all at 0) but physically the tip remains 1mm higher than 0 piece

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: manual tool change
« Reply #27 on: February 23, 2018, 05:22:21 AM »
again,

if you put a coin (or washer) on your touch plate tip will be LONGER not SHORTER,
so machine has to stop higher (thickness of coin or washer).
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: manual tool change
« Reply #28 on: February 23, 2018, 05:48:20 AM »
ok I thank TPS for the patience and availability offered.

I solved by deleting the two lines:

code "M5" ' fermo il motore
code "M3" ' riaccendo il motore

I do not know why (maybe they were in conflict?) when I was doing the tests, the inverter was off, the macro with working voice warnings was set

 Rem  MANUAL TOOL CHANGE   
Speak ("confermare cambio utensile automatico") 'Avviso Vocale
Message "************  INIZIO CAMBIO UTENSILE ************"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CAMBIO UTENSILE AUTOMATICO")


' Condizioni macchina:
' Zero macchina X dietro Y sinistra Z in alto
' Asse X, sinistra -X destra +X
' Asse Y, dietro +Y avanti -Y
' Asse Z, alto +Z basso -Z
' Abilitare l'ingresso PROBE (port 1 pin 10)(Config | Input Signal)
'
' condizioni di lavoro iniziali:
' 1) Referenziare a ZERO macchina
' 2) Azzerare i contatori
' 3) Portarsi sullo Zero pezzo
' 4) Azzerare i contatori
' 5) Inizio lavorazione



' controllo se la macchina è stata referenziata

If Not GetLed (7) Then ' è referenziato X
vxled = 1
End If

If Not GetLed (8) 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 *********xx

' 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 = 300 ' imposto il feedrate massimo
fmin = 100 ' imposto il feedrate per la palpata

zavv = -50 ' distanza rapida di avvicinamento al palpatore
zmin = -140 ' 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 = GetDRO (2) ' 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

Speak ("ora si puo' cambiare la punta") 'Avviso Vocale
MsgBox ("ORA SI PUO' CAMBIARE LA PUNTA")

Speak ("attenzione      e' stata sostituita la punta") 'Avviso Vocale
Response = MsgBox ("E' STATA SOSTITUITA LA PUNTA?", 4 , "ATTENZIONE")
If (Response = 6) Then
i = 99
Else
Speak ("ATTENZIONE , LA PUNTA NON E' STATA SOSTITUITA, RIPRENDO IL LAVORO CON LA PUNTA INIZIALE") 'Avviso Vocale
MsgBox ("RIPRENDO IL LAVORO CON LA PUNTA INIZIALE")
Message "********* CAMBIO UTENSILE NON EFFETTUATO  *********"
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
Speak ("ATTENZIONE , CAMBIO UTENSILE NON EFFETTUATO , SI PUO' RIPRENDERE LA LAVORAZIONE") 'Avviso Vocale
MsgBox ("Per riprendere il lavoro premere il pulsante 'LAVORAZIONE'")


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 = GetDRO (2) ' 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



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
Speak ("CAMBIO UTENSILE EFFETTUATO ,   SI PUO' RIPRENDERE LA LAVORAZIONE ,      RIMUOVERE PIASTRA") 'Avviso Vocale

MsgBox ("RIMUOVERE PIASTRA E PREMERE IL TASTO LAVORAZIONE")
Message "************ CAMBIO UTENSILE EFFETTUATO ************"

End If

' riprendo il lavoro da dove l'avevo lasciato