Electronic Dividing Head using the Arduino

Discussion in 'Software and Programming' started by cfellows, May 21, 2012.

Help Support HMEM by donating:

  1. Jul 18, 2017 #241

    markba633csi

    markba633csi

    markba633csi

    New Member

    Joined:
    Jul 17, 2017
    Messages:
    4
    Likes Received:
    0
    Chuck Fellows for president! Great work Chuck, I'm sure you have inspired hundreds of code newbies, me included.
    I purchased a SainSmart clone on Aliexpress, I found it was giving pushbutton errors quite often and I checked the voltage divider resistor values and 3 of them were wrong. The biggest error was that the top-most resistor was 3k instead of 2k. Big improvement in stability now. I'm thinking there might should be some decoupling caps on the shield Vcc? The stock board apparently has none.
    Mark S.
     
  2. Jul 18, 2017 #242

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    Chuck posted into this thread a steppermath.xls that shows the error rate for a 127 tooth gear cut. Easy enough to alter the values to check ones own mileage . . .

    For myself am adding a 10th degree option somewhere in the script - i.e. for 7.2 degree, - [stepsBy10thDegree = (Degrees * multiplier) / 10;]
    At 400 steps & 36:1, can get away with a reasonable error rate . .
     
  3. Jul 19, 2017 #243

    rodw

    rodw

    rodw

    Well-Known Member

    Joined:
    Dec 3, 2012
    Messages:
    1,132
    Likes Received:
    334
    I don't think there is any need to use hardware to debounce buttons when you've got the power of a microprocessor to do it in software. There are plenty of methods but here is one. https://www.arduino.cc/en/Tutorial/Debounce

    Foozer, Chucks spreadsheet on page 19 of this thread is specific to his algorithm so it can't be universally applied. Having said that, Chuck's algorithm accumulates steps, my (revised) algorithm accumulates errors. The end result is identical. The missed steps from rounding are spread around the full 360 degree circle.
     
  4. Jul 19, 2017 #244

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    Both do it well. Chucks was easier for me to adapt a NES controller as input device, yours being a bit more sophisticated left me at the time, like a deer in the headlights trying to adapt same controller . .
     
    rodw likes this.
  5. Jul 22, 2017 #245

    markba633csi

    markba633csi

    markba633csi

    New Member

    Joined:
    Jul 17, 2017
    Messages:
    4
    Likes Received:
    0
    My replica of Chuck's original design still glitches now and then, I thought it might be switch bounce but now I'm not so sure. I set up a 555 timer pulsing a transistor to simulate the "right" button closure and I still get occasional opposite rotations and sometimes the number of divisions will suddenly increment up or down by one count. It could be emi noise from my 8825 driver getting into the arduino a/d or possibly a hiccup in the code itself- I need to get out the scope and do some more checking. I can't trust it yet for actual gear cutting till I get more consistent results. Also I need to understand the code in more depth, especially the "move the stepper" section.
    Mark S.
    Mt. View, Ca
     
  6. Jul 22, 2017 #246

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Thanks for all the comments, folks. Very rewarding to see people are able to use the results of some of my work. It would be interesting to know just how many people have built a dividing head based on my software.

    For me, it was all in fun in developing a real world application for the Arduino. Love that little computer! My career started with programming in the Air Force back in 1962. Of course, that was a long before the advent of the C language, but the Arduino took me back to some of those earlier year experiences when computers didn't have much, if any, of an operating system.

    The most important test for me was to be sure that all my program values reset to their starting points after a full revolution in either direction. If one could accomplish that with a wide variety of different circle division numbers, then the algorithm was most likely working properly.

    Chuck
     
    Anatol likes this.
  7. Jul 22, 2017 #247

    markba633csi

    markba633csi

    markba633csi

    New Member

    Joined:
    Jul 17, 2017
    Messages:
    4
    Likes Received:
    0
  8. Jul 22, 2017 #248

    Foozer

    Foozer

    Foozer

    Well-Known Member HMEM Lifetime Supporter

    Joined:
    Nov 26, 2008
    Messages:
    1,164
    Likes Received:
    69
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Camano Island, WA
    I Made One . . .
    Little 3" rotary table with stepper mount similar to BMac's design.
    Trimming some trees, had a hunk of wood - First attempt at actually using it.
    One hole, wrong spot . . .

    fly1.jpg
     
  9. Jul 22, 2017 #249

    almarghi

    almarghi

    almarghi

    Member

    Joined:
    Aug 14, 2011
    Messages:
    11
    Likes Received:
    2
    I have build two of them, using arduino nano with some small changes (regarding the outputs) and I didn't have any problems with the algorithm, but with the key voltage levels on the analog input. Both worked perfectly from the first time, without any issues.
    Since I don't trust any contraption without feedback, I oversized all power components - motors and power supplies - and it worked. For supplying the arduino board, I have build a swithing 9V dc-dc converter and I have used its onboard 5V linear supply.
    in the attached picture you can see a bearing cage with 64 holes. No position error detected.
    Please excuse my bad english,
    Alex

    P0002_072416.jpg

    IMG_20170617_113513.jpg
     
    markba633csi likes this.
  10. Jul 26, 2017 #250

    ShopShoe

    ShopShoe

    ShopShoe

    Senior Member

    Joined:
    Oct 2, 2010
    Messages:
    910
    Likes Received:
    163
    Ever since Chuck Fellows posted the original article, I have been working on this. My inability to get much shop time in has made it take so long, but now it is to a point where I can post my progress.

    Originally, I started to make both the rotary table and this version, and I ordered a 4-inch rotary table from Grizzly which turned out to be so non-ridgid as to make the rotary table version a dead end for now, although I might revisit it at some point.

    I chose a spindexer as the basis for the unit as I have a selection of 5C collets and one thing I often do is use them with collet blocks to make 4-sided and hex ends on rods and get tired of indexing with the blocks, especially if my setup is somewhat tricky.

    ShopShoe_Indexer_M_1055.jpg

    Before doing much else, I machined a key slot in the base parallel to the shaft and then carefully machined off the base casting to provide a way to also mount the entire assembly in my mill vise. I may never use the key slot, but at least it is there if I want to.

    ShopShoe_Indexer_M_1056.jpg

    The next step was a piece of 0.25 aluminum, which was repeatedly modified as the project proceeded. It is a little rough, but I see this as a usable experiment rather than a bling contender.

    I made things easier on myself by using Chuck's original drive ratio, choosing a timing belt and pulleys from McMaster-Carr (Usual disclaimer: No ties to them).
    To avoid milling or drilling the spindexer shaft, a taper lock was made for the shaft drive pulley, although I later found out that the motor had enough torque make things slip and I decided to add a 0.125 key to keep things locked up.

    ShopShoe_Indexer_M_1057.jpg


    I also used Chuck's version of the Arduino, Chuck's driver board, and Chuck's keyboard shield. I added sealed momentary switches and connected them in parallel to the switches on the keyboard shield, and just drilled a hole to allow using the reset switch with a paper clip or somesuch. I found few reasons to need reset, and fewer buttons simplifies the panel. The circuitry is mounted in a diecast aluminum box, and a piece of 0.25 plexiglass is milled to fit into a milled-out window in the box to see the display.

    ShopShoe_Indexer_M_1062.jpg

    A separate power supply can be placed somewhere away from chips and coolant and saves having to cook up an elaborate enclosure. A modified square electrical box provides for enclosing the AC connections and also holds a separate 9-volt supply for the Arduino and other circuit boards. The motor power supply is 12-volts, which is adequate for this use. The red neon indicator signifies AC input to the box. The green indicator signifies the 12-volt supply is on. Connection to the control box is with 4-conductor cable, 2 conductors for each power supply. I used the square 4-conductor connectors to make sure that connections are never confused.

    ShopShoe_Indexer_M_1064.jpg

    I find the indexing works well enough for my use. I did need to experiment with the numbers of steps just a little, but most problems were due to mechanical slippage or to electrical crosstalk during the breadboard stage. Once everything was buttoned up and enclosed it settled down.

    https://youtu.be/B60SzUv1BEw

    I still have a little bit of fiddling to do, cleaning up dykem and etc. I bought the Arduino experimenter kit and have another Arduino now and another driver board, so I may do some more experimenting.
     
    almarghi likes this.
  11. Jul 28, 2017 #251

    jeep534

    jeep534

    jeep534

    Member

    Joined:
    Jan 23, 2013
    Messages:
    13
    Likes Received:
    3
    Your english looks fine from here :thumbup: I would like to know more about your indexers with more (bad english) and pictures...
    Thank You
    archie
     
  12. Jul 28, 2017 #252

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Thanks for posting, Shopshoe. It's great to see folks getting some good out of this thread.

    Chuck
     
  13. Aug 1, 2017 #253

    almarghi

    almarghi

    almarghi

    Member

    Joined:
    Aug 14, 2011
    Messages:
    11
    Likes Received:
    2
    Hi jeep534,
    there is not much to tell. You can see both of them in the photos. One of them is vertical, the other horizontal.
    The vertical one is a gear belt type, 1:5, with an normal XL037 belt. There is only one bearing inside, double row angular contact, SKF3306 ATN9, to be as flat as possible. My milling machine is an Optimum BF20L, small but not very rigid :(, so I have to be as low as possible with the spindle.
    The second dividing head, is a 1:80 HarmonicDrive personal construction. Unfortunatelly I lost all photos I made during construction. I have only the project drawings left and I can take some pictures of the completed head.
    Since I work mostly with aluminium, large diameters with thin walls, the Harmonic Drive head has now a 6jaw , 100mm chuck to prevent deformation.
     
  14. Aug 2, 2017 #254

    Captain_Obvious

    Captain_Obvious

    Captain_Obvious

    Active Member

    Joined:
    Jun 3, 2017
    Messages:
    43
    Likes Received:
    17
    Hi all,

    Sorry for the delay, but I've been a bit busy lately. I finally got the dividing head somewhat finished. I still need to make a box for the PSU and the stepper driver, but the actual dividing unit is now complete. I haven't tried it out yet, but I don't see why it wouldn't work just fine.

    As I mentioned before, I did contemplate making some sort of a spindle brake, but it seems pretty pointless, as the steel reinforced polyurethane belt is much more rigid than the original rubber belt I was planning to use. I'll have to take some test cuts and see how rigid this thing actually is.

    The spindle housing is a solid chunk of steel with a hole bored through and a recess milled at both ends for the 6007 ball bearings. Not ideal bearings for this purpose, but they do seem good enough. If I choose to use angular contact bearings, I still have plenty of material so I can bore the bearing seats a bit larger. The motor bracket is aluminium.

    The spindle is an ordinary straight shank ER32 collet holder and the stepper motor is a 3Nm Nema 23 unit running at 48V.

    div1.jpg

    div2.jpg
     
    Anatol and almarghi like this.
  15. Aug 3, 2017 #255

    ddmckee54

    ddmckee54

    ddmckee54

    Well-Known Member HMEM Supporter

    Joined:
    Jul 8, 2009
    Messages:
    193
    Likes Received:
    23
    Pink with white polka-dots? Not exactly your average machine tool color scheme. Did you lose a bet and have to paint it that color?

    Don
     
  16. Aug 4, 2017 #256

    Captain_Obvious

    Captain_Obvious

    Captain_Obvious

    Active Member

    Joined:
    Jun 3, 2017
    Messages:
    43
    Likes Received:
    17
    No lost bets here. I firmly believe it should be mandatory to paint all metalworking machinery pink. Polka dots are optional due to their mildly psychedelic effects which may result in either futuristic machine designs or severed limbs.

    Besides my shop is already full of boring green and grey and black machines.
     
    Anatol, oliomio and joco-nz like this.
  17. Aug 11, 2017 #257

    markba633csi

    markba633csi

    markba633csi

    New Member

    Joined:
    Jul 17, 2017
    Messages:
    4
    Likes Received:
    0
    Let's hope the severed limbs are just a hallucination
     
  18. Aug 12, 2017 #258

    almarghi

    almarghi

    almarghi

    Member

    Joined:
    Aug 14, 2011
    Messages:
    11
    Likes Received:
    2
    just finished a m0.8, z153 gear. No problems on dividing

    IMG_20170810_173338.jpg

    IMG_20170812_081026.jpg
     
  19. Aug 12, 2017 #259

    tjwal

    tjwal

    tjwal

    Well-Known Member

    Joined:
    Sep 22, 2013
    Messages:
    66
    Likes Received:
    6
    Nice. Is that a focusing ring? I 3d printed some for my son. I've since acquired a cutter but haven't tried it yet.
     
  20. Aug 12, 2017 #260

    almarghi

    almarghi

    almarghi

    Member

    Joined:
    Aug 14, 2011
    Messages:
    11
    Likes Received:
    2
    yep! ;) You good guess! 115mm inside, 15mm wide
     

Share This Page