Arduino indexer , full project

Discussion in 'Software and Programming' started by stragenmitsuko, Aug 4, 2019.

Help Support HMEM by donating:

  1. Aug 4, 2019 #1

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    It must have been more then a year since I've learned about the arduino indexer software .
    This was immediatly classified in my head archive as a great project , wich I would
    certainly do someday .
    I have a drawer full of those projects in the back of my head .

    So I started collecting all kinds of parts , knowing that some day I would actually build this .
    And then it became all of a sudden very acute .

    I have this vintage 1986 toyota MR2Mk1 . Owned it since I was 27 , I'm 55 now .
    It has power windows , wich was in europe a very rare and expensive option in those days .
    The gear inside that regulator is known for breaking , and so did mine .

    A 3d printed gear seemed to be the way to go . And indeed it did
    Works like a charm , until summer came .
    The temperatures inside the door caused the PLA gear to deform , and it no longer functions .
    Printing a new one will not solve the problem , and I can't print in ABS .
    And even if I could , the original ones are nylon , wich is a pretty decent plastic .

    So there I was , needing to mill a 22Teeth gear .
    My real dividing head doesn't have a 33 hole disk .
    My "toy" dividing head ( more about this later ) has 60 and 42 fixed division plates .

    The choice was either to make an indexing plate , and be able to just mill 22T , or invest a little more time and finally build that arduino indexer wich would allow me to virtually make any division .

    The 3D printed gear . IMG-20190723-00384.jpg


    The core of the original gear was salvaged , and an ali ring was press fitted / locktited and bolted to it .
    I needed to keep the core because I have no way of reproducing the internal gear wich acts as a spline
    on the motor shaft .
    IMG-20190723-00385.jpg






    IMG-20190723-00386.jpg


    This ali ring will now have to be toothed Module 2 , Z=22 .
     
  2. Aug 4, 2019 #2

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    When I bought my mill , I was negotiating the price , and I remember saying something like owning a mill isn't everything . You'll need avice and clamps and a dividing head and and and ....

    The guy responded by opening a drawer and said here I'll let you have this one for free .
    Just put a small chuck on it and you're in business ....

    IMG-20190620-00347.jpg

    I remember thinking what on earth am I gonne use a toy like this for .
    I accepted it offcourse , and it sat on a shelf for almost a decade gathering dust . Until for some reeason I finally used it and it turned out te be such a handy little device I was mad at myself for not using it earlier .
    The little indexer has an internal morse taper no3 , it can be set at an angle , it is very sturdy and yet it is nice and compact The chuck came from some sale and with a custom made backplate it looks like it belongs there .

    First things first , a little cleaning , some measuring
    Here's the base , in wich the entire head can be tilted upwards
    IMG-20190620-00348.jpg

    Its spindle , wich has a coars external thread , and an internal morse taper .
    Most of the time I'll use the chuck , to mill a square or a hex its more then adeqate .
    If it has to be more precise , I use a MT3 to ER40 collet chuck .

    IMG-20190620-00349.jpg
     
  3. Aug 4, 2019 #3

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Design considerations :
    The electronic conversion has to be reversible so that the unit can be put back in its original state .
    With as little , if possible none , damage to the existing setup .
    The tilting possability has to function also with the elctronics installed .
    Who knows , I might want to make a bevel gear someday :)
    And it has to look more or less OEM .

    This picture shows a laboratory shaker . They put test tubes in it , then they are heated and shaken .
    I had to discard it , and look and behold , a 72 t timing pulley was inside .
    Perfect for this conversion

    IMG-20181222-00247.jpg

    The pulley was bored and keyed to match the spindle .

    IMG-20190620-00352.jpg


    The original dividing plate next to the modified t-pulley . The boss on the pulley could have been a bit beefier , but it'll be ok .
    IMG-20190620-00353.jpg
    Here is the pulley installed . Looks like it belongs there and the fit on the spindle is a very light press fit .
    So far so good .

    IMG-20190620-00354.jpg
     
    Last edited: Aug 4, 2019
  4. Aug 4, 2019 #4

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Next is choosing a suitable stepper .
    I have boxes and boxes full of them . All from equippement I had to discard and take to the scrapyard .
    I found an intriguing looking stepper in one of those boxes .

    This is a planetary gearbox . Sun gear is driven by the stepper and has 12T .
    The ring gear is held stationary and has 108T . The carrier drives the output .
    Wich results in a 10:1 ratio , if I remember my formulae correctly .


    IMG-20190620-00350.jpg



    I had to make a new output shaft because the original one was an odd looking thing with a kind of coupler and a long sliding splined shaft .
    Impossible to add a timing pulley to this .
    I had to destroy it before I could figure out how it was assembled in the factory .
    Quite a hard part to make with all kinds of press fits and bearing fits .

    IMG-20190621-00356.jpg

    The output shaft has two flats , and is an interference fit into the carrier .
    So I had to mill two flats , and remember , I had already taken the dividing head apart for cleaning and greasing .


    The shafts for the planetary gears also broke during (dis)assembly . Some kind of cast iron ? Anyway 3 new ones had to bemade , again a press fit into the carrier .

    IMG-20190621-00357.jpg


    Once again it all went very well . Everything pressed together as it should and the gearbox rotates free without any binding . Dissasembley is impossible as the carrier covers the snap ring that holds the shaft to the bearings . If ever this needs to be taken apart again , I'll have to use the angle grinder just like I did when removing the original shaft .

    Bearings are imperial btw , quite unusual round here .
    Luckily they did survive and are in good shape

    The sun gear is a clamped fit to the stepper output shaft .
    All in all , quite an intriguin construction .

    IMG-20190621-00358.jpg
     
    Last edited: Aug 4, 2019
  5. Aug 4, 2019 #5

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    I could not find a way to attatch the stepper to the dividing head without drilling and tapping some holes .
    Clamping would have been my preferred method , as it is non inavsive and reversable .
    As the head can be tilted , the stepper mount should tilt along with it .
    So that also rules out bolting the stepper assembly to the mill table .

    IMG-20190624-00360.jpg




    Ended it up by centering the horizontal pivot , and drilled and tapped 5 bolts M6 .
    IMG-20190624-00361.jpg


    I choose a 5 hole bolt pattern , just for the fun of doing it .
    4 bolts would have worked to , 6 bolts would have been a more "traditional " choice .


    IMG-20190723-00387.jpg
     
  6. Aug 4, 2019 #6

    Cogsy

    Cogsy

    Cogsy

    Well-Known Member Staff Member Global Moderator

    Joined:
    Jul 30, 2012
    Messages:
    2,521
    Likes Received:
    726
    Gender:
    Male
    Location:
    Perth, Western Australia
    Interesting looking project. Just for interest, I learned of a way to 'heat treat' or 'temper' PLA so that it is more resistant to high temperature. If you bake your finished part in the oven at around 80 degrees Celsius for an hour, it will be much stronger and will hold up to higher temperatures. I needed a part for my dishwasher that sits in 65 C water. ABS was fine with the temperature but had issues with its mechanical properties (lack of flexibility) and PLA was failing almost instantly at temperature. Tried the 'baked' PLA method and I now get 100+ full temperature dishwasher cycles before I have to replace the PLA part. Probably too late to help you now but handy info for the future.
     
  7. Aug 5, 2019 #7

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Cogsy that is good advice , I will certainly give it a try .
    I would prefer a plastic gear to engage a plastic gear over an aluminium one , so if this works
    I will probably stick with the 3D printed gears .

    Here are a couple of more pictures of the planetary gearbox .
    What I like most about it is that it is an extension to an existing stepper motor .
    It has thesame nema23 footprint , so if the stepper motor fits , the gearboxed stepper motor will also fit .

    IMG-20190724-00388.jpg

    What can be seen in this picture is the result of poor planning .
    I did not really make drawings for this project . Just designed it while machining it ....
    So at first I made 4 press in bolts , M5 . Wich worked ok , only the nuts did interfere with the timing belt .
    So I countersinked two of the bolts on the motor mount to then find out I had no way of putting the nut on one of them . Finally a press in nut was made , but it had to be M4 , as the hole in the gearbox is only 5.2mm .
    An M5 tapped insert simply breaks as it has only a wall thickness of 0.1mm .

    I could have bored it out , or even threaded it M6 . But I prefer to keep things as they are if possible .

    That results in two M5 press in bolts , one M5 bolt with a nut and one press in M4 nut or sleeve .
    It works allright , but as I said .... poor planning .


    IMG-20190724-00389.jpg
     
  8. Aug 5, 2019 #8

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Then I started thinking about the motor mount itself .
    Any belt driven system needs some kind of tensioning device .
    Started thinking about spring's and idler pulleys . And as the device can turn both cc and ccw , the tensioner would have to be symmetrical .

    Then I came to my senses and decided a simple hinged setup would do .
    A plate was made on the rotary table that would fit the 5 bolt pattern I drilled in the pivoting part of the dividing head .
    Prior to drilling , I indicated the head offcourse , so the top bolt is at tdc so to speak .
    IMG-20190724-00391.jpg

    As I wanted it all to look a bit oem , I painted some of the parts in thesame green hammerite paint .

    IMG-20190724-00392.jpg
     
  9. Aug 5, 2019 #9

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Then I made the moveable part of the hinge .

    This is a casting from a cnc project I've been building for some time now .
    I goofed up this casting , but it has enough material left to carve out the motor mount with hinge I need .

    IMG-20190625-00367.jpg

    Unless you go to fast , try to eat away to much material in a single pass on a poorly supported part .
    Damn , I was nearly there .
    IMG-20190625-00366.jpg

    This part was ruined . The crash popped it out of the vice , deforming it in the process .
    I had a second goofed up casting , and with the lesson learned from the first one the second one came out as it should .
    Lucky because I didn't have a third one .

    The picture also showes the hinge bolts .
    Once again the result of poor planning . Initially they both were thesame .
    But the head of one bolt interfered with the belt , so I had to machine it down and shorten it .
    If I had drawn it first , with a bit of strategic placing of the stepper motor all this could have been avoided .


    IMG-20190724-00393.jpg
     
  10. Aug 5, 2019 #10

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Time to put it all together .
    The hooked part was also made on the rotary table and is used to tension the belt .
    When the dividinh head is not needed and in storage , I can easily release the tension wich I hope will preserve belt life .
    Don't really know , but it can't hurt for sure .

    Some of the parts got a lick of green paint .

    The locking lever comes from a biopsy cutting device . I can't help but to collect all kinds of parts , but sometimes
    some something comes in handy . Sometimes , maby 1% of all I collected is ever used again .


    The two tapped holes are for future upgrades .
    Maybe a home sensor , maybe a belt protection ,, maybe they'll never be used .
    I don't know yet .

    This picture also shows how the belt interfered with the two bolts on the left side , and the hinge bolt .
    IMG-20190724-00402.jpg
    Doesnt look like it , but I have plenty of clearance when the head is tilted to 90° .
    It can be done , even when bolted to the mill table without the back of the stepper touching the table .
    I could even put on a much larger stepper , we'll get to that when we get to the electronic partof the project . .

    IMG-20190724-00403.jpg

    IMG-20190724-00404.jpg
     
  11. Aug 5, 2019 #11

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    About the timing belt pulleys .
    I've never been able to find a cutter to machine them .
    Various module and DP cutters can be obtained from almost every source .
    But as for timing belt cutters there seem to be none . I did find some hobs though .
    Small pulleys are not worth the effort as they are dirt cheap , but a 70T pulley is quite
    expensive . Just imagine needing a 100T pulley .

    Sure , an XL profile can easily be fly cut with a homemade cutter .
    But an HTD profile fi , wich is basicly a half round tooth is already less easy .
    And can very well imagine a fly cutter getting dull when cutting 72Teeth .
    Anyway for this project the question is academic . I don't need to make my own pulleys .

    Then , I had to guesstimate the belth lengt .
    Wrapped a string around both pulleys and measured the min and max lenghts .
    It had to be 186 or 188 XL .

    So I ordered some chinese T belts . 5 belts in two different size for a whopping 11$ s&h included .
    They will never stop to amaze me .
    IMG-20190724-00396.jpg


    Turns out both sizes , 186 and 188 fit and can be used without a problem .
    And even an 190XL would be withing the range of my tensioning device .
    My guess / measurement wasn't that bad after all .
     
    Last edited: Aug 5, 2019
  12. Aug 5, 2019 #12

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    As for smaller pulleys , I had several choices .
    IMG-20190625-00365.jpg

    I more or less arbitrary choose the 15T wich also came from the test tube shaker .
    72/15 gives a 4.8 ratio .
    Multiplied by the 10:1 from the planetary gearbox , that results in an overall ratio
    of 48 . I think , with the stepper and a microstep driver that will be more then adequate .

    The 18T pulley would have resultd in a 40:1 ratio wich is almost the standard in dividing heads .
     
  13. Aug 5, 2019 #13

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    I removed the mechanical indexing pin and plugged the hole to avoid swarf getting into it .

    Nothing damaged , nothing irreversible .
    It can be put back should I ever want to return to manual indexing . IMG-20190724-00395.jpg

    That's it as far as the mechanical side of things is concerned .
    I need to make a couple of hook spanners , I'm quite ashamed how bruised and battered the chuck and backplate look from years of abuse .
    No more, I'll make a set of decent spanners first . IMG-20190620-00354.jpg
     
  14. Aug 5, 2019 #14

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    For the electronics I found this enclosure .
    I kinda liked it and put it aside for when ever I would make the arduino indexer .

    IMG-20190101-00248.jpg

    Gutted the internals and kept only the box .
    Some nice parts among them , but all quite obsolete now .
    I did keep the varable transformer . IMG-20190101-00250.jpg
     
    NickP likes this.
  15. Aug 7, 2019 #15

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    I had to carefully plan and design the layout of all the components to match the existing holes in the enclosure .
    That is more or less the downside of using parts that have been used before .

    I first made a drawing of the existing layout .
    Then I drew the outline of the new parts and tried to cover all the existing holes .
    A few evenings of shifting and positioning .

    Then it was milling time . With the sloped box it was'nt as easy as I thought to clamp it to the mill table .
    Once done , I centered the dro at one existing hole , wich was used as a reference point .
    And started milling and drilling from there .

    IMG-20190619-00345.jpg
     
  16. Aug 7, 2019 #16

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Most people , if not all , use an arduino uno and a button shield .
    Like the sainsmart , df robot and many many others .

    dfrobotshield.jpg

    I did to , initially , to see if I was able to upload the software and get it running .
    I use the sketch written by rodw .
    The uploading and use of the sketch has been very wel documented on this forum , so I'll skip that part .
    If the instructions are followed to the letter even a software analfabetic like me can do it .

    Once this was all up and running , I decided I wanted something else for the final version .
    I searched for the largest 2*20 lcd I could possably find and bought that one .
    My eyes aren't 21 anymore , so I like a bigger more readable character .


    IMG-20190708-00374.jpg

    Offcourse this display doesn't fit the arduino uno . It can be wired to it , but that is messy aand will sooner or later fail due to bad contacts , wires getting loose etc .

    I opted for an arduino nano instead .
    nano.jpg

    Wich is , at least I thought it was , a miniature version of the uno .
    It is , but not quite . More about this later .

    And I designed a few pcb to glue it all together .
    The pcb also holds a connector for the stepper driver , a 5v stabilizer and a connector for the button pcb .

    IMG-20190708-00377.jpg

    Picture shows my larger version compared to the uno with button shield version .

    The nano pcb is sandwiched with the display . IMG-20190708-00375.jpg
     
    Preston Engebretson likes this.
  17. Aug 7, 2019 #17

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    At first I thought to make a single pcb holding all the components thus reducing the external wires to a minimum .
    That was pretty hard to do mostly because display and swithches needed to be at an exact height from each other
    to fit the enclosure .
    I settled for two pcb , one with all the switches and the resistors and a second one with rest of the electronics and the display .

    The switches are bought off ebay . They have a lit arrow on them and I like the look of them .
    Unfortiunatly the arrows are silver in colour , and the circles wich are the select and reset button are black .
    I would have liked at least the select button to be thesame colour as the arrows . IMG-20190627-00370.jpg IMG-20190708-00379.jpg

    The illuminated switches are hard to take pictures of .
    The camera doesn't like the blue lights and converts them to white .
    In reality the backlight of the lcd and the switches match pretty good .
    The reset button on top has a different colour , I used a red one for the reset .
     
  18. Aug 7, 2019 #18

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    For the stepper driver I had an A3977 based driver board . It has never been used .
    The A3977 is a single chip micro step driver with several features integrated in the chip .
    Full half 1/4 and 1/8 step .
    35Volt max , 2Amp .
    Normally I don't really like single chip solutions , but this one is one of the better chips that are out here .
    Sadly it is no longer manufactured in 44pin plcc package wich is not to hard to hand solder .

    We have a fixed load on the stepper , this is an indexer not a rotary table .
    So all the motor has to do is position the chuck , it will not be subjected to cutting forces .
    Speed of indexing doesn't really matter , so we're not after the last bit of rpm we can get out of this motor .Who cares if it takes half a second or one or maybe two to step to the next position .
    And rod did an excellent job using a ramp up /down speed algorithm .

    So in this case I can see no reason not too use a single chip driver . No need for expensive driver units
    like gecko's .

    a3977.jpg
    My stepper motor needs about 1Amp/phase so the driver could even be used without the heatsink .
     
  19. Aug 7, 2019 #19

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    Power supply anyone ? :)

    IMG-20190726-00405.jpg

    These are industrial power supply 12V / 24V /48V in various amperages .
    Quite often they fail and the company that does the maintenance of the machines they are used in simply replaces them .

    The reason they fail is bad capacitors . Some have two like this one , the larger power supplys will have more up to ten or twelve .

    IMG-20190726-00406.jpg


    It's difficult to see in this picture but the two green/gold capacitors in the front have a domed surface .
    It should be flat .
    Meaning they have had a pressure build up inside wich deforms the aluminium housing .
    The pressure build up comes from bad or leaking electrolyte inside .
    Wich doen't cause them to fail right away but does increase the internal resistance .
    And that has an avalanche effect . Temperature rises , causes more electrolyte to evaporate , causes more increase in resistance , causes more rise in temperature etc etc .

    Until the unit goes bad and is replaced .Somtimes the caps will even burst and cause a miniature explosion .

    So all it takes is replacing the bad capacitors with new ones . I replace all of them at once . There's really no telling wich one is bad and wich one isn't . The cheap 3$ for 10 pieces ebay ones seem to preform just as good as the 1.5€ each ones wich I buy at the local electronics store .

    For this project , I need a maximum of 35V , and 1 amp / phase for the stepper . The stepper has two phases .So the smallest one I had was 24V 3.5Amp , wich will do fine .
     
    Preston Engebretson likes this.
  20. Aug 7, 2019 #20

    stragenmitsuko

    stragenmitsuko

    stragenmitsuko

    Well-Known Member

    Joined:
    Jan 19, 2016
    Messages:
    213
    Likes Received:
    76
    I did put an external 7805 voltage regulator on the pcb I made .
    It is rated at maximum 35 V input so I could have hooked it up directly to the 24V supply .
    I perefer not to push things to their limits and used an external 9 Volt supply for the logic instead .
    That way the regulator has to drop 4 volt only instead of 19 .

    A left over phone charger is all it takes , and I had plenty of room in the box anyway .

    The little black box in the lower left corner is a modified phone charger wich has 9V dc out at 0.85 Amp .
    PLenty for a few leds and the arduino .

    IMG-20190802-00021.jpg
     
    Preston Engebretson and Cogsy like this.

Share This Page