Battery voltage to 5V regulation - overcurrent shutdown protection: working - Page 1
Forum section: electronics / projects

author: HendriXML
author_rank: Super Contributor
timestamp: March 19, 2019, 02:02:13 pm
content: For my playable modules:playable-electronic-modulesI've designed a voltage regulator schematic, which should drop 5 x AA 1.25V rechargeable batteries to 5V.I've set following goals:No regulation IC -> fun factorLess than 10 mA lossCan regulate even with a low voltage dropSignals voltage level too low (LED -> off)Should be an improvement of this one:only-1x-gain-op-amp-regulated-power-supply-very-low-noise. Faster handling of sudden 1 amp draw. More stable, maybe even without an endcap.To reach the last goal, I've ordered a high(er) current op amp (LM7332), which can drive capacitive loads and has (no?) less input capacitance. Also will be using a Mosfet with less gate capacitance.The reference voltage is also lower and more stable. The output offsetting of the error amplification is done in a different way (thx to xavier60).Feel free to comment on the schematic. I'm waiting for the components to arrive and will probably start with redoing some characterization of the new Mosfet when they arrive (Automatic characterization via power supply).

author: David Hess
author_rank: Super Contributor
timestamp: March 19, 2019, 04:01:07 pm
content: U1B is not doing anything useful.Current limiting would be a good feature to add.I like the concept of floating a negative regulator so that an n-channel instead of p-channel MOSFET can be used.For some inspiration, check out Figure 6 on page 14 of theLT1366 datasheet.

author: HendriXML
author_rank: Super Contributor
timestamp: March 19, 2019, 05:35:35 pm
content: Quote from: David Hess on March 19, 2019, 04:01:07 pmThanks for the schematic, nice to see the similarities!I used the second op amp for buffering because I did not want the negative fb to affect the reference voltage. Or having the need for more current through the “zener”. The LT1366 schematic has even stronger neg. fb / less gain than mine. That is what I hyphothized about in my previous experiment, but couldn’t make to perform well. I’ll certainly experiment on different values in my circuit later on. My schematics uses lower decoupling and fb resistor values and higher fb capacitance. (And will be sourcing/sinking more from the ref voltage). But the opamp also can drive with more current.I originally wanted to include a “electronic fuse” functionality, and thus shutting the supply down. But after experimenting with it I’ve let the idea go. Having capacitive loads (or an end cap) would trigger it.For now I’ll try the “more controlled version” of the circuit and if this one turns to to be functional I can try to see if there’re possibilities to skip the buffered vref. (But I probably also need to create some RC V vs time graphs to get a more trained “sense” of the buffering capabilities of a capacitor)

author: HendriXML
author_rank: Super Contributor
timestamp: March 20, 2019, 10:55:09 am
content: I’ve been thinking a little more about the usefulness of U1B. If I enlarge R5 and R6 to 2K, R1 should be able to sustain a stable ref in the most extreme situation without any buffering. In that case there will be less current through the zener IC, but that IC has a better stability than a normal zenerdiode. Having a capacitor will improve stability even more.I’ve also been thinking about some current control, but that will somehow intervene with the voltage regulation. Making that slightly less optimal, mostly in respect to (expected) regulating speed. Because I want to see how this circuit compares to the previous one, I’d like it to be in the most optimal (and simple) form.

author: HendriXML
author_rank: Super Contributor
timestamp: March 20, 2019, 11:43:01 pm
content: I updated the schematic without the Vref buffering. I will try to show various examples how the ref voltage will act in time depending on the values of R5 and R6 and C1.Because there's a complex interaction between:R1, R5, R6 and C4, C1I'll revert to simulating with a self made script. It will be about developing techniques to tackle these calculations without using complex math.

author: HendriXML
author_rank: Super Contributor
timestamp: March 21, 2019, 12:05:51 am
content: The way I'll approach this is by using current calculations while assuming those won't change during a very short period.In the schematic below the capacitor discharges from 5V into the resistor. Using the RC functions it quite easy to plot a graph which shows how the capacitor is discharged.The dot's in the graph are from simulating. This is simply a loop which calculates the current through the resistor using the capacitor voltage. With this current the voltage drop dV = I*dt/C can be calculated. I also calculate in what time the voltage drop (dt=(C*dV)/I) is small (dV=0.01 V) enough, otherwise the current can't be used as being constant. After reporting the time and capacitor voltage, the capacitor voltage is decreased using the current and duration.In the more complex circuit, the duration will be determined by the voltage change of both capacitors (thus using the smallest duration).The duration is also reduced if it is more than 0.01 s, this gives more accurate results when currents get low.The datapoints in the graph are decreased to 1 on every 10 calculations.

author: HendriXML
author_rank: Super Contributor
timestamp: March 21, 2019, 10:08:15 am
content: Here's the sub circuit that will be simulated, using the attached simplification.The simplification represents the worst case scenario when the op amp is outputting at the positive rail. (For simplicity it is represented by a switch to ground.)In that case the zener IC is out of the picture (normal zeners will still be drawing some current on a subtle voltagedrop, with the used IC I've got to check this. The datasheet shows it should be negligible.)The Vref is what will be in the graph.Do I believe it will drop substantially for a brief period? No, but it bothers me a little that I don't know how much.Edit: added an extra replacement circuit that is easier to understand (we're using capacitors as a voltage source, which change in time).

author: HendriXML
author_rank: Super Contributor
timestamp: March 21, 2019, 01:30:21 pm
content: So I ran the simulation script. And the results are surprising.The drop is so low, and for such a short period of time I don't even want to make a graph for it. But I did anyway.The columns are as follows: Time, voltC4, voltC1Code:SimulationData: matrix ([0 , 2.5 , 0 ], [8.0158822588692032E-7 , 2.4999999351862704 , 0.0099999999999999949 ], [1.6064021231348794E-6 , 2.4999998741358419 , 0.019999999999999936 ], [2.4144677562866118E-6 , 2.499999816879121 , 0.029999999999999872 ], [3.2258115070725613E-6 , 2.4999997634468883 , 0.040000000000000122 ], [4.0404600795783354E-6 , 2.4999997138702915 , 0.050000000000000403 ], [4.8584405055178202E-6 , 2.4999996681808736 , 0.060000000000000691 ], [5.6797801496145696E-6 , 2.4999996264105565 , 0.070000000000000973 ], [6.5045067150941146E-6 , 2.4999995885916582 , 0.080000000000001267 ], [7.3326482492899802E-6 , 2.4999995547568979 , 0.090000000000001549 ], [8.1642331493662643E-6 , 2.4999995249394112 , 0.10000000000000184 ], [8.9992901681595981E-6 , 2.4999994991727382 , 0.11000000000000213 ], [9.8378484201436646E-6 , 2.4999994774908419 , 0.1200000000000024 ], [1.0679937387519184E-5 , 2.4999994599281187 , 0.130000000000002 ], [1.1525586926432626E-5 , 2.499999446519401 , 0.1400000000000009 ], [1.237482727332704E-5 , 2.4999994372999654 , 0.14999999999999981 ], [1.3227689051428203E-5 , 2.4999994323055331 , 0.15999999999999869 ], [1.4084203277369595E-5 , 2.4999994315722925 , 0.1699999999999976 ], [1.4944401367959926E-5 , 2.4999994351368957 , 0.17999999999999651 ], [1.5808315147096707E-5 , 2.4999994430364646 , 0.18999999999999539 ], [1.6675976852829939E-5 , 2.4999994553086141 , 0.1999999999999943 ], [1.7547419144579434E-5 , 2.4999994719914458 , 0.20999999999999318 ], [1.8422675110510234E-5 , 2.4999994931235587 , 0.2199999999999921 ], [1.9301778275069997E-5 , 2.4999995187440614 , 0.22999999999999098 ], [2.0184762606692806E-5 , 2.4999995488925856 , 0.23999999999998989 ], [2.1071662525673718E-5 , 2.4999995836092851 , 0.2499999999999888 ], [2.1962512912218778E-5 , 2.4999996229348515 , 0.25999999999998768 ], [2.2857349114674918E-5 , 2.4999996669105267 , 0.26999999999998659 ], [2.3756206957944915E-5 , 2.4999997155781037 , 0.27999999999998547 ], [2.4659122752092218E-5 , 2.4999997689799437 , 0.28999999999998438 ], [2.5566133301140874E-5 , 2.4999998271589795 , 0.2999999999999833 ], [2.6477275912075862E-5 , 2.4999998901587341 , 0.30999999999998221 ], [2.7392588404049366E-5 , 2.4999999580233325 , 0.31999999999998106 ]);Simulating this also points out quite nice that C1 does not have to charge much to make the resistor division (R5sR6 and R1) at or above the ref voltage. (It is also possible never have a drop of voltage.)The simulation shows that is of no concern in either case!!

