Go Down

Topic: using L293D h-bridge with current sensing for stepper chopper circuit (Read 4458 times) previous topic - next topic

a_g123

recently i'm thinking about using L293D h-bridge with current sensing for stepper driving
the specs for L293, L293D are here
http://www.ti.com/lit/ds/symlink/l293.pdf

and the pinouts are as follows
Code: [Select]
1 1,2EN |  VCC1 16
2 1A    |    4A 15
3 1Y    |    4Y 14
4 GND   |   GND 13
5 GND   |   GND 12
6 2Y    |    3Y 11
7 2A    |    3A 10
8 VCC2  | 3,4EN 9



the trouble is that i want to do *current sensing* for *micro stepping*
i'm initially thinking about measuring current directly off the motor pins with shunt resistors, but the reversing currents makes the design rather difficult
i ran across this innovative solution that uses diodes
http://forum.arduino.cc/index.php?topic=324977.0
but diodes would shutoff when voltages falls to around/below 0.7 volts, this'd create abrupt jumps/drops in the measured currents

of course there is also the l298 h-bridge with built in current sensing pins as well as l293e
http://www.st.com/content/ccc/resource/technical/document/datasheet/82/cc/3f/39/0a/29/4d/f0/CD00000240.pdf/files/CD00000240.pdf/jcr:content/translations/en.CD00000240.pdf

but l293d is considerably cheaper than l298n and l293e on retail sites such as ebay
https://www.ebay.com/sch/i.html?_nkw=l293d&_sacat=0
hence the motivation to stick with l293d

now the questions,
1) are those ground pins separated for each half bridge on the l293d and could i use those ground pins to measure currents relevant to each 1/4 half bridge units on the l293d?
2) if it isn't feasible to measure currents directly off the ground pins for current sensing / chopper control, i'd guess we'd need to fall back to measuring currents in series with the motor outputs pins. the trouble is that this current is reversing. how do we go about measuring that? even with an op amp, it would swing in an opposite polarity when the h-bridge reverses

thanks much in advance

groundFungus

Why not use a proper stepper driver like an A4988 or DRV8825.  Current control and microstepping built in and much more efficient than the antique L293?

jremington

Those ancient chips are extremely inefficient, and totally impractical for use in a microstepping driver.

But, you would probably learn a great deal while attempting to design with them.

a_g123

well i've indeed considered a4988 and drv8825, just that a4988 and drv8825 runs on the step and dir pin protocols, this requires the mcu to run in a tight control loop to time each (micro) step and when there are multiple steppers the mcu would be pretty busy simply running the steppers and having little timeslice for any thing else.

in addition, the a4988 and drv8825 modules (drv8825 being better) has small chip surfaces which makes them very hard to cool

one other disadvantage is a4988 and drv8825 uses the step and dir pin protocols and these pins can't be shared, this very much limits the use on mcus / boards with few pins.

hence the motivation to use an mcu for the stepper control itself, and one can do all kinds of microstepping since l293d is simply only a h-bridge and all that microstepping 'intelligence' is done in the mcu itself

the more elaborate stepper drivers some of them cost more than common arduino mcus and a h-bridge even for that matter the l298n

groundFungus

I have to wonder why all those 3D printers and CNC machines use the A4988 and DRV8825 drivers given all of their disadvantages.

Robin2

well i've indeed considered a4988 and drv8825, just that a4988 and drv8825 runs on the step and dir pin protocols, this requires the mcu to run in a tight control loop to time each (micro) step and when there are multiple steppers the mcu would be pretty busy simply running the steppers and having little timeslice for any thing else.
This does not make any sense as an argument for using an L298. An Arduino has even more work to do when driving a stepper motor with an L298 because it must control the timing of signals on all 4 motor coil wires rather than on a single step pin.

And if you are thinking of also burdening the Arduino with current measurement and current limiting ....


...R
Stepper Motor Basics
Simple Stepper Code
Two or three hours spent thinking and reading documentation solves most programming problems.

TomGeorge

Hi,
What are the specs of your stepper motors.

4988  and  8825 are both MOSFET outputs, the 298 is a bipolar transistors.

