Welcome to Our Community

Some features disabled for guests. Register Today.

About Motor Control

Discussion in 'Motors' started by kreaturen, Feb 22, 2014.

  1. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Hi, I am trying to get to more about the NEMA 17 stepper motor that they sell in the store here. The LDO-42STH47-1684AC specifically. I do not know much about stepper motors, and this is the first time I have tried to operate one.

    I have it connected to an Arduino through a simple motor drive: http://www.ebay.com/itm/Dual-H-Brid...810?pt=LH_DefaultDomain_0&hash=item3a75930dfa. The pcb itself, I do not have a datasheet for, but the driver chip is an L298N which does have proper documention...

    Never mind that. What puzzles me though is that the motor draws a lot of current at low speed and voltage. I know that stepper motors may consume quite a bit, but I thought that depended somewhat on the voltage provided and (load?).

    Right now the motor is not attached to any load. I can get the voltage up to 4.5V and then the motor draws 1.5amps at slow stepping, slightly less for higher rpms. (If I understand correctly, this may be because it takes some time for the coils to fully charge and discharge, causing the current to fluctuate more on higher rpms, simply because the the coils do not have time to fully fill up).
    I thought however that it would draw less current at that voltage. I mean, the motor struggles even moving at less than 3V?


    Edit: I explained my self poorly. What I intended was first to provide the motor with 12V, to see how it performed on that, and then gradually increase towards 20+V if necessary. However none of this has been possible, due to the motors insatiable current consumption.

    My power source can provide 30V and 2A (alternatively 7V and4A). The driver can handle 35V and at least 2A.

    I limited the current to roughly 1.7A due to the motor's current rating (1.68A). I did at the time not know that the code was running the motor in half step mode (which I discovered with the aid of LEDs), thus powering both coils at the same time and therefor would require twice as much power (roughly). However I switched code to run the motor in full step one phase mode instead, and managed then to increase voltage to 8V. At 8V the current reaches its limit, and so I am unable to increase voltage any further...
     
    #1 kreaturen, Feb 22, 2014
    Last edited: Feb 27, 2014
  2. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    John89702 and kreaturen like this.
  3. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    My NEMA 17's take 2.8A at 12V. I tried lower voltages and currents but the motors wouldn't move sometimes or they were seriously weak. I'd like to throw out 18V at 2A but haven't upgraded my power supply. You might be surprised how much power it takes to drive a nema17
     
  4. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Thank you. That seem quite useful. I've so far just skimmed trough it, and I wonder perhaps if the motor I've got is one of those high torque ones? I.e. that it is useful with "heavy loads" at low speeds? As is, the motor just slips when I start to gain some speed, and produce laud "knocking" sounds at slow speeds. Then again, as I'm unable to rise the voltage above 4.5V for half step and 8V for full step. I don't understand yet why it eats all the current available at such low voltage...
     
    #4 kreaturen, Feb 25, 2014
    Last edited: Feb 25, 2014
  5. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    You and me both. ;) It was my intention to run it with 12V at first and then try 20-24V eventually... I have the drive fed by an adjustable power source that can provide up to 30V and 2A in its current mode. Initially I set it to provide 12V and limited current to roughly 1.7A. I didn't have specs on the driver pcb board at that time, only for the H-bridge chip (L298n) itself, so I didn't want to go higher with the amps. I didn't expect it to hit the current limit so quickly though. But, when the motor started, the current hit the ceiling and the voltage dropped to 4.5V. That was for half stepping, which is what the arduino stepper library runs. I've since written a full step, one phase, code. The voltage now only drop to 8V, but the motor eats all the current.


    I have since read at a vendor webpage that my driver can handle 2A for a single bridge. Since it is a dual bridge, does that mean that the driver could potentially handle 4A in total if I were to run both coils at once?

    The motor moves forward and in reverse in incremental steps (so I believe I have wired it correctly) but only quite slowly. The shaft stop spinning before I can no longer distinguish the steps, it can't keep up. There are some weird knocking sounds (and other weird noises) coming from it, and some mild heating (although nothing unpleasant as far as heating goes).
     
    #5 kreaturen, Feb 25, 2014
    Last edited: Feb 25, 2014
  6. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Your stepper motor is 'stalling' -I think (as already said by others) you need to be using a much higher voltage to get reliable performance.

    The general rule of thumb is that the stepper motor manufacturers specification for maximum current should never be exceeded but the manufacturers voltage specification can be exceeded by up to x25 (subject to the voltage limitations of the driver chip, of course).

    If your stepper motor driver will only allow a maximum of 8 Volts then it may be best to look for an alternative driver, perhaps one which will allow 24 Volts (or more).

    Tweakie.
     
  7. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Yes. But as I've said (or tried to anyways...) is that it was my intention to use higher voltage, but that I am unable to do it. My power source can provide as much as 30V, but how can I raise the voltage above 8V, when the motor consumes or slightly exceeds its rated current limit (which is 1.68A I believe..) already at 8V?

    The driver is not the problem. I've since learned that it can supposedly handle 35V (unofficial) and 2A for a single bridge. It's a dual H-bridge, so perhaps combined it can handle 4A in total?
     
  8. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Sorry, my mistake - I thought you had voltage limitations with your stepper driver not your PSU. :oops:

    Basically you need a PSU which will hold the set voltage whilst providing the required current.
    Perhaps a 24Volts 15Amp PSU (quite cheap on the bay) would fit the bill. ;)

    Tweakie.
     
  9. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Alright.
    Alright. But if I get one of those, would not the motor draw more current that it can handle, i.e. overheat and such? What prevents current from exceeding 1.68Amps per phase, if there is so much more available? These things confuses me as I have very little hands on experience...
     
    #9 kreaturen, Feb 25, 2014
    Last edited: Feb 25, 2014
  10. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    I'll start looking for one right away. The PSU I've been using is an adjustable 'lab' PSU that I have borrowed at my collage. Thought it would do the trick at this experimental stage. The collage is unfortunately lacking in expertise at the moment, apparently the only 'electro-guru' we've got is having daddy-leave, so I'm on my own. Appreciate the advise you both have been giving me :)

    About the driver though. Where did you come across that information? I've been looking all over. Are you referring to the L298n in general or this particular pcb-model? Basically I have no official specs on the pcb and I do not know who makes them, but the datasheet for the L298 claim that:

    Io Peak Output Current (each Channel)

    – Non Repetitive (t = 100µs): 3A

    –Repetitive (80% on –20% off; t_on = 10ms): 2.5A

    –DC Operation: 2A

    To me, that looks as if the L298n can handle 4 amps (DC), 2A for each channel, in case I wanted to do half step (which I imagine that I do;)), or run two normal DC-motors from it. Am I wrong?
     
    #10 kreaturen, Feb 25, 2014
    Last edited: Feb 25, 2014
  11. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0

    Well that depends on the mode of operation. Right now I'm running the motor (or trying to, that is...) in full step one phase mode, which only provides power to one coil at a time. 2A is of course sufficient for that. But you can half step too, literally double the number of steps per revolution, but for that you need to power both coils simultaneously, only with a phase shift between the two.
    You can even microstep, but I have no idea how (probably need a fancy driver). Anyhow, if my driver can't handle both channels at the same time, I guess I'll have to make do with full step, but it sure would be nice to have those extra steps. Still not quite sure how you can claim that it can't handle both channels at the same time though... Not to be argumentative (think we've established that I don't know a whole lot about this...), just want to get to the bottom of it before I burn something is all ;)

    ****, that sounds convenient, I'm jealous. Mine is much more rudimentary; no regulatory features on it except turning logic circuits on/off... That why I'm slightly worried that it'll burn the motor if I hook it up to, lets say the 24V 15Amps PSU. What's to stop it from getting all that juice?
     
  12. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    Dude you can't run a motor with 2 coils on one coil or it will stall, miss steps, jerk, grind, vibrate, etc.
     
  13. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Hi Kreaturen,


    I, like you, have been unable to find any real data on your stepper driver circuit so it appears that it has a fixed current limit of 2Amps per phase. This, as you have already described, leads to a compatibility problem here as your stepper motors are rated at just 1.6 Amps per phase

    It is the stepper driver (not the PSU) that controls the current applied to the stepper motor and as your driver appears to have no provision for current adjustment I think it would be unwise to drive a 1.6A stepper at 2A as overheating and damage to the motor is almost certain to occur sooner or later so you need to change one or the other in order to have a matching setup.


    Tweakie.
     
  14. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    You can run one bipolar stepper off an L298N. You can control/limit the current by changing the resistor on the current sense pin. This will output 4A total, or 2A to each coil. You have to provide 4 inputs to the board from the arduino and it's a very complicated series of ons and offs if you want to do microstepping. I'm sure the arduino can handle it but if you get the wrong code it won't work very well. You can probably use 2 unipolar motors and PWM but I'm not familiar with that setup on these chips.
     
    #14 The Dude, Feb 26, 2014
    Last edited: Feb 26, 2014
  15. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Probably easier said than done on that particular stepper driver board but maybe worth a try.

    Tweakie.
     
  16. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Umm, I reserve my right to be foreign language impaired. I did not say that, or at least I did not intend to ;)

    I use both coils. Have the driver hooked up to Arduino with four wires that I subsequently send pulses like this:
    A+ 1 0 0 0
    B+ 0 1 0 0
    A- 0 0 1 0
    B- 0 0 0 1

    What I'd like to do eventually, if I get the PSU/driver situation in order, is this:
    A+ 1 1 1 0 0 0 0 0
    B+ 0 0 1 1 1 0 0 0
    A- 0 0 0 0 1 1 1 0
    B- 1 0 0 0 0 0 1 1

    Don't think I'll be reaching for microstepping just yet.

    So if I change those resistors I could limit the driver's output, to lets say 1.6A? I imagine that those resistors are soldered somewhere to the pcb then? Because the pcb doesn't seem to have any sense outputs. How difficult is it to replace those (assuming that I find them)?
     
    #16 kreaturen, Feb 26, 2014
    Last edited: Feb 28, 2014
  17. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Ok, I think I've got more of an idea how to proceed now. The motor already runs smoother after having corrected some issues with the code, but still runs on just 8V.

    Would it be safe (and easiest) to simply use a laptop AC adapter as the PSU? Those things are PSUs in their own right, ain't they? Something like this: http://www.ebay.com/itm/AC-Adapter-...12-Power-Supply-Charger-20V-65W-/301033616904. It gives 20V 3.2Amps, which ought to make a decent match right? It would provide each coil with 1.6A each, so that I could half step and not have to worry about overload.
     
    #17 kreaturen, Feb 26, 2014
    Last edited: Feb 26, 2014
  18. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    The max rating of your power supply means it will overheat if you draw more current than that. Try it out but keep an eye on the heat. Also, I have about 10 power supplies that say 12V and they ALL put out 15+V. It's really annoying when trying to match voltages but the PSU has bad info printed on them. My suggestion is an old ATX power supply from a defunct computer. They give a rock solid 12V and go as high as 25A.
     
  19. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    Yes. You can download the datasheet for L298N and it will tell you which pin is the current sense(pins 1 and 15) and what to set the resistance to. Then look at your board. I bet your board doesn't have any resistor, thus giving the max current. You could add a trim pot that would allow you to adjust the current over the whole range
     
  20. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    You are right. The voltage on those pins are zero. Do you mean that the two pins could share one pot?
     
  21. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    I have no idea... The spec sheet says -1 to 2 V and nothing about the resistance... ***? Maybe you can make sense of it http://forum.allaboutcircuits.com/showthread.php?t=17915
     
  22. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    It seems to me that a resistor on the sensory pins does not reduce the driver's current outputs, but rather enables your microprocessor to sense the current output by measuring the voltage potential across the sense resistor. For instance it could shut the driver off in case currents exceeded a predefined limit. Like a sensor :)

    That would be a useful safety measure, but I still need to find a way to limit my current supply so that I can increase the voltage. I'm still unsure how to do that. I thought an AC adapter would do the trick, but if it can get overloaded too, then I do not know. I can't hook the motor up to a psu that may give as much as 25Amps without knowing how to restrict access to all that Amp :/
     
    #22 kreaturen, Feb 27, 2014
    Last edited: Feb 27, 2014
  23. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Ok, good to know. So you're saying that power supplies can draw more current than they should also? So I need a psu that can handle more current than I'm gonna use. I guess that makes sense, although now I am truly unsure how to power this thing.
     
  24. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Let me just ask you guys something. Are stepper motors optimal for slow and gradual acceleration, or is it more rapid and precise motion they're used for? The reason I ask is because I really need it to accelerate smoothly, but it struggles so much at slow speeds. Makes an awful lot of noise and vibration. At higher speeds the current drops and supply voltage increases, and it runs much smoother, putting off a nice electric hum. Today, while running it quite fast, I got the voltage up to 15V, and the motor used only about 1A, shared by the two coils. I have it accelerate with an analog stick, but the motor is not happy with slow speeds.
     
  25. The Dude

    The Dude Well-Known
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    102
    You can enable microstepping to smooth out the motion. You sacrifice holding torque though. The acceleration is totally programmable on the driver. For 3D printing the fast acceleration is good because they do lots of back and forth motion and it needs to be done quickly for the plastic to fuse. I turned my acceleration way down and it sucked. Took a long time to turn around and go the other way. When I'm cutting, acceleration doesn't matter much because the feed rate is like 10% or less of the machine's max speed.
     
  26. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Hey. I think I've found a solution to my problem, but have yet to try it. I'll try tomorrow. Me and some guys are building a camera tracking device (student project), and that's why we need smooth acceleration. Right now we're controlling the motor and belt drive and a couple of servos on the platform with a PS2 controller, but the motor only handles rapid speed at the moment and so acceleration is a bit rough. The camera rocks like a bubblehead on top of its mount. The load is of course very light, so I think I'll go for microstepping eventually if I only get the rudimentary in order first.

    The solution I thought of though, is to find the right time to cut power to the coils when slow stepping, and not feed it for the entire step-delay. I need to measure the rise time for the current and give the coil just enough to complete the step, but no more. At least I hope that works. Would be more energy efficient too I suppose, producing less heat. It'll be a whole lot of work for nothing if it doesn't work though :)
     
    #26 kreaturen, Mar 4, 2014
    Last edited: Mar 4, 2014
  27. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,427
    Likes Received:
    1,906
    you need to look into vibration damping the mechanics.
    http://solsylva.com/cnc/dampers.shtml

    then you need to go straight to microstepping. there are chips for this so don't reinvent the wheel here. look up Polulo and Easy Driver products.

    stepper motors are rated at say 5V at 2amps, but because they are inductive the rise time is limited by the low voltage, this limits step rate. so it is common to run that much higher voltage, 20 to 70, while limiting the current to the rated current. limiting can be done simply with a resistor (high wattage eh, calculate it!), or more fancy with chopper control which is what the many driver chips will do, and combine that with microstepping.
     
  28. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Hey, thank you for those tips. I have been a bit preoccupied with other things lately, but will definitely look into those things. Very interesting, thanks again :)
     
  29. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    715
    To limit your current you can supply your driver using a constant current LM317 circuit google it and enough info will pop up
    You can also look through my laser v build and the same info is there
     
  30. kreaturen

    kreaturen New
    Builder

    Joined:
    Jan 27, 2014
    Messages:
    16
    Likes Received:
    0
    Thank you as well. I'll be sure to check out that solution too. I'm sorry for the lack of progress on my part though. It's just that my team have had to focus our attention on other aspects of the project for a while and decided to pick up the power situation and current control again a bit later. The lab PSU does the trick for the time being. I've gotten quite a few tips from you guys though, so I'm sure I'll figure out what parts I need to order in order to solve this issue.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice