need some help with this simple schematic - Page 1
Forum section: electronics / projects

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 05:42:07 pm
content: I'm going crazy over here. I have spent most of my day trying to fix something that should be simple.I have a project with a PCB that has a 12V voltage supply tough a system cable. There is also a auxiliary supply on the PCB that can be used if more current is needed than can be drawn out of the system cable. I also need some reversed voltage protection.Attached you can find 2 sims with these 2 different situations- Without R4/Q4 the and the switch open, Q1 turns off fine.- However when the switch is closed, the gate of Q1 remains high, so the FET doesn't fully switches on- To switch the Q1 fully on, i need to lower the gate voltage. This can be done with R4 and Q4.- While the switch is off Q1 remains on somehow switching Q4 on, keeping Q1 on, etc...- Meanwhile this also stops Q2 from turning on fully.i have tried many similar solutions, but i can not get it to work. Can anyone explain me what is happening and suggest a alternative circuit?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 11, 2020, 06:12:55 pm
content: Q2 is upside down (body diode in forward conduction) so it is as good as a weak diode. Q1 is ok but driving high side n-mosfet without charge pump can be problematic. are you sure you've checked your schematics?sorry i didnt notice they are pmosfets. looking again, both pmosfets are upside down, so they are both as good as weak diodes... its hard to see when there are 2 voltage sources one at top one at the bottom. are you sure you've checked your schematics?

author: strawberry
author_rank: Super Contributor
timestamp: October 11, 2020, 06:16:23 pm
content: there is not right gate-source voltage level or polarity to turn MOSFET on

author: IanB
author_rank: Super Contributor
timestamp: October 11, 2020, 06:19:01 pm
content: Reading your requirements, the first thought that comes to mind is "diode", yet I don't see any diodes in your designs. Is there some other requirement that you are not describing, such as minimizing voltage drops?The concept of source 2 providing more current when source 1 cannot provide enough to sustain the load is classically implemented as a "pass element" in power supplies. Yet I don't see any sign of this topology either.I'm not an electronics expert and maybe this makes sense to someone else, but at first glance I don't understand the circuit topology.

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 06:22:49 pm
content: Quote from: Mechatrommer on October 11, 2020, 06:12:55 pmsorry, i did not mention this, but the reason i'm using mosfets is, that i use these as a alternative to diodes. I prefer to avoid the voltage drop/dissipation. Using a P mosfet is a simple a populair way to do this. my problem however is, that i can not find a way to fully switch them off.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 11, 2020, 06:41:55 pm
content: they will not be switched off when their body diodes are conducting to R1. i'm sorry i'm not the expert but i never heard to use reversed pmosfet as altenative to diode as popular way, can you provide reference? i've seen similar back to back nmosfets in battery protection ic but they are not quite like your topology and supply current is in order of mA only.if you dont want voltage drop, use schottky diodes, nothing can be better afaik. edit: ok now i think i know what you are up to.. i need to meditate on this..(but i still think thats not how you'd do it ymmv)

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 06:50:38 pm
content: Quote from: Mechatrommer on October 11, 2020, 06:41:55 pmSorry, again i was not clear here. I do not want current to flow form source 2 tot source 1. Source 2 can be a unprotected source, while source 1 used advanced surge protection and basic current protection.Obviously the most simple solution would be to use a jumper, but if it van be done with 20cents worth of components that cango into the SMD process, this is prefered.see this for example:my situaltion however is a little diffrent. I want Q2 to be able to turn off when the auxilery power is connected, (and if possible Q1 too if auxiliary power is NOT connected)

author: IanB
author_rank: Super Contributor
timestamp: October 11, 2020, 06:58:49 pm
content: I am imagining a topology something like this:Code:+---------------+Source 2: O------| Pass element |----- >|----++---------------+ Diode |^ || |+---------------+ |Source 1: O------| Current sense |----- >|----+----++---------------+ Diode ||+--------+| Load |+--------+||---------When the current through the current sense element exceeds a threshold value the pass element starts to open and supplies additional current as required.This addresses your statement of requirements:QuoteWith these words it seems that Source 1 is the system cable, and Source 2 is the auxiliary supply that provides more current if Source 1 cannot supply enough. The diodes provide the reversed voltage protection.However, in your diagrams I do not see where the current sensing occurs, so I do not see how the load balancing can happen?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 11, 2020, 07:13:29 pm
content: Quote from: superKris on October 11, 2020, 06:50:38 pmok thats a good recap thanks. so i guess there is leakage (reversed) current in Q1 when S1 is off. try reducing R2 value to say 1Kohm. and if necessary R4 and R3 too. ymmv cheers.

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 07:40:05 pm
content: Quote from: IanB on October 11, 2020, 06:58:49 pmThank for your detailed input, but this is not the same as im trying to do. I want my circuit to always take power from source 1 UNLESS source 2 is connected. Then only power from source 2 should be used, and this current can not flow in the direction of source 1.

author: Peabody
author_rank: Super Contributor
timestamp: October 11, 2020, 07:46:20 pm
content: Maybe it's just leakage, but it looks like the simulation is wrong with the switch open. For example, how can the voltage at PR7 be 10.3V when there's a 10K resistor to ground and the switch is, uh, open. So with R3 in place, Q1 can't be on unless a lot of current is leaking back through it to the NPN base, turning it on. I just wonder if that leakage is for real.Ok, how about this. There's no red dot where the Q2 gate and R2 connect to S1. In the sim world that may mean there's no actual connection. Try making that a connection and see what happens. If it still doesn't work, try making R4 100K.Basically, I think this works. The mosfets are oriented to block backflow, not to switch the forward current into the load. That's why they're in the Australian orientation. But with the switch closed, the power is provided entirely from the switched 13V source. Is that what you want?

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 07:54:05 pm
content: Quote from: Mechatrommer on October 11, 2020, 07:13:29 pmIncreasing R2 or other resistors did not help, but thanks anyway.The paradox is, when there is no transistor pulling the gate of Q1 down, it switches off fine like it should. When the transistor is there, Q1 never closes so the transistor never swiches of, and Q1 never turns of, etc.

author: superKris
author_rank: Regular Contributor
timestamp: October 11, 2020, 08:11:46 pm
content: Quote from: Peabody on October 11, 2020, 07:46:20 pmyou may be right here. I generally dont do sims a lot. Maybe i should just build in on a breadboard, but i was just trying to confirm the workings of something i have drawn for a new PCB.I'm not sure why there was no red dot, but i redid the line, and on difference. Diffrent values for R4 dint change anything neither.Indeed i want no power to flow from source 2 to source 1. If source 2 is connected it should power the load alone.In real life source 1 and 2 will have the same voltage btw. Its just that source 1 cant provide high power since its trough a RJ45 patchcord.

author: onlooker
author_rank: Frequent Contributor
timestamp: October 11, 2020, 08:24:29 pm
content: It looks like OP's simulation actually used 10.3V for V2 instead of, 13V. What happen is that when S1 is on, your circuit will select the higher of V1-1(body diode) and V2 to supply Vout.Now V1-1 = 11V and V2 = 10.3V so V1 is actually supplying Vout.The other thing is you are trying to use ideal diode topology. There are a lot online info about it.

author: IanB
author_rank: Super Contributor
timestamp: October 11, 2020, 08:34:26 pm
content: Quote from: superKris on October 11, 2020, 07:40:05 pmOK, but I quoted your requirements statement from your first post. With this clarification you are making a different statement. It seems like you want the topology below instead.QuoteThis is important, because if they have the same voltage you cannot compare the voltages between Source 1 and Source 2 to see if Source 2 is connected. You must instead compare the voltage on Source 2 to ground. If voltage is present on Source 2 then Source 1 is disconnected. If no voltage is present on Source 2 then Source 1 remains connected.Code:+---------------+Source 1: O------| Off switch |----- >|----++---------------+ Diode |^ || |+---------------+ |Source 2: O------| Voltage sense |----- >|----+----++---------------+ Diode || || +--------+| | Load || +--------+| || |----- -------- ---- -

author: Peabody
author_rank: Super Contributor
timestamp: October 11, 2020, 08:36:36 pm
content: Well, I'm stumped. It looks like the simulation has 2mA flowing back through Q1, which seems like an awful lot of leakage. And I think you said before that you tried reducing R2 to 1K and it still didn't work. All I know to suggest is to set up current test points everywhere - all three pins of the NPN in particular. I guess there could be assumed leakage through the collector of Q4 to its base. Anyway, you have to find where the current is flowing when the switch is open.

author: IanB
author_rank: Super Contributor
timestamp: October 11, 2020, 08:58:12 pm
content: If you don't want to have diodes in the circuit I think you might do it this way, using the switch elements with combined duty as reverse current protection, which is I think your intent?Anyway, my recommendation would be that before creating a circuit schematic, you should be able to write down a very clear statement of the requirements for the circuit behavior, and second, you can draw a block diagram of the topology that your circuit should match.Code:+---------------+Source 1: O---------------| Off switch |------------------------++---------------+ |^ || |~ +--------------+ |Source 2: O---------+-----------------------| On switch |-------+-------+| ~ +--------------+ || | ^ |+---------------+ | | +--------+| Voltage sense |-----+----------------+ | Load |+---------------+ +--------+| || |----- -------- ---- -

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 11, 2020, 09:26:40 pm
content: meditating on the schematics for a while.... the problem when S1 is switched off just after turned on is that, gate charges of Q2 will divide to R2 and R4->Q4 making Q4 still on, and hence Q1 on, for this short period current will find its way from source 1->Q2->Q1 in reverse direction until it meets Q4 again, so Q4 will never turned off. few solution i can think of to avoid "back current" slip into Q4 is add diode before R2 to avoid back charges from Q2's gate, and some capacitance on the load to avoid reverse current rush through Q1's channel during that short period, giving enough time for Q4 to turned off, and also still, reduce R4 value to reduce time constant (quicker Q4 turning off) or/and add pull down resistor to Q4's base to reduce time constant even further. ymmv.

author: superKris
author_rank: Regular Contributor
timestamp: October 12, 2020, 08:11:03 pm
content: Quote from: IanB on October 11, 2020, 08:58:12 pmThank you, that is indeed what im trying to do. I guess, its a ittle more clear in my head than in my schematic. Anyway, i cant get it to work with fets because the transistors i need to turn them fully on, switches them on permanently by being switched on in the first place... At least, this happens in simulation.Quote from: Mechatrommer on October 11, 2020, 09:26:40 pmVery smart! i guess that theory makes sense. Unfortunately none of the suggested modifications worked.I did discover something however that i overlooked at first. If i start with the switch off, Q1 is off (approx 80mv). If i flip the switch, Q1 turns on. If i flip the switch again, it stays on (at 10.3V)I'm not sure how i overlooked this... Its alomst like it wasnt like that in the start. I guess this behavior makes sense. Its basically a latching circuit, but how do i stop it from happening???

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 12, 2020, 09:15:20 pm
content: then maybe you need to use open collector comparator like LM393 instead of Q4 to drive Q1's gate low. +ve input to PR3, -ve input to PR5, this can give true protection when 0 < V2 <= V3, and you can use the other half of the comparator to do extra work or leave it unused. ymmv.

author: onlooker
author_rank: Frequent Contributor
timestamp: October 12, 2020, 10:47:25 pm
content: It looks like Op's Q1, with S1 open, is bistable. Though it should not affect the operation. The ~2mA wasted current can be reduced by riising R3 and R4. Or, maybe, OP can try to use two typical ideal diodes connected back-to-back. This is modified from a googled schematics.

author: Peabody
author_rank: Super Contributor
timestamp: October 12, 2020, 11:45:32 pm
content: Ok, when S1 is closed, everything works ok, with Q1 on and Q2 off. Then when you open S1, Q1 is still on, and current will flow in either direction through a mosfet if it's on, so as the voltage drops, current flows through the body diode of Q2, which is still off, and that produces the 10.3V at the load. And that flows back through Q1 to Q4, which keeps Q1 on. It's not leakage. Q4 and Q1 are on. Q2 is off, but its body diode is providing all the power. Well, that's how it looks to me.It's not obvious how to fix this other than replace the whole circuit with two diodes.

