Co-ordinate positioning for circle of holes (not all equally spaced)

Advert

Co-ordinate positioning for circle of holes (not all equally spaced)

Home Forums Help and Assistance! (Offered or Wanted) Co-ordinate positioning for circle of holes (not all equally spaced)

Viewing 25 posts - 1 through 25 (of 39 total)
  • Author
    Posts
  • #766042
    Zebethyal
    Participant
      @zebethyal

      Hi There,

      Does anyone have a method for calculating co-ordinate positioning for a ring of holes that are not all equally spaced.

      There are a number of PCD calculators out there, however these all assume that the number of holes are all equally spaced.

      My requirement is for the 99% of the holes to be equally spaced, but the gap between the first and last may not be the same as for the rest.

      A couple of examples:

      Screenshot 2024-11-22 at 10.38.49Screenshot 2024-11-22 at 10.39.01

      Both are variations on plates that can be used on a Spin Indexer to generate a 127 tooth gear, the first has 127 holes on 3 different pitch circles (OxTools variant), the second uses a 5 hole vernier to achieve the same result with 26 holes (RJSakowski on the Hobby-Machinist forum).

      The OxTool one actually does fit a PCD if it is large enough, but the reduced version has every second hole moved to a second pitch circle and the last one to a third.

      The gap between the first and last hole, on a given pitch circle, is different for both of these compared to all the other holes.

      The 5 hole vernier for the second variant may have the same issue as again a full circle of holes may not have the first and last equally spaced.

      I guess I could calculate them all in a spreadsheet using trigonometry, I just need to get my head around the associated maths.

      Advert
      #766050
      JasonB
      Moderator
        @jasonb

        If you have the 3D CAD, just produce a 2D drawing from that and dimension the holes as needed. I would suggest X and Y from the middle.

        #766059
        Zebethyal
        Participant
          @zebethyal

          Many thanks Jason, that is of course a viable option and one I had only vaguely considered.

          I created the above in SketchUp, but could probably create in Fusion360 just as easily, which would be more suited to creating the 2D ‘dimensionable’ version.

          #766108
          DC31k
          Participant
            @dc31k

            As Fusion is the offspring of AutoCAD, ACAD has a ‘list’ command, that you could select entities and it would write their properties into the text window.

            Put a point entity at the centre of each hole, select all of them and ‘list’ to the console.

            A variation on this is to save just the point entities into an ASCII dxf file and open that in a text editor to extract the information.

            The utility of the textual information might be dependent on the order in which you create the points. they would list in creation order, so create them systematically and they will list systematically.

            If you tell us PCD, first hole bearing from due north and angular increment, we could do the maths independently as a check on your own work.

            The easiest way to obtain these in a spreadsheet is to use polar coordinates. x = r cos(theta) and y = r sin(theta). The angle is measured anticlockwise from the horizontal positive x-axis (mathematical and navigational angles are measured in different directions). For the Ox one, with two hole circles, the outer thetas would be 0, 2/127 * 360, 4/127 *360, 6/127 * 360 etc. The first hole on that outer circle would be at three o’clock. For the first hole on the inner circle, start at 1/127 * 360 and then 3/127 * 360, 5/127 * 360 etc.

            #766129
            Zebethyal
            Participant
              @zebethyal

              Many thanks DC31k,

              That has allowed me to build a spreadsheet that can calculate the holes for both discs based on the centre being 0,0 and position 0 at 3 o’clock, as you mention.

              For the OxTools one, PCDs are 45, 40 and 35mm, pick even numbers for outer, odd numbers for middle and #126 for inner ring.

              Screenshot 2024-11-22 at 14.21.10

              For the other one, PCD is 2.4″ (60.96mm) I need to pick every 5th hole for the ring

              Screenshot 2024-11-22 at 14.21.24

              Just had to remember to convert the angle to radians before the trig function for it to work correctly in Excel.

              #766164
              DC31k
              Participant
                @dc31k

                I do not know if this might help with displaying the results, but you can use the MOD() (remainder from division) function to show or hide stuff automagically.

                On the first one, if you do MOD(hole_number, 2) you see 0 or 1 depending on if the number is odd or even. So if you multiply the cell result by this, it either gives what you want or shows zero. To do the ‘opposite hand’ of this, use MOD(hole_number-1, 2) to flip the correspondence of 0 and 1 with odd and even.

                You can combine or substitute this with an IF statement to show a completely blank cell instead of a zero:

                IF(MOD(hole_number, 2), <formula to display value>, “”)

                This logic can be extended to accommodate the ‘show one in five’ option – IF(MOD(hole_number, 5), etc.) would get you all non-multiples of five – IF(NOT(MOD(hole_number, 5), etc.) should get all exact multiples of five.

                #766224
                Martin Connelly
                Participant
                  @martinconnelly55370

                  I considered this type of division plate for manufacturing a 127 tooth gear some time back. I thought about making a division plate as shown but decided that for a one off job that printing a division plate image and sticking it to an existing division plate would allow a true 127 division plate, as shown, to be made on a rotary table. No hole calculation needed, just a CAD program to draw up the paper image. With CAD I could easily print off a CAD image and post it to someone else to use as well. All that would be needed are some details regarding the diameter of the pin face on the selector arm, the mounting hole diameter, the outside diameter and the PCDs to put the circles on (to lie between those on an existing plate for example).

                  You could make a thin brass one from the paper one and a steel one from the brass one if you wanted easy drilling for the first one. The steel ones are only needed for wear resistance if used a lot. Just remember to lock everything before drilling as the pin on the paper will not hold position the way a pin in a hole will.

                  An alternative now is a thin plywood one made on a laser CNC machine. Use it once to make a metal one.

                  Martin C

                  PS it occurs to me two paper ones will allow one to be stuck on the blank to be drilled to check hole positions as you go round.

                  #766255
                  DC31k
                  Participant
                    @dc31k
                    On Martin Connelly Said:

                    No hole calculation needed, just a CAD program

                    No CAD program needed, just a web browser:

                    https://www.blocklayer.com/pitch-circle-diametereng

                    https://www.cgtk.co.uk/metalwork/calculators/divider

                    It is worth bookmarking the CGTK website as there are other useful utilities.

                    #766344
                    Zebethyal
                    Participant
                      @zebethyal

                      Many thanks for all of the suggestions.

                      I was already using modular arithmetic to do display a given entry (or not):

                      example from the first set

                      =IF(MOD($A5,2)=0,$D$1*COS(RADIANS($B5)),””)

                      =IF(MOD($A5,2)=0,$D$1*SIN(RADIANS($B5)),””)

                      I suppose I could have tidied up even further by choosing which PCD to use based on the same modulus decision.

                      Example from the second screenshot

                      =IF(MOD($N4,5)=0,$R$1*COS(RADIANS($O4)),””)

                      =IF(MOD($N4,5)=0,$R$1*SIN(RADIANS($O4)),””)

                      The online PCD calculators only work for a full set of holes, you still need to remove the unwanted entries, so for the first example I would need to generate 3 sets of PCD data, then remove every second item, for the first 2 rings and only need 1 item from the third set, by which time you might as well generate it all in a spreadsheet anyway (once you find/understand the required formula).

                      At the time I asked this question, I had overlooked the fact that I still needed all 127 holes to be calculated, especially when looking at the second plate that only contained 26 holes.

                      I did also consider simply printing it out and centre punching each hole.

                      #766458
                      SillyOldDuffer
                      Moderator
                        @sillyoldduffer

                        My contribution illustrates a more advanced solution to the problem already solved by Zbethyal and DC31K.  Not necessary when a spreadsheet is ‘good enough’,  but programming languages being more general are able to tackle complex requirements.  My code may be of interest to Pythonistas. More complicated than it needs to be or milling and drilling because the computers coordinate system is mapped to a screen The 0,0 origin is top left and negative coordinates are illegal.

                        Here’s my example, with 3 different rings:

                        holerings

                        The outer ring is 20 equally spaced white filled holes, generated with this code:

                        eqspaced

                        The blue ring is thirty odd holes generated from a list.  The hole spacing looks odd and is. It;s the list of angles that are the largest prime numbers in a decade.  Chosen to show anything is possible, not because prime number angles are useful.   Here’s the code:

                        listofAngles

                        Finally, the orange holes are a 27 equally spaced sequence, except the computer is programmed to skip hole numbers 15, 16, 20, 21, 22 and 26:

                        eqspaceremove

                        The code uses a Point class written by me as an off-shoot of Duncan Webster’s locomotive valve gear simulator: he did all the hard-work in ‘C’, whilst I tweaked performance and attended to the graphics.  I wondered if a Python version would be easier to write than C and fast enough to run Duncan’s animation.  The answer is yes, but…

                        Anyway, the Point class supports everything I could think of helpful when working with coordinates, so:

                        littleHolePosition = Point(WindowCentre).pointAt(OuterCircleRadius*0.7, 0);

                        means, calculate the point (x,y) that’s an angle and distance away from the screen centre, and,

                        x, y = littleHolePosition.rotate(WindowCentre, turnAngle*i)

                        means, rotate the position of littlehole about  WindowCentre, by an angle.

                        Hours of fun…

                        Dave

                         

                        #766464
                        JasonB
                        Moderator
                          @jasonb

                          You mentioned that you can use F360, rather than have hours of fun it will do it for you in less than 60seconds, well it did for me.

                          Import your 3D model, go to manufacture (CAM) and do the setup which you don’t actually need to alter. Then click drill, pic a random drill bit, select one hole then “all similar” and then it will work it out in a few seconds

                          plate 1

                          Then click the post processor and you can just read off teh co-ordinates from the generated G-code. Good thing is it arranges the co-ordinates with the least amount of handle twiddling between each hole. It starts and stops where the “missing holes” are. I set datun as ctr. but could just as easily be any other position.

                          plate 2

                          A good example that CAM can still be useful even if you don’t have a CNC.

                          Also shows that CAM is far quicker than writing g-code. The old school way would have been to work out the co-ordinates of each hole by one of the methods shown by others above and then copied it all into the gcode adding the X and Y  and +- to each which is very long winded. No wonder we don’t see much actual build progress here!

                          #766468
                          John Haine
                          Participant
                            @johnhaine32865

                            A simple Excel formula can translate two coordinate values in cells in the same row into a gcode statement.  Just copy the formula down for all the rows then copy and paste the column into a text document.

                            #766487
                            John Haine
                            Participant
                              @johnhaine32865

                              Here’s an example for lathe code.  If you paste this formula into a cell, where cells K4 and L4 contain the coordinate values:

                              =”G01 X”&K4&” Z”&L4

                              You get this:

                              G01 X31.35 Z-86.53

                              Text in “quotes” is just inserted as is, the & symbol concatenates values, K4 and L4 are standard excel cell references.  Though often CAD/CAM makes this superfluous, sometimes a shape can’t easily be generated in CAD because the maths isn’t possible, whereas Excel makes the maths easy.

                               

                               

                              #766488
                              Michael Gilligan
                              Participant
                                @michaelgilligan61133
                                On John Haine Said:

                                A simple Excel formula can translate two coordinate values in cells in the same row into a gcode statement.  Just copy the formula down for all the rows then copy and paste the column into a text document.

                                My Excel skills are withering due to lack of exercise, John

                                … very grateful if you would share your formula [either here or privately] to kick-start my recovery.

                                MichaelG.

                                .

                                Edit: __ crossed in the post !!

                                #766500
                                John Haine
                                Participant
                                  @johnhaine32865

                                  Is what I gave in my post enough Michael?  I can email you some “worked examples” if you like.

                                  #766502
                                  Michael Gilligan
                                  Participant
                                    @michaelgilligan61133

                                    Pleased to say that John’s little formula also works in Apple ‘Numbers’

                                    … available on an iOS device near you.

                                    MichaelG.

                                    .

                                    Edit: __ Thanks, John

                                    Yes a few examples would be helpful … I have only scratched the surface of G-Code but would like to learn more.

                                    #766530
                                    John Haine
                                    Participant
                                      @johnhaine32865

                                      I emailed you with an example.  A good place to read up on g-code is the Mach3 Mill manual.

                                      #766710
                                      SillyOldDuffer
                                      Moderator
                                        @sillyoldduffer

                                        As usual the forum has moved on from Zebethyal’s original question “Does anyone have a method for calculating co-ordinate positioning for a ring of holes that are not all equally spaced.

                                        There are several ways of doing the job ranging from wet-towel round head and a good understanding of the maths to programming it on a computer.   DC31K supplied the basic maths and suggested a spreadsheet, and Zebethyal got what he needed from that.

                                        Other suggestions are good, but may not answer.  For example Martin suggested “No hole calculation needed, just a CAD program to draw up the paper image.”.  That’s do-able for a 127 hole ring, but not Zebethyal’s “ring of holes that are not all equally spaced.”   Simple methods don’t serve when the holes aren’t equally spaced unless eyeballing the gap is ‘good enough’.   And if an approximation isn’t  ‘good enough’, then we’re forced back to geometry and understanding coordinate systems.

                                        In general, the best answer in engineering is the simplest one that does the job.   Say 7 holes are to be drilled on a PCD.   Not difficult with paper, pencil, a protractor, graph-paper and a simple sum, except it’s labour intensive and people like me make mistakes.   Simpler to use a tool like DRO’s PCD function, or to draw the item in CAD.  CAD can tackle more complex problems than a DRO.  And if CNC is available, then CAD beats a human guided DRO.  Writing a computer program for PCDs is over the top.  However, the fun starts when the holes on a PCD aren’t equally spaced.  Not uncommon – one of my old bangers had a cover designed to stop clowns replacing it in the wrong orientation, like the two blue holes in this otherwise equally spaced ring of 8.

                                        offPCD

                                        I gave a programmatic solution to holes.  Setting up is harder than the other methods, but once is established, a programmed framework simplifies the harder problems that other tools struggle with, many of them becoming trivial.   This example puts holes on an Archimedean spiral.  The spiral is just an example of a curve represented by a formula, and all curves can be represented by a formula.  Petals, cardioids, ellipses, and many more.  Opens the door on cams etc.

                                        archimedes

                                        Next example is more useful than plotting holes along parametric curves I’m sure! My program makes index wheels for an HV6 rotary table a doddle, 11 lines of code:

                                         

                                        Screenshot from 2024-11-25 11-03-03

                                         

                                        Screenshot from 2024-11-25 11-03-54

                                        hv6wheelc

                                        The program…

                                        hv6

                                        A thought!  In the good old days, engine turning on an Ornamental Lathe, often a Holtzapffel was a popular hobby amongst the super-rich.   Cross between a lathe and a spirograph, and full-featured machines were extremely expensive, because all the ratios were developed by gears and indexed wheels.

                                        roseEngine

                                        As far as I know, no-one makes a modern equivalent.   I wonder if the techniques discussed above, normally applied by us to PCD drilling, dividing on a rotary table, ELS, and CNC could be used to convert a mini-lathe into a Rose Engine?

                                        Dave

                                         

                                         

                                         

                                         

                                        #766712
                                        DC31k
                                        Participant
                                          @dc31k
                                          On SillyOldDuffer Said:

                                           

                                          This example puts holes on an Archimedean spiral.

                                          I like that.

                                          Can we come up with some mechanical contraption that changes the radius of the indexing pin as you rotate from one hole to another?

                                          Could I commend these sites to you:

                                          https://mathshistory.st-andrews.ac.uk/Curves/

                                          https://mathcurve.com/courbes2d.gb/courbes2d.shtml

                                          Does python easy graphics offer output to more than the screen? Is there an easy way to make an SVG or a pdf from it? Adding a nominal 100mm long line on the same page would be a useful item to check the printed output is scaled correctly.

                                          #766741
                                          Martin Connelly
                                          Participant
                                            @martinconnelly55370

                                            Sorry Dave but you are mistaken on the CAD process for this job. Draw the disk with three concentric circles of the required Ø40, Ø45 and Ø50. Draw a single line vertically from the centre to beyond the Ø50 circle. Chose polar array centred on the circles to put in 127 lines filling the 360° of the circle. Then just place the holes to be drilled at the intersection points of lines and circles as detailed on the original model at the beginning of this thread.

                                            A short and simple process. A few minutes work.

                                            127 divider plate 2

                                            Martin C

                                            #766745
                                            JasonB
                                            Moderator
                                              @jasonb

                                              You could also draw a single circle and use a circular pattern and enter $ x 360/127 for the angular spacing where $ is the number of 127th divisions between each circle so in Martin’s case the outer two rings would be spaced at 2 x 360/127 intervals repeated 63 times The first starting at 0 degrees and the second ring starting at 1×360/127and the final hole is 1 x 360/127 to the other side

                                              holes

                                              Exactly the same method can be used with a DRO. Enter the starting and finishing angle and the number of holss for each ring diameter and there is no need to even work out the coordinates it will work it’s way round each ring leaving the correct gap at the end.

                                              #766753
                                              JasonB
                                              Moderator
                                                @jasonb

                                                Forgot the sketch that produced the above. I just positioned the three orange circles and did two circular patterns of 63 for the outer two circles.

                                                circles2

                                                #766757
                                                SillyOldDuffer
                                                Moderator
                                                  @sillyoldduffer
                                                  On DC31k Said:
                                                  On SillyOldDuffer Said:

                                                   

                                                  This example puts holes on an Archimedean spiral.


                                                  Could I commend these sites to you:

                                                  https://mathshistory.st-andrews.ac.uk/Curves/

                                                  https://mathcurve.com/courbes2d.gb/courbes2d.shtml

                                                  Many thanks!

                                                  Does python easy graphics offer output to more than the screen? Is there an easy way to make an SVG or a pdf from it? Adding a nominal 100mm long line on the same page would be a useful item to check the printed output is scaled correctly.

                                                  Yes, but only to JPG and PNG.

                                                  Dave

                                                  #766764
                                                  SillyOldDuffer
                                                  Moderator
                                                    @sillyoldduffer
                                                    On Martin Connelly Said:

                                                    Sorry Dave but you are mistaken on the CAD process for this job. …

                                                    A short and simple process. A few minutes work.

                                                    127 divider plate 2

                                                    Martin C

                                                    My fault probably!  I tried to be clear I was talking about rings of unequally spaced holes, as in this example, not Zebethyal’s equally spaced apart from one example.   Try this one in CAD!  The holes are irregularly spaced around the wheel at the following angles: 11, 17, 29, 37, 47, 59, 67, 79, 89, 97, 113, 127, 139, 149, 157, 167, 179, 199, 211, 229, 241, 257, 269, 277, 283, 293, 307, 317, 337, 349, 353.   (With some omissions, they are the highest prime number in each decade from the tens to the three hundred and fifties.)

                                                    unequalSpacing

                                                    Though I’m sure it can be done in CAD, I think those who try will find it hard work because CAD is only tooled up to copy rotate  at a constant angle.   And then have go in CAD at spacing holes equally along an Archimedean spiral as shown in my other example.   As always, I’m happy to be proved wrong. Maybe  I’ve just not noticed there’s a tool, perhaps for drawing cams.

                                                    No criticism intended of your post, I used it as a link to explain my next observation; “Simple methods don’t serve when the holes aren’t equally spaced unless eyeballing the gap is ‘good enough’.   And if an approximation isn’t  ‘good enough’, then we’re forced back to geometry and understanding coordinate systems.

                                                    Clear as mud I expect – it’s my only talent…

                                                    Dave

                                                    #766837
                                                    Martin Kyte
                                                    Participant
                                                      @martinkyte99762

                                                      If the requirement is to equally space holes except between the last and the first then my DRO’s pitch circle function already does that. Just specify the start and end angle, for example 0 degrees and 358 degrees.

                                                      regards Martin

                                                    Viewing 25 posts - 1 through 25 (of 39 total)
                                                    • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                                                    Advert

                                                    Latest Replies

                                                    Viewing 25 topics - 1 through 25 (of 25 total)
                                                    Viewing 25 topics - 1 through 25 (of 25 total)

                                                    View full reply list.

                                                    Advert

                                                    Newsletter Sign-up