Need help with OVP/OCP - Page 1
Forum section: electronics / projects

author: kalan01r
author_rank: Contributor
timestamp: December 13, 2016, 07:07:08 pm
content: Hello,I'm working on smart NiMH charging device using fast charge method. I have done it once, but it was not so well designed. Now i would like to improve it a bit. I know what i need to change and i have solved almost all problem. But with one thing i am not able to come up with any good solution, because i have never done something like this before. Let's have a look at schematic.If everything is working as intended, there should be no problem. Battery is connected to "BATTERY_1" (positive) and ground (negative). "PWM_1" comes from uC, next we have switching circuit, and converter (Q4, L1, D13). R5 is used to measure current. If current is too high, U5-A will block PWM signal.Here is my problem. Lets say that we charging battery, with average 2A current (100khz switching freq, about 8-12A peak not sure), and because of any reason battery is disconnected from terminal while Q4 is open. We have energy in L1, so it will have to go somewhere. It is possible that this will destroy U4 or Q4 or i don't know what. I am looking for some good solution, how to safely discharge that power, let say shorting to ground via low value resistor.How should i approach that task ?

author: moffy
author_rank: Super Contributor
timestamp: December 13, 2016, 09:30:34 pm
content: Quote from: kalan01r on December 13, 2016, 07:07:08 pmPut a suitably sized zener diode across the battery terminal. Make the voltage large enough so that it doesn't turn on in normal operation, but ensure that it can absorb the energy from the inductor.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 14, 2016, 07:22:06 am
content: The only way to do this properly is to create a fast active overvoltage detection that shuts down the PWM generation in one cycle, or a few cycles max. Use enough output capacitance so that the voltage doesn't change too much during this time. You should probably already have enough in any case -- otherwise you would have huge output voltage ripple. Zener is totally unnecessary.Without that active limit, zener does not work, because it just dumps all the energy you feed it indefinitely, so you'd need a huge zener with a heatsink - this doesn't make a lot of sense!

author: moffy
author_rank: Super Contributor
timestamp: December 14, 2016, 07:54:31 am
content: Quote from: Siwastaja on December 14, 2016, 07:22:06 amI think the zener is the simplest and safest, key word being "suitably sized". But you also need overvoltage shutdown, but the energy needs to go somewhere. If it overvoltages then it switches off for a period, then back on for single pulses without a battery. Average zener power in such a case is not too much.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 14, 2016, 08:11:35 am
content: I'd recommend adding a latch to the active overvoltage protection that is needed anyway.If not adding a latch, then the OVP will just regulate the output voltage to the OVP setpoint, working like a pulse-skipping CV controller. Zener still does nothing for the OVP, except adds unnecessary power consumption by generating heat for no purpose whatsoever. And due to the curve shape, it's not easy to determine exactly how much heat is generated, especially if the OVP is not exact. And making it exact and well controlled decreases simplicity.Really, I can't find any purpose for the zener. Adding an extra part doesn't add any "simplicity". Zener by itself doesn't work, as you already admitted. Adding it adds considerable extra design work to ensure that it's safe and properly chosen, and works properly with the actual OVP you need to design in any case.Without the zener, the energy goes in the capacitors. Without the latch, the circuit is re-enabled only after the OVP is off, i.e., the voltage has dropped in the caps (you need to have some hysteresis in the OVP!). The zener only makes this cycle happen more quickly, making the circuit oscillate on---off at higher speed, for no reason whatsoever, creating an oscillator / heater hard to analyze.

