Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Probing calculations


Recommended Posts

I am trying to right a probing macro to determine the center of three pins that are not  a simple 120 degrees apart for fixture offsets.  The pins are equally spaced but not to  a three pin configuration.  Example: I may have 5 holes equally spaced on the part setting them at 72 degrees apart,  the fixture uses three pins to locate the part.  The first pin maybe  20 degree, the second at 92 degrees , and the third at  236.

The information I have  is as follows. 

Diameter of bolt circle 

angle that each pin is on 

 

I tried to write a macro program using  G65P9819 from  Renishaw but it will not work because I am only wanting to measure three pins not the five.  I am needing to probe each pin, store the variables for x and y as I probe each one, run a calculation to determine the center of them.  The problem is I am not sure what that calculation is.  Would anyone be able to help with this.

Thank you in advance.

 

Not asking for a program, I can write that. I just need a little help with the mathematical side.

 

I should probably add this is a 5 axis trunnion machine, and the fixture is not trammed to the center of  the rotary Axis, Wanting to know what it is off for the dynamic fixture offset.

 

Matt

Link to comment
Share on other sites

Basically, you need to do a boss measurement for each individual pin.  The calculation for the center of those pins, regardless of angle can be done using the general equation for a circle.

General equation for a circle.

(x−xc)^2+(y−yc)^2−r^2=0

Since you have probed the pin locations, and you know the bolt circle radius (r) the math is actually pretty easy, in fact all you would need is two pin locations and the radius and a general idea of where the center is.  But since you are probing three pins, disregard the radius and calculate the radius as well as the center locations.  It's high school level math, not trivial, but doable, it would easier if it was linear.  But basically you have three equations and three unknowns, plug, chug and solve, then turn it into code.

The math would be much easier if you do know an accurate pin circle diameter.  Then it is just two unknowns and two equations, much faster to solve and write into code.

Good luck.

 

PS - if you don't need to do this all the time, and only at setup, use excel to solve the location for you, spread sheet attached, its setup for a sphere, but it's the same thing, just punch in zero for z.  You will have to activate solver (option>add-ins>manage: (excel add-ins) > go >solver add-in check box), then once it is activated, you can press the solver button in the data tab.  It should be tee'd up and all you should have to do is press solve.  Inputs are green, and the solution will be found in the yellow.  Let me know if it doesn't work.

 

Also, you could find the center of the pins bolt circle using an indicator in the spindle if you wanted, might take a little bit, but you would just be sweeping the peaks until you get the same reading going over each pin.

 

Points Solver.xlsx

Link to comment
Share on other sites

Thank you Husker

 

Using the formula you gave me this is what I have got.  Not sure how to take the formula you have given me and put it in as Macro B.   Would you or anyone be able to share with me how  to do this in Macro B?  N40 is the calculation section. I entered the formula next to it. I understand the math not Macro B formulas so much.  This is to save time on setup from tramming  it in with an indicator.  System has over 100 pallets to calculate center on for setup.

 

O8600  
   
