Please Criticise my Circuit and Layout - Page 1
Forum section: electronics / projects

author: Pentoad
author_rank: Regular Contributor
timestamp: October 12, 2019, 04:31:10 pm
content: Hello again,I have been doing further work on my battery management system idea. Shown here is a balancing module with adjustable setpoints for low voltage cutoff, overvoltage cutoff and balance voltage.I still feel it's a bit basic and there probably needs to be some extra resistors and capacitors put in somewhere.Ideally, it will be accurate to within a millivolt.Each cell in the battery will have one of these modules which will be connected to an external unit via optocopler. The external unit will control relays for disconnecting the charger on overvoltage and disconnecting the load on undervoltage.I'm just looking for some expert opinions on whether this idea will work at all.

author: teksturi
author_rank: Regular Contributor
timestamp: October 12, 2019, 05:52:26 pm
content: Do not leave op amp inputs floatinghttps://www.analogictips.com/working-op-amps-tying-floating-pins/Do not use 4 wire cross junctionsYou need decoupling capacitor for U1.Voltage dividers should be placed close to input pins.Component designators can be placed better. You have lot of room in your board.Why no ground plane on the other side?Your traces should go 45 angle only.In schematic there is H3 and pcb there is P3?It seems to at least to me very hard to understand because there are no headers. How should I know what you want to do with R2, R3 and R4? How about what is the function for output1 and output2 in optocoupler? Please but this kind of info in your schematic. You can even but info how you get some of those resistor values. But math in and show us and your self how you get those values. It will be much better when you watch it after month. Also you may want to use op amp symbols. Maybe that way this will be more readable.

author: teksturi
author_rank: Regular Contributor
timestamp: October 12, 2019, 07:10:23 pm
content: And because I was bored I make this to show you The path.I have also use more meaningful designators.Edit: Designators

author: Pentoad
author_rank: Regular Contributor
timestamp: October 12, 2019, 09:13:58 pm
content: Thanks everyone. Regarding the resistors, I just looked at datasheets and used the values provided in their example and test circuits. I also did a few current calculations to make sure the comparator wouldn't be overloaded with driving the mosfet and optocoupler.For the decopling capacitor, would that just be placed in parallel with the comparator power supply as close to the chip as possible? Maybe 100nf would do but I'm not too sure how that would be calculated

author: splin
author_rank: Frequent Contributor
timestamp: October 12, 2019, 09:28:43 pm
content: NOTE: This message has been deleted by the forum moderator Simon for being against the forum rules and/or at the discretion of the moderator as being in the best interests of the forum community and the nature of the thread.If you believe this to be in error, please contact the moderator involved.An optional additional explanation is:

author: teksturi
author_rank: Regular Contributor
timestamp: October 12, 2019, 09:40:58 pm
content: Quote from: Pentoad on October 12, 2019, 09:13:58 pmYes, place as close as possible. Datasheet would usually tell the size. Decoupling caps are not usually calculated. You ether use common rule of thumbs or look datasheet or use little bit both. You can Google common guidelines for decoupling caps.

author: Boscoe
author_rank: Frequent Contributor
timestamp: October 13, 2019, 07:51:39 am
content: Just a note on schematic drawing (something close to my heart), the schematic is an abstracted representation of an electrical circuit. You have not achieved full abstraction or a literal representation, it's something in the middle.Make the schematic work for you. Make it as clear as possible to represent sections and parts of your design, how they connect to each other without using continual wires (use net names), draw your op amps as op amps!!!

author: Berni
author_rank: Super Contributor
timestamp: October 13, 2019, 08:21:41 am
content: Alright then:1 ) Don't draw schematic symbols of chips in the same way the pins are physically arranged on the chip. This usually puts the pins in bad places and results in lots of wire spaghetti to get it connected. Order the pins in a way that makes the schematic more sensible and crosses fewer lines. The reason chip symbols have little pin numbers next to each pin is so that you can move the pins around and still know what exact pin that is. (But when it makes sense its okay like your optocopler)2 ) If the chip you are using already has a standard symbol then use the standard symbol and don't draw it as just a rectangle. This goes for things like opamps, comparators, diode or transistor arrays, multicolor LEDs, logic gates...etc. You can use multipart components for this or stick them in a single block like your optocopler (Depends on what makes more sense)3 ) Try to make the signals flow in a certain direction. Since most of the world reads from left to right this usually means you want information to flow along your wires from left to right. Aditionaly there is a convention that current should be flowing from top to bottom. So you want your power sources on top and ground on the bottom of components.4 ) On the PCB you usually want to stick to 45 degree bends and straight traces where you don't have a good reason to do otherwise (This is just an aesthetics thing, makes it look more professional)5 ) You usually want to have your ground fill on the bottom side of the board, so you can connect as much stuff as possible using long traces on the top where the components are, then jump down to the bottom layers only to make short jumpers and keep the ground fill mostly filled. But on busy cramped boards its often a good idea to have ground fill on both sides and then put tons of vias to stitch them together.6 ) Designator placement on the silkscreen is just as important to making the board look nice. You don't want lines obscuring them and you want them to be nicely centered on the component it belongs to if that is possible(Sometimes its not due to no room). For chips you usually place the designator next to the chip body not the pins(In your case placing U1 above the chip would seam more sensible)7 ) Use the silkscreen to mark down as much information as possible. Put down text with the name of the board, the date it was made, who made it etc... as that makes it easier to tell what this board is upon finding it 10 years later. Things like trimm pots mark each one what it does. Put text next to connectors to tell you what they are for, if there is space even write down the connector pinout.8 ) Mounting holes. Its easy to forget about it but its often very useful to put some holes in the corners of a PCB as it makes it much easier to mount the board to something, or if its a board that just sits on a table then you can screw short little screws or standoffs into those holes to give the board feet so it sits nice and stable on a table(Especially significant if there are a lot of components on the bottom).The user teksturi provided a really good example of what a schematic should look like

