Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: _ Advice, Help and Info with a stepper motor and Arduino

  1. #1
    Join Date
    Feb 2013
    Location
    New York
    Posts
    546

    Post _ Advice, Help and Info with a stepper motor and Arduino

    I would like to start a long term project (converting a manual mill to a hybrid) .

    First stage will be hooking a stepper motor to the Z axis and (hopefully) controlling it manually with a homemade “pendant”. This will be a long term use (and focus of this thread) in case the full hybrid project never gets finished.

    For the record, I know nothing about stepper motors, drivers or Arduino.

    Mill head weighs around 200lbs
    Right now i have no plans on swapping the current lead screw to a ball screw.
    Currently I have a 12v cordless screw guns motor moving the head up and down, the motor does not strain too much while moving the head up, obviously coming down is not a problem.

    What I would like to do:
    • “rapid” with a momentary toggle switch
    • feed with a toggle switch
    • potentiometer to set the feed
    • move the head at .0001 .001 and .01 increments with a hand wheel and selector switch
    • have a re-settable readout which can be used as a DRO (I understand there is a lot of room for error & backlash counting on the lead screw like this and not using real scales, but for the Z, i would just like to zero out and then move down xxx distance)
    • bore & drill to a depth by hooking up a number pad to Arduino, keying in distance (displayed on a second readout) then flip a switch to “engage/start”
    • Use a 12v PC power supply to run everything


    So far heres where im at:
    • Stepper motor (Nema 34 1290 oz) too big, too small ???
    • Arduino Mega 2560 or Arduino Due (knowing nothing, they seam to have the most flexibility/options)
    • Arduino Motor Shield to drive the stepper motor


    The motor will mount on side of column and drive the lead screw via a pulley (have height issue, can not directly lead screw)

    Questions:
    How do these Arduino boards work ?
    1. Do you write the code on a PC
    2. hook a PC to the Arduino
    3. offload the code to the Arduino
    4. disconnect the PC from the Arduino
    5. and now the Arduino runs as a standalone with the code you saved to it ?



    Since I have no need for a PC in the current plan, I do not want one in the operation. I would like to use the Arduino like a “stand alone” device.


    With all of that said, am I close, will it work, what else do I need ?
    What would be better, Arduino Mega 2560 OR Arduino Due ?
    Aside from the switches, buttons, displays, etc for the “pendant” and the code; will the stepper motor, Arduino Mega and Arduino Motor Shield accomplish what im looking to do ?

    Hope I didn't miss anything...
    Any input would be great, any input conveyed like im a simpleton would be better

    Thanks...

    _
    ~ What was once an Opinion, became a Fact, to be later proven Wrong ~
    http://site.thisisjusthowidoit.com
    https://www.youtube.com/user/thisisjusthowidoit

  2. #2
    Join Date
    Apr 2009
    Location
    Ashburton, near Christchurch New Zealand
    Posts
    6,590

    Default

    Hi

    Questions:
    How do these Arduino boards work ?
    They are a little micro computer on a standard circuit board that you can program yourself and you can plug various sub boards in to. The sub boards are called 'shields'

    Do you write the code on a PC
    Yes, it is easy if you are experience with versions of 'C'.

    hook a PC to the Arduino
    There is a USB socket on the Arduino


    offload the code to the Arduino
    It is all taken care of in the editor program that you use to write the program.

    disconnect the PC from the Arduino
    Pull the USB cable out!


    and now the Arduino runs as a standalone with the code you saved to it ?
    Yes, thats right although it will need a power supply which you would not have needed when it was plugged into the PC's USB port.

    With all of that said, am I close, will it work, what else do I need ?
    You will need bits and pieces, which may be available as shields, to connect the Arduino to the actual physical devices you want to use. You will need a stepper motor shield and you will need power supply for the Arduino and the stepper(s).

    You will also need some means on putting your commands into the Arduino which might be a shield with push buttons or something custom built that you connect to a port on the Arduino.

    What would be better, Arduino Mega 2560 OR Arduino Due ?
    I think any Arduino would do your task, otherwise sorry but I am not familiar with the various versions available.

    Aside from the switches, buttons, displays, etc for the “pendant” and the code; will the stepper motor, Arduino Mega and Arduino Motor Shield accomplish what im looking to do ?
    First thing is make a detailed plan of exactly what you want to do and go online to get the plan checked by others more experienced. Here as it is a machining application or the Arduino website where there is a lot of knowledge and helpful people (there are also some smart alek snot gobblers who should be confined to their mothers basement, but thats another story.)
    Last edited by The Artful Bodger; 05-26-2014 at 10:10 PM.

  3. #3
    Join Date
    Jun 2004
    Location
    Anniston, AL
    Posts
    1,162

    Default

    From what little I think I know, the Mega 2560 is way,way overkill for what you want to do. The Uno seems to be quite popular and should be more than capable. I don't think you will be able to move an ordinary 200 LB mill head in 0.0001" increments, the inertia and friction would be too great. I doubt you could get a 0.001" movement, although you could probably get either 0.250" or 0.251". I can't comment on your motor choice except to say it depends a lot on how fast you want the head to move. Unless using a servo system, the motor, screw, head, and other parts have to accelerate from a standstill fast enough for the system to not lose steps and that seems to be the critical requirement for motor power. A too small motor can work but the performance may not be adequate for you.

    You have undertaken a pretty big job, but with time, effort, and money it can certainly be done. Gook luck and keep us posted on your progress. There are a lot of people smarter than me that can help you along.
    Don Young

  4. #4

    Default

    have another look at your torque requirements. You won't find a Arduino Stepper Driver Shield that'll turn that monster you want to use.

    my 2cents: You've bitten off far too much for a first project. Don't get bogged down by feature creep. Get a small stepper, Uno, and driver to go up and down, THEN add functionality. Otherwise you'll likely loose your mind. These type of projects NEVER work the first time.

    Do keep us posted!
    Last edited by superUnknown; 05-26-2014 at 10:39 PM.

  5. #5
    Join Date
    Feb 2013
    Location
    New York
    Posts
    546

    Default

    Thanks guys...
    As for the coding, im not worried about that, ive played with a few different languages and have peeked at some things written for Arduino, thats something i can grasp... how much torque i need and how many in/outs terminals/pins and IO/PWM i have no idea.

    Thanks for the brake down Bodger.

    Don Young
    For now, speed is not something which i really care about. The current lead screw rides in a bronze (im assuming, as long as its the same as the X and Y) nut. So i cant go crazy and wear it out. Ill have to do alittle figuring and find out the speed at which the current cordless motor is working at, that current speed would be fine for the "rapid". The reason for choosing the Mega 2560 or more so the Due was the In/Out, IO/PWM and size of RAM. In the end, to do everything i want, it will take alot of code (i think).


    For the first stage (controlling the Z), thats my plan superUnknown, getting rid of the cordless motor (even tho its much better then the hand crank) and just getting a momentary toggle switch in place, then potentiometer and feed switch and so on. I dont expext to do the whole thing all at once.

    More questions:
    * To move the 200lbs head on the mill at the speed in this clip, what size stepper motor should i use ?

    * How many IO/PWM will it take to: rapid up and down via a momentary switch, feed up and down via a toggle switch and use a potentiometer ?

    Not know how the electronics works, i would guess:
    momentary switch = 2 (1 up 1 down)
    toggle switch = 2 (1 up 1 down)
    potentiometer = no clue
    stepper motor = 3 (1 CW 1 CCW 1 Brake)
    7+

    While peeking around i came across someone talking about a number pad saying (stock) it will take up 7 of your digital input/output pins:
    http://www.instructables.com/id/Ardu...Matrix-Keypad/



    _
    ~ What was once an Opinion, became a Fact, to be later proven Wrong ~
    http://site.thisisjusthowidoit.com
    https://www.youtube.com/user/thisisjusthowidoit

  6. #6
    Join Date
    Sep 2001
    Location
    Mountain Brook, AL
    Posts
    1,182

    Default

    Steppers operate on pulses, knowing the gear ratio between the motor and the screw (ie one 360 turn of the motor results in how much rotation of the screw on the mill) and the number
    of pulses the stepper provides per 360 rotation, which is standard info on the motor nameplate, you can use the arduino to count the pulses needed to move the elevation screw through a given distance. The arduino does the math to convert distance, entered by number pad or rotary wheels that generate pulses as you turn them (google stepper motor
    pendants for examples) You calibrate the wheel or number pad for fractional or full inches or have a separate switch with 1x, 10x and 100x as pulse multiplier. The arduino takes
    the input, makes the calcs to convert to pulses and outputs the needed number of pulses to the motor driver. Stand alone pendants are available. For a primer on stepper functioning
    look at:
    https://www.geckodrive.com/gecko/ima...cs%20Guide.pdf
    Steve

  7. #7
    Join Date
    Feb 2013
    Location
    New York
    Posts
    546

    Default

    thanks sch...
    Quote Originally Posted by sch View Post
    ....The arduino does the math to convert distance, entered by number pad or rotary wheels that generate pulses as you turn them....
    When you say "the arduino does the math" do you mean the Stepper Driver Shield (arduino main board or what ever) or do you mean the code writing (by me or who ever) does the math ? Can you elaborate alitte more with that ?

    I was under the impression i would have to write the code for this:
    simple example:
    pulleys are 1:1 and the lead screw is a 10 tpi (dont know if it is or not, just an example)
    I want to feed down with a boring head .05
    so when i hit the "auto feed button", that sends a signal to the Arduino and my code tells the stepper to "pulse" 180 times CCW
    or
    do you save the necessary info to a "config file" once: pulley ratio, lead screw tpi, what ever motor info is required, then you just tell the Arduino to move this direction, this far and it does the math ?

    Like i said, a simple example, im just trying to understand the logic and communication behind this.

    Ive seen the cost for some of the pendants (they might be tossing an old W&S retro CNC lathe at work and im gonna see if i can have the control and gut it out and use what i can) and for the end result in what i want to do with the Z, those pendants will not do it. If i ever get the full hybrid done, i will buy one then, but for this project, they will not fit the bill... + theres no learning when buying one
    ~ What was once an Opinion, became a Fact, to be later proven Wrong ~
    http://site.thisisjusthowidoit.com
    https://www.youtube.com/user/thisisjusthowidoit

  8. #8
    Join Date
    Dec 2010
    Location
    Finland
    Posts
    3,256

    Default

    Okay its way early in the morning to write for a proper answer, as I'm heading to work in like 5 minutes, but having toyed with Arduinos for a couple of years almost has taught me a lot and I can give you some very detailed ideas for your system that will save coding, money and headaches For the record, I'm the guy who built a working wire EDM with an Arduino So stay tuned, I'll pop back in about 10 hours or so.
    Amount of experience is in direct proportion to the value of broken equipment.

  9. #9
    Join Date
    Feb 2013
    Location
    New York
    Posts
    546

    Default

    That would be great, Jaakko - thanks.
    If you could post a link to your EDM that would be nice (never seen it), just tried to search using your name and EDM and forum "error".
    The following words are either very common, too long, or too short and were not included in your search: EDM

    [edit]
    found some stuff, will do alittle (more) reading.
    https://www.google.com/search?q=Jaak...pmachinist.net

    _
    Last edited by iMisspell; 05-27-2014 at 01:04 AM.
    ~ What was once an Opinion, became a Fact, to be later proven Wrong ~
    http://site.thisisjusthowidoit.com
    https://www.youtube.com/user/thisisjusthowidoit

  10. #10
    Join Date
    Sep 2001
    Location
    Mountain Brook, AL
    Posts
    1,182

    Default

    I was under the impression (I have zero experience with coding) that the arduino could count and make pulses. I presume the device could be programmed to accept an input that corresponds to the number of inches desired, have a table with the pulley/tpi etc ratios that converts inches to pulses and then calculate the number of pulses needed to get that
    movement. The arduino motor shield is way underpowered for this, I think you would need a more robust controller such as a Geckodrive or Keling motor contoller. Motor controllers
    work by pulsing the stepper with 10-20x the rated motor voltage at the rated motor current, which the controller is set for. The arduino shield just doesn't have the voltage rating needed for moving a milling table. With this in mind, disregarding cases, switches, power supply and steppers, you are already upwards of $200. All of this is conceptual only, sorry no direct experience. From another POV, a surplus (older) windows computer, with vista or xp and a parallel port, a $200 Mach install will drive a motor controller and stepper under keyboard control. Assuming computer is free, the hardware is going to be about $250, software $200. You will be hard put to beat that with an arduino. Depends on what you have available.
    Best to see what Jaako suggests.
    Steve

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •