Metalworking (rec.crafts.metalworking) Discuss various aspects of working with metal, such as machining, welding, metal joining, screwing, casting, hardening/tempering, blacksmithing/forging, spinning and hammer work, sheet metal work.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,392
Default Irregular bolt circle calculator from simple distance measurements

When reverse engineering parts, I often come across bolt circles with
irregular spacing. That is, the holes all fall around the same circle,
but at random angles, rather than evenly spaced around the circle. The
diameter and angles were always a challenge to deduce using only
calipers.

Today I looked up some geometry and with some head-scratching came up
with the following formulas to calculate the bolt circle diameter given
the distances between any three holes. Also calculated are the relative
angles to the second and third holes from the first.

In practice, when presented with a mystery bolt-circle part, all you
have to supply are the 3 distances between the three hole centers. I do
this with calipers by reading the inside and outside measurements and
averaging. Then the code will deduce and report the diameter and
angles. No more guessing or eyeballing with protractors or graph paper.

No doubt this has been solved before, but I've never been able to find
the software to do it, so here is my attempt. I wrote this in awk, but
the formulae should be clear if anyone cares to rewrite this as, say, a
spreadsheet.

Being that evenly-spaced bolt circles are a special case, this works for
them as well.

#
# Calculate bolt circle diameter from the separation distances of
# any three holes on the bolt circle. Also calculates angles of
# the second and third holes relative to the first
#
# Kinch, November 2007
# After _Graphics Gems_, "Useful Trigonometry", p 12,
# and "Triangles", pp 20-22.
#
# Input arguments: three distance values in CCW:
#
# |AB| |BC| |AC|
#
# Outputs the apparent diameter of the bolt circle, and angles
# to the second and third relative to the first
#
BEGIN {
c = ARGV[1]+0 ; a = ARGV[2]+0 ; b = ARGV[3]+0
printf "Given lengths: %.3f %.3f %.3f\n", c, a, b
if (a=0||b=0||c=0) {
printf "3 input lengths must all be positive!\n"
exit 1
}
if ((a=(b+c))||(b(c+a))||(c=(a+b))) {
printf "Inputs fail triangle inequality!\n"
exit 1
}
cosA = (a*a - b*b - c*c) / (-2*b*c) # Law of cosines
d = b*cosA
e = sqrt(b*b-d*d)
d1 = c*d
d2 = c*c - c*d
d3 = d*d - c*d + e*e
c1 = d2*d3
c2 = d3*d1
c3 = d1*d2
diameter = sqrt((d1+d2)*(d2+d3)*(d3+d1)/(c1+c2+c3))
r = diameter / 2.0
printf "diameter = %.3f\n", diameter
cosa2 = ((r*r-0.5*c*c)/(r*r))
sina2 = sqrt(1.0-cosa2*cosa2)
if (cosa2!=0.0) a2 = atan2(sina2,cosa2)*180.0/3.1415926 ; else a2 = 90
a1 = 0
a3 = 360.0 - a1 - a2
printf "angles %.1f %.1f %.1f\n", a1, a2, a3
exit 0
}
  #2   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 14
Default Irregular bolt circle calculator from simple distance measurements

The Fagor DRO on my mill will do this sort of thing too, however I've
only used it half a dozen times.


  #3   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 3,138
Default Irregular bolt circle calculator from simple distance measurements

On Wed, 07 Nov 2007 17:18:31 -0600, Richard J Kinch
wrote:



No doubt this has been solved before, but I've never been able to find
the software to do it, so here is my attempt. I wrote this in awk, but
the formulae should be clear if anyone cares to rewrite this as, say, a
spreadsheet.

(snip)

Good on ya, Richard. Probably only UNIX users would have/use awk, but
(as you say) your program clearly shows how to apply the law of
cosines here.

I'm a bit surprised that Marv Klotz doesn't have a program for this on
his site. He might be interested in adding it.
http://www.myvirtualnetwork.com/mklotz/

About any CAD drawing package (turbocad, autocad, etc etc) can make
a circle described by 3 points and thence tell you the radius and
center. I regard some sort of CAD program as a very useful shop tool
because they can solve a LOT of geometry problems effortlessly.

Once one has the radius and angle to each hole, a CAD package can then
ordinate (X-Y) dimension their locations so one can go right to the
mill, dial in the locations, and drill the holes -- no need to set up
and center a rotary table. I've found this to actually be more
accurate than a rotary table because with a rotary there are the
cumulative errors of centering table on mill, centering workpiece on
table, and runout of an inexpensive RT. YMMV.
  #4   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 3,286
Default Irregular bolt circle calculator from simple distance measurements


I'm a bit surprised that Marv Klotz doesn't have a program for this on
his site. He might be interested in adding it.
http://www.myvirtualnetwork.com/mklotz/


Richard's program is essentially written in "C". For a "C" programmer, it
would be a trivial job to edit and compile this for DOS or Windows.

I *used* to be able to do this. But, alas, haven't done "C" for 15 years
now.

This would indeed be a nice addition to Marv Klotz's collection.

Is there a nice volunteer out there?

Karl


  #5   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1
