Previous in Forum: how to set output voltage of ELTEK slimpac 20 a 48vdc supply   Next in Forum: PLC SCADA Communication
Close
Close
Close
7 comments
Rate Comments: Nested
Member

Join Date: Sep 2007
Location: Ventura CA
Posts: 5

Power supply not switching to battery backup

09/03/2007 11:31 AM

If I could figure out how to add a schematic, I would; but in the meantime, here goes:

I have a microcontroller that usually runs from an AC power supply, but needs to run normally as long as possible during power failures. The microcontroller must turn the battery power off (killing the circuit) when battery voltage drops too low. I added a 12V battery and charger. The client also wants a report on battery health, so I added some extras to separately control the battery charger IC and the AC voltage applied to the main switcher.

A brief outline of normal operation: When AC voltage comes up, power MOSFET Q4 (IRF9510) is turned on (by the AC) and applies voltage to the switcher. The switcher turns on and provides 5V to the rest of the circuit. The microcontroller turns on, and turns on power MOSFET Q1 (also IRF9510), which is between the battery and the input to the switcher. The micro also turns on the battery charger (LM317, with the Vadj pin switched between values that do, and do not charge the battery) There are diodes to block undesired current flows through MOSFET Q4, the LM317, and MOSFET Q1. Q1 is actually driven by Q2, a 2N4401 level shifter that in turn is controlled by the micro.

At intervals, while running on AC, the micro switches the battery charger off, and measures the battery voltage. If the battery passes, there is a battery installed, and the test continues by turning Q4 off. This should cause the power supply to switch to battery power for the test duration. Afterwards, AC and battery charge are restored, and everything returns to normal. I have measured voltages around Q1 and Q4 during each step described above, and I see the voltages I would expect to see.

My test setup has the microcontroller and power supply on separate boards. If I power the microcontroller board from my bench supply, and use resistors as the power supply load, the microcontroller and power supply run as intended.

However, if I remove the lab supply and run the micro from the power supply, the program fails every time it tries to switch to battery power. I have set break points, so I know it is here, and not at the point where it decides the battery has failed and is supposed to shut down. (The shut down is working properly if the battery fails.) The failure is reported as an illegal breakpoint if I have the debugger connected. Without the debugger, the program resets and restarts from the beginning.

I have monitored the 5V with my (non-storage) scope; it looks OK. Nevertheless, I added caps anyway just in case I was missing a glitch. I got up to 10uF with no change in operation.

I removed the control line to Q2, and tied it to the 5V. This fixed the problem completely, but of course makes it impossible to turn the battery off at the end of charge.

So, I am out of ideas. It sure looks like a glitch, but I can't find it, or make it go away. Any ideas?

Register to Reply
Pathfinder Tags: battery backup
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
United Kingdom - Member - Olde Member!! Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jul 2006
Location: Dunstable, England
Posts: 2821
Good Answers: 45
#1

Re: Power supply not switching to battery backup

09/03/2007 2:12 PM

Hmmmm sounds like a power supply is dipping which can of course also mean the earth return wire is giving a glitch into the micro to reset it...

Without a circuit diagram its difficult to comment on the circuit, but from your problem I'd say it was a supply spike occuring when switching, if you've tried decoupling the supply with caps what about having a seperate local regulator for the microprocessor circuit, as well as having a seperate earth return wire to the power source...

You don't say whether the battery is a long way - in wiring terms, from the ac power supply but it could make the difference enough to cause the earth wire to supply the spike which means capacitive decoupling wouldn't work in itself...

Try a seperate supply for the micro as its obviously resetting itself at every swithing point.

John.

__________________
A little knowledge is a dangerous thing - Googling is far worse!
Register to Reply
Member

Join Date: Sep 2007
Location: Ventura CA
Posts: 5
#4
In reply to #1

Re: Power supply not switching to battery backup

09/04/2007 1:34 AM

I am using DesignWorks, which can't Save As anything except its own format. It can Print to .pdf. It can Export to .dxf, .wmf, or to formats matching everything from EAGLE to Zuken. It can't do .jpg, .bmp or anything like those.

Be that as it may, the long lead idea had value, because one thing I didn't mention last time was that I actually have four boards that all get power from the same source. I daisy chained the power and ground to cut down on the clutter. The board I am testing is physically next to the power board, so I thought I had short wires. But when I tracked them down, it turned out that power was actually fed to the other end, and then back through every other board, meaning the power leads to this board were about three feet long.

So, I added some six inch (24 ga) wires between the power board, and the board I am testing. I left the existing wires. There was no change in operation at all.

Next, I will change the switcher to 8 or 9V, and add a three terminal 5V regulator in series on the power board (too dangerous anyplace else). There is very little room available to do this, so the answer will be delayed until tomorrow. I added this message so you wouldn't think I was blowing you off.

Register to Reply
Guru

Join Date: May 2006
Location: Placerville, CA (38° 45N, 120° 47'W)
Posts: 6215
Good Answers: 248
#2

Re: Power supply not switching to battery backup

09/04/2007 12:05 AM

Assuming you have a circuit diagram, save or export it as a JPEG image. Then when you are posting your message, click on the camera icon and navigate to the image - it will be inserted wherever your cursor is at the moment.

Without that circuit, it is very difficult to follow your problem...

__________________
Teaching is a great experience, but there is no better teacher than experience.
Register to Reply
Guru
Philippines - Member - New Member Engineering Fields - Instrumentation Engineering - New Member Engineering Fields - Control Engineering - Who am I?

Join Date: Oct 2006
Location: Northern Mindanao, Philippines
Posts: 2147
Good Answers: 53
#3

Re: Power supply not switching to battery backup

09/04/2007 1:29 AM

As the others have said, a schematic would be nice. For the meantime...

It sounds like your battery is not being switched in fast enough or the supply is dipping too much before your battery comes in to take the load. I'm saying this because you said that when you tied Q2 to 5V, (effectively, this connects the battery to the load continuously, I gather) the circuit worked fine. There's practically no delay in switching in the battery.

However, I didn't get it why doing this disables the switching off of the charger circuit. These should be separate circuits and work independently. I may be misunderstanding your description though.

Just on a hunch, try increasing the power supply's capacitor to a really big value, say 2000uF. That should keep the DC voltage stable long enough (milliseconds?) for the battery to kick in and take the load.

__________________
Miscommunication: when what people heard you say differs from what you said. Make yourself understood.
Register to Reply
Power-User

Join Date: May 2007
Location: 39°10' N 91°52' W
Posts: 237
Good Answers: 15
#5

Re: Power supply not switching to battery backup

09/04/2007 6:44 AM

Have you ever heard of Winsnap? or any other utility for taking screen shots?

I use Winsnap all the time for saving Eagle output that is postable in several forums that I am a member of.

I forgot where I got it or even if it's a freebee, but it is worth checking out.

__________________
If you don't have time to do it right the first time, when are you going to have time to do it over?
Register to Reply
Member

Join Date: Sep 2007
Location: Ventura CA
Posts: 5
#6
In reply to #5

Re: Power supply not switching to battery backup

09/06/2007 4:05 PM

I got it fixed. Actually, I ended up with two solutions.

Raising the switcher output and adding a linear post regulator worked quite well.

I finally thought to measure the load current instead of merely calculating it (you'd think I'd have learned THAT lesson after all these years...) It turned out to be over twice what I had calculated. So, after removing the linear regulator, and resetting the switcher, I tripled the output cap, and managed to reduce the load a bit by removing some of the "features". This approach also seems to be working just fine.

So, thanks for all your help.

Register to Reply
Guru
United Kingdom - Member - Olde Member!! Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jul 2006
Location: Dunstable, England
Posts: 2821
Good Answers: 45
#7
In reply to #6

Re: Power supply not switching to battery backup

09/07/2007 6:32 AM

Thanks for letting us know... Glad its all sorted.

Its a shame that most others never respond to their question on here and so nobody knows what has happened...

John.

__________________
A little knowledge is a dangerous thing - Googling is far worse!
Register to Reply
Register to Reply 7 comments
Copy to Clipboard

Users who posted comments:

astrayelmgod (2); charlie_r (1); dkwarner (1); Electroman (2); Vulcan (1)

Previous in Forum: how to set output voltage of ELTEK slimpac 20 a 48vdc supply   Next in Forum: PLC SCADA Communication
You might be interested in: Battery Holders, Battery and Fuel Cell Components

Advertisement