# Hi Power HBridge, DC Motor

I finally found a single easy to use chip I could use to control my Dc motor. I was hoping you guys could help with it. (I am a total Newbie when it comes to electronics, Software guy by trade). I am using a TLE6209 to control a dc motor. What I would LOVE to do is know when my motor stalls out. I know that my motor will draw 2 about amps during normal operation, and it will draw 6.7 amps stalled. That's what I want to detect - the stall state. Do I need more to detect this? Can I use this chip directly? Any input would help. Thanks all,
Brandon

Well one method would be to read the motor current draw using an Arduino analog input pin. If you wire a very low ohm resistor in series with the motor negitive power source and read the voltage drop via a analog read you should be able to determine normal Vs stall current being drawn. You will have to be sure that the motor voltage source's ground is also wired to the Arduino's ground.

A .1 ohm resistor will drop .6vdc when drawing 6 amps.

Lefty

Well - my motor will be running in both directions - so I will need to build some logic in to the wiring to determine which pin is ground... right? Or is there a more clever way to do that?

Also - I assume because the resistor is such a low value, it won't slow my motor down a noticeable amount? Is that a correct assumption (again, sorry, really new at this stuff).

Well - my motor will be running in both directions - so I will need to build some logic in to the wiring to determine which pin is ground... right? Or is there a more clever way to do that?

If you install the resistor between the motor voltage source's ground and the ground pins on the controller chip it will read the same polarity no matter which direction the motor is turning. And yes a .1 ohm resistor will rob very little voltage (.6 volts @ 6 amps draw) so you would lose 5% voltage at max stall current if running the motor at 12vdc.

Lefty

Oh, right... Duh, the source voltage. Not the lines goign to the actual motor. Ok thanks!
Brandon

The L298 motor H-bridge driver chip has pins specifically designed for current monitoring. You can fit a current shunt (as such a resistor is called) in the ground return for each of the two H-bridges in an L298.

The L298 says it only handles peak output of 3 AMPS. My motor will draw 6.7 Amps when stalled - won't that blow up the chip?

Yes, you'll need a more powerful H-bridge. The L298 is just one example.

You can probably just use both the outputs of the L298 to drive the motor and double your current carrying capacity. just be careful, that's dangerous for the chip.

Perhaps this is a really dumb question... I know I can double my current capability by using both outputs on a L298, can I use 2 L298's to quadruple my capacity?

You can connect MOSFETs in parallel and they'll share the load nicely, but with bipolar parts like the L298, they won't. One L298 will take the majority of the current,, and the other will take a smaller proportion. So, it's generally not a good idea to connect bipolar transistor drivers in parallel. You'll see it done all the time with MOSFETs, though.

It's impossible to fit this L298 on a normal breadboard... how can you manage this? Do I need to solder 20 wires?

I patiently soldered the wires and made a simple demo that enables the enable pin and then cycle the inputs.... it's so funny to see the motor changing direction then turn off thanks to the Arduino... IT WORKS!!!

What's the purpose of the 100nF capacitors? I read it's better to place them close to the GND pin.
For SENSE pin I read on another forum you should use a small value resistor like 0.2 Ohm to lower voltage drop, then use an op-amp to raise the voltage, allowing a more precise ADC conversion. Is it right?

BTW the heatsink + some paste is a must!

For SENSE pin I read on another forum you should use a small value resistor like 0.2 Ohm to lower voltage drop, then use an op-amp to raise the voltage, allowing a more precise ADC conversion. Is it right?

Yes that would work at the expense and extra layout of the external components. It really comes down to how much resolution you need for the function of using the current value in your program.

The Arduino analog input is setup to read a 0-5vdc range and converts it to a 0-1023 digital value. In your case of 6.7 amps stall current being monitored with a .2 ohm resistor the voltage to the Arduino would range from 0-1.34vdc. This would convert to a digital value of 0 to 275 or so. This is certainly enough resolution to use as a alarm or safety value to turn off the motor controls or similar action. However if you were going to perform some PID type control algorithum with the current feedback reading then it would be better to amplify the current voltage drop to utilize more of the full 0-5vdc range.

Lefty

It's impossible to fit this L298 on a normal breadboard...

I fitted an L298 to stripboard (Veroboard) by carefully bending the pins outwards, leaving a wider gap in the middle (for ground). There's a photo here, but it's not very clear:

http://www.flickr.com/photos/anachrocomputer/3104717449/

Not sure if this would work for a solderless breadboard! But with the currents involved when driving motors, you might be better off making a small soldered board for at least part of the circuit.

Retrolefty: yeah you're right, less is better
If I use both outputs for the same motor, is it still possible to link the two sense pins, to use just one arduino pin?

Anachrocomputer: interesting pic! On the datasheet they say to use 1A fast recovery diode (trr <200ns). Is it ok the 1N4001 diode? I found also the 1N4936RLG which is much cheaper.
Can I use diodes to save the enable pin? I mean, the enable pin is high when one of the two inputs are high.

Is there an easy way to override the enable pin when a certain voltage threshold has been exceeded?
Otherwise, what are the risks of having a stalled motor for a few seconds?

If I have a 24 Volt, 250 Watts, with 15Amp DC motor and I only have L298's as my DC motor driver, Can possible hook 8 L298's in parallel to withstand the high current rating of my motor? How to do it?

Limit of the L298: 2A 46 V

Help..

According to P = I2R...
Given: I = 6.7A and R = 0.1
You would need a resistor(or a stack of them) that could handle AT LEAST 4.5Watts. Your standard resistors are 1/4Watt. Even if you put 10 1ohm (1/4Watt variety) resistors in parallel--achieving the desired resistance of .1ohm , you could only expect to handle 4Watts.
Just something to consider as a 0.1ohm resistor is not too common.

@retrolefty

then it would be better to amplify the current voltage drop to utilize more of the full 0-5vdc range.

Wouldn't it be easier to just change the reference voltage for the ADC(AREF)? You could use a voltage divider(trimpot maybe?) to set the 'range' for the ADC by setting AREF to 1.34V. That way you could get the full resolution out of the ADC. Perhaps I'm just being facetious.. Who needs that kind of resolution for current sensing in motor control, anyway?

Pat