author: HendriXML
author_rank: Super Contributor
timestamp: March 21, 2019, 01:34:18 pm
content: If both capacitors where 1000uF this would be the result (a drop of approx. 5 mV):Code:SimulationData: matrix ([0 , 2.5 , 0 ], [0.008016922296702601 , 2.4993539405024848 , 0.0099999999999999949 ], [0.016068135978486966 , 2.498749569771472 , 0.019999999999999936 ], [0.024153799240427936 , 2.4981869742722166 , 0.029999999999999872 ], [0.03227407028332793 , 2.4976662388994186 , 0.040000000000000122 ], [0.040429107298078573 , 2.4971874469460998 , 0.050000000000000403 ], [0.04861906844984903 , 2.4967506800724042 , 0.060000000000000691 ], [0.056844111862104826 , 2.4963560182743226 , 0.070000000000000973 ], [0.065104395600461786 , 2.496003539852361 , 0.080000000000001267 ], [0.073400077656379315 , 2.4956933213801635 , 0.090000000000001549 ], [0.081731315930698381 , 2.4954254376730918 , 0.10000000000000184 ], [0.090098268217027955 , 2.4951999617567968 , 0.11000000000000213 ], [0.09850109218498697 , 2.4950169648357658 , 0.1200000000000024 ], [0.10693994536330518 , 2.49487651626188 , 0.130000000000002 ], [0.11541498512279019 , 2.4947786835030058 , 0.1400000000000009 ], [0.12392636865916582 , 2.4947235321115914 , 0.14999999999999981 ], [0.1324742529757876 , 2.4947111256933354 , 0.15999999999999869 ], [0.14105879486624259 , 2.4947415258759062 , 0.1699999999999976 ], [0.14968015089683942 , 2.4948147922777334 , 0.17999999999999651 ], [0.15833847738899645 , 2.4949309824769085 , 0.18999999999999539 ], [0.16703393040153203 , 2.4950901519801766 , 0.1999999999999943 ], [0.17576666571286934 , 2.4952923541920637 , 0.20999999999999318 ], [0.18453683880315843 , 2.4955376403841485 , 0.2199999999999921 ], [0.19334460483632461 , 2.4958260596644672 , 0.22999999999999098 ], [0.20219011864205398 , 2.4961576589471264 , 0.23999999999998989 ], [0.21107353469771997 , 2.4965324829220758 , 0.2499999999999888 ], [0.21999500711026157 , 2.4969505740251114 , 0.25999999999998768 ], [0.22895468959802278 , 2.4974119724080963 , 0.26999999999998659 ], [0.23795273547255987 , 2.497916715909417 , 0.27999999999998547 ], [0.24698929762042749 , 2.4984648400247197 , 0.28999999999998438 ], [0.25606452848495216 , 2.4990563778779043 , 0.2999999999999833 ], [0.2651785800480015 , 2.4996913601924381 , 0.30999999999998221 ]);

author: HendriXML
author_rank: Super Contributor
timestamp: March 21, 2019, 01:57:50 pm
content: Just for fun a graph showing the simulation of the following parameters:Supply voltage: 6,00 VInitial voltage C1: 0,00 VInitial voltage C4: 2,50 VR1: 100,00 kΩR5 R6: 2,00 kΩC1: 1,00 μFC4: 1000,00 μF

author: HendriXML
author_rank: Super Contributor
timestamp: March 26, 2019, 05:19:26 pm
content: I’ve build the circuit and did benchmark the voltage regulation. The measurements were taken sinking into a 5R1 resistor shorted to ground by a IRLZ44N mosfet, driven by a signal gen. Square wave, 0-3 V, 26 hz, 20% duty cycle.Testcase 004C3: 2200 uFC1: 0 nFR2: 0 ΩThe reference psu measurements are of a Siglent SPD3303X.I used a BNC cable which I cut in half to do the probing directly at the terminals. This method gave a very different picture than measuring at the load which I did previously. Drawing about 1 A suddenly is probably quite sensitive for inductance.

author: HendriXML
author_rank: Super Contributor
timestamp: March 26, 2019, 05:41:37 pm
content: So I ended up with a circuit with no short (before mosfet) feedback loop.The circuit is stable using a non stabilized simple 9V adapter and on 5x AA batteries. It works still very well at only 5.2 V input and also driving a DC motor shows no "noise".With a short feedback loop a ripple on the adapter is noticeable and also some noise when driving a DC motor. So I think I leave it without. It’s handy that the module can also be used with an adapter. The circuit should run at 5.5 - 10V input and deliver 0-2 A with ease. I used a 3.8 K/W heatsink.The LED indeed goes off when it can not regulate the voltage anymore. This will signal that the battery voltages are to low.

