Author Topic: L298 not totally working  (Read 7846 times)

0 Members and 1 Guest are viewing this topic.

Offline digitalundernetTopic starter

  • Contributor
  • Posts: 12
  • Country: 00
L298 not totally working
« on: November 01, 2013, 09:32:27 pm »
So I'm built a sumo robot for a competition in 10 days and the L298 is giving me some fits. Motor one (X-1) is working properly and no issues while Motor two (X-2) only works in reverse. I have no idea why. I want to say its the back EMF diodes but that shouldn't stop the motors from turning. I've probed the micro pins going to the L298 and they work as intended. Here's the schematic and board layout (Warning PDF)

http://digitalundernet.com/wp-content/uploads/2013/11/SumoBotSch.pdf
http://digitalundernet.com/wp-content/uploads/2013/11/SumoBot.pdf

I've also applied power to both motors out of the circuit and they work in both directions.
 

Offline kizzap

  • Supporter
  • ****
  • Posts: 477
  • Country: au
Re: L298 not totally working
« Reply #1 on: November 01, 2013, 10:33:28 pm »
Things I would be checking.

    • Polarity of the diodes for Motor X2
    • Inspect the board for any shorts
    • Test the second motor on the first channel (just completely removes any thought the motor is the issue)
    • Write a piece of sample code, to only put motor X2 into reverse.

    -kizzap
<MatCat> The thing with aircraft is murphy loves to hang out with them
<Baljem> hey, you're the one who apparently pronounces FPGA 'fuhpugger'
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: L298 not totally working
« Reply #2 on: November 01, 2013, 10:35:30 pm »
Assuming no wiring faults, dead silicon?  Have you tried replacing the part?

It happens more often than you think.  Every single component you use has a level of damage applied to it by the time it is in place.  Sometimes this pushes them over the edge.

Also:  could you share pictures of the robot :) 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2117
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: L298 not totally working
« Reply #3 on: November 01, 2013, 10:39:13 pm »
L298's are notoriously easy to blow.

LMD18200T's are pretty robust in comparison.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline digitalundernetTopic starter

  • Contributor
  • Posts: 12
  • Country: 00
Re: L298 not totally working
« Reply #4 on: November 01, 2013, 10:44:13 pm »
Kizzap: we meet again.
  • Polarity for the diodes looks fine and they passed my meter test.
  • I see no shorts and again, continuity on my meter agrees there are none.
  • I've wired the motor by it's self and it works forwards and back no issues.
  • Just tried it and the motor did nothing.

Looks like I'll be sucking that chip off the board and trying another. Good thing I bought multiple.

Whales: Its not pretty to look at but sure
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: L298 not totally working
« Reply #5 on: November 01, 2013, 10:50:49 pm »
If I'm reading your circuit correctly (and you've not exactly made it easy), the motor and logic supply pins on the L298 appear to be reversed. (Pins 4 and 9).
 

Offline digitalundernetTopic starter

  • Contributor
  • Posts: 12
  • Country: 00
Re: L298 not totally working
« Reply #6 on: November 01, 2013, 11:13:02 pm »
Andy: Well that's annoying, I do. I also exceded the max input by a few volts so I'll bend those pins and wire them properly when I fix it. Damn I feel stupid.

I'm still pretty new to schematic making so what could I have done to make it easier to read? Keep in mind I'm using free eagle so there aren't multi page options
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2085
Re: L298 not totally working
« Reply #7 on: November 01, 2013, 11:45:54 pm »
...  Damn I feel stupid.
Don't! Simple mistake - learn from it :)  It'll be better next time - and easier.