author: moffy
author_rank: Super Contributor
timestamp: December 14, 2016, 08:29:20 am
content: The power is not hard to work out, its related to L*I*I/2 by the duty cycle(the period on during fault over total on/off time for the fault). If there is no battery then the voltage will pulse at the zener breakdown voltage. Zeners are handy because they catch spikes. So do caps, but you really need a discharge resistor across that cap so it doesn't hold the overvoltage too long.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 14, 2016, 09:27:48 am
content: You don't seem to get the ideaat all. I don't know how to try to explain it any better, but I'll try one last time, very clearly, then I'm out, the OP is free to do their own analysis. This is frustrating, since this is exactly what I've been doing many times, and seen the issues myself, and you don't even seem to have an idea what we are talking about.1) OVP is an active circuit that detects a voltage over certain threshold, then stops the converter action completely, so no more energy flows. It's very similar to voltage control loop, only that it's not trying to regulate, but shut down completely.2) There already are (or should be) enough output capacitance so that by dumping the energy in L, the voltage only changes a little [compared to component ratings]. (Otherwise, there would be huge voltage ripple over the caps in normal operation.)Maybe a numerical example helps you:Say, the nominal maximum output voltage is 10V.The output caps are rated to 16V, the switching components to 20V (quite tight design).The OVP is set to activate at 12.0V.Load is suddenly disconnected - output voltage exceeds 12.0V, OVP comparator detects this and shuts down the PWM generation, energy in L is dumped to the caps, now the voltage is at maybe 12.1V, maybe even 13-14V if the OVP is slow and crappy and inaccurate and there were a few cycles of normal operation into open load before it reacted. Let's say it's at 14V. No big deal!With a latch, highly recommended, everything will shut down until power is cycled, and the voltage at the output slowly fades in leakages.Without a latch, the voltage will slowly fade in leakages, until it goes below the OVP activation level minus hysteresis, let's say it would be at 10V, then there is a short operating cycle which brings the voltage back to the peak, let's say 14V. This doesn't happen too often, because the leakage is small. This is a hiccup mode CV regulator, running every few seconds, consuming almost no power, keeping the output inside a range.Now how do you add a zener to this? Use a 10V zener? Not going to work, it's going to conduct well before 10V, under normal conditions. Maybe a 13V zener would be "off enough" at 10V, and thus usable under normal conditions. You know what? A 13V zener would start properly conducting at maybe 15-16V. It wouldn't do much anything! Finally, if you manage to find a zener that doesanythingin this circuit, then all it does is that it speeds up the discharge. And in this case, it causes the circuit to dump more and more energy to the zener. The formula you posted has nothing to do with this whatsoever. It doesn't even model the curve of the zener. You just assume some duty cycle of "over voltage fault time", but your zener is going to define that duty of fault time, and it's not too trivial to calculate! Yes, if you have enough hysteresis in OVP, then the zener only conducts very shortly, only eating tiny amount of the voltage peak, but why bother?Then you might think: what if the OVP circuitry isn't working properly? Maybe the zener is a good safety device! No. If the OVP misbehaves and doesn't limit the overvoltage actively, then you are injecting huge amounts of energy in the zener. It needs to be massively overrated and heatsinked. Not going to happen.You see, the problem with zeners are that they are very inaccurate. An active OVP doeseverything that is needed, and, as you admitted, it's neededin any case, because your zener solution depends on it. Inbestcase, your zener does absolutely nothing. In the worst case, it blows up, most likely in a short circuit, waiting for a battery to be inserted.And adding a zener to the hickup CV controller (the OVP controlled converter) is nothing more than adding an unnecessary, random load. And, because it's an inexact, not perfectly regulated voltage source that can deliver a lot of current, a zener is the worst type of load.You should expect that the OVPworks. And if it doesn't, the zener is not going to save your ass.And even a crappy OVP is more accurate at clamping the voltages than a zener.Crowbar type of OVP in a battery charger is generally a horrible idea!You are seeing some limited part of the issue, but not the big picture.

author: moffy
author_rank: Super Contributor
timestamp: December 14, 2016, 08:59:46 pm
content: Funny, the only voltage on the diagram is -12v connected to the power FET, I don't know how many NiMH cells he has so I can't guess. You assume he has lots of output capacitance, but there is none on the diagram, so that is pure assumption. If there is little or no capacitance the the dv/dt on the output will be very fast and destructive. I agree zeners are not that accurate and they have a dynamic impedance that will raise the voltage for surge current, but they are quite useable in such circumstances as long as you know what your max allowable voltage is. I would also put a series resistor in series with the buffer U4-A with some diodes to its plus and minus supplies."Then you might think: what if the OVP circuitry isn't working properly? Maybe the zener is a good safety device! No. If the OVP misbehaves and doesn't limit the overvoltage actively, then you are injecting huge amounts of energy in the zener. It needs to be massively overrated and heatsinked. Not going to happen."If it misbehaves with only capacitance on the output then the voltage will continue to rise until it destroys something. Better to have a zener to limit max voltage.

author: kalan01r
author_rank: Contributor
timestamp: December 14, 2016, 09:32:31 pm
content: Thanks for Your reply.Just to clarify, -12V comes from transformer ->full bridge rectifier -> smoothing cap, so it is unstable and depend on load.Only one AA/AAA NiMH is connected to output. I agree that OVP should cut down PWM signal. uC will stop pwm when it detect voltage below certain level, but it will take time. Few pwm cycles or more. Duty cycle is quite low, about 15% (depend on current/capacity of cell).So voltage at battery connection should never be higher than 2V. I think active OVP should work here. What about something like this ?https://datasheets.maximintegrated.com/en/ds/MAX4838-MAX4842.pdfIn addition i would like to add additional npn at pwm (just like Q5) but not sure if i can or should connect gate output of this OVP ic to fet and npn.In that case if battery is remove, and we have energy in inductance, voltage should rapidly rise. So uc will detect it, and short via fet to ground, and cut pwm signal, so theoretically we will have to dissipate only one pwm cycle.This project is not going to be mass produced or something, just for my use, so i don't care about going simple, or cheap (in reasonable range).

author: moffy
author_rank: Super Contributor
timestamp: December 14, 2016, 11:54:58 pm
content: The simplest way to detect OVP is with just a comparator set at a suitable threshold. It could turn on an npn transistor in parallel with Q5 to disable the PWM signal. You definitely need some output capacitance to limit dv/dt and to absorb inductor energy (I'm sounding like Siwastaja). The output of the comparator could then provide a fault signal to the microcontroller to disable the PWM signal. Put a little hysteresis on the comparator as Siwastaja suggested.The MAX4838 is overkill and also has UVLO higher than your maximum output voltage.Place resistors in series with both U4-A and the comparator and use clamping diodes connected to their respective power supplies to protect them. A 12v zener would also not go amiss to catch any nasty transients.

author: kalan01r
author_rank: Contributor
timestamp: December 15, 2016, 07:37:11 am
content: Got it! So just comparator with hysteresis that will turn on npn and fet. Series resistor and clamping on U4-A, and comparator input. I think i should set comparator voltage like 1.7-2V. In that case zener with higher voltage should be off all the time, but if something goes wrong, it will protect with higher spikes.Thank you guys, that was really helpful