Hello Guest it is November 12, 2019, 09:36:19 PM

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

0 Members and 1 Guest are viewing this topic.

Re: center axis rotating axis
« Reply #10 on: March 12, 2018, 07:45:48 AM »
imposed diameter 50 mm
1 touch is withdrawn and second touch
2 rises 50mm (here 'should be half')
3 moves by 100 mm (too much travel)
4 goes down
5 touch is retracted and second touch
6 rises to 100mm (too much travel)

Offline TPS

*
  •  1,406 1,406
    • View Profile
Re: center axis rotating axis
« Reply #11 on: March 12, 2018, 07:51:08 AM »
imposed diameter 50 mm
1 touch is withdrawn and second touch
2 rises 50mm (here 'should be half')should be 0.5*Diameter + 10 now
3 moves by 100 mm (too much travel)should be Diameter + 30 now
4 goes down
5 touch is retracted and second touch
6 rises to 100mm (too much travel)should be 0.5*Diameter + 10 now


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 + (0.5*diameter) + 10
While IsMoving()
Wend

'Y behind part
Code "G0 Y" & Ypos + diameter + 30
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 + (0.5*diameter) + 10
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 #12 on: March 12, 2018, 08:04:45 AM »
OK !!! PERFECT
Many thanks