Quote
I'm still pretty new to schematic making so what could I have done to make it easier to read? Keep in mind I'm using free eagle so there aren't multi page options
Since you ask:
Basically, the idea of a schematic/circuit diagram is to convey "what is happening" in a form that is easy for humans to comprehend (there was a thread about this recently). It is more than putting the individual components on the same sheet of paper and labelling "nets".  Connecting absolutely everything to everything else will create a mess, but, connecting parts of the circuit that are functionally linked, will make it easier to read the circuit.

 For example: Take the L298 and the major components the it uses - the output terminals could easily be connected to the chip (X2  to U1). Or the diodes (D1-D8), what do these do? There's plenty of space on the page - connect them. Also, (possibly an over sight) what do the cathodes of D5-8 connect to? - just a  line on your diagram.  These might appear to be minor issues, but remember the point of the diagram is to convey information - as a reader, I should not be having to guess where wires go!

Like the PCB :-+, pity about the "typo" on the pins :)

Edit: another typo!
« Last Edit: November 02, 2013, 10:38:09 am by Andy Watson »
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: L298 not totally working
« Reply #8 on: November 01, 2013, 11:52:26 pm »
Looks like I'll be sucking that chip off the board and trying another. Good thing I bought multiple.

Always good practice to buy more than you need.  Then you have leftovers for other projects :D

Whales: Its not pretty to look at but sure

On the contrary:  you have gotten your own board properly fabbed and use what looks like a dedicated host.  This contrasts greatly with my last robotic project to make a line follower:  I made almost everything myself except the MC.  Check it out!

http://members.optusnet.com.au/amerricka1/projects/maurice/front.jpeg
http://members.optusnet.com.au/amerricka1/projects/maurice/rear_guts.jpeg
http://members.optusnet.com.au/amerricka1/projects/maurice/bottom.jpeg
http://members.optusnet.com.au/amerricka1/projects/maurice/motor_drive.jpeg
http://members.optusnet.com.au/amerricka1/projects/maurice/IRboard.jpeg

@your schematic, it is a little messy.  More logical visual connections, rather than just broken links with net names, will make it easier to read.

I would recommend you have a look at Kicad -- free & open source, no limitations.  A few days ago CERN merged changes which make it MANY times nicer to use as well (OpenGL rendering FTW!).



Offline digitalundernetTopic starter

  • Contributor
  • Posts: 12
  • Country: 00
Re: L298 not totally working
« Reply #9 on: November 02, 2013, 04:45:10 am »
So I fixed the VLC,VCC mixup on my sumo and put my last l298 in. Now rather than one wheel working and one only working in reverse. I now have two motors that dont work in either direction.

 |O. I have NO idea what the problem is.
 

Offline kizzap

  • Supporter
  • ****
  • Posts: 477
  • Country: au
Re: L298 not totally working
« Reply #10 on: November 02, 2013, 09:21:37 am »
you are not shorting out the bottom sitting the thing on the motors?

-kizzap
<MatCat> The thing with aircraft is murphy loves to hang out with them
<Baljem> hey, you're the one who apparently pronounces FPGA 'fuhpugger'
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 618
  • Country: ca
Re: L298 not totally working
« Reply #11 on: November 02, 2013, 09:29:33 am »
I find it much easier to use a L297 in combination with the L298. Let the L297 do all the work. All you need to do is feed it pulses if using a stepper motor and you can set jumpers for the pins to fwd/rev,step, or do it with code from the MCU.


-=Bryan=-
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8275
Re: L298 not totally working
« Reply #12 on: November 02, 2013, 10:52:00 am »
Do you have a scope, or at least a multimeter?

Check voltages and signals to ensure that they're what you expect...
 

Offline digitalundernetTopic starter

  • Contributor
  • Posts: 12
  • Country: 00
Re: L298 not totally working
« Reply #13 on: November 03, 2013, 01:50:21 am »
Do you have a scope, or at least a multimeter?

Check voltages and signals to ensure that they're what you expect...

I've checked and rechecked the voltages/signals and they all seem ok until it hits the L298. If its dead I'm SOL. My mind keeps going to the diodes being bad but out1 and out 2 have 0 volts so I don't think its the diodes.
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: L298 not totally working
« Reply #14 on: November 03, 2013, 08:36:23 am »
If its dead I'm SOL.

Never!