author: superKris
author_rank: Regular Contributor
timestamp: October 13, 2020, 07:32:26 pm
content: Quote from: Mechatrommer on October 12, 2020, 09:15:20 pmI guess that could work... But instead of PR3 and PR5 i guess you mean the source and drain of Q1? Due to the RDson there must always be a voltage drop that the comparator can work with. I'll look in to this. Thanks!Quote from: onlooker on October 12, 2020, 10:47:25 pmThank you very much for that schematic! I already tried it in SIM, and it works with just 1 shortcoming: The source with the lowest voltage will always be shut down. Ideally source 2 should always be preferred, also is the voltage is lower. I'll look if i can add something to make it do this.To be honest, i do not fully understand yet why you schematic works so far. How is it that the FETs switch off at such a small voltage difference between source 1 and 2? At 20mv difference both sources supply a similar amount of power. At 30mv difference, one of the FETs is already switched off.Quote from: Peabody on October 12, 2020, 11:45:32 pmYou are absolutely right. I just figured it out myself! (i'm a little slow sometimes)

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 13, 2020, 09:16:57 pm
content: Quote from: superKris on October 13, 2020, 07:32:26 pmno, i mean PR3 is Q2's drain, PR5 is Q1's drain, as per your drawing. these 2 points will have larger voltage differential (RDson1 + RDson2) when source 2 is disconnected or lower than V3 and hence will trigger (released from low output) comparator much earlier.

author: onlooker
author_rank: Frequent Contributor
timestamp: October 13, 2020, 09:55:50 pm
content: OP, There are many controller ICs made to do this using internal or external FETs.The transistor pair form a simple differential amp. It does not need much voltage difference to swing fully the voltage on the two collectors. To change the switch over voltage differential, You can add a few diodes or a Zener on the base of Q2B. For example, if you add a 3V Zener, V1 will not, and V2 will, supply Vout when V2 > V1 - 3VEdit: as Mechatrommer pointed out, voltage drop on the Zener more than body diode will not work properly. Maybe, a not so elegant solution is to serial a few Q3s(?).

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 13, 2020, 10:20:03 pm
content: Quote from: superKris on October 13, 2020, 07:32:26 pmnow with this "we just know it" requirement... maybe you can add dropping diode at Q2B's base to give more threshold for source 2 to supply current if (V3 - Vdiode drop) < V2.. but reversed direction from what onlooker shows zener diode above. you can add hyterisis to avoid race condition by maybe adding resistor between Q2A's base and collector. if you still unsatisfiy with that, if you still want source 2 to supply current even if V2 < (V3 - Vdiode drop) then protection is no point as Q2's body diode will conduct and try to charge source 2 and will eventually burn in your original design, on which case you'll need a new drawing from scratch as your mosfets topology is broken.

author: onlooker
author_rank: Frequent Contributor
timestamp: October 13, 2020, 10:31:02 pm
content: Mechatrommer, you are right and my bad. Voltage drop more than body diode will not work properly.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 13, 2020, 10:37:21 pm
content: if you still want to proceed with the circuit, or maybe you've developed a pcb for that, you may want to enforce new rule that source 2 should be higher than V3 - Vdrop, otherwise another option for low loss is... using old school relays, or... switchable boost converter on source 2

author: onlooker
author_rank: Frequent Contributor
timestamp: October 13, 2020, 11:20:09 pm
content: How about this one.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 13, 2020, 11:45:13 pm
content: haha golden! double the Rdson, if want to get back equivalent single mosfet Rdson, need another 4 pieces in parallel, much stronger supply! but thinking about it, with your circuit, body diode is probably not needed at all, just switch mosfet parts that have no body diode. edit: maybe i'm typing too fast... the Q2 (without conduction body diode during startup) may unable to swithed on since Vout cant develop voltage to satisfy Vgth as per OP's reply #6. maybe high value bleed resistors from both mosfets drain to Vout is needed.

author: superKris
author_rank: Regular Contributor
timestamp: October 14, 2020, 08:50:34 pm
content: Quote from: onlooker on October 13, 2020, 09:55:50 pmThank you, i was already experimenting a little bit with that, but indeed i noticed it only works up to a certain level.At this point i have to think about the type of MOSFET. I'm currently looking at this one:https://lcsc.com/product-detail/MOSFET_Anpec-Elec-APM4953KC-TRG_C20897.htmlI choose this as i'm planning to use JLCPCB and this is one of the few P-FET's in the basic library that has a decent current capability (5A), acceptable RDSon (50mOhm), and a nice Vds (30) and Vgs (25). I'm trying to make this project 26V tolerant, so that is close enoughThis FET's body diode has a Uf between 0,7 and 1,3V.Typically both the sources will be of similar voltage. To be more detailed: a 12V system in a car. Source 1 is a system cable with very thin wires. I'm hoping to provide up to 1A. If the user needs up to 3A, he can run a thicker separate power cable. This is source 2. A thicker cable will have low voltage drop. However, when switched to source 2, the current trough the system cable will decrease resulting in less voltage drop. This way both sources will be reasonably close in voltage. I guess its unlikely that one of the cables will have a voltage drop of less more than 0,7. If so, a 3V (or any diode with a drop over 0,7) should be fine!Do you guys agree?Quote from: Mechatrommer on October 13, 2020, 10:37:21 pmHaha, i'm afraid that is not possible. The whole idea here is trying to come up with a cheap and simple solution instead of the jumper i was planning to use.Quote from: onlooker on October 13, 2020, 11:20:09 pmLike you said, that would double my Rdson. rasing it to a total of 100mOhm. At 3A that causes a voltage drop of 0,3V which is a little higher that i would prefer. That's almost 1W dissipation at 3A. Stil better than a schoytky diode, but higher than i would like. Also the additional components take up space on the PCB and add costs. With the proposed FETs, 2 transistors, a zenerand soem resitors it can be done under 20 cents!Just 1 last thing i would love to fix is how to stop transients from source 2 flowing into source 1. Automotive transients can be devastating. Right now the other part of the system should be able to survive long 200V transients (load dumps), but such a transients would surely kill the FETs and transistors making them to conduct the transient into source 1 (my protected part of the system)P-FETS with a decent RDS on and a Vds of 200 are rare, big, and expensive. Maybe there is no way around a diode here. The system cable will only supply currents up to 1A, so the dissipation over a diode will likely be acceptable. From what i read schottky diodes can be a little slow, but i obviously like their low voltage drop.Man, i never though things would get this complicated this fast!