#630=0 CLEAR VARIABLES
#631=0
#632=0
#633=0
#634=0
#635=0
#636=0
#637=0
#638=0
#639=0
#640=0
#641=0
#642=0
#643=0
#644=0
#645=0
#646=0
#647=0
#648=0
#649=0
#650=0
#651=0
#652=0
#653=0
#654=0
#655=0
#645=0
#657=0
#658=0
#659=0
   
   
#3006=1 SET VARIABLE VALUES
(ENTER VARIABLES BELOW)
(#630 = Diameter of Bolt Circle Feature is on)
(#631 = Diameter of Boss or Bore)
(#632 = Use when a BORE is Measured)
(#633 = Use when  a BOSS is Measured)
(#634 = Angle of First Boss or Bore)
(#635 = Angle of SECOND Boss or Bore)
(#637 = Angle of THIRD Boss or Bore)
(#638 = ABSOLUTE Z REFERENCE OF SURFACE BOSS OR BORE IS ON)
(#639 = ANGLE OF SURFACE TO MEASURE Z)
   
   
T1 STANDARD PROGRAM START
M06
G17 G40 G49 G80
G91 G28 Z0.
G0 G90 G54 X0.Y0.
A0. B0.
G43 H1 Z10.
M01  
   
   
G0 B#639 POSITION  B0. TO SET Z SURFACE
X[#670/2] Y0. POSITION X AND Y TO PROBE POSITION
   
G65 P9832  PROBE ON
G65 P9810 Z[#638 + 2.] F100.  SAFE MOVE TO Z+2.
G65 P9811 Z0. R2. PROBE Z SURFACE LOOKING 2" IN ADVANCE
G65P9833 PROBE OFF
#640=#137 SET VARIABLE #640 TO Z MEASURED VALUE
   
   
G0 Z5. F100. Z CLEARANCE
B0. POSITION B TO 0
X[#630/2[COS[#634]]] Y[#630/2[SIN[#634]]] POSITION X AND Y TO FIRST PIN
   
   
IF[#672EQ1] GOTO N20 LOGIC TO DETERMINE IF A BOSS OR BORE
 
IF[#673EQ1] GOTO N10
 
#3001=1 (NOT ENOUGH INFORMATION TO CONTINUE)
   
   
N10 Boss Probe
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE PIN
G65 P9814 D#631 Z[#677+.2] R.25 MEASURE PIN
G65 P9833 PROBE OFF
#641=#135 STORE X VALUE IN #641
#642=#136 STORE Y VALUE IN #642
   
G0 Z5. F100. Z CLEARANCE
X[#630/2[COS[#635]]] Y[#630/2[SIN[#635]]] POSITION X AND Y TO SECOND PIN
   
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE PIN
G65 P9814 D#631 Z[#677+.2] R.25 MEASURE PIN
G65 P9833 PROBE OFF
#643=#135 STORE X VALUE IN #643
#644=#136 STORE Y VALUE IN #644
   
G0 Z5. F100. Z CLEARANCE
X[#630/2[COS[#636]]] Y[#630/2[SIN[#636]]] POSITION X AND Y TO THIRD PIN
   
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE PIN
G65 P9814 D#631 Z[#677+.2] R.25 MEASURE PIN
G65 P9833 PROBE OFF
#645=#135 STORE X VALUE IN #645
#646=#136 STORE Y VALUE IN #646
   
G0 Z5. F100. Z CLEARANCE
   
GOTO N30  
   
   
N20 BORE Probe
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE BORE
G65 P9814 D#631 MEASURE BORE
G65 P9833 PROBE OFF
#641=#135 STORE X VALUE IN #641
#642=#136 STORE Y VALUE IN #642
   
G0 Z5. F100. Z CLEARANCE
X[#630/2[COS[#635]]] Y[#630/2[SIN[#635]]] POSITION X AND Y TO SECOND BORE
   
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE BORE
G65 P9814 D#631 MEASURE BORE
G65 P9833 PROBE OFF
#643=#135 STORE X VALUE IN #643
#644=#136 STORE Y VALUE IN #644
   
G0 Z5. F100. Z CLEARANCE
X[#630/2[COS[#636]]] Y[#630/2[SIN[#636]]] POSITION X AND Y TO THIRD BORE
   
G65 P9832 PROBE ON
G65 P9810 Z[#640+1.] POSITION Z ABOVE BORE
G65 P9814 D#631 Z[#677+.2] R.25 MEASURE BORE
G65 P9833 PROBE OFF
#645=#135 STORE X VALUE IN #645
#646=#136 STORE Y VALUE IN #646
   
G0 Z5. F100. Z CLEARANCE
   
GOTO N30  
   
N30  
G91G28Z0. Z CLEARANCE
   
N40 CENTER CALULATION
  (#641-Xc)^2-(#642-Yc)^2-R^2=0
  (#643-Xc)^2-(#644-Yc)^2-R^2=0
  (#645-Xc)^2-(#646-Yc)^2-R^2=0
   
  (#643-Xc)^2-(#644-Yc)^2-R^2-(#641-Xc)^2-(#642-Yc)^2-R^2=0
  (#645-Xc)^2-(#646-Yc)^2-R^2-(#641-Xc)^2-(#642-Yc)^2-R^2=0
   
   
  CENTER OF X SET TO #657
  CENTER OF Y SET TO #658
   
#7001=[#5221-#657] SET VALUE OF X TO  #7001
#7002=[#5222-#658] SET VALUE OF Y TO  #7002
   
N50  
M30  
Link to comment
Share on other sites

Well it's not quite a simple as punching in the formula.   Ummm, give me a few days I can work the algebra and put in into a macro b format for you. 

How consistent is the pin circle radius?  Can we assume it is very consistent, say within a thou?  How close do you really need the offset to be?  If the pin circle radius is really close, it will save a pile of time math wise (at least with my math skills) to put it into an executable code form.

Link to comment
Share on other sites

Technically XYZ center of three points given a known radius.  You could in theory add as many points as you wanted to it, as long as you know the radius.  If you know the radius, you could in theory solve for that as well if you had four points, it is an iterative solver, so it would be and approximate fit.  Anyway, I set this up to use a ballbar to find a rotational center of a rotary table.  Given you know the radius from center of the base, (ballbar length) and the location you parked the spindle at. You can locate the ball bar base ball.  Move it a few times, and you can then calculate the center.

Link to comment
Share on other sites

Still don't have time to do the algebra, but there is an easier method to use than I described earlier.  You have three points on the radius.  If you calculate the intersection of the perpendicular bisectors of two of the chords you can create with the three points, you have the center.

https://math.stackexchange.com/questions/306468/perpendicular-line-passing-through-the-midpoint-of-another-line

The last equation on this page is the general form of the equation required for each perpendicular bisector.  Once you have the equation for both lines, just solve for X and Y two equations, two unknowns.  Really couldn't be easier algebra wise.  Anyway, not sure which of the three line combinations would be best, so if you are concerned about getting the most accurate result from the input information, I would do it all three ways, and check for variation between the results.  If it is miniscule, and likely it is, pick one and sweep the pins with an indicator.  Not 100% sure (logically/mathematically this is ringing a few bells in my head), but as all three points are involved, and because you have greater calculation precision than you can position to, it shouldn't matter which combo of points/lines you use.

Line combos are:  1) L1:(P1-P2)  L2:(P1-P3),  2) L1(P1-P2) L2:(P2-P3),  3) L1(P1-P3) L2:(P2-P3)

Hope this helps steer you in the right direction. Good Luck

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...