Capacitors : theory, physics and misconceptions - Part 1: Bypassing/Decoupling

Hi!

many moons ago I posted this topic: Current Flow in an (AC) RC Circuit (Low Pass Filter). And I wanted to get back to it, however reading that topic now, it went off on a tangent. So, forking a discussion to hopefully keep things in line.

This is a classic, 7805 circuit, and will serve as a useful reference - but first, would the proper term for C1 and C2 be “decoupling”, “bypass”, “filter” or “smoothing” capacitors - I have seen all used interchangeably, and to some degree all seem correct.

in any case, no matter what they are called they serve two main purposes

  1. filter any noise away from the Vcc line
  2. provide a reservoir of power for a short burst incase the 7805 pulls a higher amount of current
    → essentially ensure the Vcc line is a smooth, and stable as possible

we all know this; but given Muntizing in a thing, and given this video from Dave Jones recently (https://www.youtube.com/watch?v=PgHQ7ES1uDk)


maybe I’m not the only one who needs a refresher on how bypassing works (and how to do it properly!)

as I see it, there are some issues - and after simulating, thinking, reading and researching, I believe I have found the source of my error, and that is that I have been assuming ideal components. If we assume ideal capacitors and voltage sources, then I think there is a paradox here - that is my hypothesis, but I would love feedback.

Referring to the 7805 circuit above (though the 7805 could be any device of course, an MCU being another good example). If we assume at t<0, the capacitor is discharged, when we add power, what will be the voltage at node A? Vcc is attempting to make it 5v; however at the same time, there is 0v across the capacitor. And this seems to be a paradox! However the capacitor is not ideal, there is resistance and inductance as well. If i add a series resistor in (a simplified model) then the simulation appears as I would expect.

image

  • the voltage across the capacitor rises as expected to Vcc
  • the voltage across R1 (in series with the capacitor) decreases to 0 as expected
  • the current through the load R/C branch decreases as expected (as the voltage across the capacitor ramps up to Vcc)
  • the current through the load is Vcc/RLoad

if i remove the parasitic resistance (set it to 0) - then we get maybe what I expect - and that is a spike of 500A through the capacitor, and Vi across the load… in this case perhaps the simulation resolution is not good enough to see the detail. But in the real world, I can imagine this would be a problem
image

at this stage, i will pause and ask am I correct?

  • is the ESR of the capacitor preventing the problem i describe?
  • have I misunderstood somewhere, and in fact there isn’t an issue in the first place? (i.e.: an ideal capacitor would function just fine)?

thanks! If i am correct, then I have follow up questions/theories!

1 Like

Don’t forget the inductance of the wire. There could be some tens of nH’s for thinner tracks over a short distance.
There’s a pretty good article at Sierra Circuits that talk about decoupling capacitor placement: Decoupling Capacitor Placement Guidelines for PCB Design | Sierra Circuits

1 Like

thanks @ToyBuilder - good point; in this case I deliberately left them out just to simplify the discussion, as i am looking to clarify if my main conclusion (that ideal components would be problematic, and in such designs where a capacitor is tied between Vcc and ground, we are relying on the non-ideal properties to prevent issues, such as high inrush currents)

It’s generally not considered to be good practice to rely too heavily on parasitics, as they will tend to vary more than first class parameters. If it isn’t on the datasheet, the manufacturer has made no promises about it.

The USB spec specifies an upper limit on how much capacitance a device is allowed to put on it’s power input.

An easy but potentially expensive method is a starter relay - start the system with a resistor in line, then short out that resistor with a relay (or similar) once the bulk caps are charged. Used this for scary big tesla coils.

Hot swap controllers are similar, but typically create a constant current source from the pass fet instead of using a resistor. This keeps you at peak current longer, so you can have a lower peak or a faster charge up than with a resistor.

1 Like

thanks! since i wrote this post I have seen that in the real world inrush current due to capacitors is in fact an issue that sometimes require mitigation - the same is true for inductors such as transformers which exhibit inrush current due to the very low resistance of the windings and as such soft start mechanisms are required; Another example is Rg on FETs as the gate/drain looks and acts like a capacitor so having Rg in place as a series gate resistor limits the inrush current (then you can also have a pull down to drain the gate capacitor if need be)

since this post I have found designs that take this into consideration, but also as you say the USB spec does put a limit on capacitance - one reference I found says

The USB spec has limits on the ‘inrush current’, which is designed to prevent you from having 2000uF of capacitance that must be suddenly charged when your board is plugged into the USB port . The limit works out to around 10uF of capacitance .

when i look back through my note book, shortly after I made this post I wrote in my diary

there are a LOT of “rules of thumbs” thrown around in circuit design. they are thrown at you in engineering class, text books, forums, blogs, datasheets, youtube videos etc. I find that such rules of thumb are only useful when you understand why they exist, where they come from and when to apply them. Although they simplify the process for beginners allowing to them to achieve something quickly, the rules of thumb have the side effect of allowing misunderstanding (or false assumptions/conclusions) to take root which makes subsequent learning difficult as you put new information into a wrong frame of reference

I noted the example of “a capacitor is an open circuit at DC” - i have come across this in some beginners who assume open-circuit like a switch, and this can be fine - but this is only at steady state and ignores the transients. This is also I believe one of the fundamental errors veritasium made in his now infamous “electricity doesn’t flow the way you think it does” videos (Kathy Loves Physics did an excellent follow up which, although it was a year late, I was thrilled to see as its one of the few responses that considered transients properly)

I have used rules of thumb myself for years, and gotten away with it… but I am now questioning everything I once “knew” and asking if it makes sense

Could be nice to create a list of these rules of thumb - the rule, the condition for applicability, the underlying assumption, the full scary math

A younger more naive me would have agreed! But I don’t think it’s that simple, and to be honest I don’t think it would be that useful…

Speaking for me only here, with hindsight I had the wrong mental approach at school - I was more focused on not-failing than I was on understanding. I actually had a long discussion recently with my old professor on this topic (and I apologized as well). If you make a list you’re not actually teaching something you’re just creating another shortcut. You need to get into a habit of learning things and making sure you understand it - whether that be a rule of thumb or a simplified model or analogy… Newtonian physics or the solar system model of the atom … they are very useful models but have limitations. It’s also a question of how far down the rabbit hole you want to fall! There is always a limit - at some point you cease being a design engineer and become a theoretical physicist (nothing wrong with that!). For a lot of work a high level, rule of thumb view is more than good enough… and for people like me, who have become detail oriented (too late!) it’s dangerous as I spend more time searching for answers than doing something useful

If I had my time again I would take much more time and not just copy down the notes and regurgitate them on an example.

Rules of thumb are good for people who are just getting started and don’t yet have the knowledge about which things are more important, or for people who just need a refresher after not thinking about it for 20 years! But sure, the answer to every engineering question is “it depends” so you don’t get far without the proper understanding.

100% agree - sadly, the part of “having knowledge” is often lost; the rules are just thrown at beginners without proper explanation or qualification (even just a “this is valid for the current discussion, but make sure you understand the limitation”) otherwise, and I am proof! it can be taken as gospel and make further learning much more difficult (even leading to paradoxes which can take a long time to resolve… again, I am proof! - and yes, this is a reflection on me)

again I have no issue with using rules of thumb, or simplifying things (Esp. for beginners) - you want people knew to the field to achieve something quickly - but as long as it doesn’t slow them down in the long run!

Hi! I’d like to take a stab at clearing up a few things and answering your questions.

I think you’re getting turned around in how you’re thinking about the voltage source. You’re correct that the voltage can’t be both 0 V and 5 V at the same time at the same ideal node, but the piece you’re missing is that an ideal voltage source turning on at t=0 has an infinitely fast rise-time (which we know to be physically impossible, but can be theoretically applied). It’s not a paradox so much as a consequence of instantaneous transitions. An infinitely fast rise time is a perfectly vertical line; instantaneously changing from 0 V to 5 V. In this scenario, an ideal capacitor would indeed charge with an infinite current.

Remember the formula describing capacitor current! This is key, and fundamental to wrapping your head around your questions.
I = C (dV/dt)
Note that the formula doesn’t care about parasitics - it describes an ideal capacitor. In your simulation, you’re setting the voltage ramp rate AKA slope (dV/dt) and the capacitance. This is all that’s needed to calculate the charging current, even with an ideal capacitor with no ESR. This current lasts from V = 0V to V = 5V. Once the capacitor is charged, no current flows.

So, summarizing what I wrote above, even if you didn’t have ESR (as with an ideal capacitor), the voltage source ramp-rate (often called “soft-start” in real applications) is sufficient to limit inrush current (no voltage source can have an infinitely fast rising edge!). However, you are partially correct: ESR further limits inrush current.

Reiterating: yes, and ideal capacitor functions just fine with proper ramp-rate.

1 Like

cheers mate - since writing the question I have wrapped my head around things (I hope!)

on a fun side note, my son and I built a gaming PC for him with an 850W Thermaltake PSU - every time it’s plugged into the wall (after being uplugged for a while) it trips the breakers due to (I assume) inrush current as after its plugged in, it’s fine, the breakers are not tripping, the PC is stable - I keep wondering why it doesn’t have a soft start mechanism in it. Not having worked with PC’s for some 20 years, is this a common issue now or do I have a poor PSU?

Sounds like a poor PSU! Personally, haven’t ever experienced that with mains-powered equipment/appliances.

At my previous employer we had several ovens for burning in circuits, running thermal tests, etc. One paticular model (that used the ubiquitous linear power supplies of the 1970s - power transformer, 4-diode bridge rectifier, and very large electrolytic capacitor) would fail occasionally as its bridge rectifier diodes couldn’t repeatedly handle the inrush currents on power up. After replacing the diodes a couple of times, I added a little series resistance between the diodes and capacitor to limit the inrush. These linear supplies almost always relied on the capacitor ESR, transformer secondary resistance, and surge current rating of the diodes to limit inrush current, and this usually is enough to prevent circuit damage.

Most PC supplies have a soft start. Also, could be earth leakage tripping if the breaker has that capability or even arc-fault.

Best to measure and determine which of the 3 it is.

Earth leakage is often a too high leakage Y-Class cap for example.

Some EEs aren’t too familiar with high voltage, if that’s you, you can blow up a scope very easily. And maybe safer to replace the supply with a different make first.

There are also common problems with power in houses with could be causing it to trip, i.e. computer is the symptom not the cause.

Mark

we were away on a ski vacation, and i normally unplug anything that is not necessary when we are away for an extended period of time

when we returned it was the first thing I plugged back in, and nothing tripped - so it could just be a combination of everything on that circuit?

1 Like