go_away

Author Topic: L298 question  (Read 5435 times)

0 Members and 1 Guest are viewing this topic.

Offline Eco19RTopic starter

  • Full Member
  • ***
  • Posts: 104
  • Helpful? 0
L298 question
« on: June 03, 2007, 11:33:39 PM »
hello - I had a couple questions regarding the L298 dual h bridge.

Do I need to put a cap between the outputs on the L298 chip ?

Also can I directly interface my MCU to the inputs of it? or should I "protect" the MCU with like a resistor and diode to stop any reverse current.

They suggest a .1uf cap between the power and ground connections - since its just a filter cap to smooth out any spikes I can substitute that value for another one as long as its with the current/voltage requirements - correct ?

Thanks for any information you can provide on this.

Offline rgcustodio

  • Robot Overlord
  • ****
  • Posts: 217
  • Helpful? 0
  • Use "Search" and ye might find answers!
Re: L298 question
« Reply #1 on: June 04, 2007, 01:31:20 AM »
Maybe you can use the design from Solarbotics as a reference.

http://downloads.solarbotics.net/PDF/Solarbotics%20-L298_schematic.pdf
http://downloads.solarbotics.net/PDF/Solarbotics-L298_Schematic_complete.jpg

They use the L298 on several of their motor drivers.

HTH

- Rommel
The best thing one can do when it's raining is to let it rain. - H. W. Longfellow

understanding is the path to enlightenment

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: L298 question
« Reply #2 on: June 04, 2007, 05:56:22 AM »
Quote
Do I need to put a cap between the outputs on the L298 chip ?

it's not strictly necessary but it's often a good idea (especially with cheaper motors).
putting a capacitor close to the motor terminals would be one of the first things i would try if you start getting interference from the DC motors in the rest of the circuit. (symptoms would be the circuit working without the motors connected but becoming temperamental with the motors.)

Quote
Also can I directly interface my MCU to the inputs of it? or should I "protect" the MCU with like a resistor and diode to stop any reverse current.

nope. you should be good connecting your MCU inputs straight on to the motor driver. the motor driver will take the strain of any back EMF traveling through the wire from the inductive load (motors).
you will need shotkey diodes between the motor and the motor controller though as demonstrated by the application note on figure 6 of the datasheet:
http://www.st.com/stonline/products/literature/ds/1773.pdf
it might be worth going to a bit of effort to keep the wires between the MCU and motor controller fairly short this close to the motors though.
likewise any capacitors should be soldered on reasonably close to the component they are working with.
this is all because motors create a lot of EMF interference that can be picked up by other bits of wire. the linger the wire, the more the effect.
for a demonstration, listen to an AM radio close to a running motor.

Quote
They suggest a .1uf cap between the power and ground connections - since its just a filter cap to smooth out any spikes I can substitute that value for another one as long as its with the current/voltage requirements - correct ?

so while having exactly .1uf is not critical you want close enough. somewhere between 0.01uF and 1uF should do.
too big a capacitor will not reduce high frequency ripples.
too small a value will not have enough stored charge to prevent longer drops in power.
most digital circuits require a .1uf cap between the power and ground connections so i always make sure i have a big bag of them clearly labled as it stops me from having to dig through my capacitor draw....

question: do plan to make use of the current sense pin connected to an analogue input on your MCU?
i'm in the process of designing my own motor controller board and i was thinking motor current sense might be a good alternative to "bump sensors" on the robot.
if the load on the motors has gone up it means the motors are stalled which in turn means the bot has found a chair leg to crash into...


good luck with your motor controller,

dunk.

Offline Eco19RTopic starter

  • Full Member
  • ***
  • Posts: 104
  • Helpful? 0
Re: L298 question
« Reply #3 on: June 04, 2007, 09:40:37 AM »

To measure the current aren't you just making a voltage divider that the analog pin on the MCU is hooked up to? Or am I being stupid and reading the schematic wrong.

Wouldn't you need a high power resistor for that?

A 1/2 or 1/4 Watt wouldn't be enough - also wouldn't you lose allot of power - even with a small Ohm value?

Thanks for the information.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: L298 question
« Reply #4 on: June 04, 2007, 02:59:02 PM »
Quote
To measure the current aren't you just making a voltage divider that the analog pin on the MCU is hooked up to? Or am I being stupid and reading the schematic wrong.
so looking at the datasheet, presuming i'm interpreting it correctly (it doesn't have much information on this)
the output on the on Voltage Sensing pin is between "-1 to 2.3" volts so you shouldn't need a voltage divider but it's not the most straight forward either having a possible negative voltage...

Quote
Wouldn't you need a high power resistor for that?
either that or several higher value resistors in parallel.

Quote
also wouldn't you lose allot of power - even with a small Ohm value?
yup. quite a lot. but then you are using a 2 Amp motor driver so i was presuming your project was going to be quite power hungry anyway.

dunk.

Offline iNFINITE

  • Jr. Member
  • **
  • Posts: 21
  • Helpful? 0
Re: L298 question
« Reply #5 on: June 04, 2007, 04:47:02 PM »
Hey dunk.
Quote
you will need shotkey diodes between the motor and the motor controller though as demonstrated by the application note on figure 6 of the datasheet:

Can i use normal 1N4007 diodes or we have to use Schottky diodes?

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: L298 question
« Reply #6 on: June 04, 2007, 05:05:28 PM »
the datasheet recommends shotkey diodes:
Code: [Select]
An external bridge of diodes are required when inductive
loads are driven and when the inputs of the
IC are chopped ; Shottky diodes would be preferred.

but to be honest, i don't know the difference using regular ones would make.
(i don't have any training in any of this stuff, i just peice it together from datasheets.)
i think it might have something to do with the speed they can operate at but that's just a guess.
i'm guessing if you are not going to approach the max load of the motor driver you will be safe with whatever you have in your bits box but if you are going to operate near the max the i'd go with the datasheet's recommendation.

dunk.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,663
  • Helpful? 169
    • Society of Robots
Re: L298 question
« Reply #7 on: June 04, 2007, 05:09:26 PM »
Quote
question: do plan to make use of the current sense pin connected to an analogue input on your MCU?
i'm in the process of designing my own motor controller board and i was thinking motor current sense might be a good alternative to "bump sensors" on the robot.
if the load on the motors has gone up it means the motors are stalled which in turn means the bot has found a chair leg to crash into...
two problems with this . . . first, your robot has to physically collide to sense anything . . . and second, you will get large power spikes whenever your robot accelerates that you need to differentiate from collisions.
i think people only use this in tandem with encoders to know if the robot is high centered (wheels rotating but low power usage).

Offline Brandon121233

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 320
  • Helpful? 0
  • "Genius is %1 inspiration and %99 perspiration"
Re: L298 question
« Reply #8 on: June 04, 2007, 06:41:49 PM »
Give your robot a break! Imagine if we as humans had to go around all day bumping into walls just to get around ;D
Hell, there are no rules here—we're
   trying to accomplish something.

                                                                              —Thomas Edison

 


Get Your Ad Here