Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Motor power dropping with battery voltage

Status
Not open for further replies.

AceOfHearts

New Member
Hello everyone,

I have a problem with my robot.

It uses PWM with DC motors. Im using an L293D which powers the motors directly from the 12V battery pack it is controlled by the 5V PWM pulses from a microcontroller - so the actual PWM pulses to the motors are 12V in amplitude.

The problem is that with time as the battery voltage decays, so does the amplitude of the PWM pulses received by the motors because it is not connected via any regulator. This means for a given a certain PWM width, the motor speed decreases with time, even though the amplitude of the 5V PWM pulse from microcontroller is constant (which is conencted to a regulator).

The robot moves forward using a wheel encoder so moving forwards is never a problem as it can move at whatever speed the battery permits to the required distance. But it becomes an issue when turning as Im turning it purely on keeping the motor on a for a period of time...but this means the user will end up with a robot that turns wrong amount more and more over time as battery voltage drops.

Any suggestion to get around this problem? I had a regulator connecting the motors once upon a time, but was advised by members of this board that it is not efficient to do so with motors...but this seems to be one solution now as the voltage will be kept constant to the motors.

Many thanks for reading.
 
Last edited:
You can also get more consistent performance by measuring the battery voltage and increasing the duty cycle whenever as the voltage falls (of the voltage drops by 20%, increase the duty cycle by 20%) so that the motor sees the voltage you want it to see rather than blindly picking a PWM duty cycle (within limits of course...obviously with PWM you can't make the motor see a higher voltage than the batteyr's max voltage).

INstead of thinking "I want the motor to see 50% of the battery voltage so I'll send it 50% duty cycle), you might think instead "I want the motor to see 5V. Now since the current battery voltage is 10V, I will send a duty cycle of 50% so the motor sees 5V). THis won't give you a constant speed since the motor load might be unpredictable so that changes the speed, but it does give more consistent performance. You can measure the actual motor speed with your encoders anyways and increase/decrease the speed by varying the PWM duty cycle as needed.
 
Last edited:
Thanks for the suggestions. Nigel's one seems to be the most suitable...but it will require me to to work on the code. Given that deadline is looming and I have so much to do...sticking a regulator between the L293D and supply seems like the quickest fix.
 
So pop in a regulator and work on the code, timing pulses and good motor control circuitry will give you very accurate and repeatable turns though. If you finish the code in time you can pull the regulator out.
 
yeah thanks. But right now as I speak I have been struck down with another problem...after soldering my final components on what is Id say a very neat job...some or all my existing components seem to heat up and nothing works....the uC pretends to work for a moment...the ICs etc. get extremely hot and I have to quickly switch the Vs off.

I only put on caps and an IC max232 which I have removed from its socket...still it persists! Theres obviously a short developed somewhere...and its not like program compiler where it will tell you where an error is comming from...been busy with the continuity probes all over the circuit board...zilch. I wonder if the regulator is gone? but why would it coincide with me putting in new components? suspicious. Cutting off the reg. is a risk with price to pay if it turns out to be working: I'll have to acquire a new one. btw. the +5V line is giving out 9V!! (input to reg. is 12V)...Is this the regulator? Or something else causing it?
 
Last edited:
I'd replace the regulator. Not sure what would cause that though.
 
Last edited:
What's the regulator you're using?
 
Last edited:
Thanks for the suggestions. Nigel's one seems to be the most suitable...but it will require me to to work on the code. Given that deadline is looming and I have so much to do...sticking a regulator between the L293D and supply seems like the quickest fix.
Actually, if you are interested in relative and not absolute speed there is no need for encoders.

The speed at a given load will be very consistent if you compensate for the supply voltage and ditch the piece of crap L293 that is robbing you of 1-2V per driver depending on your load current, which BTW WILL cause IT to over heat (2V*1A*4 (max load current)=8W) and even if you have an infinite heat sink the junction temperature would be 25C+8W*14C/W=137C with an absolute max of 150C. Chances are you are probably running close to the 80C/W junction to ambient instead.

You can even get pretty good dynamic load speed consistency without speed feedback if you add in load current compensation as well.

Dan
 
What's the regulator you're using?

Its a 7805.

Not sure what ubergeek means...the L293D is so that it can provide the needed current/voltage which the MCU cant?

Anyways guys...Ive replaced the regulator...the components are good (not heating up)....but my MCU is not running and when I probe the Oscillator pinout pins with my logic probe I dont get the yellow pulse LED flashes (which I usually get) which tells me its receiving the crystals oscillations....replaced the MCU with new one, same problem. There appears nothing wrong with the oscilator circuit (crystal+caps).

Does anyone know how to test a crystal for correct operation? Thanks for all the help.

PS. I got my self a 9V 2A regulator for the motors. Will install it once the current problems are cleared up.
 
Last edited:
Swap the crystal out with a new one see if it works, that's generally how you test them.
 
Its a 7805.

Not sure what ubergeek means...the L293D is so that it can provide the needed current/voltage which the MCU cant?
The L293 saturates at 1.5V so if you are driving 0.5A with all four outputs you are trying to make the chip dissipate 3W. If you are lucky it shuts down instead of burning out.

Dan
 
"Will install it once the current problems are cleared up."

Pun intended? :rolleyes:

Once you get the oscillator oscillating, it may jump into life, but you may have a reset chip monitering the power and holding the micro in reset if the power is sagging or maybe the reset chip is damaged. The L293 I just glanced at seems to be a transistor based drive device and doesn't deliver power to your motor as efficiently as say, an FET based solution
 
Last edited:
lol...yeh bit of a pun there come to mention it. Ok everything is working finally! The old regulator chucking out almost 10V destroyed almost every component which had to be replaced. Just have to be careful now until the demo day is over next week. :)

The L293 saturates at 1.5V so if you are driving 0.5A with all four outputs you are trying to make the chip dissipate 3W. If you are lucky it shuts down instead of burning out.

Dan

I see. Thanks for the info...but my L293D is cool while the motors run like its not even on...could be to do with the fact that it's outputting PWM perhaps.
Thanks for the info. :)
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top