Electronic (Arduino) Rotary Indexer - Another One

Discussion in 'Machine Modifications' started by kquiggle, Jan 19, 2018.

Help Support HMEM by donating using the link above.
  1. Jan 19, 2018 #1

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    268
    Likes Received:
    66
    Introduction:

    This thread is a variation based on the excellent post by bmac2: Arduino Rotary Table for Dummies. First, I want to acknowledge that the electronic part of my build is based 100% on bamc2's post. However, I took a somewhat different direction in the Arduino programming and in the "rotary table" (because I didn't use one!). If you are interested in this post at all, I strongly recommend that you read bamc2's post first.

    I've started this new post because I did not want to detract from bmac's post in any way, or post items to that thread which were starting to veer off in other directions. With that said, here are the areas where I went in a different direction:

    First - I decided from the start that I wanted to try a build that did not use a rotary table. Instead, I built an indexing head with a collet holder which connects directly (no belts or gears) to a stepper motor. As I write this, the mechanical part of the build is complete (see below), but I am still working out some final details.

    Second, because my "straight through indexer" requires some approximations in setting the stepper motor positions, I took the Arduino code posted by bmac2 and made some extensive revisions and additions. The advantage of this new code is that it makes it easy to select angular positions which are not an exact number of stepper motor steps, and still get a reasonably accurate approximation of the desired position.

    I'll get into more detail on these two areas in subsequent posts.

    Here is a link to my build page (still a work in progress as I write this): https://sites.google.com/site/lagad...ls-etc/build---electronic-indexing-head?pli=1

    Here is the (nearly) complete indexing head/collet holder:

    indexer.jpg
     
  2. Jan 19, 2018 #2

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    268
    Likes Received:
    66
    My goal for this build was to create an electronic indexing head which I can use to make gears, knobs, and other small parts requiring milling at defined angles. Parts for milling will be held in an ER32 collet holder (or mounted on mandrels held in the collet holder).

    From a high level view, this build has three parts:

    1. Electronics - the stepper motor and associated electronics
    2. Code - the computer code which determines stepper motor movement
    3. Fixture - the mechanism which connects to the stepper motor on one end, and holds stock for milling on the other end.
    Here I will talk about the fixture, and the current state of the build. The build consists of these primary parts:

    1. Baseplate - holds all other components, and fastens to the mill table
    2. Stepper motor holder - holds the stepper motor
    3. Flexible connector - connects stepper motor to collet holder (I purchased this part)
    4. Collet holder support - supports the collet holder and bushing in which the collet holder is mounted
    5. Collet holder - (purchased) ER32 collet holder for holding stock (or mandrels for holding stock) for milling
    The picture below shows the (nearly) complete fixture mounted on my mill table for initial testing. The brass lever in the middle is used to mechanically lock the collet holder in place for milling. For this setup, I used a test indicator to first mount the baseplate square to the table. The, I used the indicator to determine the TIR. For this purpose I mounted a carbide cutting tool in the collet holder, and measure against the shaft of the tool. Before using the carbide tool as my standard, I checked it with a micrometer to make sure it was accurately "round." Based on this test, I came up with a TIR of 0.0035" - not great, but acceptable for my purposes.

    See also my build page here: https://sites.google.com/site/lagad...ls-etc/build---electronic-indexing-head?pli=1

    indexer-first-test.jpg
     
  3. Jan 19, 2018 #3

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    268
    Likes Received:
    66
    As noted in the introduction, I built the electronics based on a post by bmac2 (Arduino Rotary Table for Dummies), and I really have nothing to add to that very thorough write-up.

    At this stage of my build, I have simply mounted the components on a "breadboard" as shown in the picture below; I'll build an enclosure later. The parts shown in the picture, starting from the lower left and going clockwise:

    1. Stepper motor controller
    2. Arduino Uno (computer - a Chinese clone in this case)
    3. Display
    4. Keypad
    5. Power supply

    electronics-breadboard.jpg
     
  4. Jan 19, 2018 #4

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    268
    Likes Received:
    66
    The computer used in the build requires code to operate, and bmac2 provided such code in his write-up. However, that build assumed that gearing, a belt drive (or both) would result in the stepper motor's steps (typically 200 steps per 360 degrees) to be converted into rotary motion that would be evenly divisible into 360 degrees. Since my build does not use gearing or belts, I needed to revise the code substantially. In addition, the discussion in bmac2's post included some suggested improvements which I also incorporated into my code.

    At this time, I have a good working version of the code, but I will probably make additional changes. The current code, and any updates, will be posted to my build log here:

    https://sites.google.com/site/lagad...ls-etc/build---electronic-indexing-head?pli=1

    To see the changes I made, the best thing to do is to examine the code itself. However, I will also provide a brief explanation here.

    The code changes were made so that when stepper motor and rotary table parameters are entered into the program, calculations will be made in two ways [Note: In this explanation I will use "steps" to mean either full steps or microsteps, whichever the stepper motor is set for.]:

    First, the program will calculate the exact ("theoretical") number of steps required to move a specified number of degrees; this may be a fractional number even though the stepper motor cannot move a fractional step. The program also keeps track of the total number of theoretical steps moved.

    Second, the theoretical number of steps are converted to "actual" (integer) steps. The program also keeps tracks of the total number of actual steps moved.

    The determination of the required number of steps to move is in all cases based on the theoretical steps, which are then converted to actual steps. This method provides the best approximation (typically with an error less than 0.01%), and enables the easy use of gear and table ratios which do not divide exactly into 360 degrees.

    The table below shows an example for a circle divided into 7 divisions, for a stepper motor which makes 3200 steps in 360 degrees (note that position 0 and position 7 are the same physical position). The first column shows the division number, second column shows the number of steps the stepper motor would turn if it could make fractional steps, and the third column shows the actual number of (cumulative) steps the motor will turn when my revised code is used. For fractions of <.5 the steps are rounded down, for fractions of >=.5 the steps are rounded up.

    Although I have used 3200 total steps in this example, the code can be set to whatever microstepping your motor is set for, as well as any gearing or belt drive ratios might be used in your setup, so this code can also be used if you are using a rotary table or a belt drive.

    HTML:
             Theoretical      Integer   
    Div      Position         Rounded                   
    0         0.000               0                   
    1         457.143           457                   
    2         914.286           914                   
    3         1371.429         1371                   
    4         1828.571         1829                   
    5         2285.714         2286                   
    6         2742.857         2743                   
    7         3200.000         3200
     
  5. Jan 21, 2018 #5

    kquiggle

    kquiggle

    kquiggle

    Well-Known Member

    Joined:
    May 29, 2012
    Messages:
    268
    Likes Received:
    66
    The two pictures below show my first two tests of the indexer - one fail and one success. The first test was in 1/2" brass rod, cutting with 4 divisions. I'm not exactly sure why this failed, but it may be because I did not properly lock the rotation for every cut.

    For the second test cut, I switched to (cheaper) aluminum 1/2" rod. This time I was very careful to lock the rotation before each cut. The result was a successful four-sided cut (note, the sides may not look parallel in the picture, but this is just due to parallax error in the camera).

    Build log is here: https://sites.google.com/site/lagad...ls-etc/build---electronic-indexing-head?pli=1

    test-cut-01.jpg

    test-cut-02.jpg
     

Share This Page