Hello Guest it is December 06, 2019, 05:21:57 AM

Author Topic: center axis rotating axis  (Read 1496 times)

0 Members and 1 Guest are viewing this topic.

center axis rotating axis
« on: March 11, 2018, 05:43:03 AM »
hello I would like to equip my machine with a macro to find center rotary axis (A) in automatic, the axis that should find the center and '"y", according to you and' possible?
Re: center axis rotating axis
« Reply #1 on: March 11, 2018, 05:45:44 AM »
I correct hello I would like to equip my machine with a macro to find the center central rotary axis (A) in automatic, the axis that should find the center and '"y", according to you and' possible?

Offline TPS

*
  •  1,413 1,413
    • View Profile
Re: center axis rotating axis
« Reply #2 on: March 12, 2018, 06:17:06 AM »
try this.
please test carefully, not tested.

y-axis must be in front of (-) part in a-axis, z-axis in height to probe.

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
  
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub




« Last Edit: March 12, 2018, 06:22:12 AM by TPS »
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: center axis rotating axis
« Reply #3 on: March 12, 2018, 06:45:25 AM »
thanks TPS for the answer the macro works, I have a height problem, I try to explain myself
1 the probe starts and first touch
2 back and second touch
3 gets up and is here 'that I have the problem, I'm at the end of the race, could you halve the climb? or could you set the macro starting up more or less in the middle?
with small diameters the macro is OK !! ;)

Offline TPS

*
  •  1,413 1,413
    • View Profile
Re: center axis rotating axis
« Reply #4 on: March 12, 2018, 06:47:14 AM »
here with half the height

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
   
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + (2*diameter)
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub





anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: center axis rotating axis
« Reply #5 on: March 12, 2018, 07:12:18 AM »
the first one worked better, the second one by height remained unchanged and the stroke increased when it passed over the piece.
to explain to me at first if you could halve the ascent
I hope to explain myself use google translator.

Offline TPS

*
  •  1,413 1,413
    • View Profile
Re: center axis rotating axis
« Reply #6 on: March 12, 2018, 07:22:36 AM »
sorry code was wrong , here the new one:

Code: [Select]

Sub Main()

'get Diameter from user
Begin Dialog TextBoxSample 16,30,180,96,"enter digfilename"
OKButton 132,20,40,14
Text 8,8,132,8,"Diameter of part:"
TextBox 8,20,100,12,.TextBox1
End Dialog
Dim Dlg1 As TextBoxSample

Dialog Dlg1
diameter = CDbl(Dlg1.TextBox1)

If diameter <=1 Then
MsgBox "Diameter wrong !"
Exit Sub
End If
  
Call SetDRO(0,0)
Call SetDRO(1,0)
Call SetDRO(2,0)

Xpos = GetParam("XDRO")
Ypos = GetParam("YDRO")
Zpos = GetParam("ZDRO")

Fcurr = GetParam("FeedRate")
SP = 80 ' avanzamento prima palp impostare diametro mm del cerchio da palpare
VSP = "F200" ' velocita avanzamento prima palp
bkSP = 3 ' ritorno dopo palp mm
VbkSP = "F240" ' velocita ritorno
Spp = 5 ' avanzamento seconda palp mm
VSpp = "F40" ' velocita seconda palp


Code "G31 Y" & (GetParam("YDRO")+SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")+Spp) & VSpp
While IsMoving()
Wend

B=GetParam("YDRO")

Code "G0 Y" & (GetParam("YDRO")-bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + (2*diameter)
While IsMoving()
Wend

'Z down
Code "G0 Z" & Zpos
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-SP) & (VSP)
While IsMoving()
Wend

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

Code "G31 Y" & (GetParam("YDRO")-Spp) & VSpp
While IsMoving()
Wend

A=GetParam("YDRO")
measuredY = B-A

Code "G0 Y" & (GetParam("YDRO")+bkSP) & (VbkSP)
While IsMoving()
Wend

'Z up
Code "G0 Z" & Zpos + diameter
While IsMoving()
Wend


Code "G0 Y" & (A+(B-A)/2)
SetParam("FeedRate",Fcurr)

MsgBox ("Measurement Y: " & nFmt(measuredY,3) & " mm")

End Sub





anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: center axis rotating axis
« Reply #7 on: March 12, 2018, 07:31:15 AM »
the height is not halved, at the end it goes to the end of the race at the top

Offline TPS

*
  •  1,413 1,413
    • View Profile
Re: center axis rotating axis
« Reply #8 on: March 12, 2018, 07:34:35 AM »
it should start with at z 0,

and raise z for the entered Diameter.

how much does z raise ?
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline TPS

*
  •  1,413 1,413
    • View Profile
Re: center axis rotating axis
« Reply #9 on: March 12, 2018, 07:43:30 AM »
or are we talking about y-axis distance ?
anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.