Unexplainable design fault - Page 1
Forum section: electronics / projects

author: Pentoad
author_rank: Regular Contributor
timestamp: January 16, 2020, 12:56:48 pm
content: I have been designing a battery management system for several months now and have come up against a strange problem.I have set the three multiturn pots, R2 R3 and R4 so that overvoltage triggers with a battery voltage of 4.2, undervoltage of 3.4 and a balance voltage of 4vWhen I apply power and the battery voltage is below 4v, both the overvoltage and undervoltage outputs are triggered and in some cases the balancing will trigger also. If the supply voltage is above 4v, they don't trigger when the power is applied and the module works as it should across the entire operating voltage range of a lithium ion cell. I am beginning to suspect that this may be due to my poor choice of comparator, the LM239DT. I am using a 1.225v voltage reference and the common mode voltage range of the comparator is VCC+ -1.5 VCC + -2 as per the datasheet with a supply voltage of 30v. The confusing thing is that not all of the boards have this problem despite being exactly the same so I am not too sure what to do. It would seem like the comparator on the faulty boards is requiring a higher voltage to start up properly.

author: Prehistoricman
author_rank: Regular Contributor
timestamp: January 16, 2020, 01:18:52 pm
content: Are you powering the comparators with the battery or H1P2?Is H1P2 30V?Why not measure the comparator inputs when you see this fault occurring? Then you can see if your components are misbehaving or if there is something else going on.