author: HendriXML
author_rank: Super Contributor
timestamp: April 01, 2019, 10:56:21 pm
content: I think I have designed a working overcurrent protection at 2 Amp (Circuit 2.0.48).The idea is that it does a normal R-sense (R12) amplification until the zener IC (D4) starts conducting, at that moment the non-inverting input of op-amp will go down rapidly. The measured voltage of the other op-amp will go down as well, and thus shutting down the output mosfet and turning of the LED.Via R4 the op-amp might deliver a tiny bit of current, but that is ok. The circuit is about protecting the input supply (5 AA 1.25V batteries).I think using this circuit, I don't have to worry that the circuit starts in overcurrent mode due to charging of the capacitors of other modules or a ramp up of the input voltage. When C4 is discharged, the output ramps up slowly anyway.It also does not need a lot of extra parts, but it still will be hard to find space on the perfboard to place them.Feel free to comment!-edit updated the schematic moved R12

author: Psi
author_rank: Super Contributor
timestamp: April 01, 2019, 11:12:55 pm
content: A fun, but mostly pointless, voltage regulator to build is a system that switches in/out different number of diodes in series based on control from ADC+discrete digital logic (or a MCU).Use a low voltage drop diodes like 1N5817 or better.Use a binary approach where each bit in a byte adds different diode numbers (or shorts them to remove from series string).egbit0 might add 1 diode,bit1 might add 2 diodesso if bit 1 + bit 2 are both set then 3 diodes are in series.Also include a way to short input to output in case no diode drop is needed.Then you can control the output voltage by selecting the binary number from ADC/MCU.It's a pretty pointless and slow voltage regulator but is kinda cool and it does have the advantage of no drop-out voltage.

author: HendriXML
author_rank: Super Contributor
timestamp: April 01, 2019, 11:35:24 pm
content: Quote from: Psi on April 01, 2019, 11:12:55 pmCould be useful as a drop voltage regulator in a variable power supply. With 6 relays a drop of more than 38 V could be achieved (64x0.6V diodes).But I hope my circuit belongs to a different category...

author: Psi
author_rank: Super Contributor
timestamp: April 01, 2019, 11:49:10 pm
content: Quote from: HendriXML on April 01, 2019, 11:35:24 pmYep, it does, this thread just made me remember it.

author: HendriXML
author_rank: Super Contributor
timestamp: April 02, 2019, 12:00:51 am
content: Quote from: HendriXML on April 01, 2019, 11:35:24 pm

author: HendriXML
author_rank: Super Contributor
timestamp: April 06, 2019, 12:16:24 pm
content: I (partially) rebuild the circuit and tested the overcurrent protection and it works fine!I had to replace the voltage reference IC with a normal zener diode. The IC isn't suitable for very low (near zero) currents because it needs some current for its internal circuitry.Because the overcurrent regulation op amp sinks very low currents from the zener diode, the zener voltage is not the voltage at which the protection activates.It is a combination of the amplification (RV1) and the how the voltage over R9 drops. (Which can be seen as "an amplification" regulated by the zenerdiode). If these two combined result in an amplification of more than 1, the positive feedback collapses.Because it is dependent of the zener curve instead of just the one value spec and thus cannot be calculated easily, the protection needs to be set by a potentiometer RV1. This can be done by drawing the shutdown current and then tuning RV1 until the shutdown kicks in.C5 is added so that the circuit doesn't shutdown when a loadcapacitor of 1000 uF needs to be charged (my modules use thoose). The optimal value of it needs to be determined yet. If a shutdown occurs, the circuit needs to be disconnected from the input for about 20 seconds. This is the duration that is needed to discharge C4 properly. If not discharged, the startup current is to high and the circuit re-enters the shutdown mode right away.I'm pleased with the results. One of the design targets was to make the shutdown fast and as sensitive as possible.

author: HendriXML
author_rank: Super Contributor
timestamp: April 06, 2019, 08:37:05 pm
content: For my application the circuit is fine, but I’m a bit concerned about two things:* temperature influences on the zenercurve* when after a shutdown the voltage of the input drops to about 3V, the shutdown circuit becomes ineffective and “normal” high current operation continues. When having half full batteries as an input this is not an issue because the current is then very limited anyways. But it should be mentioned. Having a diode for the zener effect might lower the effective voltage of the shutdown state to the point that the mosfet won’t conduct anymore.The last point is also the reason the shutdown must be faster than a drop of the input voltage. C5 can be increased beyond 100 nF, but more might lower the input voltage to much in case of a shortcircuit at the output.However in case of C5=100 nF, a short with a 1000 uF capacitor still activates a shutdown. But that’s the thing when implementing a electronic fuse: capacitors draw a lot of current! So I think I will lower the buffer capacitors of the modules which will use the supply instead.However the product has reached the moment that altering stuff means desoldering stacked components, so experimenting lost its appeal.