daisychained boards - how to size capacitors for each? - Page 1
Forum section: electronics / projects

author: k8943
author_rank: Regular Contributor
timestamp: July 09, 2017, 10:44:14 am
content: I've got a number of microcontroller boards daisychained together (not all in series, there are some branches and somewhere in the web there is a power supply).All the boards are connected with +7.5v and GND, then SDA and SCL (I2C) wires. (Each board then has its own LDO to output a steady 5v.)The boards are all doing different things with different power requirements (NFC, ADC, Motor drivers (those boards also have +36V for the steppers!)...).I guess each board should have its own capacitors serving as a local source of energy.Until now I've just been putting 100uF here and there, then maybe 45uF if it seems like not much is happening on the board.In short carrying on with no science or reason. In truth I don't know how to go about estimating (or measuring?) what size capacitor to use on each board. Have spent hours with google on the matter but haven't had any luck.Can anyone explain?I can imagine that you need more capacitance if the max current draw on the board is high, if the board turns on very abruptly, if the board turns on and off a lot, if the voltage is high etc. etc. But have no idea how to put numbers on this.Or do I need to put a scope on the power tables and look to see if there's a ripple at power up?

author: The Soulman
author_rank: Super Contributor
timestamp: July 09, 2017, 02:02:56 pm
content: LDO's typically require some capacitors close-by (inches) on inputs and outputs, look at the datasheet for those.Also look at the minimum input voltage required to maintain the 5 Volt output voltage.Another thing that you need to know is the current consumption of your modules, including any peaks, a oscilloscopecombined with a current shunt (resistor) to measure that would be ideal.Lets assume your 7,5 Volt PSU has infinitely low output impedance (it doesn't) and just onemodule is connected 10 meters away with 2x0,75 mm2 power supply cable and the LDO needs 6 Volt minimum.The cable gives about 0,5 Ohm resistance (from its datasheet) and if the module draws 1 Ampere that resultsin a voltage drop of 0,5 Volt so 7 Volt remains for the LDO, no worries.Now if your module draws 10 Amps for a short amount of time that would cause a drop of 5 Volt and leaves 2,5 Volt, no good.A solution could be to increase cable thickness to 2x7,5 mm2 (not practical) or provide a energy reserve (capacitor) on the module.The size of it depends on the current needed (in this example a additional 9 Amp), the voltage drop allowed (in this example from 7 to 6 Volt = 1 Volt) and the length (time) that the additional 9 Amps are required (lets assume 1 mS).First we need to calculate the apparent resistance of the load, (5 Volt/9 Amp=0,555 Ohm).With these numbers known we can calculate the capacitance needed, easiest way is to use something like:http://mustcalculate.com/electronics/capacitorchargeanddischarge.php?vfrom=7&vto=6&vs=0&r=0.555&time=0%2C001That tells us we need 12.000 micro-farads minimum on this module before the LDO.In the real world there is also some resistance in the output of the PSU, connections, pcb tracks and in even inside the capacitors,with more modules or nodes on the same cable or buss this can get fairly a complex equation but not impossible to solve.For real world application always assume the worst specification and add a healthy margin on top of that.Read up on Ohms law and R-C time constants if you have to.

author: k8943
author_rank: Regular Contributor
timestamp: July 09, 2017, 03:56:48 pm
content: Thanks a lot.This really gives me something to work from.Next week I'm going to start with the shunt resistor / oscilloscope suggestion and see where it leads.

