morecambe
Posts: 5
Joined: Sat Mar 28, 2015 10:01 pm

L293D leakage

Thu Mar 30, 2017 6:15 pm

Use L293D based motor controllers to control small DC motors. Recently noticed with an 4tronix controller that even when the motor supply is disconnected, motors can still receive 0.35v or so, via L293D output. This voltage was sufficient to cause the motor to produce a little noise as though it was attempting to move. On investigation, discovered that 4.6v is seen on the unconnected motor supply terminals. This can only be due to leakage through L293D.
On checking another motor controller, (SB Components), also using L293D, found 2.75v at unconnected motor supply terminals.
None of this affects the apparent operation of the L293D, ie when logic 5v supply, and motor control 7.2v supply are both connected, everything works as expected. However, I would be interested to know if the observed leakage between the logic supply (VCC1) and the motor supply (VCC2) of the L293D is typical, or do I have damaged L293D's? I suspect the former as whilst I have seen no figures, I note that an Arduino FAQ states that "some H-bridge chips" do exhibit leakage.

User avatar
mikronauts
Posts: 2779
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: L293D leakage

Thu Mar 30, 2017 6:25 pm

Very interesting - and somewhat disturbing.

Do you see the leakage if you drive all the inputs of the L293D low?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13009
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: L293D leakage

Thu Mar 30, 2017 6:34 pm

If the leakage reaches the GPIO, and drives it over 4 volt, this can potentially damage your PI!
But perhaps I'm overreacting.

morecambe
Posts: 5
Joined: Sat Mar 28, 2015 10:01 pm

Re: L293D leakage

Thu Mar 30, 2017 7:57 pm

If inputs are low, 0v is seen on output. Thus L293D appears to act as it should, ie it switches "motor supply" on/off in response to input. However when no motor supply is physically connected, the voltage at the motor supply connection is leakage from the 5v logic supply, thus any output is insufficient to actually drive a motor.
In my original post, I should have said that the Arduino FAQ specifically referred to leakage between the chip's 5v logic supply and the motor supply. Unfortunately they simply said "some H-bridge chips" but as the L293D is one of the commonest chips used for cheap motor control, and bearing in mind my experience with two controllers from two different manufacturers, I now assume that the L293D was probably one such chip that Arduino was referring to. It would have been helpful if Arduino had been more specific and also given some values. Note that I only discovered this "leakage" when on one occasion I inadvertently left the motor supply switched off. Under normal conditions, ie both supplies on, one would be never aware of it as everything checks out perfectly.

wayne.dolesman
Posts: 64
Joined: Sat Feb 25, 2017 8:10 am

Re: L293D leakage

Thu Mar 30, 2017 8:07 pm

mahjongg wrote:If the leakage reaches the GPIO, and drives it over 4 volt, this can potentially damage your PI!
But perhaps I'm overreacting.
I believe, based on his description, that the leakage is on the pins that drive a motor and should never be hooked up to a Pi.

Morecambre:
What I do not see most how-to diagrams on the net but is in the Ti data sheet is voltage clamps between the motor and the motor drive pins. Do you have a voltage clamp (couple of diodes on each side)? If not can you try it and see if that helps?

edit: read your last post and it seems that voltage clamps here wont matter for this problem (but are still a good idea for when the motor stops to prevent damage to the chip).

morecambe
Posts: 5
Joined: Sat Mar 28, 2015 10:01 pm

Re: L293D leakage

Thu Mar 30, 2017 9:38 pm

Quote Arduino again "Some H-bridge chips leak enough current from the 5v logic side of the chip to dimly light the LED". The LED they were referring to was an LED on the board whose purpose was to indicate that the motor supply was switched on, ie was monitoring the motor supply voltage.
Thus it suggests such leakage is the norm, and if it is only in this direction, and limited to the two supply pins, then no harm done. Interesting!

Edit: see from Arduino photo, board referred to uses L293D! So my experience is not unusual, maybe some chips worse than others, but as I say, no real problem as under normal conditions one would always have both logic and motor supplies active, and this leakage is only seen when there is no motor supply connected.

User avatar
Burngate
Posts: 6290
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: L293D leakage

Fri Mar 31, 2017 9:09 am

According to the TI datasheet, the recommended operating conditions for Vcc2 is minimum Vcc1 (and maximum 36v)
Clearly, disconnecting Vcc2 violates this.

There's a couple of diagrams showing the input & output circuit:
L293D.png
L293D.png (23.24 KiB) Viewed 1666 times
Somewhere between the input and output there has to be an inversion. Most probably that's what's responsible for the leakage.

What happens if you put a resistor between the Vcc2 input and ground?

morecambe
Posts: 5
Joined: Sat Mar 28, 2015 10:01 pm

Re: L293D leakage

Fri Mar 31, 2017 5:20 pm

Fully realise having no motor supply is outwith normal operation. The reason for raising the issue was that the observation was a surprise. I was testing a change in my code and inadvertently forgot to switch on the motor supply. The result was faint intermittent buzzing, and the motors appeared to occasionally vibrate slightly. When I realised that there was no motor supply I was naturally puzzled as to how the motors could be receiving any sort of voltage as the only source was the 5v logic supply. Subsequently discovered a voltage on the motor terminals even though supply disconnected. There would have been the same surprise if I had been using the board as Arduino were referring to and I had seen the motor supply LED lighting up even though there was no motor supply.
It now appears that some degree of leakage from logic supply to motor supply is normal under such conditions. Furthermore it would appear to vary from chip to chip, eg the leakage on the 4tronix board which uses a single chip is more than that of the SB board which uses 2 chips, although in fairness we are not comparing exactly like for like as the SB board uses the surface mount version, but presumeably the interiors are similar.
Many thanks for the interest.

User avatar
Burngate
Posts: 6290
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: L293D leakage

Fri Mar 31, 2017 5:29 pm

morecambe wrote:... and inadvertently forgot ...
Been there, done that.
Making coffee this morning, water boiling in kettle, coffee grounds in jug, spoon full of sugar ... where's the mug?

I'd still be interested in what happens if you ground Vcc2 with a resistor. But probably nobody else is :cry:

morecambe
Posts: 5
Joined: Sat Mar 28, 2015 10:01 pm

Re: L293D leakage

Sat Apr 01, 2017 10:57 am

Burngate wrote: I'd still be interested in what happens if you ground Vcc2 with a resistor. But probably nobody else is :cry:
Sorry! 10k will pull voltage at motor supply terminals down to 0.2v. Oddly this is in contrast to the voltage being pulled down to around 3.4v when the code was running and one was attempting to drive the motors with no supply connected. Hope this helps but unless one knows just what is taking place within the chip I am not sure of the value of this data. Interesting, but I am taking the practical approach, ie the chip exhibits leakage under these abnormal conditions and, most importantly, I am now aware that it would appear to be a normal characteristic of this chip, so I don't have a problem with my kit. :D

User avatar
Burngate
Posts: 6290
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: L293D leakage

Sun Apr 02, 2017 8:02 am

morecambe wrote: 10k will pull voltage at motor supply terminals down to 0.2v.
Brill! Thanks

Return to “General discussion”