Default Irregular bolt circle calculator from simple distance measurements

On Nov 7, 3:18 pm, Richard J Kinch wrote:
When reverse engineering parts, I often come across bolt circles with
irregular spacing. That is, the holes all fall around the same circle,
but at random angles, rather than evenly spaced around the circle. The
diameter and angles were always a challenge to deduce using only
calipers.

Today I looked up some geometry and with some head-scratching came up
with the following formulas to calculate the bolt circle diameter given
the distances between any three holes. Also calculated are the relative
angles to the second and third holes from the first.

In practice, when presented with a mystery bolt-circle part, all you
have to supply are the 3 distances between the three hole centers. I do
this with calipers by reading the inside and outside measurements and
averaging. Then the code will deduce and report the diameter and
angles. No more guessing or eyeballing with protractors or graph paper.

No doubt this has been solved before, but I've never been able to find
the software to do it, so here is my attempt. I wrote this in awk, but
the formulae should be clear if anyone cares to rewrite this as, say, a
spreadsheet.

Being that evenly-spaced bolt circles are a special case, this works for
them as well.

#
# Calculate bolt circle diameter from the separation distances of
# any three holes on the bolt circle. Also calculates angles of
# the second and third holes relative to the first
#
# Kinch, November 2007
# After _Graphics Gems_, "Useful Trigonometry", p 12,
# and "Triangles", pp 20-22.
#
# Input arguments: three distance values in CCW:
#
# |AB| |BC| |AC|
#
# Outputs the apparent diameter of the bolt circle, and angles
# to the second and third relative to the first
#
BEGIN {
c = ARGV[1]+0 ; a = ARGV[2]+0 ; b = ARGV[3]+0
printf "Given lengths: %.3f %.3f %.3f\n", c, a, b
if (a=0||b=0||c=0) {
printf "3 input lengths must all be positive!\n"
exit 1
}
if ((a=(b+c))||(b(c+a))||(c=(a+b))) {
printf "Inputs fail triangle inequality!\n"
exit 1
}
cosA = (a*a - b*b - c*c) / (-2*b*c) # Law of cosines
d = b*cosA
e = sqrt(b*b-d*d)
d1 = c*d
d2 = c*c - c*d
d3 = d*d - c*d + e*e
c1 = d2*d3
c2 = d3*d1
c3 = d1*d2
diameter = sqrt((d1+d2)*(d2+d3)*(d3+d1)/(c1+c2+c3))
r = diameter / 2.0
printf "diameter = %.3f\n", diameter
cosa2 = ((r*r-0.5*c*c)/(r*r))
sina2 = sqrt(1.0-cosa2*cosa2)
if (cosa2!=0.0) a2 = atan2(sina2,cosa2)*180.0/3.1415926 ; else a2 = 90
a1 = 0
a3 = 360.0 - a1 - a2
printf "angles %.1f %.1f %.1f\n", a1, a2, a3
exit 0
}


The program CIRC3 has been on my page for a long time. It computes
the diameter of the bolt circle from three chord measurements but
doesn't compute the angles as Richard's does. (Computing the angles
is trivial once the diameter is done.)

My program is unnecessarily complicated because I wrote it as a test
case to proof a number of geometry subroutines I had written for
another application.

Richard's program is also unnecessarily complicated. Once you've used
the law of cosines to solve for cosA as he has done:

cosA = (a*a - b*b - c*c) / (-2*b*c) # Law of cosines

the bolt circle diameter is given simply by:

D = a/sin(acos(cosA));


Regards, Marv

Home Shop Freeware - Tools for People Who Build Things
http://www.myvirtualnetwork.com/mklotz




  #6   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,392
Default Irregular bolt circle calculator from simple distance measurements

The program CIRC3 has been on my page for a long time.

I looked at your list, but was hunting for "distance" or "chords" or some
such magnitude keyword, not "points" (implies coordinates to me) on a
circle.

Richard's program is also unnecessarily complicated. Once you've used
the law of cosines to solve for cosA as he has done:

cosA = (a*a - b*b - c*c) / (-2*b*c) # Law of cosines

the bolt circle diameter is given simply by:

D = a/sin(acos(cosA));


Imagine that, D = a/sinA. Not sure why that lengthy solution is in
Graphics Gems. Since angle A (and thus acos(cosA)) must be 180 deg, sin
(A) must be non-negative, namely (by identity) sqrt(1-cosA*cosA). So:

D = a/sqrt(1-cosA*cosA)

which altogether avoids the trigonometric functions (and thus works on that
cheap calculator!), and solves the diameter in two steps.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to fill an irregular hole? largecorp Woodworking 13 November 3rd 07 06:38 PM
Irregular Shower Door a12vman Home Repair 1 September 21st 06 01:52 PM
Laying out a bolt circle? Dave Hinz Metalworking 45 July 11th 05 07:42 PM
How to accuratly plot bolt circle radius? JR North Metalworking 16 March 31st 05 09:59 AM
Bolt circle calculator?? steamer Metalworking 24 December 17th 04 03:51 AM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 DIYbanter.
The comments are property of their posters.
 

About Us

"It's about DIY & home improvement"