author: CopperCone
author_rank: Super Contributor
timestamp: July 09, 2017, 06:11:29 pm
content: if you really want to think about it, you need to use the impedance of the wire and telegraphers equations.Why would you ever want to bother doing this? Cost.You can estimate a minimum acceptable solution and then double/triple it.Will it work out nicely or be a clean equation? Not really. Is it easy to do? Not really. Is it worth your time? Probably not.Realistically, this sounds like a fairly noisy serious industrial environment. The soulman only covered one aspect of this, which is voltage drop. It's important but..You should probably be more interested in EMI filtering in this case, due to the large number of switching regulators present, that is protecting the circuits from each other (not to mention this sounds like an industrial project, and the atmosphere will not be clean).What will have the best effects, and what you really can't calculate effectively:-Increasing the gauge of the wire-adding LC filters and ferrite beads to the power supplies-increasing the capacitance of the power supplies (which is what you are attempting) Again, its difficult to say, if you run something for 100 meters its going to be vastly different then running something for 3 meters-isolation between all the SPIs using optical/radio/capacitive/magnetic isolators. You might also want to filter the SPI above its bandwidth. Or switch to a more robust protocol is RS485. SPI is not great for distances. Or even something more advanced with error correction.-Attempting to star ground it as much as possible, instead of daisy chaining. This means running more wires-shielding the wires from each other. If you go to a real star ground/star power, you will want to use shielded wires for all the power.-shielding the communications might be more difficult depending on how you end up wiring everything. This will require some thought. This is why a differential protocol is nice.-protecting things against common mode. This goes along with filtering, but it might mean using EMI filters/modules on each of the boards, and putting common mode protection on the digital communications inputs. They have DC versions of the EMI filters found in most devices. ALso, they have DIN rail mountable ones which might be convenient.-maybe lowering the impedance of communications protocols. maybe.-make the circuits tolerate as big of a voltage input as possible. this gives you more headroom for damage and the easy ability to increase supply voltage to meet any sag requirements without exposing the other boards to damage. I..e run them off a 48v max (or as big as you want, no reason why you cant do 100v) supply, then feed it 24V. This way if some circuit ends up receiving only 18V, due to sags, changing requirements, additional sensors, etc, you can raise the voltage to 36V and everything is still happy.-run things off AC and use transformers to turn it into DC. Expensive but this offers a lot of protection rather then running DC voltage wire, you could use 48V transformers and 100VDC input switching buck converters that turn it into 5V, with no transformers, or even better would be to run 48V, do a 48 to 12VDC step down, then convert that down to your rails.-running directly off mains voltage is often hazardous unless you run it in conduit and shit. If you step it down first, you can have a bank of protection at your primary step down transformer thats heavy, and put lighter protection on your subsequent circuits. plus, a big surge would damage all your protection, causing widespread repairs, rather then only requiring repair of one module.. but this really depends on your wiring requirements and practicality. Also, you need to hire electricians, unless your in somalia, in that case do you need to pay tribute to the war lord ? and do you want to hire electricians every time you change something ? this is why lower voltages are nice, so long you look at the legislation to determine what low voltage is and how it effects your ISO and shit.- i assume you shielded everything nicely.Practical solution to capacitance1) Leave some space on the PCBs so you can actually measure noise and add capacitance if required. Ballpark numbers will probably require testing and its going to depend on ESL, ESR, wire gauge, etc.also, don't forget about protection. Filtering will offer some, but you probably want things like TVS, MOV, etc. From the sound of things I'm not sure you know what you are doing when it comes to actually wiring an 'industrial installation'.Someone moves something around and the starting kick from some giant motor can end up destroying things or causing anomalous operation. This means down time, stopped productions, etc... unhappy people in meetings arguing with eachotherrenember the perfect DC solution could still make the EMI performance shitalso, you still need to think about ground loops, which is why i recommend isolation/star as much as possible.

author: k8943
author_rank: Regular Contributor
timestamp: July 11, 2017, 08:58:01 am
content: A lifetime of experience in one post!I feel they've left this one out of the textbooks. Many thanks.

author: CopperCone
author_rank: Super Contributor
timestamp: July 12, 2017, 05:57:40 am
content: Quote from: k8943 on July 11, 2017, 08:58:01 amkeep in mind, this is the paranoid approach to cover all those aspects.In reality, you may not ever see such a system unless someone has a particular mindset and deep pockets.. I say these things are hard to measure, but if a team is working on them they are often put into the category of 'low risk' . But again, they will work to protect you from a 'black swan'. Convincing people that these things are necessity is often difficult. most people willat you if you put this in a specification. However,can be mitigated.....case in point, the EMI filters on alot of gear that I believe Lecroy has, made in Switzerland, theoretically capable of mitigating the effect of transients on equipment, in fact turned into a reliability problem, as they kept exploding. One school of thought is that adding complexity decreases reliability, if the events are infrequent enough.. however I am sure that Littlefuse, Bourns and atomic weapons hardened systems would often disagree with this.It kind of goes into your design style.. even consider overrating capacitor voltages and such... some guy can always get praise (and possibly other things...) from some other guy saying something is low risk (typically engineer/bean counter relationship). When I think about some failure modes though, it seems really difficult to ascertain what the hell is going to happen and I end up thinkin yea, we need everything.movies like fail-safe (recommend the 2002 with george cloony), the china syndrome kinda make you think.. also don't forget the carrington event / solar flares /lighting induction/etc. It is very difficult to quantify what protection system or design choice is going to prevent a catastrophic failure. This turns into your choice to prevent 'fat removal' Remember, even in the military, their usually just gonna end up buying the lowest bidder that can meet the specification. There might be a footnote somewhere that something exceeded the specification...I could say that each of those things mentioned can have long studies associated with their efficacy. It's kind of like personal health choices, but you are making the person. And sometimes another person is just telling you, make a fuckin person, I know the formula works.I legit knew people in engineering positions that completely refused to take ownership of designs they made, just because of the legal ramifications (and it saved one guys ass that I know, big lawsuit over what appeared to be attempt at self injury for cash, however the designer is now deceased bless him). This was for in house manufacturing equipment. I'm not sure I agree with his decision, it was complicated, one of those stories that makes the hairs on the back of your neck stand up.. where you would really not know who to trust. Different, but the fact was the guy making the design was thinking about budget.. perhaps from management pressures, I don't know