Hello Guest it is October 28, 2021, 12:09:39 PM

Author Topic: Axis A as a 4 axis angular move when i do a G31 Z-n command for probe  (Read 266 times)

0 Members and 1 Guest are viewing this topic.

Hello,

I have a mill with 3 axis x,y (axis C as a slave of y),z and recently i intalled a 4 axis (a angular axis) in my port A.

I adjusted this axis, but when i finised the autotool zero don't work fine:
when i want make the 0 for the axis, x, y, or z only axis A is moved.
-I can move well the axes x,y,z manually.
-when in the probe rutines i whan do G31 Z-n   or G31 X-n or G31 Y-n :
-with the axis A enabled: only axis A is moving until  i touch my probe , then axis A stop.
-with the axis A is disabled all works fine.

with the axis A activated I can put in the MDI for example G0 X50 or Y50 or Z50   it works fine. 
Or if i make a a reff all home, it works fine.
Only fail when  i want make a 0 tool

this is a sample for autotool:
rem save the actual veloticy
CurrentFeed = GetOemDro(818)
DoSpinStop()
Sleep(200)

ZMove = 20.00
YMove = 50.00
XMove = 50.00
ZOffset = 1.60
ZUp = 2.00

YRetorn = 10.00
XRetorn = 10.00

StopZMove = 0
StopYMove = 0
StopXMove = 0



rem axis Z

rem si no tenim entrada de la sonda getoembutton 825
rem fem un 0 de z dooembutton 1010

If GetOEMLed(825)=0 Then

   DoOEMButton(1010)
   Sleep(400)
rem stop the axus  2.5 seconds   
   Code "G4 P2.5"

  /*This is the problem when i make a G31 command only axis A move. In this case axis Z must move but when axis A
     is activated G31 works bad.*/
   Code "G31 Z-"&ZMove &"F30"
   
   While IsMoving()
      Sleep(400)
   Wend

/*for the next motion codes G0, G1... Z, Y or X axes works fine*/

rem agafem la posocio actual de leix z getvar 2002 i comprovem que no surti fora de rang sense haver detectat la sonda
rem a saber Var(2000) = X Var(2001) = Y Var(2002) = Z   
   Probepos = GetVar(2002)
   Sleep(400)
   If Probepos = -ZMove Then
     MsgBox("**Error**" &"4" &"Probe **ERROR**, NO HE DETECTAT LA SONDA")
     Sleep(1000)
     Code "G0 Z0"
     StopZMove = 1
     Code "F"&CurrentFeed
   End If
   
rem getdro 2=z 1=y 0=x   agafem la posicio de leix
   If StopZMove = 0 Then
      Probepos = GetDro(2)
      Sleep(400)
     
rem pugem 5mm leix z      
      Code "G0 Z"&ZUp
   
      While IsMoving()
        Sleep(400)
      Wend 
   
      Probepos = Abs(Probepos)
   
      Sleep(400) 
rem calculem loffset   
      Posicio = Probepos+ZOffset+ZUp
rem posem a leix z el valor que hem calculat 2=z, 1=y, 0=x   
      Call SetDro(2, Posicio)
   
      Sleep(400)
rem lhi fem un 0     
      Code "(Z zeroed)"
      Sleep(400)
rem retornem la velocitat guardada que tenia la maquina
      Code "F"&CurrentFeed
      Sleep(400)



anybody know how i can solve it?


Thanks,


Jaume