author: Pentoad
author_rank: Regular Contributor
timestamp: October 14, 2019, 09:46:50 pm
content: Criticisms taken on board, thanks.The concern I have is with hysteresis of the comparators. Will I need to also implement that to prevent the comparator maybe resonating at high frequency between on and off states when the cell voltage is exactly at the set trigger voltage? When it hits the balance voltage, the resistor draws just over 1 amp which will cause a small voltage drop which may in turn cause the comparator to switch off the output which then makes the voltage rise again so a resonance is set up.I was thinking of connecting all of the external connectors in parallel and connecting that to a two channel relay module but that may not work due to lack of hysteresis which will make the relays buzz. Quite a large hysteresis of 10mv on the comparators handling the external warnings is totally fine but for the balancing function it needs to be as small as possible.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 14, 2019, 09:57:55 pm
content: Add some hysteresis. Two additional resistors per comparator.

author: Pentoad
author_rank: Regular Contributor
timestamp: October 16, 2019, 07:52:29 pm
content: I did some tests on a breadboard today using just one of the comparators in the chip. I also put an LED across the load resistor. As it approached the balance voltage, I noticed the LED getting gradually brighter and the mosfet got roasting hot, probably because it was being switched at many kilohertz if not hundreds of kilohertz. With the mosfet fully on and not in this resonating zone, it stayed barely warm. I reckon the voltage drop within the breadboard was making the resonance a lot worse. I will just need to figure out resistor values for the hysteresis and that should fix it.

author: mikerj
author_rank: Super Contributor
timestamp: October 17, 2019, 09:44:47 am
content: You will need considerable hysteresis on the comparator driving the MOFSET. All batteries have some internal impedance, so the voltage will drop as soon as you switch the MOSFET on and rise when you switch it off. You need to measure this for your application and then add suitable margin for cell aging and temperature effects. 10mv feels like it would be too small.Where does your 1mv accuracy spec come from? It seems rather pointless if you are balancing regular LiCoO2 cells.

author: Pentoad
author_rank: Regular Contributor
timestamp: October 17, 2019, 09:28:34 pm
content: The 1mv accuracy is to keep this system as accurate as the management systems in electric cars. I made a system before which used a whole arduino pro mini per cell and that could only manage an 8mv accuracy as the ADC on it is only 10 bit. Another issue I've come up against is the power consumption of the module when not in use which could be a few milliamps. I was thinking of putting a small reed relay on each module which would be externally powered. The reed relay will just turn off the power supply to the comparator and potentiometers and as such will only need to handle a few ma of current.Will adding in hysteresis reduce the accuracy at all?

author: Berni
author_rank: Super Contributor
timestamp: October 18, 2019, 06:08:37 am
content: Not if you add a large value capacitor in the positive feedback line in to integrate the error.

author: mikerj
author_rank: Super Contributor
timestamp: October 18, 2019, 10:34:05 am
content: Quote from: Pentoad on October 17, 2019, 09:28:34 pmAre you certain that EVs require and achieve that level of accuracy?Renesasdoesn't seem to think to. Remember that perfection is the enemy of good enough.Quote from: Pentoad on October 17, 2019, 09:28:34 pmIt will stop it oscillating, so it will improve the accuracy. You aren't going to hit 1mV over temperature/life with your circuit anyway.

author: Pentoad
author_rank: Regular Contributor
timestamp: October 24, 2019, 06:18:24 pm
content: I've disassembled a battery from an electric car and every cell was within a millivolt. I suppose it isn't really necessary.The LM239 chip I'm using has 4 comparators in it, one of which is unused. Is it okay just to connect its inputs and its output to ground? The output is open collector and pulls down to ground when triggered.

author: teksturi
author_rank: Regular Contributor
timestamp: October 25, 2019, 05:28:05 am
content: Quote from: Pentoad on October 24, 2019, 06:18:24 pmIs not ok. Especially if you connect output to ground what happend if it try to drive output to high? Read thishttps://www.ti.com/lit/pdf/SBOA204?jktype=tech_docsor thishttps://www.analogictips.com/working-op-amps-tying-floating-pins/