Pages: 1 [2]   Go Down
Author Topic: L298 H-bridge motor controller  (Read 9960 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
mostly confused
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

looking at the schematic and the board itself it appears that the sense pins of the L298 are already connected to ground...
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

blamski, I agree that your schematic has no sense resistors in the grounf path.

But the OP referenced http://www.pyroelectro.com/tutorials/l298_control/schematic.html as the schematic that they were following, and it has 10 ohm resistors in the Current Sensing B path to ground. Looking at the datasheet that connection is the from the 'bottom' of the H-Bridge to ground.

The http://www.pyroelectro.com/tutorials/l298_control/schematic.html schematic has got a connection from the pin marked GND to ground, but, looking at the datasheet, that GND pin is not the H-bridge ground. It is very probably the 'logic' ground.

HTH
GB
Logged

Wyoming
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Blamski, Try hooking the other input pin to ground.  It might not work if the pin is simply not connected.

The current sensing resistor is in series with the load--the bridge ground is separate than the chip ground, as stated.  If the resistor is too big, a motor won't run--I found this the hard way, using pyroelectro's suggested setup.  My .6 amp motors weren't running on 9V with 10 ohms, a potentiometer indicated that the max for the current sensing resistors is 4-5 ohms for my motors. smiley-wink

Technically, you don't need the resistors if you're not trying to limit the current.  Running them straight to the breadboard's ground bus seems to work for me.  There's a few situations where a resistor makes sense, but I can't see most setups needing it.

If you feel you need a sensing resistor, then you need to put a potentiometer in to start, and find out where the cut-off is, and what value works best.  Then you need to make sure the resistor is rated properly--most people will use a 1/4 watt since that's the most common, but my motors for example pull over 5 watts, and so I'd need a much larger resistor to run it properly.
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Technically, you don't need the resistors if you're not trying to limit the current.

These resistors are not intended to limit current.

Quote
If you feel you need a sensing resistor, then you need to put a potentiometer in to start, and find out where the cut-off is, and what value works best.

Don't do this. As explained in the datasheet. It is not there to limit current, it is there to allow measurement of current.

[edit]Unless it is a low resistance 'power' potentiometer designed to dissipate heat, it would be lucky to get close to a reasonable value before getting damaged.

Low value power potentiometers are often wire wound, with significant inductance, which will likely react with the motor, so the DC resistance value measured with an ohmeter will probably be misleading.

If the motor uses such a small amount of power that an ordinary potentiometer is okay, then the motor used so little power that the L298 would be very unlikely to be damaged by the motor.[/edit]

The purpose of the sense resistors is so that an external system can detect how much current is flowing through each motor (load).

By measuring the voltage drop across a fixed resistor (the sense resistor), the current flowing through the motor can be deduced from Ohm's Law:
I = V / R

Put a low value resistor in the path from the sense resistor pin to ground (say 0.1 ohm, to make the arithmetic easy, with a power dissipation, of say 1W), and
Measure the voltage dropped across the sense resistor using an analogue input on the Arduino
I = V * 10 (for an R of 0.1, and remembering that 1V is approx 100)

This allows the Arduino to be used to monitor the current through the motor, and even decide if it is stalled, and switch it off.

HTH
GB
« Last Edit: April 23, 2010, 09:07:29 pm by gbulmer » Logged

Wyoming
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The data sheet says to use filter diodes to protect the motor controller from back EMF from a motor.  Would a similar setup between a wire wound resistor and the motor do the same, or just be a pointless exercise?
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a good question.

Off the top-of-my-head, putting an inductor (a wire wound resistor) in series with an inductor (the motor) will make matters worse.

Back-EMF protection diodes short voltages which go outside the power rails (ground and motor supply) to ground and the motor supply, preventing the L298 from being dragged outside of the power rail voltages.
« Last Edit: April 25, 2010, 06:27:25 am by gbulmer » Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8907
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The data sheet says to use filter diodes to protect the motor controller from back EMF from a motor.  Would a similar setup between a wire wound resistor and the motor do the same, or just be a pointless exercise?
Diodes are usually used because they allow current flow in only one direction. Your resistor will allow current flow in both directions, possibly resulting in the resistor getting very hot and killing your power supply. Just where are you planning to put the resistor?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Wyoming
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Diodes are usually used because they allow current flow in only one direction. Your resistor will allow current flow in both directions, possibly resulting in the resistor getting very hot and killing your power supply. Just where are you planning to put the resistor?
We're getting a little off topic, I suppose.  We're no longer exactly about the current sensing resistor--we're talking about an issue with using a wire wound resistor.

The diodes we're talking about link the motor leads to ground and Vc, though I still don't understand quite how it's supposed to work, which would be getting even more off topic.  The idea was that they would provide a similar service they do the L298, containing the back emf produced when the inductive load of the wire wound resistor collapses.

This can be gotten around by not using a wire wound resistor, but remember that regardless of how big the resistor is, it does need to be rated for the motor power.
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The back-EMF, or fly-back diodes are shown on page 6/12 of the L298 datasheet
http://www.st.com/stonline/products/literature/ds/1773/l298.pdf

They should be fitted, or the L298 can be damaged.

The motor acts as a generator when it's moving, and an inductor when current is flowing. These forces oppose the applied voltage.

When the driving voltage is removed, e.g. by the LOW part of the PWM signal, the energy stored in the inertia of the motor, and the electromagnetic field of the armature, could drive the L298 motor connections below the ground or above VS of the motor power supply, and hence damage the L298.

The back-EMF diodes prevent that from happening by conducting that power directly to VS or ground, rather than going through the L298.


Using inductive resistors as the sense resistors will store energy in them, which will drive the connections in the opposite voltage direction when the power is removed, i.e. by the PWM going LOW..

HTH
GB
« Last Edit: April 25, 2010, 07:18:18 am by gbulmer » Logged

Pages: 1 [2]   Go Up
Jump to: