Author Topic: Simple 5V UPS Design (not working in SPICE)  (Read 1616 times)

0 Members and 1 Guest are viewing this topic.

Offline aiq25Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: us
Simple 5V UPS Design (not working in SPICE)
« on: October 25, 2019, 07:41:19 pm »
I'm looking to design a simple 5V UPS circuit. The UPS will have two inputs: 5V USB and 5V boost from a Li-Ion battery.

I designed something in LTspice but this does not seem to work. Attached is the schematic. Please ignore the 1mOhm resistors, I put them to measure the direction of current flow.

The idea is simple: M3 provides reverse polarity protection for the USB input (not required but wanted to through this in). M3 and M4 should open when there is no voltage present on the USB (denoted in the schematic as "VUSB"). M1 and M2 provide power to the load when VUSB is not present. VBST is the 5V boosted from a Li-Ion battery.

The problem I'm facing is even when VUSB is disconnect from 5V (as shown in the SPICE simulation), there is somehow voltage on the VUSB line and the output voltage is not 5V, rather ~0.8V. When I disconnect the VUSB line from R13 then the circuit seems to work properly (Result 2). I think somehow there is current through M3 and/or M4 that is going to the VUSB line and powering something.

I'm using NPN transistors to control the FET's. I have tried replacing them with N-Channel MOSFET's but that didn't help.

I cannot figure out this problem and would appreciate some feedback.

The MOSFET's I'm using are just for simulation purposes. I have tried others from the LTspice library but similar and/or same results. I don't have any parts picked out yet, just looking to get a concept working.

The end UPS will have to provide 1A to the load. LTspice file is also attached.
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #1 on: October 25, 2019, 08:41:41 pm »
What's wrong with just two Schottky diodes?

ETA: At all times, one of the MOSFETs in each pair will behave as exactly that, so why not cut out the middleman?

To answer your question, try pulling VUSB down with ~10k to ground. Collector-base junctions are not ideal diodes. I haven't simulated this design, but the path R9-R8-Q2-R5 arouses my suspicions.
« Last Edit: October 25, 2019, 08:57:05 pm by jhpadjustable »
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline aiq25Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: us
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #2 on: October 25, 2019, 11:12:09 pm »
What's wrong with just two Schottky diodes?

ETA: At all times, one of the MOSFETs in each pair will behave as exactly that, so why not cut out the middleman?

To answer your question, try pulling VUSB down with ~10k to ground. Collector-base junctions are not ideal diodes. I haven't simulated this design, but the path R9-R8-Q2-R5 arouses my suspicions.
I was trying to minimize voltage drop and losses.

Thanks for the suggestion, will try it. I think this circuit much more optimized. I was using one of the mosfet to negate the effect of the body diode.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15797
  • Country: fr
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #3 on: October 26, 2019, 12:07:04 am »
The back-to-back PMOS pair is a good idea to make a switch that will switch off in both directions. (Of course with just one PMOS, due to the body diode, one direction is never off.)

The reason why your approach doesn't work is that it will actually not properly handle all 4 cases: VUSB on/off, VBST on/off. Just think about each case, and how your circuit will behave. You'll see that controlling the MOSFETs correctly is definitely not this simple. For instance, you definitely can't pull up to VUSB to control the upper PMOS pair. When VUSB is not 5V, it won't pull it up to anything, and the transistors will conduct...

Of course the simplest would be to use two diodes. Schottky diodes will have less voltage drop (and thus power loss), but beware of their relatively "high" reverse leakage current. Not necessarily a problem in your application, but just something to keep in mind.

Now if you're OK with the voltage drop (how low can the output of your "UPS" be to still fulfill your requirements?) you'll get with Schottky diodes, but would still like to minimize losses when on the battery, whereas you don't care when on USB, I suggest the following schematic. You may think that duplicating the bottom structure with the transistors for the VUSB path will work, but it won't. There are cases that would make it fail, and the controlling part would get even more involved than this. A bit too much for my liking, so I'm suggesting this. Would still need a few transistors... Check it out, it should work as expected (with priority for VUSB, shutting down the battery path even if the battery is connected when VUSB is present).

If anyone manages to get it right with fewer transistors, don't hesitate to chime in. But make sure all cases are properly covered first.

There are also integrated OR'ing controllers. I suggest looking them up; they are simple to use, integrate more protections and will reduce part count.
« Last Edit: October 26, 2019, 12:18:47 am by SiliconWizard »
 
The following users thanked this post: jhpadjustable

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #4 on: October 26, 2019, 08:05:21 pm »
The good thing about many of the integrated controllers is they include a charge pump, which enables a single N-MOSFET to be used on the high side, which have a lower on resistance than two P-channel devices in series.
http://www.ti.com/lit/an/slvae57/slvae57.pdf
 

Offline aiq25Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: us
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #5 on: October 27, 2019, 12:33:31 am »
The good thing about many of the integrated controllers is they include a charge pump, which enables a single N-MOSFET to be used on the high side, which have a lower on resistance than two P-channel devices in series.
http://www.ti.com/lit/an/slvae57/slvae57.pdf

Thanks. I looked into the ideal diode controllers from TI before but one thing is that they seem to control only a single MOSFET, I wanted to use the back to back FET’s to ensure complete disconnect.

Thank you for the simulation as well. For my application a shottky will work.
 

Offline jmw

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: us
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #6 on: October 27, 2019, 01:24:52 am »
Is this for the fun/challenge of it? When I had this need in a design, I put in a TPS2113, which only needs the usual bypass caps and a pair of resistors in its reference design.
 

Offline aiq25Topic starter

  • Regular Contributor
  • *
  • Posts: 243
  • Country: us
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #7 on: October 27, 2019, 05:01:34 pm »
Is this for the fun/challenge of it? When I had this need in a design, I put in a TPS2113, which only needs the usual bypass caps and a pair of resistors in its reference design.

This is more for fun and to learn to control the FET’s (I thought it was going to be simple lol).

My application is really for a clock, which draws about 50-100 mA. So the diodes should be fine. I was looking for a solution that I can reuse in the future for more demanding projects.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: Simple 5V UPS Design (not working in SPICE)
« Reply #8 on: October 27, 2019, 05:30:38 pm »
Is this for the fun/challenge of it? When I had this need in a design, I put in a TPS2113, which only needs the usual bypass caps and a pair of resistors in its reference design.

This is more for fun and to learn to control the FET’s (I thought it was going to be simple lol).

My application is really for a clock, which draws about 50-100 mA. So the diodes should be fine. I was looking for a solution that I can reuse in the future for more demanding projects.

https://electronics.stackexchange.com/questions/223935/understanding-an-ideal-diode-made-from-a-p-channel-mosfet-and-pnp-transistors
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf