Hello Guest it is May 26, 2022, 06:42:54 AM

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

0 Members and 1 Guest are viewing this topic.


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)

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

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()

/*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)
   If Probepos = -ZMove Then
     MsgBox("**Error**" &"4" &"Probe **ERROR**, NO HE DETECTAT LA SONDA")
     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)
rem pugem 5mm leix z      
      Code "G0 Z"&ZUp
      While IsMoving()
      Probepos = Abs(Probepos)
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)
rem lhi fem un 0     
      Code "(Z zeroed)"
rem retornem la velocitat guardada que tenia la maquina
      Code "F"&CurrentFeed

anybody know how i can solve it?