Make your own.  4 N-Fets  (or 2 NPN + 2 PNP) will make a H-bridge.  If you don't have the parts, either find a brick and mortar store to purchase them  from (it should be less than several dollars, even at their premium rates) or find someone who has the parts.  If you know nobody and don't go to an institution where other EEs lurk, shoot off emails to your nearest educational institution's staff in electronics related teaching.  There are many more nice people in the world than nasty ones, even at a few day's notice :)

Seriously:  don't give up.  You have many pathways available to you to solve any problem, even if a deadline is mere days away.  Try multiple at once, and be polite to anyone who helps you  :-+

Offline MrAureliusR

  • Supporter
  • ****
  • Posts: 373
  • Country: ca
Re: L298 not totally working
« Reply #15 on: November 03, 2013, 09:04:55 am »
Hey I'm actually curious about building an H-bridge from discrete components. The schematics I've seen online so far seem more complicated than I think it needs to be. If it's not being interfaced to a uC does it need any logic or can you just wire up 4 fets? And it's 2 NPN and 2 PNP correct? I heard you can also use BJTs but that seems kinda pointless as they can't handle the same kind of current (or have I been terribly misinformed?)

Any pointers are greatly appreciated and I'm sure the OP could use them too :)

Typed using Hacker's Keyboard for Android

--------------------------------------
Canadian hacker
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: L298 not totally working
« Reply #16 on: November 03, 2013, 10:33:18 am »
Making a quick H-bridge is easy.  The complexity comes from making it fool-proof and most of all, efficient.

Check out the attached hbridge_fets.jpeg.  You need four switches of some description -- here N-channel mosfets --  to generate AC current from DC, and they ALL must be capable of the rated current.  Use PWM on the control wires to vary speed.  Keep in mind using exactly what I show here will result in a few problems:

There is no flyback protection in this design
When you switch off power to an inductor (like a motor) it will try and keep the current moving  In effect, it will ramp up the voltage across itself.  If it goes high enough it will fry your FETs.  Your mileage will vary depending on your motor, choice of FETs, etc etc

If you signal power to both forward and backward pairs, you effectively short power to ground
Indeed!  Make sure your micro does not try and power the motors both backward AND forward at the same time :)

Mosfets do not achieve their lowest resistance unless driven on the gate by a high voltage
This leads to greater power wastage through heat.
For most FETs, to reach the datasheet's stated ON-resistance they need to be driven by about 12V or more.  Check your datasheet.  My second picture shows a solution to this problem:  use another couple of FETs to level shift your micro's low voltage output to driving 12V signals.

Unless your FETs are designed for switching, PWMing them will waste a lot of power
"Gate transition" from on to off requires power, but you will probably just have to live with this.  Same problem as above, especially since (most?) micros output PWM at very high frequencies.

I have successfully driven motors in the past using a circuit identical to what is shown in the first diagram.  It was inefficient, and the FETs desoldered themselves within a minute.  They were however cheap, not designed for fast switching, in tiny SMD SOT packages and not heatsunk in any way beyond the copper tracks they lay on.



BJT transistors are available for this level of current draw -- and for a long time were better in switching duties than available FETs.  In low voltage applications like this however their voltage drop tends to waste more power than a FET's resistance does. 

If you were to make a BJT H-bridge, remember a few things:
  • You will lose voltage going through two BJTs ala two diodes
  • You must calculate resistor values for powering the BJTs

My thoughts were to use two NPNs and two PNPs so that the control current completely avoids the motor (a varying load).  That way the resistor values would be easier to calculate -- remember that you can practically sink an infinite amount of current into the base of a BJT if the right end of it is grounded/powered, turning it into vapour within an oh-no-second or two.  You will need to measure the BJT's beta (gain), so a cheap multimeter will be useful. 

On second thoughts, perhaps using two NPNs and PNPs to intentionally force current through the motor would allow you to omit the resistors could work.  You would have to think more about this -- I have to go to bed right now, sorry.  I recommend N channel MOSFETS anyway :P


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf