Electronic Dividing Head using the Arduino

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

Help Support HMEM by donating using the link above.
  1. May 21, 2012 #1

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    I've made some strides on my Arduino powered dividing head the past few days. Here's a little background for what I am doing. First, the Arduino micro controller.

    [​IMG]

    Available online for under $30, has 32K memory, numerous analog and digital inputs and outputs, including serial and PWM.

    Next, the Sainsmart LCD display and keyboard shield

    [​IMG]

    This board is called a shield because it is pin compatible with and piggybacks right on top of the Arduino board. It has a 2 line x 16 character display and 5 input keys plus a reset. The keys are configured like the cursor keys on a PC having a left, right, up, and down as well as a select. So, with this shield in place, the microcontroller can be used with only a power supply and doesn't have to be tethered to a computer. The keys provide input and the LCD provides the display.

    Here is the Sainsmart shield mounted on the Arduino...

    [​IMG]

    The Sainsmart gets its power from the Arduino.

    Another picture

    [​IMG]

    The Arduino is programmed by hooking it up to your PC through a USB cable. This also provides power to the Arduino board. A free programming environment is available for the PC and allows you to develop programs in a language that looks almost exactly like C. There are a host of standard libraries for interfacing to LCD's, keyboards, wireless, serial devices, and others. You write the programs and compile them on the PC. The compiler then automatically downloads the program to your Arduino. Once the program is loaded on the Arduino, you can decouple it from the computer and run it off a separate power supply from 9 - 12 volts. The program will stay in the Arduino memory even when the power is switched off.

    [​IMG]

    So this is the basis for controlling my electronic dividing head. The up and down arrow keys will be used to set the number of divisions I want, then the left and right arrow keys will be used to step forward or backward one division at a time. The program I have written will calculate the number of stepper steps need for each division and keep track of the position I'm on. The display shows the number of divisions and the current dividing head position.

    I have purchased a stepper driver board that is about the size of a postage stamp and will power a stepper of up to 2 amps, 35 volts. I still have to select the stepper motor I want to use and build the mechanical part of the dividing head. Still have a few challenges ahead of me.

    Chuck
     
  2. May 21, 2012 #2

    stevehuckss396

    stevehuckss396

    stevehuckss396

    Senior Member

    Joined:
    Nov 19, 2008
    Messages:
    3,795
    Likes Received:
    892
    That is a great idea Chuck! I wonder if you could just send step and direction pulses to a Gecko drive. They can source 7 amp. Not so much for the driving force but for the holding power.

    Anyway, awesome project.
     
  3. May 21, 2012 #3

    Blogwitch

    Blogwitch

    Blogwitch

    Ex Bogstandard

    Joined:
    Dec 26, 2008
    Messages:
    3,646
    Likes Received:
    625
    Chuck, or in fact anyone else who is going along the electronic RT route. here are a couple of links on to how I did things to mount the stepper to the RT.

    You don't need to follow religiously, but they will give you an idea of what is required to get a backlash free with smooth movement RT, and to keep the swarf out. Once assembled, the slot in the tube is covered over with tape.

    Vertex type

    http://madmodder.net/index.php?topic=4040.msg44911#msg44911

    Arc Euro type

    http://madmodder.net/index.php?topic=4730.msg52166#top

    Hope it helps someone


    John
     
  4. May 21, 2012 #4

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
    Looks really nice so far Chuck.
    The stepper board you're looking at sounds like a Pololu driver. Is that the case? The A4988 version is quite good (certainly good enough for a dividing head), and really difficult to kill. By which I mean the short protection actually works. I tried it.

    I'm not sure too much holding torque will be needed, because of the worm drive. The one thing you will need to be careful of is that the pololu driver will get extremely hot if you don't give it a good heat sink, and even then will roast if you feed the motor more than about 1.25A. I have some heat sinks that work marvelously on the pololu drivers (if those are what you are using), and would be happy to send one your way.

    Best of luck.
     
  5. May 21, 2012 #5

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    Thanks, Steve. I don't see why this wouldn't work with pretty much any stepper driver, incluing the Gecko. There are two outputs from the Arduino... direction and step start/stop.

    John, I'll have a look at your thread. I'm sure there are number of issues you have thought of that I will miss otherwise.

    Yes, it is the pololu driver. I've sent you a private message regarding the heat sink. I haven't selected a stepper motor yet, but with a 30:1 worm reducer and no real load on the dividing head, I'm guessing it won't take much of a stepper.

    Chuck
     
  6. May 21, 2012 #6

    Blogwitch

    Blogwitch

    Blogwitch

    Ex Bogstandard

    Joined:
    Dec 26, 2008
    Messages:
    3,646
    Likes Received:
    625
    Chuck,

    I don't know what sized RT you have, but both I have converted (a 6" and a 4"), plus my dividing head when I get around to it, all or will use the recommended 180N steppers, which are rated at 2.5amps.

    OK, go small if you only want to move the table, but if you are going to use it for machining, even the 2.5 amp one that I use is a little underpowered, and I have to be careful on my depths of cut and feed speeds to stop them stalling.

    I would have preferred something around 4.5 to 5 amps to work really comfortably, but my unit just won't give that amount out.

    John


    Sorry, should have shown location of stepper motors

    http://www.arceurotrade.co.uk/Catalogue/Stepper-Motors/Stepper-Motors

    2nd or 3rd one down. They work out to approx 18kg/cm holding power.
     
  7. May 21, 2012 #7

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
  8. May 22, 2012 #8

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    I have two candidate steppers in my surplus stepper motor box. Both are bipolar and smaller than the NEMA 23, but I think either would suffice for my needs. This will strictly be a dividing head, not a rotary table and will be used just for positioning, not for machining.

    One motor is a 7.5 degree, 48 step motor with 16 oz in holding power. It requires 12 volts and the resistance per phase is approximately 28 ohms which works out to little less than half an amp. The other motor wants 5.2 volts at 0.9 amps and the resistance per phase is about 6.2 ohms. This second motor is a 1.8 degree and has a holding power of 30.2 oz in.

    At the moment, I'm leaning toward the first motor because I think 48 steps per rev is more than adequate for a dividing head geared down 30 : 1. This gives me an overall resolution of 1440 : 1. I'm also thinking that the Pololu driver I have will easily handle half an amp with no problem. And, finally, both the Arduino and the motor will operate off 12 volts which means I only need one power supply. Anybody see a flaw in my thinking?

    Thx...
    Chuck



     
  9. May 24, 2012 #9

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
    I'd go for the motor with more steps/rev and more torque. You'll get smoother, (and more importantly) faster motion.
     
  10. May 24, 2012 #10

    stevehuckss396

    stevehuckss396

    stevehuckss396

    Senior Member

    Joined:
    Nov 19, 2008
    Messages:
    3,795
    Likes Received:
    892

    You need the high torque to hold position while you do your work. More torque the better
     
  11. May 25, 2012 #11

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    Help! :-[

    Not having so much luck getting my stepper motor to work.

    I have the following loop to step the stepper forward.

    write direction pin HIGH Forward (or Backward depending on direction setting);
    loop:
    write step pin HIGH;
    delay (10);
    write step pin LOW;
    delay (10);
    repeat the loop n times (n=33 in this case)

    It will step one step forward, then nothing unless I press the back button twice, then the forward button again in which case it moves one step forward. It never moves backward...

    I know this is probably pretty fundamental stepper motor operation, but I can't make it work!

    Thx...
    Chuck
     
  12. May 25, 2012 #12

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
    I'm assuming the delay is in milliseconds?
    Things to check:
    Are the leads wired correctly?
    Is the separate motor voltage connected to the driver, and does it share a common ground with the controller?
    What is the current pot set at?

    Upload the code, maybe it's something subtle there.
     
  13. May 25, 2012 #13

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    Yep, Jeremy, it was subtle! I took a picture of the arduino and driver chip to upload and when I got to looking at it, I discovered my error. I thought I was using pins 3 for direction and 4 for step, but I got caught by the old zero base problem. The third pin is really pin 2 and the fourth pin is really pin 3. I just changed the program to work with 2 and 3 and it works great! I do have a bug when the position rolls over the top and back to zero that I need to work out but that will be simple.

    Since I took the picture of the circuit, here it is. Not too pretty, but I will tidy up the wiring when I finalize the whole thing.

    [​IMG]

    The resistors are 12K pull-down resistors. The leads from the stepper driver are soldered to the LCD / Keypad shield to pins which are carried through from the Arduino. I don't have the stepper leads hooked up in this picture. I'm also not using the half step, quarter step, enable or sleep functions. Don't think I'll need them.

    The 12v, .5 amp stepper has a lot of torque and holding power. And even though it's 7.5 degrees per step, I'll be driving the dividing head through a 24 pitch, 60 tooth worm gear. That will give me a huge amount of torque and holding power, not to mention 2880 steps of resolution.

    I'm Pumped!!! :big: I'll fix my program bug then take video to upload, maybe tomorrow or this weekend.

    Chuck
     
  14. May 25, 2012 #14

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
    Glad to hear everything is working now. I can't wait to see this working!
     
  15. May 26, 2012 #15

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    The worm wheel I want to use for my dividing head is a 60 tooth, 24 pitch bronze worm gear. Turns out I don't have a worm for it and I'm too impatient (and cheap) to order one from SDP. So, guess I have a go at making one. I figured if I replace the 48 tooth gear on my lead screw with a 46 tooth and set the quick change gear box to 8 TPI, that should get me 7.66 TPI which is very close to the 7.64 required for 24 pitch. I've got a tungsten carbide acme threading insert which I ground back to the right depth profile so we'll see how this goes.

    [​IMG]

    I'll be using the ER16 spindle for my dividing head spindle.

    Chuck
     
  16. May 26, 2012 #16

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    Here's a video of the preliminary setup. This doesn't include the dividing head, but does have the Arduino, the stepper motor driver and the stepper. You can see how I'm able to control the divisions per rotation of the stepper. I can change the program to work with any resolution by changing one variable.

    http://www.youtube.com/watch?v=ZRcPKY3APM0&feature=youtu.be

    Chuck
     
    myrickman, bvd1940 and xpylonracer like this.
  17. May 28, 2012 #17

    craynerd

    craynerd

    craynerd

    Active Member

    Joined:
    Aug 13, 2009
    Messages:
    33
    Likes Received:
    1
    Hi Chuck

    Excellent idea and this has been needed for some time with an Arduino.

    I recently did something similar to make a small dividing head for my horizontal milling machine: http://www.raynerd.co.uk/?p=1578

    Good luck with the build and I look forward to further updates! PM sent to you as well.

    Chris
     
  18. May 29, 2012 #18

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,878
    Likes Received:
    667
    Here's some pictures of the dividing head. I've hooked it up to the arduino and it works. More than enough torque and holding power using the NEMA 23 motor. The ratio of the timing pulleys is 12 : 60 or 1:5.

    [​IMG]

    [​IMG]

    [​IMG]

    The spindle is an ER20 with a 3/4" shaft running in sealed ball bearings.

    Chuck
     
  19. May 29, 2012 #19

    Jeremy_BP

    Jeremy_BP

    Jeremy_BP

    Well-Known Member

    Joined:
    Jul 26, 2011
    Messages:
    142
    Likes Received:
    7
    Looks great! When do we get to see it working?
     
  20. May 29, 2012 #20

    Maryak

    Maryak

    Maryak

    Well-Known Member

    Joined:
    Sep 13, 2008
    Messages:
    5,001
    Likes Received:
    73
    Nice one Chuck, :bow:

    At least you won't be confused by all the hoohaa associated with a mechanical one. :p

    Best Regards
    Bob
     

Share This Page