author: mikerj
author_rank: Super Contributor
timestamp: January 16, 2020, 01:44:01 pm
content: Why is the overvoltage detection measuring at 'Q2 Drain' (presumably battery +ve) but the undervoltage detection is measuring at 'K1 4'?It's not obvious to me how a balancing circuit with one switching element can work? You say the battery voltage is only 4.2v which is a single Li-Ion cell, so why is balancing even needed?You'd also be wise to put a small amount of hysteresis into those comparators to prevent them chattering when the voltage gets close to the threshold.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 16, 2020, 02:28:46 pm
content: Same here: 1/ I don't understand where K1_4 comes from, and 2/ I don't understand how your "balance circuit" is supposed to work.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 16, 2020, 02:46:24 pm
content: There was a mistake in the diagram, K1 4 is connected to Q2 so I have sorted this. One of these modules is used on each cell in a pack and this diagram represents only one module. H1 is where 5v is supplied to turn on the module via an optoisolator connected to Q2 so that if the pack is not being used it doesn't get destroyed over time. H1 also outputs the voltage warnings and is isolated via the optoisolators.H2 is where a removable jumper is connected to allow me to calibrate the module without the load resistor causing a voltage drop and upsetting the calibration.

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 03:02:30 pm
content: What is H2? Where is battery conector?What does U1x do? (it has unconnected inputs, that's bad. Connect them as in theAN "Application Design Guidelines for LM339/LM393/TL331 Family Comparators"for unconnected inputs. See "Unused Comparator Input Connections" 5.1.2.).

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 03:18:01 pm
content: Quote from: Pentoad on January 16, 2020, 02:46:24 pmI don't see that. Q2 has three legs.K1_4 = Q2 Drain?

author: splin
author_rank: Frequent Contributor
timestamp: January 16, 2020, 03:19:43 pm
content: U1x is presumably there to show the common power pins 3 and 12 connected - but U1A also has pins 3 and 12 connected. Use one or the other. U1x also shows pin 14 as the output instead of pin 13.Is H1_5V supposed to be the same as H1P2?You still have a couple of K1_4 labels.There is no decoupling on H1P2 - does it stay clean when the over/under voltage outputs trigger?

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 03:23:54 pm
content: And I'm afraid that circuit will eat battery a lot.

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 03:32:47 pm
content: May be you should look at "Window Comparator" topic. For example AN "Window Comparator Reference Design" or AN "Window comparator circuit" at ti.com

author: Prehistoricman
author_rank: Regular Contributor
timestamp: January 16, 2020, 03:44:03 pm
content: Quote from: Vovk_Z on January 16, 2020, 03:02:30 pmNow I understand!U1X is showing the power supply connection for all U1 comparators.Max common mode range doesn't seem to be violated, as long as VREF and the divider inputs are below B+ - 1.5Schematic is a bit messy, as others have hinted to. The layout on the right side is particularly out-of-order.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 16, 2020, 03:47:07 pm
content: The LM239Dt has 4 comparators inside it which share the same power pins. U1x is just a placeholder name and is just there to show how the comparator is powered. The whole thing is powered by the battery cell apart from the optoisolator outputs which are powered up from an external 5v source. I have done a bit more fault finding and it seems to be to do with the reference voltage. It is meant to be 1.225 and on the faulty boards it is 1.07 when the battery is at 3.16. As I increase the voltage, the reference voltage slowly increases as I increase the battery voltage. When the battery reaches 3.8, the reference jumps to 1.225 and stays stable even if I reduce the battery voltage back down to 3.16 or below. It is like the voltage reference isn't starting up properly but it is just a diode so I don't see how this can happen. The worst thing is that replacing the voltage reference doesn't solve the problem. As for power consumption, each module consumes 12ma. I have updated the diagram with K14 removed properly. It used to refer to a reed relay in an old version of the system which has now been replaced by Q2.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 16, 2020, 03:56:19 pm
content: Quote from: Pentoad on January 16, 2020, 03:47:07 pmThis is obviously where you should now focus your investigations.Have you checked all resistors' values on the "faulty" boards?

author: Prehistoricman
author_rank: Regular Contributor
timestamp: January 16, 2020, 03:57:54 pm
content: The LM4041 is not just a diode:http://www.ti.com/lit/ds/symlink/lm4041-n.pdfCheck R1 on the faulty boards. Maybe break the VREF line and see how much current is flowing out of it. Maybe something is pulling it to ground.

author: splin
author_rank: Frequent Contributor
timestamp: January 16, 2020, 04:20:03 pm
content: Quote from: Prehistoricman on January 16, 2020, 03:57:54 pmBeat me to it. The LM4041 needs 60uA minimum so if R1 happened to be 47K (or more) instead of 470R that could explain the battery voltage needing to be at least 3.8V before Vref is valid.Also check R13 isn't short or low resistance which could load Vref with C2. The LM4041 is supposed to be stable with a capacitive load but it may have a limit,especially if U1A's output is oscillating. A bit unlikely though.

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 04:26:12 pm
content: Quote from: Pentoad on January 16, 2020, 03:47:07 pm- a capasitor across D1 can help. Have you tried that?

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 16, 2020, 04:37:27 pm
content: U1A does the same as U1D. Or no?

author: Pentoad
author_rank: Regular Contributor
timestamp: January 16, 2020, 06:03:32 pm
content: Thanks for the suggestions. I checked all of the resistor values on a faulty and good board and they are all exactly the same apart from allowable variation due to their tolerances. Another suggestion is that maybe I have damaged the comparator or reference with heat as I am using a temperature controlled hot air station to assemble them but that is unlikely as I have tried soldering the reference and comparator using a normal soldering iron and still got a faulty board from that. U1A and U1D are not doing the same thing. U1D is connected to an optoisolator to output a signal when the module is cell balancing. It is up to the customer what they use the signal for but it could maybe be interfaced with a charger somehow so that it reduces current output so the balancers can keep up.

author: splin
author_rank: Frequent Contributor
timestamp: January 16, 2020, 06:20:35 pm
content: You need to measure the current through the LM4041 when it's only delivering 1.07V to make sure it's at least 65uA. Also check it with a scope to ensure it's not oscillating. If not, then replace the reference.Could you have been supplied with fake parts perhaps? Could they have suffered from ESD damage?

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 16, 2020, 06:27:42 pm
content: You can also progressively isolate VREF to find out the culprit: remove R12, R13, R31, R32 one after the other. Monitor Q2_Drain and VREF signals at each step.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 16, 2020, 07:59:40 pm
content: Will try progressively isolating. I have also noticed that sometimes just touching the output of the voltage reference using my multimeter probe fixes the problem until the board is powered again. The multimeter wasn't even switched on when I did this.

author: jmelson
author_rank: Super Contributor
timestamp: January 16, 2020, 11:24:47 pm
content: Quote from: Pentoad on January 16, 2020, 07:59:40 pmDoes the LM4041 need a capacitor across it? Check the data sheets for recommended operating circuits. It might be oscillating.Jon

author: Prehistoricman
author_rank: Regular Contributor
timestamp: January 16, 2020, 11:39:35 pm
content: Quote from: jmelson on January 16, 2020, 11:24:47 pmI also thought this. Datasheet says none is required, but one may be used.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 16, 2020, 11:47:02 pm
content: Quote from: Pentoad on January 16, 2020, 07:59:40 pmHave you also just checked the soldering?

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 17, 2020, 01:45:13 am
content: That capacitor connected from U1A's output back to its non-inverting input has me concerned...That particular part can go into latch-up (or simply misbehave) if any of the I/Os go more negative than the GND pin. Also, the current into any of the I/Os must be limited to 10mA or less.Is that capacitor needed? You might try removing it to see if it helps.

author: amyk
author_rank: Super Contributor
timestamp: January 17, 2020, 02:13:54 am
content: Have you considered using an integrated protection IC like a DW01?

author: Lesolee
author_rank: Regular Contributor
timestamp: January 18, 2020, 09:13:41 am
content: Quote from: Pentoad on January 16, 2020, 07:59:40 pmThat is a classic symptom of oscillation. You have multiple boards, some of which work and some don't. You must probe it with a scope, not just a DVM. Q2_Drain is a key place to look with a scope. Look at the start up timing using a digital storage oscilloscope.Remember that the scope probe itself can suppress oscillations. If it always starts up correctly when the scope is connected, that is another clue.I designed one of these myself, where each cell was around 1kg (that is BIG). The circuit needs to be protected against single faults, requiring more circuitry to prevent failed over-charge signals etc.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 18, 2020, 12:00:15 pm
content: C2 is essential to prevent the comparator oscillating at high frequencies when both its inputs are at the same voltage. Without the capacitor, the output oscillates at possibly a few hundred kilohertz which causes Q1 to heat up severely. I also tried adding a load resistor to the voltage reference which didn't help. When I have an oscilloscope attached to the reference, the problem doesn't arise at all, possibly due to its 47pf input capacitance. I will try adding different capacitors to the reference to see if that helps.

author: Lesolee
author_rank: Regular Contributor
timestamp: January 18, 2020, 01:00:40 pm
content: You might also want to consider using a 100R resistor in series with the gate of Q2, right up close to its gate leg. The device itself can like to oscillate.

author: TerminalJack505
author_rank: Super Contributor
timestamp: January 18, 2020, 09:20:25 pm
content: To prevent oscillation due to noise it is best to configure your comparator with some hysteresis as others have suggested. You can do this by replacing the capacitor with a very large resistor.I've attached simulations of that portion of your circuit as-is as well as with a 1M Ohm resistor in place of the capacitor. Both are being fed a noisy input that is near the reference voltage.Notice the following:The cap will allow the non-inverting input to be pushed below GND when the output switches from high to low. This risks putting the LM239 into latch-up.With a cap, the non-inverting input eventually settles back down at the same voltage it was at before so it won't really prevent oscillation due to input noise--maybe just reduce the frequency.With a 1M Ohm resistor, the non-inverting input's voltage will swing +/- approximately 30mV. Thus, preventing false triggers. The amount of hysteresis can be changed by changing the feedback resistor's size.