MOSFETs have a very low ON resistance, so they dissipate very little heat, compared to the 298 that drops up to 2V across it and needs a heatsink.

The MOSFET drivers are way more efficient.

http://howtomechatronics.com/tutorials/arduino/how-to-control-stepper-motor-with-a4988-driver-and-arduino/

the a4988 has on board microstepping selection.

https://www.pololu.com/product/2133/resources

drv8825 has microstepping ability too.


Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

jremington

Quote
in addition, the a4988 and drv8825 modules (drv8825 being better) has small chip surfaces which makes them very hard to cool
Since they can handle twice the current (without any extra cooling) that the L293D can, this argument makes no sense at all.

a_g123

This does not make any sense as an argument for using an L298. An Arduino has even more work to do when driving a stepper motor with an L298 because it must control the timing of signals on all 4 motor coil wires rather than on a single step pin.

And if you are thinking of also burdening the Arduino with current measurement and current limiting ....


...R
Stepper Motor Basics
Simple Stepper Code

well, you have a point there, A4988 and the better DRV8825 takes care of much of the stepper motor driving.
however, the motivation is slightly different, i think there are some advantages of using the mcu / arduino for that matter as the motor driver. the idea is that L293D and L298 are high current devices that does the motor control, the idea is to separate the 'power driving' stages (i could have use a mosfet h-bridge for that matter) from the control stages. this is so that if a low cost L293D part burns out for some reason, it can be swapped with a new piece at a lower cost.

of course A4988 and DRV8825 aren't that expensive these days, and i think using those stepper drivers makes sense as well. A4988  and DRV8825 goes at a slight premium compared to L293D going for around $1 on ebay. while L293D is around 40c a piece on ebay.


TomGeorge

Hi,
Quote
think there are some advantages of using the mcu / arduino for that matter as the motor driver. the idea is that L293D and L298 are high current devices that does the motor control,
  • What are the specs of your stepper motors, Please.
  • What voltage are you using to drive them?
  • Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
  • What do you consider high current?


293 and 298 are 2A each side.

Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Robin2

i think there are some advantages of using the mcu / arduino for that matter as the motor driver. the idea is that L293D and L298 are high current devices that does the motor control, the idea is to separate the 'power driving' stages (i could have use a mosfet h-bridge for that matter) from the control stages.
Read the Allegro A4988 datasheet to get an idea of how much thought and complex engineering has been built into the a4988 driver.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Welease_Woggah

if a low cost L293D part burns out for some reason, it can be swapped with a new piece at a lower cost.

Or, you could adopt a more state-of-the-art approach to your design, and prevent a failure by doing it right in the first place.

And anyway, the cost of a repair isn't limited to the cost of the failed part. It must include the opportunity cost of the plant being out of action, and possibly even penalties for late delivery. Not to mention the risk of injury if a motor and whatever's attached to it is un-controlled.


a_g123

thanks much for the replies the steppers i'm trying to control are NEMA17 motors commonly found on the cheaper 3d printers
https://www.adafruit.com/product/324

i'm seeing specs for currents in the order of less than an amp hence i think i may do some experiments with them, the lower current ones are likely pretty drivable using a L293D even if the bipolar device probably isn't a best fit.
the hard part with L293D is that it doesn't have current sensing pins and unless it is somehow possible to use the ground pin for that purpose, i'm left with trying to hack up something to do current sensing on the motor driving output pins.
it is pretty challenging to design given the reversing voltages and currents when the h-bridge reverses

if that's too difficult i may resort to the L298N instead which has the current sense pins provided on chip, and current sensing become as simple as placing a shunt and a low cost op amp at the current sensing pins

but L298N is pricier than L293D. The only benefit is that L298N could take a full 2 amps and hence could drive the bigger motors

Welease_Woggah

Quote
may resort to the L298N
But you're still dabbling with decades old tech, which by now the makers should pay us to use.




Robin2

thanks much for the replies the steppers i'm trying to control are NEMA17 motors commonly found on the cheaper 3d printers
And how many of those 3D printers are using L298 drivers for their stepper motors?

Think about it ... those guys will wish to save every penny in materials cost but they don't use L298 drivers. That must tell you something.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up