Macro Programming Fundamentals - Page 27

1. Cast Iron
Join Date
Jan 2003
Location
Tel Aviv, Israel
Posts
493
Post Thanks / Like
Likes (Given)
61
79
Originally Posted by Tonytn36
Just a shot in the dark, anyone got a probing macro to determine center of a circle from 3 touches handy? Fanucese.
Contact me on PM.

2. Titanium
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
3,050
Post Thanks / Like
Likes (Given)
581
1537
Originally Posted by sinha
.....Yes, 3 touches are sufficient to locate the center.
I think there will be a small error in the result due to the calculations assumption that the tip contacts the bore at tangent points of 120 degrees during the vector move. I think this is probably small enough that most users would not be bothered.

3. Diamond
Join Date
Dec 2007
Location
Southeastern US
Posts
6,266
Post Thanks / Like
Likes (Given)
761
2645
Originally Posted by PROBE
Contact me on PM.
Your PM box is too full to accept messages.

4. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by Vancbiker
I think there will be a small error in the result due to the calculations assumption that the tip contacts the bore at tangent points of 120 degrees during the vector move. I think this is probably small enough that most users would not be bothered.
Hello Kevin,
Mathematically it wouldn't matter if the three points were within 1 degree of one another,the result would be accurate. The inaccuracy of using closely space coordinate points would be more positioning system related. Accordingly, if the spacing was 0, 110 and 245deg, the result would be just as good as with spacing of 0, 120 and 240deg.

Regards,

Bill

5. Originally Posted by Tonytn36
Just a shot in the dark, anyone got a probing macro to determine center of a circle from 3 touches handy? Fanucese.
Here you go...
MAIN
%
O1000(FIND HOLE CENTRE)
G65P8001S1
(G54=1)
(G55=2)
(G56=3)
(G57=4)
(G58=5)
(G59=6)
M30
%

SUB

