High current stepper with L298

Hi, I recently bought quite powerful stepper motor 57STH56-2804 http://www.snasda.com/doc/57STH.pdf (2.8A, 2.5V) I decided for this one because I intend to use its high torque. However I am new in this "hardware things" and I would be really thankful for some help.

I found out, that it should be possible to use two L298 drivers, one for each coil, if I use paralled configuration (See Fig.7 http://www.gme.cz/_dokumentace/dokumenty/332/332-005/dsh.332-005.1.pdf) because this way L298 should allow me to get up to 3A. Here comes my first question. Will L298 limit the current on its own, or do I have to care about it, to not burn it? I expect the answer to be that I have to care, so how can I limit the current? I want to power the motor from battery, so I care about power consumption and if I put a resistor in the circuit, I will get huge amount of energy losing to heat. Better solution might be MOSFET ahead of the L298, so I could limit the current a bit more with arduino, when I don't need full torque, but still lot of energy lost on MOSFET. So any other ideas to limit the current and not waste so much energy?

Also about the steppers, I'd like to be sure that I understand correctly, how it works: Rated voltage is a minimum voltage the motor needs to work and if i give him higher voltage, current will get faster to the coils and it'll be able to achieve higher speeds, right? But, if I constantly give 2A, there will still be just about 1.8V on my 57STH56 and rest of voltage would be lost somewhere in L298 probably, so what am I missing? Current 2.8A in specs is maximum current I can use and get maximum torque, if I give it less current, I'll get less torque, if i give more than 2.8A, I'll break the motor?

Thanks in advance for any help, I'd really appreciate it. And sorry for my bad english, not my mother language.

R3gyT: Hi, I recently bought quite powerful stepper motor 57STH56-2804 http://www.snasda.com/doc/57STH.pdf (2.8A, 2.5V)

Unfortunately, you can't use the L298 to drive that stepper, which you would know had you read the datasheet for the L298 closely. Note that in the table called "Electrical Characteristics" (page 3), it states that VS (supply voltage to the outputs) must be a minimum of VIH (input pin HIGH voltage - ie, 5 volts in the case of the Arduino) plus 2.5 volts; note that it also says that the input pin HIGH voltage minimum can be 2.3 volts - so the minimum supply voltage, at best, for the outputs is 4.8 volts - almost twice what your stepper is spec'd for. If you were using a "standard" Arduino, the minimum you could supply to those pins would be 3.3 volts, so your supply could only be at minimum 5.8 volts (over twice what your stepper is spec'd for), and if you were using a standard 5V Arduino - then it'd be 7.5 volts (3 times the spec of the motor).

You'll need either a different h-bridge, or a different motor, or both.

R3gyT: I decided for this one because I intend to use its high torque. However I am new in this "hardware things" and I would be really thankful for some help.

I will indulge your questions here a little, but there are also a few things I'd like to point out about the L298 as well:

  1. It does not have a standard pin spacing profile - it -will not- plug into a standard 0.1" grid (breadboard or otherwise)
  2. To get anywhere near its rated current output, you need a fairly beefy heatsink - Multiwatt15 heatsinks, for some reason, aren't easy to source; then again, you could just bolt it onto a chunk of aluminum and be OK, though something finned would be better
  3. The L298 does have over-temperature protection, which is related to current consumption - but it isn't the same as controlling the current
  4. Note that you -need- the flyback diodes as noted in the L298 datasheet; they aren't internal to the IC (like some variants of the L293) - also, they must be fast switching shottky-type diodes (once again, the datasheet will guide you) rated for the voltage and current expected - don't just drop any diode on there

Regarding item 1 above - check out these adapters: http://www.jrhackett.net/L298adapter.shtml

I have no affiliation with this guy - I'm just a happy customer. Also if you wanted to build a complete driver board (and had the extra parts) he also sells the following: http://www.jrhackett.net/L298brdInfo.shtml

Cheaper than most Chinese Ebay offerings, if you already have the parts (and don't mind the assembly time).

R3gyT: I found out, that it should be possible to use two L298 drivers, one for each coil, if I use paralled configuration (See Fig.7 http://www.gme.cz/_dokumentace/dokumenty/332/332-005/dsh.332-005.1.pdf) because this way L298 should allow me to get up to 3A. Here comes my first question. Will L298 limit the current on its own, or do I have to care about it, to not burn it?

As I noted above, the L298 has over-temperature protection, but that is mainly for protection of the L298 - not of the motor. To protect the motor, you need to protect it from what the L298 can provide (up to 4 amps, though in reality, 3.5 amps is about the limit).

R3gyT: I expect the answer to be that I have to care, so how can I limit the current? I want to power the motor from battery, so I care about power consumption and if I put a resistor in the circuit, I will get huge amount of energy losing to heat. Better solution might be MOSFET ahead of the L298, so I could limit the current a bit more with arduino, when I don't need full torque, but still lot of energy lost on MOSFET. So any other ideas to limit the current and not waste so much energy?

Well, you could use what the L298 datasheet recommends, which is the L6506 Current Controller (see page 9); if you wanted to "emulate" the L6506, you would do so (with the Arduino or another microcontroller) by monitoring the Rsense resistors (separate resistors you supply - pay attention to the L298 datasheet for values and ratings) for each of the bridges in the L298 voltage levels, then using PWM on the coil output pins to limit the current (note pages 3-4 of the L6506 ST datasheet gives a lot of information on this process). This is called a "chopper drive". Note that to do this properly, you're probably going to need more test equipment (oscilloscope at minimum, but probably also some temperature probes, maybe a frequency counter, etc); however, you can probably get "close enuf" without investing a ton of money in tools.

R3gyT: Also about the steppers, I'd like to be sure that I understand correctly, how it works: Rated voltage is a minimum voltage the motor needs to work and if i give him higher voltage, current will get faster to the coils and it'll be able to achieve higher speeds, right? But, if I constantly give 2A, there will still be just about 1.8V on my 57STH56 and rest of voltage would be lost somewhere in L298 probably, so what am I missing? Current 2.8A in specs is maximum current I can use and get maximum torque, if I give it less current, I'll get less torque, if i give more than 2.8A, I'll break the motor?

Pretty much - but given that you can't use the L298, it's all a moot point. However, that said, I hope the above helps you (or others) if you do have a project in which the L298 would be more ideal (also, note that I mentioned above something about the L293 - it won't work for your purpose, either, because it doesn't have the rated current, and has similar voltage limitations, with a minimum of 4.5 volts on the supply).

Thank you so much for your help. I'm counting with heatsink, flyback diodes and pcb. :) I noted the minimum suply voltage, but was not sure if I'm understanding correctly. I was thinking about sink and source saturation voltage. If I understand it correctly, with around 1.4A going through each bridge, there should be total voltage drop over 3V according to Fig1, so this should already take me over 5.5V and with a 1ohm resistor ahead of motor I will get to 8V, or with a mosfet ahead of the driver, that will collect the remaining voltage. So I should be able to use 8V suply and use the driver right? With fact I'll be wasting energy...

I'll also consider buying a different motor that will suit better for the driver, or find a different driver. And thanks once again for your advices, it really helped me a lot :)

I'm using the L298 w a 2v stepper. It does get hot when you put 12v on it! This can be solved in software, no additional hardware is needed. This way you can keep the enhanced performance of a higher voltage! Runs cool now.

Hmm - it's looking like I may need to re-review the L298 datasheet and my assumptions about how it works; I guess you learn something new every day! :)

sbright33: So it really is possible :D what do you use as a power supply and what current does the stepper use please? I suppose it still has to get over 5V supply, so I guess it's either also high current stepper or you added resistors?

That motor is a low impedance high performance bipolar motor - really designed for a constant-current driver IC ideally, check out the A4988 (although that's only 2A, but that's the kind of driver you need to get high-speed high-torque performance).

@crosh you are correct about the datasheet I'm supplying it with 12v. I use a 1A wallwart. The average current while it's moving is near that when I measured it, with some higher peaks. At first I just connected the motor to the example circuit for the L298. Then I bought some boards which are the same. It will not run for long on 12v without over heating. Both the IC and the motor, as it is designed for 2v. I modified the circuit with a 1uf cap and 1k res using PWM to lower the voltage before the IC. Without much code I can halt the motor when I want at a lower voltage which keeps it cool. Still I have the problem of running it fast for an extended period. So I use PWM! Now you can adjust the speed and the power with code. No extra hardware. It is much smoother at slow speeds. But now you can't go fast, with the cap and res inline. You cannot change the coils from on to off faster than 3ms. So I modified the circuit again. Let's say I was using pins 2-5 thru the 1k res to charge the caps, before the IC input. Next I connect Uno pins 6-9 directly to the caps. When I change their pinMode to Input, it's in PWM mode. When I change it to Output I can drive the motor much faster. You can switch modes whenever you go from fast to stop. It is smoother using PWM at medium speeds and slow speeds. At slow speeds I go one step using 1 cycle to adjust the voltage from 1 to 3v on the next pin. Then I reduce it back for x milliseconds. You can decide the power and speed by adjusting x. Smooth. Will post code.

@Mark the thing is I can't give it more power without a bigger PS. And I wouldn't want to because it runs hot after 1 minute the way I have it configured. I wrote a function to send it a sawtooth wave with a steep leading edge and gradually falling off over 500us. I did this without any extra hardware. Sure if I had the correct IC maybe I could send it more current for a few microseconds. But already I have tripled the speed of the motor compared to driving it with a 12v squarewave.

If you're lazy and want to spend your time with software instead of hardware you only need 1 cap and 1 res instead of 4. This way you only need to tie up 5 pins on the Uno. You cannot make it run smoother with PWM, but you can stop it using a variable voltage on the cap. Still it will run slow this way, just pause when you get to the phase with the cap. You keep your high performance by driving it with 12v for awhile until it gets hot. Depending on your duty cycle requirements this might be enough.

I disagree with crOsh. Steppers are usually run at a much higher voltage than their nameplate rating. This is generally recommended to be 4-20x the rated voltage. (the motors on my CNC machine are rated at 5 V but I run them at 36 V and if my drivers could stand it I would like to get them up to 50V) It has to do with motor inductance and countering back EMF. A good explanation can be found here: [http://www.geckodrive.com/ark-2/support.html?id=14]url]http://www.geckodrive.com/ark-2/support.html?id=14](http://url). For driving a stepper, the L298 is usually paired with an L297 which serves as a "translator"that accepts step and direction signals and generates the 4 phase inputs to the L298, so you only use 2 pins of the microcontroller rather than 4. The L297 also allows the motor to do halfstepping, doubling the resolution and it provides current sensing and switch mode current regulation so you can set the current with a reference voltage on one of the pins. Having said all that, the L298 is a 25 yr. old chip and I would go with the more modern A4988 which provides all the features I just mentioned in one chip plus it can microstep to 1/16 step. It's a little underated for your motor so you will not get the full power and you will definitely need to heatsink it well. Pololu has a driver board with this chip for <$15. But if you need all the torque the motor can deliver you will have to go to a larger drive which will probably be >$50. On the issue of motor heating, steppers are designed to run hot, usually in the 70 - 80 degree Celsius range.

Thanks for the info. I agree. Next stop 24v for my 2v motor!

If you roll your own, you can use an A3985. That's a chip that uses SPI, so you can do "any number" of drivers using one chip select per each, and then the three SPI wires. It also does micro-stepping. What it doesn't do is the final switching -- instead, it contains a booster that lets you use N-channel MOSFETs on all the switches. Thus, you can get some nice high-current, high-voltage, low-Rdson MOSFETs and heat sink them separately, and drive almost as big a motor as you want.

http://www.allegromicro.com/Products/Motor-Driver-And-Interface-ICs/Bipolar-Stepper-Motor-Drivers/A3985.aspx 18 milliOhms Rdson for a buck: http://search.digikey.com/us/en/products/AOT462/785-1147-5-ND/1855919 4 milliOhms Rdson for two: http://search.digikey.com/us/en/products/PSMN4R6-60PS,127/568-5780-ND/2296336

Lower Rdson typically means less heatsinking needed -- that second one may need no heatsink at all for 2A current. I-squared-R says < 20 milliwatts dissipation!

That looks like a cool chip but it would require a lot of study on my part to figure out the serial protocol. Looking further I found Allegro has basically the same chip (A4989) with step and direction input which I do understand. I think I'll have to get one of them and a handful of those mosfets and give it a try. Then my machine would have the 50 V drives I've been wishing for. :D