I would like to expose my problem connecting stepper motors and a L298N bridge.
I'm trying to connect my Arduino Yún to a unipolar stepper motor (I've tried both unipolar as bipolar and bipolar versions) through a L298N bridge like this:
I'm following this schematics
And using a 12V / 8.5A power supply connected to the bridge (with a 4700uF capacitor) and my computer to power the Arduino. Both grounds, Arduino and the bridge are connected.
I'm using basic stepper code from Arduino library.
The result: it works for 10-15 seconds aprox, then starts failing, losing steps, stops turning and doing weird noises. Obviusly, I don't let it doing it for more than some seconds.
As you can expect, the bridge gets hot as hell (untouchable)
My bet is with the 8.5A current. I had tried previously with a 12V / 5.5A one and same happened.
I'w really appreciate some guidance here, I'm a total noob and this is my very first Arduino project.
You must use a motor with high impedance windings such that IxR = supply voltage
What winding resistance is you motor? If its less than about 40 ohms it will not
work as you intend from 12V as the current draw will be excessive - this seems to
be what's happening, the motor driver is overheating and shutting itself down.
Normally with bipolar motor you use low impedance windings and drive with constant current driver. This allows much faster rotation speeds and better torque curve as
you can simply increase the supply voltage for faster top speed.
10 years ago high impedance unipolar motors were more common, now they are
rare, expensive, and bipolars rule (which means you need a stepper driver not
a motor shield).
If you ignore the centre connections to the two coils that can be operated as a bipolar motor.
I can't figure from the datasheet if the 1.5 ohms is measured between an end and centre tap on a coil or between the two end taps. You should measure it with your multimeter.
It is obviously designed to take 2 amps and that is really outside the practical range of an A4988. The Pololu DRV8825 has a little more capacity. If you need the full 2 amps I think both drivers would need heat sinks and maybe fans. The problem is that if you go for stepper drivers with more current capability there is a big jump in price. There is a Toshiba TB6560 chip that can handle about 3 amps but there have been suggestions of poor quality control in driver boards that use it.
Is your comment "Since the driver was getting SO hot" referring to the L298 or the A4988 ?
It is normal for the motor to get hot - uncomfortable to touch.
GrauchoMarx:
Hi guys, thank you both for your answers. I have been here for a while now and know about your knowledge.
First things first:
I was misguided to buy that driver to use with stepper motors. Now I know that the Pololu A4988 fits much better for my project.
for a low-impedance stepper, yes.
This is the datasheet info of my stepper. As I can see, resistance is 1.5 Ohm per phase. Is that the same as "per winding"?
depends if its intended to be used as unipolar (4-phase) or bipolar (2-phase) - 6 wire motors
can be either. You get a multimeter and measure it yourself to know for sure (always worth doing
with a new motor just in case its faulty or the wrong winding resistance).
Since the driver was getting SO hot (also the motor) it totally seems that is a overheat problem.
Now my doubt: is it possible to run a stepper with that driver? What voltage / current?
As has been said DRV8825 is a little pokier than the A4988 - 2A is a bit too much, try it at 1.5A
and see if its enough (motor will run cooler).
For high current steppers 2A+, discrete motor driver design is necessary - cheapest commercial
unit I've seen is React App (But cannot personally vouch for it).
If you ignore the centre connections to the two coils that can be operated as a bipolar motor.
Yep, I was doing that.
Is your comment "Since the driver was getting SO hot" referring to the L298 or the A4988 ?
I meant the L298N. The A4988 ran much cooler and smoother.
In the end we are going to use Nema17 at 1.7Amps/phase. These ones
We didn't wanted to use unipolar steppers, as I told you, I was badly recommended (and being such a noob...)
What do you guys think about the Nema17 A4988 combo? It is not supposed to need neither big torque nor rpms.
The little A4988 and DRV8825 driver boards are commodity items these days (ultra cheap on eBay
if you trust that source), and will get high performance if needed.
If you don't need any performance a high-impedance unipolar stepper can be driven from an
ULN2803 (like the little boards that come with the 28BYJ-48 mini-steppers). High impedance here
means about 48 ohms for a 12V NEMA17 motor. However you don't get microstepping either that
way, which can be a problem (vibration).
I suspect chopper-drive and low impedance 4-wire bipolar steppers are becoming the universal
standard. Lots of old projects on the internet haven't caught up with this changeover (which is
why a lot of motor shields claim to support steppers, but only work with rare high impedance
steppers).
MarkT:
I suspect chopper-drive and low impedance 4-wire bipolar steppers are becoming the universal
standard. Lots of old projects on the internet haven't caught up with this changeover (which is
why a lot of motor shields claim to support steppers, but only work with rare high impedance
steppers).
Isn't it always like this?
My only remaining doubt (I was intended to try): would the stepper work better with a smaller power supply? Or batteries?
Anyway, I think I may have my correct setup now. I need to test it now.
Aaaaaaalright! It was intended only to test, in order to avoid high voltage / current.
Another thing, I am testing endstop switchers to stop the stepper. I have connected one to A0 input and did some tests. It works.
So my doubt is: what is the 10K resistor for?
It is usual to use a pull-up or pull-down resistor to ensure the I/O pin "rests" in a known state. Otherwise the value seen by digitalRead() could vary randomly between HIGH and LOW.
You can use pinMode(pin, INPUT_PULLUP); to use the Atmega's internal pullup resistor.
Alan0:
It provides a current sense and enable for external regulation with PWM using the EA inputs (note: you have tied them to Vcc).
Stepper motors do not work with PWM in the way that a DC motor does.
Building the external circuitry to limit the current provided by an L298 sounds like hard work compared to using a specialized stepper motor driver. A specialized stepper driver can limit the current in every single step movement separately.
Robin2:
Stepper motors do not work with PWM in the way that a DC motor does.
Building the external circuitry to limit the current provided by an L298 sounds like hard work compared to using a specialized stepper motor driver. A specialized stepper driver can limit the current in every single step movement separately.
...R
Hi Robyn2,
Yes easier to use a board with built in PWM but these board can be used for steppers and people want to use them(?).
If your using 12 volt power supply and your motor voltage is 2.4v then a PWM duty of 20% (on the EA inputs) will work fine.
No need for current sensing or feedback loops etc.
The real headache is you need a fairly high frequency (say 20kHz), so the analogWrite just will not cut it.
So that means learning how to write Timer and ISR code. But then is this not what the Arduino is all about?
PWM duty cycle is only linearly related to output drive if you use synchronous rectification mode,
not the normal decay modes. Standard decay modes are not linear in response.