%
O8001(FIND CENTRE MACRO)
#3006=1(PUT EDGE FINDER IN)
#3006=2(TOUCH 1ST POINT)
#3006=3(PRESS CYCLE START)
#1=#5021(FIRST X)
#2=#5022(FIRST Y)
#3006=4(TOUCH 2ND POINT)
#3006=5(PRESS CYCLE START)
#3=#5021(2ND X)
#4=#5022(2ND Y)
#3006=6(TOUCH 3RD POINT)
#3006=7(PRESS CYCLE START)
#5=#5021(3RD X)
#6=#5022(3RD Y)
(BISECT #1,#2,#3,#4)
#7=[#3+#1]/2
#8=[#4+#2]/2
#9=#3-#1
#10=-[#4-#2]
(BISECT #3,#4,#5,#6)
#11=[#5+#3]/2
#12=[#6+#4]/2
#13=#5-#3
#14=-[#6-#4]
(CALCULATE INTERSECTION)
(X CENTRE)
#15=[#8*#10*#14+#11*#10*#13-#7*#9*#14-#12*#10*#14]/[#10*#13-#9*#14]
(Y CENTRE)
#16=[#15-#7]*#9/#10+#8
#[5201+[20*[#19]]]=#15(X CENTRE)
#[5202+[20*[#19]]]=#16(Y CENTRE)
#3006=8(MOVE OUT OF JOB)
#3006=9(END OF PROGRAM)
M99
%

The notes were pretty much there just for me while I was digging through it... As you can see this is if you do it manually with your edge finder.

6. Cast Iron
Join Date
Jan 2003
Location
Tel Aviv, Israel
Posts
493
Post Thanks / Like
Likes (Given)
61
79
Originally Posted by Tonytn36
Your PM box is too full to accept messages.

7. Titanium
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
3,050
Post Thanks / Like
Likes (Given)
581
1537
Hi Bill,

I've attached a simple sketch to attempt to illustrate the error I think will occur when a 3 point probe routine is performed inside a bore of unknown position.

Does this make sense?

8. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by Vancbiker
Hi Bill,

I've attached a simple sketch to attempt to illustrate the error I think will occur when a 3 point probe routine is performed inside a bore of unknown position.

Does this make sense?
Hello Kevin,
Not really. When the Probe Stylus makes contact with the circumference of the bore, the Probe's circumference will be tangent with that of the bore (within the positioning limits of the machine). The speed at which the probe made contact would have a bearing on the result and therefore, if the bore position and diameter is unknown, then a second touch after the circumference has been found would be in order.

The attached picture shows the same circle centre obtained with 3 points incrementally 120degs apart (Yellow Circles) and 3 points grouped close together. Given that both sets of 3 circles (Probe Stylus) are tangent to the White Circle, then the centre coordinates of the Green Circle will be the same for each set of 3 points.

Regards,

Bill

9. Cast Iron
Join Date
Jan 2003
Location
Tel Aviv, Israel
Posts
493
Post Thanks / Like
Likes (Given)
61
79
Originally Posted by angelw
Hello Kevin,
Not really. When the Probe Stylus makes contact with the circumference of the bore, the Probe's circumference will be tangent with that of the bore (within the positioning limits of the machine). The speed at which the probe made contact would have a bearing on the result and therefore, if the bore position and diameter is unknown, then a second touch after the circumference has been found would be in order.

The attached picture shows the same circle centre obtained with 3 points incrementally 120degs apart (Yellow Circles) and 3 points grouped close together. Given that both sets of 3 circles (Probe Stylus) are tangent to the White Circle, then the centre coordinates of the Green Circle will be the same for each set of 3 points.

Regards,

Bill
The problem is, that when probing 3 point circle and not starting from circle center but from arbitrary point even close to the center, the contact point between probe's sphere circumference and bore's inner wall is not what one expected based on approach angle. Therefore the result will include some error. In order to minimize this error the circle routine has to be repeated several times, each time starting from just calculated last center position. One can observe, that the differences between each set of starting point and just calculated point will be smaller and smaller.

10. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by PROBE
The problem is, that when probing 3 point circle and not starting from circle center but from arbitrary point even close to the center, the contact point between probe's sphere circumference and bore's inner wall is not what one expected based on approach angle. Therefore the result will include some error. In order to minimize this error the circle routine has to be repeated several times, each time starting from just calculated last center position. One can observe, that the differences between each set of starting point and just calculated point will be smaller and smaller.
Hello Probe,
Yes, I understand that and for that reason, my comment regards Positioning in my first Post. Accordingly, it seems that we are in agreement that its a positioning issue rather than whether the routine considers the probe "contacts the bore at tangent points of 120 degrees". Corresponding with your Post, if each point is approached along the line from the bore center to a point where the Probe is tangent to the Bore, then the result will be the same whether the three points are close together, or equally spaced at 120degs.

Regards,

Bill

11. Titanium
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
3,050
Post Thanks / Like
Likes (Given)
581
1537
My comment was based on Tonytn36's request
anyone got a probing macro to determine center of a circle from 3 touches handy?
From that, I assume he does not know where the circle center is and will be starting his probing from some position approximately in the circle center. That is when the result will have a small error from the probe contact not being tangent to the motion vector.

In his case, a 4 point routine will give better results.

12. Diamond
Join Date
Dec 2007
Location
Southeastern US
Posts
6,266
Post Thanks / Like
Likes (Given)
761
2645
Originally Posted by Vancbiker
My comment was based on Tonytn36's request

From that, I assume he does not know where the circle center is and will be starting his probing from some position approximately in the circle center. That is when the result will have a small error from the probe contact not being tangent to the motion vector.

In his case, a 4 point routine will give better results.
Agreed. The question is whether the error would be considered significant to the application. I haven't done the CAD yet to determine that.

I'm probing a 0.852" bore with a 6 mm ball. I'll be within 0.040" of center to start with. I'll have to lay that out and see how much error is possible and whether that error is acceptable. I'm believe it will be acceptable, but I have to check.

13. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by Vancbiker
My comment was based on Tonytn36's request

From that, I assume he does not know where the circle center is and will be starting his probing from some position approximately in the circle center. That is when the result will have a small error from the probe contact not being tangent to the motion vector.

In his case, a 4 point routine will give better results.
Hello Kevin,
With regards to your sketch shown in Post#527, reproduced below, are you saying that:
1. a geometric error occurs due to the probe not feeding along the path from the true circle centre to be tangent with the bore circumference,

or

2. that the coordinates captured when the probe is triggered won't represent the probe being tangent to the bore due to mechanical issues?

Regards,

Bill

14. Titanium
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
3,050
Post Thanks / Like
Likes (Given)
581
1537
Hi Bill,

#1 is what I was trying to explain.

15. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by Vancbiker
Hi Bill,

#1 is what I was trying to explain.
Hi Kevin,
A geometric error implies that the error amount could be calculated based on the actual angle of approach and the angle of approach from the centre of the circle. This is not the case.

Tony’s application is very similar to a project I worked on a few years ago; in fact I Posted the Macro used to find the circle centre based on a circumference through three point on this Forum. In a perfect world, if the coordinate of the Probe centre was exactly the trigger point of the Probe when it made contact with the bore circumference, then it would be irrelevant how, and from what direction the Probe travelled to get there. The only thing that is important is the coordinates of the Probe Centre.

The method described earlier uses the Chord method, where effectively, two Chords are created from the Three Points and the intersection of the perpendicular bisectors used to determine the arc, or circle centre.

In the not so perfect world, the error that actually results through approaching the bore circumference along a path other than one from the true center of the bore is due to mechanical error. The Standard Renishaw Probe is a mechanical trigger and will give varying results when not feeding perpendicular onto a surface. The picture below shows an exaggerated scenario of the Probe approaching along an acute path angle to the circumference (along the Red arrow), demonstrating what could be described as a Glancing Contact with the circumference. Renishaw also have a High Accuracy Probe that is not a Mechanical Trigger and yields better results.

I used the same technique described by PROBE in an earlier Post, where subsequent iterations of the Circle Thru 3 Points routine use the previous centre result to improve the accuracy. My tests used:

1. True Bore centre coordinates obtained with a dial indicator for comparison.
2. First iteration of the Circle Thru 3 Points routine executed from a point far from the true bore centre.
3. The Centre Coordinates resulting from each iteration of the Circle Thru 3 Points routine, used in the next iteration.
4. A Renishaw Standard Accuracy Probe.

From the above test, I found that:
1. the correct position of the Probe, within the Least Programmable Increment of the control, was achieved on the third iteration of the Macro.
2. small position errors of the Probe result in relatively large errors for the Arc/Circle centre.
3. the larger the circle diameter, the larger the centre coordinate error
4. three point from within a 90deg sector resulted in greater errors than points from a sector of => 180degs.

Three points at 60degs, 80degs, 110degs at a radius of 185mm, shifted X+0.001, Y-0.001 and X-0.001 respectively, results in a centre error of X-0.001, Y-0.016; an error far greater than the Probe position errors equal to the Least Programmable Increment of the control.

Regards,

Bill

16. Titanium
Join Date
Jan 2014
Country
UNITED STATES
State/Province
Washington
Posts
3,050
Post Thanks / Like
Likes (Given)
581
1537
Hi Bill,

My understanding of this is far less than yours. My thoughts and presumed grasp of this is from a situation I was asked to look into several years ago. It's a long story, but the gist was that machining results differed between operators of the same workpieces on the the same machine.

The parts were investment castings that had been "best fit" target machined with 3 pads and 2 bores. The pads were probed and the part rotated (5 axis machine)to set the resulting plane perpendicular to the spindle. The operator then manually positioned the probe near the center of one of the bores. The probing routine then probed both bores to establish the coordinate system. Then some finish machining was performed. A CMM operation then checked the newly finished details back to the target bores and pads to verify that the newly finished details could be used as datums so the targets could be machined away in subsequent operations.

One operator was using a scale to check how close he positioned the probe in the center of the first bore and worked to center within ~1mm. The other operator just "eyeballed" the probe into the center. Initially no one thought that the differing techniques would cause the variation since the probe was "supposed" to find the center based on the 3 touches. A bit of testing, demonstration, and discussion convinced the manager to switch to a 4 point routine. The final result was that operator influence to the process stability was greatly reduced.

Sorry, it still ended up a long story.

17. Titanium
Join Date
Sep 2010
Location
Victoria Australia
Posts
3,112
Post Thanks / Like
Likes (Given)
0
1216
Originally Posted by Vancbiker
Hi Bill,

My understanding of this is far less than yours. My thoughts and presumed grasp of this is from a situation I was asked to look into several years ago. It's a long story, but the gist was that machining results differed between operators of the same workpieces on the the same machine.

The parts were investment castings that had been "best fit" target machined with 3 pads and 2 bores. The pads were probed and the part rotated (5 axis machine)to set the resulting plane perpendicular to the spindle. The operator then manually positioned the probe near the center of one of the bores. The probing routine then probed both bores to establish the coordinate system. Then some finish machining was performed. A CMM operation then checked the newly finished details back to the target bores and pads to verify that the newly finished details could be used as datums so the targets could be machined away in subsequent operations.

One operator was using a scale to check how close he positioned the probe in the center of the first bore and worked to center within ~1mm. The other operator just "eyeballed" the probe into the center. Initially no one thought that the differing techniques would cause the variation since the probe was "supposed" to find the center based on the 3 touches. A bit of testing, demonstration, and discussion convinced the manager to switch to a 4 point routine. The final result was that operator influence to the process stability was greatly reduced.

Sorry, it still ended up a long story.

Hi Kevin,
I agree 100% with what you found, assuming that the 3 point routine wasn't run multiple times, using an ever improving vector moves in each iteration, to improve the accuracy. The results on the same machine, using the same equipment will vary when using the 3 point routine starting from varying degrees of Off Centre for each application.

The 4 point routine uses the average of two touches along each axis to get the circle centre. This method is inherently more accurate as the position is only considered in one axis for each leg of the routine, ie, the points on opposite sides of the circle of the Y axis and the same for the X axis. Even if the two touches of the first leg are made starting with the axis not being considered way off centre (the X axis way off centre when the Y touches are being made) the error along the first leg will be very similar on the opposite sides of the bore and then the Mid Point of the two touches is calculated to get the circle centre in that axis.

The touches made along the second leg of the routine will be made with the axis not being considered accurately positioned to the circle centre of that axis (Y axis if that was the first leg axis).

Regards,

Bill

18. Diamond
Join Date
Dec 2007
Location
Southeastern US
Posts
6,266
Post Thanks / Like
Likes (Given)
761
2645
I found a little CAD time today and did some calculations. The potential error was excessive for the tolerance I need. (Greater than 10% of my tolerance).

19. Cast Iron
Join Date
Jan 2003
Location
Tel Aviv, Israel
Posts
493
Post Thanks / Like
Likes (Given)
61
79
Originally Posted by angelw

...

In the not so perfect world, the error that actually results through approaching the bore circumference along a path other than one from the true center of the bore is due to mechanical error. The Standard Renishaw Probe is a mechanical trigger and will give varying results when not feeding perpendicular onto a surface. The picture below shows an exaggerated scenario of the Probe approaching along an acute path angle to the circumference (along the Red arrow), demonstrating what could be described as a Glancing Contact with the circumference. Renishaw also have a High Accuracy Probe that is not a Mechanical Trigger and yields better results.

...
Regards,

Bill
The repeatability of both "Standard" and "High Precision or Rengage" Renishaw probes is mainly dependent on ability of the probe to return to same basic position after being deflected. In both types of probes the MECHANICAL kinematic setup is executing this task. The generation of the trigger however is different in the two types: In the "Standard" probe deflection of the stylus causes the normally close contact (or one of the six contacts in fact)to open, while in "High Precision" probe same deflection causes the inner strength gage to build up the voltage which at preset threshold causes the trigger. Those two different types of the generation of the trigger have in fact quite marginal impact on probes repeatability: one micron for "Standard" probe vs quarter micron for "High precision" probe. The error generated in measuring of bore using 3 points is way beyond that.

20. Plastic
Join Date
Dec 2017
Country
INDIA
Posts
2
Post Thanks / Like
Likes (Given)
0
0
I have fanuc oi-mate TD & TC control I want to use G71 rough turnaing cycle as rough boring cycle on CNC lathe please help.