An Application to create dividing head tables

Advert

An Application to create dividing head tables

Home Forums Suggested Online Resources An Application to create dividing head tables

Viewing 25 posts - 51 through 75 (of 100 total)
  • Author
    Posts
  • #240059
    Howard Lewis
    Participant
      @howardlewis46836

      Apologies to anyone looking on the Stub Mandrel website for my spreadsheet. What Neil has published is my revised chart for the Vertex HV6 Rotary Table.

      Being in EXCEL, the spreadsheet ought to make it possible to change the numbers in the various formulae, to suit any worm/wheel ratio, and number of holes in a Division Plate.

      Obviously where the number of holes quoted is not an integer, then that number of divisions is not obtainable with that particular hole circle. From memory, (some time since I devised it) the integer holes are highlighted.

      In the past the spreadsheet has ben E mailed to a few Forum members who requested it.

      Howard

      Advert
      #240079
      Howard Lewis
      Participant
        @howardlewis46836

        Neil has now kindly posted links at the head of the thread "Corrected Dividing Tables for VERTEX HV6 Dividing Head" for the corrected chart and to the EXCEL spreadsheet.

        I am pretty sure that by changing the numbers in the formulae, it can be applied to worm/wheel ratios other than 90:1, and to Division Plates with different numbers of holes.

        If I am wrong, someone is sure to tell us!

        Howard

        #240331
        Andy Ash
        Participant
          @andyash24902

          I finally got some time to check my revised spreadsheet today.

          It's was set up for the Myford dividing head but now you can specify the worm by typing a new number in the box. The same is true for the hole circles.

          The calculations were always right, but the filter to hilight the matches, had several problems. I'd not realised this because it had always been acceptable for the number of divisions I had needed. It has been good to put it up here though because I have found and been able to fix the problems with it.

          The filtering is actually slightly different now too. I wanted exact and near matches to be hilighted in different colours. That way you can instantly see if you are about to make a compromise. You couldn't do that well enough before. Now the options which carry an error are hilighted yellow, but the exact matches come up green.

          The colouring in excel works off the value in the cell, and the way I figured to handle this was to use a minus sign. In general all of the numbers on the spreadsheet are positive. In the real world, there are no negative divisions. If you see a minus then the value carries an error, and this is used to drive the hilighting.

          Both the whole number of turns, and the number of holes on the circle are reported this way. Obviously the dividing plate corrects the error in the whole number of turns. You can correct any error in the number of holes in the circle as I described previously. You only need to do that if you use a number hilighted in yellow.

          I found the Myford manual on the internet, and I have checked every division from 1 to 100 and the answers are all there. I think it must be right this time.

          Bazyle…….

          I don't know why I used the MOD function. I must have had an off day. It is very odd that it seemed to be nearly right. By analysis, I can't see how I ever expected it to be! I have now used TRUNC, but I don't think I've used it the way you have. The fact is that I don't know what you did, but that makes me think I did something different. If they are the same, then that's probably the only way you can do it.

          **LINK**

          Have fun.

          Edited By Andy Ash on 25/05/2016 22:17:48

          #240342
          Ajohnw
          Participant
            @ajohnw51620

            Mod can be used Andy. It returns the remainder of an integer division. So for instance to get divisions that are whole turns It can be used to check that a number divides exactly. Spread sheets usually have Quotient. That returns the result of an integer division discarding fractions. So quotient 9 / 4 for instance would give 2. Mod 9/4 would give 1

            So quotient of worm teeth / division ratio gives the number of whole turns for a division. Mod (worm teeth / division ratio) gives the remainder so if that's zero the division is done. It's just whole turns

            Usually there is a remainder so the next check is if a hole count can give the fractional turn. To do that the remainder must divide exactly into the hole count in the ring. So if the ring can do it Mod ( Hole Count / Remainder) = 0

            Last is the number of holes to skip. That's Remainder * Hole count in the ring / the division

            If the same thing is done in some programming language it may not have quotient because the same thing can be done by specifying the numbers as integers. Languages should have the facility to do it without that though because the need can crop up and the numbers may be floating point.

            Anyway – no floating point so if done correctly it can't go wrong. There are only 3 checks needed. A division that is a whole numbers of turns, a division that needs some number of turns and a part turn and a division that is just a part turn. If it works with all 3 it has to work with all numbers, Even stupid ones providing they are not greater than the software used can handle.

            John

            #240347
            Andy Ash
            Participant
              @andyash24902

              Hi John.

              MOD does what it's supposed to. And for what we are trying to do, it has more merit than most.

              The trouble is that I was using it in a way that just wasn't correct for what I had wanted to achieve.

              Because of that, the spreadsheet wasn't reporting all of the possibilities that it should have.

              I know you have mentioned the business of floating point arithmetic quite a number of times. I don't know how to say this tactfully, but I just don't buy into it. I don't think there is anything wrong with using fractions, but I am also completely satisfied that decimals are just fine too. The floating point unit in any machine capable of running windows, can do this sum with enough precision that you could index individual atoms if your dividing head was up to it.

              If you look you will see that I have explicitly set zero. I figure anything less than 1×1012 to be "zero". If there is an error less than this then it isn't worth worrying about. Bear in mind that an atomic nucleus is considered to be 1.75×1015 of a metre. This is not an uncommon issue when using floating point numbers.

              The best example is comparison. In software, although you can compare two floating point numbers to see if they are equal, there is almost no point in doing so. When you think about it, that is quite reasonable. With so much precision there is almost no chance that two different quantities will be the same.

              Generally the computer is less good at handling values with reoccuring decimals. This is because it only "appears" to have limitless precision. It is true to say that fractions can help humans deal with these scenarios. If you know you want the computer to do the grunt work, then I think it's decimals, all the way.

              It's not actually decimals which are the problem. It's the computer. If you were to write down the whole string of a decimal, then it would be just as good as a fraction. The computer does not do this because it's designers knew better. As it happens the floating point unit is more or less a fraction machine. The mantissa and exponent are an expression in base 2 scientific notation. Nevertheless they work together almost the same way as fractional values.

              As an example, floating point numbers are regularly "normalised" by the computer. This process is the same as reduction of an improper fraction. One of the main departures is that the computer does not attempt to distinguish units. It does not try to say 1 7/8 it just says 15/8. During calculation it might arrive at the quantity 30/16 which would be "normalised" to 15/8.

              You have to bear in mind that I have simplified this. the sums it performs are actually in base 2. I did that example in base 10 just to make it obvious.

              You might be able to choose the right fraction to deal with a reoccuring number, but the computer has no way to do that. The real observation is that I am sure that the computer is prepared to maintain more digits in it's floating point "fraction" than any human ever would be bothered to. In my opinion on precision, with floating point numbers pitted against inspired human fractional choices, you win some, you lose some. The main thing is that the computer does what it does FAST.

              Don't forget that I'm not insisting that you use my spreadsheet. I fixed it because a fault was raised and I didn't want to lead anyone astray.

              I think using the variable precision is an extremely useful tool. To use it well one must understand what it can and cannot give.

              #240351
              Tony Pratt 1
              Participant
                @tonypratt1

                This is all very interesting but there are tables already in existence that do all that you are struggling with?

                Tony

                #240359
                Ajohnw
                Participant
                  @ajohnw51620

                  I've worked on all levels of computers including the OS for over 30 years on and off Andy so am well aware of what they do.

                  blush I should say minus the windows end as I have had little need to go near that,

                  No tables available for my plates Tony.

                  John

                  #240362
                  Steven Vine
                  Participant
                    @stevenvine79904

                    …. and it's satisfying making something yourself, and doing it your way.smiley

                    #240404
                    Ajohnw
                    Participant
                      @ajohnw51620
                      Posted by Steven Vine on 26/05/2016 10:45:49:

                      …. and it's satisfying making something yourself, and doing it your way.smiley

                      Very true Steven. Anyway I haven't written any Basic for donkeys years and for what I want a spreadsheet macro function looks to be the easiest way to do it. Just a pity that without using the extensions that have been made to the spread sheet Basics and others which aren't in the spirit of Basic its seems I can't write directly to cells in the way I would like. It's a much maligned language part due to the B = beginners. The A = all-purpose is very true in computational terms. It's intended to dump stuff out to a printer or dos box etc – or a spread sheet if the right bolts ons were added. As often with programming languages current fashions rule instead and set the extensions that are added. Near rant over.

                      John

                      #240407
                      SillyOldDuffer
                      Moderator
                        @sillyoldduffer
                        Posted by Michael Gilligan on 24/05/2016 16:02:16:

                        For anyone with 'BASIC' nostalgia:

                        Here's how I did it on the Commodore 64, in 1993

                        DIVIDING.BAS

                        100 PRINT CHR$(147)
                        110 PRINT "RATIO = ";
                        120 INPUT RATIO
                        130 PRINT "DIVISIONS = ";
                        140 INPUT DIVN
                        150 HOLES%=0
                        160 HOLES%=HOLES%+1
                        170 MAX=RATIO*HOLES%
                        180 LOT=MAX/DIVN
                        190 IF LOT=INT(LOT) GOTO 210
                        200 GOTO 160
                        210 TURNS=RATIO/DIVN
                        220 T%=INT(TURNS)
                        230 PLUS=LOT-(T%*HOLES%)
                        240 PRINT CHR$(147)
                        250 PRINT RATIO;":1 ";DIVN;"DIV"
                        260 PRINT T%;"+";PLUS;"/";HOLES%

                        MichaelG.

                        Not guaranteed that I translated the BASIC correctly but this is what the program looks like in Python3 which is a modern "batteries included" language available free for Windows, MAC and Linux.

                        #! /usr/bin/python3

                        ratio = int( input( "Ratio = " ) )
                        divn = int( input( "Divisions = "  ) )

                        holes = 0

                        while True :
                        holes += 1
                        maxi = ratio * holes
                        lot = maxi / divn
                        if lot == int( lot ):
                            break

                        turns = ratio // divn
                        plus = int( lot – turns * holes )

                        print( ratio, " : 1", divn, " DIV" );
                        print( turns, "+", plus, "/", holes );

                         

                        Edited By SillyOldDuffer on 26/05/2016 16:52:23

                         

                        Edited By SillyOldDuffer on 26/05/2016 16:53:48

                        #240422
                        Ajohnw
                        Participant
                          @ajohnw51620

                          LOL falling of my seat. There's no room for hole counts on my plates so I want to know which plate as well. I can number the plates. One plate that came with the head does have hole numbers on it but they are tiny – can't be seen when it's on the head either – it only came with one plate

                          I bashed this out after lunch some hours ago. Not checked at all yet but if some one wants to produce tables this may be of use and may also have coding mistakes. Syntax seems to be fine but notice that the kit hasn't highlighted Fix and Mod to me is in a strange position. Help with fix highlighted does show it exists though,

                          divplatessmacro.jpg

                          Collecting all of the results in a string? It could dump to a file. It's written as a spreadsheet macro function but could also be changed.

                          Edit –indecision One thing I found interesting is that I have written an awful amount of code in assembler so when goto's are available I can't think  round not using them.

                          John

                           

                           

                          Edited By Ajohnw on 26/05/2016 17:30:05

                          #240524
                          Ajohnw
                          Participant
                            @ajohnw51620
                            Posted by Timothy Moores on 24/05/2016 14:06:23:

                            For anyone interested, I have just created the equivalent of Michael's app using 4 cells of a spreadsheet (plus headings) to find the lowest possible value to solve for a given division.

                            Cell format for B4 is 'Fraction – up to 3 digits'

                            You can then multiply this up to find a suitable plate – 4/22, 6/33, etc (I have a 33 hole plate).

                            As another example using 60:1 and 13 divisions, the answers would be 4 turns and 8/13 holes (16/26, 24/39, etc).

                            Edited By Timothy Moores on 24/05/2016 14:31:06

                            Neat Timothy. crying There is a hole in my basic and couple of typo's.

                            I've just added yours to my spreadsheet to that I can quickly check the output. I had been using something similar the comes up with 0 if the plate can do it, not very convenient for checking.

                            I made two changes though. I used these instead of dividing fractions.

                            =INT(B1/B2) and =MOD(B1/B2),B3) 'cause to divide fractions invert the 2nd one and multiply.

                            Then I thought hang on ………………….

                            Does it have the same hole as my basic? Fine for divisions up to just one complete turn and then falls over for divisions that have just a part turn? Looks like it does here. Say 100 divisions so B1 = 90, B2=100

                            Turns = INT ( B1/B2) = 90/100 so 0 Ok no turns so B3 = 0

                            Holes = Mod (B1,B2) , B3) =90/100 so 0.9/ 0 whoops.

                            blushProbably my fault as when I checked what I intended to do I only checked divisions up to 1/tooth count even though as I pointed out I should have checked a part turn division.

                            John

                            #240529
                            Ajohnw
                            Participant
                              @ajohnw51620

                              The problem is down to MOD (WormTeeth x HoleCount / Division) needing to equal zero.

                              This will give the fraction of a turn when the 0 crops up =IF(B3=0,(B1/B2),(MOD((B1/B2),B3))) The fractional output reduces it.

                              Me? I did have MOD(WormT * HoleCount / Division) at one point. Must 'ave forgot.

                              John

                              #240778
                              Ajohnw
                              Participant
                                @ajohnw51620

                                I have the macro function working. My main mistake earlier was trying to treat divisions with whole turns in them the same a partial turn ones. Currently it ignores divisions that are pure whole turns and am not sure if I will bother doing it as it's easy to work out. They divide exactly into the worm ratio.

                                Now I want to find out if I can write directly to cells from a macro function without using the more recent OO extensions. Those will do it but really they have no place in BASIC as it was intended and there should be other ways and probably are.

                                I thought I had posted the answer to the problem with Timothy's. Sorry about that. This fixes it

                                =IF(C7=0,(C5/C6),(MOD((C5/C6),C7)))

                                Mine has the output and input in column C running from 5 to 8 so "if C7…" checks for zero turns and provides the direct fraction when it is which is correct. The spreadsheet fraction format reduces it as much as possible automatically so the results can be used as Timothy suggested.

                                John

                                #240995
                                Ajohnw
                                Participant
                                  @ajohnw51620

                                  I just had another hour or so on the macro. Much of it was down to OpenOffice not retaining things like cell (x,x) = what ever and I didn't really want to use their object orientated substitutes as feel that the don't belong in Basic. MS have added some too but less typing and they have retained the Basic way.

                                  It's a bit like working in sticky toffee. I can format the results in the spread sheet but I just want some tables so may just use it to write out a text file and then import into a word processor as it only takes minutes to format tables.

                                  The output shows why I am not keen on columns of divisions on the left and can can't do on the right. It only outputs what can be done.

                                  divplatessmacrooutput.jpg

                                  The #'s and , are for reformatting it in a word processor if I do it that way and it goes division, plate hole count, turns, holes. Looking at an export to a pdf it looks like I might get the results from 4 plates on one sheet so next bit will be to format the division, hole count, turns and holes into separate cells. On the other hand it would be much quicker to make a small change and just copy paste the result into a WP.

                                  John

                                   

                                   

                                  Edited By Ajohnw on 31/05/2016 20:18:13

                                  #241473
                                  Roger Woollett
                                  Participant
                                    @rogerwoollett53105

                                    Sorry to be late to the party but I have another variation on this theme. I have a program that works out how many complete turns plus how many holes in which ring on which plate you need to cut x number of teeth.

                                    It is written in python using tkinter for the GUI so should run on most systems. I am happy to make the code available and if there is sufficient interest I will give it a proper configuration screen (at the moment it defaults to my HV4 rotary table plates)

                                    #241493
                                    Ajohnw
                                    Participant
                                      @ajohnw51620

                                      I'd be interested Roger. Linux generally comes with Python or is easy to add. I'd expect Windows to be even more straight forwards. The only complication maybe that either Python 2 or 3 could be required. My Linux install does both. Both versions are on Python.org.

                                      I've spend a number of hours on LibreOffice Calc spreadsheet macro's written in Basic. Limited info about but plenty on Excel. What I found is that MS have retained things like Cell (x,y) = something or the other but Calc Basic hasn't. It needs a lot more typing and the functions look rather intimidating. The documentation is extensive but for a casual user probably far to much to remember. I did find one decent page eventually that shows some use of it rather well but as far as I am aware it's the only one.

                                      **LINK**

                                      As I periodically try and do things on spreadsheets and find that the normal spreadsheet functions wont do what I want I intend to write some macro's so that I can have things like ReadCell (x,y), ReadRange (x,y) and same for write. A few others will be needed as well. A memory aid should fit easily on a single A4 sheet.

                                      blush Seems MS has done the right things for once. Left the Basic like stuff in Excel macro's in Visual Basic. They have also added the other type too. The OS people seem to have just done that and screw casual users. Macro's can also be written in C or Python. This way I suspect that exactly the same core of code is used on all of them.

                                      If some one is used to using VB there is an option to make xxxxxOffice macro's compatible. Just add

                                      Option VBAsuport 1

                                      to the top of the file. Not sure how well this works and have now learned xxxxOffice Basic syntax so not keen to find out. It would mean more web crawling. I've already done to much and I doubt if compatibility is complete.

                                      John

                                      #241503
                                      Roger Woollett
                                      Participant
                                        @rogerwoollett53105

                                        It works with Python 3 – I just tried Python 2 and it fails. Something to do with automatic type conversion, I could fix it if there is a demand for python 2. Most testing has been on windows but it also works on my Raspberry Pi under Linux.

                                        I have forgotten how to put it on GitHub so if you PM me with your email address I will send the code to you as an attachment.

                                        You will need to modify the code – see the comments – to correspond to your rotary table/dividing head.

                                        #241520
                                        Ajohnw
                                        Participant
                                          @ajohnw51620

                                          I doubt if anyone is interested but this so far is my way of doing ir. In Basic there is no need usually to declare variables and there will be some I could do without. It's all done in integer. One point on that – on the Turns = line it would be better to use QUOTIENT or FIX if decimal was being used. FIX in one Basic I have seen rounds up though rather than down so best check. I'm saving the results in a string array ( aka Text ) format and as an integer array at the moment. There are some bugs in my LibreOffice that prevents arrays from working as they should when the function has finished running.

                                          divplatessmaintop.jpg

                                          divplatessmainloop.jpg

                                          The sheet looks like this at the moment but more to be done. It'll probably be activated with a button.

                                          divplatessheet.jpg

                                          Top left is the spread sheet way of getting a factor for any division. The function call is in quotes 'cause I kept having to delete it when playing with the integer array.

                                          This is the sort of thing needed in a macro to avoid having to use xxxxOffice's Basic functions. .Formulae could be .Integer, string and etc

                                          divplatessnoddyfunct.jpg

                                          Variant seems to mean any type so could be that as well but it may not convert to what ever it is automatically.

                                          Several photo's as Neil's size limits are miserable. The code ones are in order.

                                          Edit smiley Yes I do know I could bury things in nested if then else's and do without some variables but I wanted to leave it clear. Turns out it has a case statement as well but syntax is missing from the doc's.

                                          John

                                          Edited By Ajohnw on 05/06/2016 15:26:37

                                          #241522
                                          Roger Woollett
                                          Participant
                                            @rogerwoollett53105

                                            I think I have got the source onto GitHub – you shoud be able to download it from there.

                                            **LINK**

                                            #241573
                                            Ajohnw
                                            Participant
                                              @ajohnw51620

                                              Just in case some one has problems downloading from Roger's link. Follow it, click raw which should then show plain text and then save the page from the browser.

                                              It confused me the first time I downloaded a .py file. The same can apply to anything that is just essentially a text file on git hubs.

                                              On linux it's also possible to type magical incantations in a console and download things. Usually used for getting git releases of large packages. Not sure how this works on win and mac but there are probably similar utilities.

                                              John

                                              #241591
                                              Roger Woollett
                                              Participant
                                                @rogerwoollett53105

                                                A possibly easier alternative is to click "<>code" and then "Clone or download". This will allow you to download a zip file containing Divide.py and two control files you can ignore.

                                                #241642
                                                Ajohnw
                                                Participant
                                                  @ajohnw51620

                                                  It works for me Roger. I had to install python3-tk to get the TK graphics extension. I wondered initially and then realised I hand't changed the worm wheel to 60 !

                                                  angryWhile messing around checking mine I noticed a problem with number of turns. It looks like integer division rounds either up or down based on x.5 or maybe even bankers rounding. Turns are worked out correctly at times but some come out 1 higher than they should. Easy to fix by using multiply and decing if the results comes out high. It doesn't have quotient. Looking at some of the integer functions they return double. Too much trouble to do it properly. So much for Option Explicit. There can't be any actual type checking at all at this level.

                                                  I've come across this sort of thing before. I did do a bit of commercial work for a while. Ugggg. One of the jobs was time sheets processing. The compiler I used stated "works at any base in integer so that there are no rounding errors". So did it in base 60. Eventually some one decided to tot up all the numbers by hand and found that there were minor errors. There is always some one like that around. If the compiler did really use integer calcs there wouldn't be any discrepancies at all. Binary is integer so there is no reason why there should be. They must have been using float under the hood. I made sure only integer went in. Have to on this sort of job as people might put in any old thing including function keys and control this and that or anything else they can think of or do by accident.

                                                  John

                                                  #241644
                                                  Roger Woollett
                                                  Participant
                                                    @rogerwoollett53105

                                                    Thanks for that John. I will look into it. What platform are you using?

                                                    I found that python 2 does integer division – python 3 converts to float so I had to float some arguments to get the code to work on python 3. I am working on a configure screen so will look at this later.

                                                    #241656
                                                    Ajohnw
                                                    Participant
                                                      @ajohnw51620

                                                      No problem with yours Roger. I'm using it on Linux under KDE4. I've only put a few through it but all have been fine.

                                                      The problem is my speadsheet and Libre Office Basic. Not an ideal place for this sort of thing but I thought it's worth getting to grips with how as when I have used them before I have been hampered by only having the spreadsheet functions available.

                                                      Floating the two that are causing the problem and then truncating them should work for me. It's only causing a problem when I calculate turns as I need to divide. They are declared as integer. The rest of the logic uses Mod which does do what it should.. I think I will use Ask OpenOffice to see if there is some undocumented compiler option. I expected integer divisions to truncate as no Quotient provided. That way along with mod fraction type work can be done easily and exactly. I don't know. Looks like compiler writer are getting lazy.

                                                      Or maybe young and not taught fractions any more.

                                                      John

                                                    Viewing 25 posts - 51 through 75 (of 100 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