Electronic Dividing Head using the Arduino

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

Help Support HMEM by donating:

  1. Jun 9, 2012 #41

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Thanks, John. I doubt you are any more surprised than I am! I'm truly pleased with how well it works, and how convenient it is. I haven't tried any machining on the run. However, I do have the programming set up so I can adjust the speed of rotation as slow as I want.

    The ER20 collet will only take work up to 1/2". My main purpose for building this was just for indexing for gear cutting, radial drilling, etc. And of course, the learning process. I've always wanted to be able to use stepper motors and to write my own programs. Now I know how easy it is. I'm kind of itching to get my hands on a NEMA 34 or even NEMA 42 stepper. I think something that powerful could really have some possibilities. Of course, those require a whole other level of driver electronics not to mention power supplies.

    I've just ordered several different types of rotary encoders and gap sensors to make my own encoders. I see a lot of possibilities with those. Been thinking about an electronic gear hobber somewhere down the road...

    Chuck

    Chuck
     
  2. Jun 9, 2012 #42

    Blogwitch

    Blogwitch

    Blogwitch

    Ex Bogstandard HMEM Supporter

    Joined:
    Dec 26, 2008
    Messages:
    3,697
    Likes Received:
    667
    Gender:
    Male
    Occupation:
    Retired Aeronautical Engineer
    Location:
    Crewe, Cheshire, UK
    Chuck,

    I basically have very little knowledge about steppers, only that the Nema quote is the physical size of the mount not the power of the motor.

    I have been using these Nema 23 mount, 180 Ncm ones off here (2nd & 3rd ones down) and my power supply is a second hand (new old stock) 24 volt 3.5 amp waterproof power supply off an external security camera costing 8 pounds off eblag. They drive my 6" RT just great, and I am destined to do the same for my dividing head using the same size. If you have watched my vid, you will see that even fairly small ones like these can cut on the run very well.

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


    John
     
  3. Jun 9, 2012 #43

    rabdouglas

    rabdouglas

    rabdouglas

    Member

    Joined:
    Sep 11, 2011
    Messages:
    14
    Likes Received:
    0
    hi there

    when you have connected your stepper motor to your RT via your divison master can you control the rotational speed of the RT thro the division master for machining.

    regards rab
     
  4. Jun 9, 2012 #44

    Blogwitch

    Blogwitch

    Blogwitch

    Ex Bogstandard HMEM Supporter

    Joined:
    Dec 26, 2008
    Messages:
    3,697
    Likes Received:
    667
    Gender:
    Male
    Occupation:
    Retired Aeronautical Engineer
    Location:
    Crewe, Cheshire, UK
    Rab,

    You can adjust the speed of rotation, ramp up and ramp down (the speed when starting and stopping the rotation), even set up an overshoot then auto wind back to take into account of any backlash in the RT gearing system, for when drilling holes.

    You can even control the RT very accurately, manually from the keyboard, very handy when you are given odd degree measurements between say a set of holes around an arc or circle. I used that feature fairly recently when making a Canon lens mount, all the holes were different degree settings between them.


    John

     
  5. Jun 9, 2012 #45

    rabdouglas

    rabdouglas

    rabdouglas

    Member

    Joined:
    Sep 11, 2011
    Messages:
    14
    Likes Received:
    0
    hi john thanks for the infomation

    rab
     
  6. Jun 9, 2012 #46

    John S

    John S

    John S

    Well-Known Member

    Joined:
    Apr 13, 2008
    Messages:
    654
    Likes Received:
    40
    A remark from Chuck jogged a memory when he mentioned the Nano.
    Didn't realise the Nano was related to this beast because a while ago I had a guy write a program similar to the divisionmaster that was software based and ran on a PC with USB port.

    This was to go into a camera system and the PC that ran the camera could control the rotary table that had the part on for scanning. can't say much more as it is proprietary but i had the guy alter me one that I controlled, not the camera.

    This was a little box with a nano in it, USB type B in and a cable with 7 leads out of which I only used step direction and ground.

    This is the box and screen shot.

    [​IMG]

    Can be altered to suit a ratio and hold 4 different profiles.

    I don't own the rights or source code to this but may be able to get it.

    John S.
     
    bvd1940 likes this.
  7. Jun 20, 2012 #47

    salzburg

    salzburg

    salzburg

    Member

    Joined:
    Mar 30, 2008
    Messages:
    12
    Likes Received:
    2

    Question to cfellows:

    Do you have any plans to publish the program for this divider here?
     
  8. Jun 21, 2012 #48

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Yes, I can upload the program. I assume a text file would be best so it can be cut and pasted into the arduino IDE?

    Chuck
     
    xpylonracer and singhdarshan17 like this.
  9. Jun 21, 2012 #49

    salzburg

    salzburg

    salzburg

    Member

    Joined:
    Mar 30, 2008
    Messages:
    12
    Likes Received:
    2

    That would be realy great and generous , thanks.
     
  10. Jun 22, 2012 #50

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    singhdarshan17 likes this.
  11. Jun 23, 2012 #51

    salzburg

    salzburg

    salzburg

    Member

    Joined:
    Mar 30, 2008
    Messages:
    12
    Likes Received:
    2

    Chuck, thanks again for the program. I have ordered the arduino and sainsmart components. Am I right in assuming that your program

    works only with a 60:1 rotary table.

    John.
     
  12. Jun 23, 2012 #52

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    I have the program set up to work with my rotary table which is 72:1 or my dividing head which is 5:1. The program can easily be changed to work with any ratio and stepper motor combination. Have you tried to load and compile the progam yet? You can download the IDE here:

    http://arduino.cc/hu/Main/Software

    You can compile programs without an Arduino attached. It will just give you an error when it tries to upload the code to the Arduino.

    Chuck
     
  13. Jun 24, 2012 #53

    kf2qd

    kf2qd

    kf2qd

    Well-Known Member

    Joined:
    Apr 1, 2008
    Messages:
    477
    Likes Received:
    36
    With the Arduino IDE there is a "Verify" button that will compile without downloading to the Arduino for checking your program.

    I have done some work on using the Arduino as a Stepper Driver wound up putting the code in an ATtiny2313. I then go to some MOSFETs to drive a unipolar stepper. The driver uses Step & Direction inputs. Here's the link to the driver so far -http://arduino.cc/forum/index.php/topic,84809.0.html. I started developing the code on the Arduino board and then used the Arduino to program the ATtiny2313.

    I have an stepper attached to a 10:1 gearbox - should be able to get 4000 steps per revolution using half-steps.

    Depending on just what you are wanting to compile you can download version 0.23 and version 1.01 as there are a few things that work better with the older version.
     
  14. Jun 25, 2012 #54

    salzburg

    salzburg

    salzburg

    Member

    Joined:
    Mar 30, 2008
    Messages:
    12
    Likes Received:
    2

    Yes, I have downloaded the arduino software and while I am waiting for the arduino I am checking all the tutorials I can find
    on the net. The ratio of my rotary table I have to find by counting the screw turns for 1 turn of the table because there are no
    markings on it.

    kf2qd, I am going to check out your project. Sounds interesting.
     
  15. Nov 8, 2012 #55

    cwebs

    cwebs

    cwebs

    Well-Known Member

    Joined:
    Sep 12, 2012
    Messages:
    54
    Likes Received:
    13
    I want to thank you for posting this code. I have played with the Arduino and have a hard time grasping the code. I guess I'm getting to old to retain and understand code. This will be used on my RT project.
    I do have a couple questions.

    How do you get the program to reset so as to change the number of Divisions?

    And, this shows your RT and Divideing head steps. How do you switch between them?
    float stepsDiv = 0; // Steps per Division
    float numSteps = 1000.0; // Holds either Rotary Table or Dividing Head steps per rev.
    #define stepperDiv 1000.0 // Stepper Resolution.
    #define rotaryDiv 14400.0

    I have the ide working just haven't got the stepper driver board yet. It's in the mail.
    Thank you again for the work you have in this info, Carl
     
  16. Nov 8, 2012 #56

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Hi Carl,

    First, pressing the reset button on the Arduino board will cause the program to start over just like when you first apply power. However, the program is also written in such a way that you can change the number of divisions at any time by pressing either the up or down button.

    When the program first starts up, pressing the up or down buttons toggles back and forth between 1000 steps for the dividing head and 14,400 steps for the rotary table. Then, pressing the Select button, on the far left locks in the number of steps. After that, pressing the up or down buttons, at any time, will increment or decrement the number of divisions. Pressing the left or right buttons will move the stepper backward or forward one division.

    Hope that helps. If not, don't hesitate to ask for clarification.

    Chuck
     
    Last edited: Nov 8, 2012
  17. Nov 9, 2012 #57

    cwebs

    cwebs

    cwebs

    Well-Known Member

    Joined:
    Sep 12, 2012
    Messages:
    54
    Likes Received:
    13
    THanks you for the info and it works as advertized.
    I also found out from playing with the numbers that if I put in another number in.

    float numSteps = 1000.0;
    Like; float numSteps = 2000 gave me 400 steps per stepper revolution. Would that work if drive board is set for half stepping?

    That gave me three differant stepper counts to use. Just didn't click on the up or down button, just the select button. Didn't seem to screw any thing up. Don't know what I'm doing but it worked. Carl
     
  18. Nov 10, 2012 #58

    cfellows

    cfellows

    cfellows

    Well-Known Member Project of the Month Winner

    Joined:
    Aug 26, 2007
    Messages:
    3,891
    Likes Received:
    701
    Yeah, the program defaults to 1000 steps per rev. You only need to press the up / down buttons to change this value. If you press the select button without pressing either the up or down button, it uses the preset value in numsteps.

    In my current version of the program, pressing the select button a second time will let you use the up and down keys to set the stepper speed, that is, the delay between commands to step. Pressing the select button again will then go back to letting you set the number of divisions.

    You might try pressing the select button a second time and see what your version of the program does.

    You should get back into playing with programming the Arduino. It's a fascinating little micro controller and lots of fun to do different things with. One of the projects I have on the drawing board is to build a MIDI controller that I can plug into the iPad to control various synthesizer and music apps I've downloaded. I want to build a breath controller, like a flute, and a ribbon controller, like a steel guitar.

    Chuck
     
  19. Nov 10, 2012 #59

    cwebs

    cwebs

    cwebs

    Well-Known Member

    Joined:
    Sep 12, 2012
    Messages:
    54
    Likes Received:
    13
    Thanks, Chuck. I wondered what the S and the 5 was for. I was thinking it would be nice to control the speed just yesterday and "there you go".

    I have a draw full of Arduino stuff and found no REAL use for them untill your project. That is partly the problem of not getting into the code and understanding it better. Now look at what you have done to me! Carl
     
  20. Nov 10, 2012 #60

    chris

    chris

    chris

    Member

    Joined:
    Mar 13, 2011
    Messages:
    6
    Likes Received:
    0
    Chuck: having little knowledge of Electronics etc. Am I correct in assuming that if I obtain all the stuff mentioned in this thread and ask many questions. I will eventually have something which will give me fairly precise divisions for cutting clock wheels. I know I have over simplified this ,but am interested.
    Chris
     

Share This Page