Calculate (R)LC circuit's inrush current - Page 1
Forum section: electronics / beginners

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 20, 2022, 10:42:56 am
content: HiSimple question: how do you calculate the inrush current in an RLC circuit? (suppose R is big enough so it does not oscillate)Suppose you put the circuit through a 0->5V step. I guess the inductor limits the inrush current created by the capacitor. But thinking about it if the induction was tiny compared to the capacitor then it would get quickly saturated and the "rest" of the inrush current will still flow and create a massive spike.So I'm thinking there must be a way to get the current I(t) based on R, L and CThanks!Simon

author: ledtester
author_rank: Super Contributor
timestamp: November 20, 2022, 11:44:23 am
content: This page:http://www.mathforengineers.com/transients-in-electrical-circuits/series-RLC-circuit-response-to-a-step-voltage.htmlslogs through all of the math to solve a series RLC circuit.For the overdamped case the solution is:$$i(t) = \frac{V_0}{2\beta L}\left( e^{(\beta-\alpha)t} - e^{(-\beta-\alpha)t} \right)$$where$$\alpha = \frac{R}{2L},\quad\beta = \sqrt{\left(\frac{R}{2L}\right)-\frac{1}{LC}}$$From this you can show that the maximum current occurs at time:$$t = \frac{\ln\left(\frac{\alpha-\beta}{\alpha+\beta}\right)}{-2\beta}$$Then just plug in this time into the formula for \$i(t)\$.Update: The above referenced page has a calculator solving the step response of an RLC circut:http://www.mathforengineers.com/transients-in-electrical-circuits-calculators/step-response-of-a-series-RLC-circuit.html

author: wasedadoc
author_rank: Super Contributor
timestamp: November 20, 2022, 11:46:45 am
content: If the inductor saturates then it isn't a perfect inductor and the theoretical formulae for RLC circuits do not apply.

author: Picuino
author_rank: Super Contributor
timestamp: November 20, 2022, 12:24:00 pm
content: You can simulate several cases and learn from them.https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.htmlEDITJust one question: How are the three components connected?From the text I deduce that in series, but also that the inductor and capacitor can be in series and the resistor in parallel with them.

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 20, 2022, 03:22:01 pm
content: Wow thank you all for the responses.@Picuino: yes in series, i.e. input -> R -> L -> (output ->) C -> gnd with input going from 0V -> 5V and output where the load will be (but for now it's irrelevant).@ledtester: that website is all I needed, really greatAll it's lacking is a plot of the values, I copied them manually into desmos.comMy circuit is USB-powered and uses an RLC filter with a large cap so I was worried about in-rush current.with an inductor L=47uH which has an ESR or 1.64 ohm, combined with a 470uF cap I get the red curve. The orange one is when I switch the inductor to 100uH with an ESR of 3 ohm.That's too high for the USB spec but there is a power switch in front of the filter which should have a "soft-start" function. The switch should also cut the current after 2us if it becomes higher than 570mA. So I'm not sure which function will kick in first...(FYI:the power switch's datasheet)

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 20, 2022, 06:04:28 pm
content: So I decided to test this, with the MT9700 power switch.My circuit is:+5V -> (4.7uF cap to gnd) -> MT9700 -> 3.3 ohm res -> 47uH inductor -> output -> 100uF cap -> GNDI am measuring the voltage at the +5V source (the power is from a USB phone charger) and at what I call the "output" (after the inductor).See attached the measurements when turning on and off the switch (blue is +5V source, yellow is output), as well as the graph from desmos.com which is the theoretical inrush current.

author: MrAl
author_rank: Super Contributor
timestamp: November 20, 2022, 06:40:32 pm
content: Quote from: simonlasnier on November 20, 2022, 03:22:01 pmHello there,I am not entire sure what you are doing, why you are running this RLC circuit, but here is an idea if you can do this.With your first two values of L and C and R the current peak is:ipk=2.771801215789373 ampsBut if the cap has some positive initial voltage across it then the expression for the current peak is:ipk=2.771801215789373-0.55436024315787*vCand you will note right off that if there is any cap voltage 'vC' then there is some amount of current at the peak that is diminished from the current without any initial voltage across the cap.For example, if you can precharge the cap to +2.5 volts then the current peak reduces to around 1.6 amps, but interestingly if you can precharge the cap to the nominal USB voltage 5.0 volts, then the current peak is zero (0 amps). That would mean you could connect the circuit and there would be no surge at all.To get this to happen you can use a transistor or relay with second, larger resistor connected directly to the cap and with nothing else connected yet, then wait for a time until the cap charges, then disconnect that second resistor and connect the original circuit and it will be connected and there will be no surge.To calculate the value of the second resistor based on the desired max USB current you would simply do:i=5/Rswhere i is the max current and Rs is the second resistor. From that it is easy to see that if Rs=5 then the max current is 1 amp, and if Rs=10 the max current is 1/2 amp, and if Rs=20 the max current is 1/4 amps, etc., etc.Since the voltage across the cap reaches to about 99 percent of the max voltage in 5 time constants, the time to reach 99 percent of the final voltage (5 volts) would be:t=5*R*Cand for your first set of values again for the cap (470uf) that time with the second resistor equal to 20 Ohms would be:t=0.047 secondswhich is quite fast.With Rs=100 Ohms the current is reduced to 0.050 amps and the time to charge is about 0.25 seconds, also not too bad.So if you can arrange a little switching circuit to switch the second resistor in, wait for the cap to charge, then disconnect that second resistor and connect the original circuit, then you will see very little surge.This would probably best be done with a relay but there are other options.Note all of the above was calculated using the first set of values 470uf and 1.64 Ohms, but it would work even better with the second choice 100uf and 3 Ohms as the cap would charge even faster being about 1/5 the other value.Of course alternately you could connect a second larger resistor in series with the entire network to reduce the charge current than after a time short that second resistor out. That is a typical way to handle these problems.

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 20, 2022, 08:24:07 pm
content: Thanks MrAl, that makes sense. I guess this could be done with a power mosfet switching on after x seconds using an RC circuit on the base. But ideally I want to avoid all that, just tweek the values a little bit to get an "acceptable" inrush current.Question is:what's an acceptable inrush current for USB? I looked it up and... it's a secret. Thank you USB-IFAll I know is the source voltage should not drop by more than 350mV. Looking at my previous graphs, it drops by about 2V it seemsBut then I heard the "common" accepted capacitance is 10uF. And if I put 10uf on that page given by @ledtester above (say the USB cable is 1 ohm and 0.8uH), I get 4.5A of inrush current...So if that 4.5A of inrush is acceptable, maybe my 2.5A of my RLC circuit is?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 20, 2022, 11:17:49 pm
content: 470uF is WAY too big for USB. See if you can meet your specs (what, SMPS ripple?) with more like 10uF.You can generally assume the source is current limited, either with a polyfuse (does nothing to transients) or a power controller proper (will be current limited up to some modest duration, beyond which it faults out / thermally protects -- typically 100s us). I'm sure there are cases where, with a low resistance load (no cable?), and a weak supply (some laptops/tablets/phones somehow with direct connection to main internal power bus?) maybe the transient could brown out the system and cause it to fault or reset. That's probably the worst that could happen.I mean, extra current means extra contact erosion of course (assuming we're talking about hot-plugging here), not that USB connectors are great on insertion cycles in the first place anyway; so, kinda who cares, but also kinda, reason enough not to reduce it further? *shrug*If you can afford to increase ESR (those inductors have tremendous ESR!), just plonk in the resistor and call it done!Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 21, 2022, 08:28:05 am
content: Thanks Tim for the reply.Yes I get that, but it's not 470uF directly on the VBUS, it is part of an RLC filter which reduces greatly the inrush current. Like I wrote in my last post: it seems a 10uF creates a 4.5A inrush current, while my RLC (with R=1.6, L=47uH, C=470uF) "only" reaches 2.5A. Or have I got that wrong?See attached a graph showing the inrsuh current for a 0->5V step of:* 10uH capacitor (I estimated R and L of a USB cable)* RLC described above* same RLC with lower C (47uF)Obviously the 10uF draws a lot less current overall (much shorter burst), and based on your answer I guess that's the key - i.e. the power controller proper will fault after 100s us, and with the big RLC filter it takes 1.5ms to go below 500mA?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 21, 2022, 09:10:30 am
content: No I mean, why is your comparison 10uF and almost nothing else, if you're putting 1+ ohms in series with the other cases? Why would you not also add a 1 or 1.5 ohm resistor to the 10uF case? If you can afford that much voltage drop (I guess your total load is some 100-200 mA max?), I guess it wouldn't hurt to save a little inrush while you're at it, eh?Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 21, 2022, 09:23:59 am
content: Quote from: T3sl4co1l on November 21, 2022, 09:10:30 amThanks Tim - I think you misunderstood me though. I heard/read many places that having 10uF (without any resistor) on the USB Vbus is acceptable. So I only included it in the graph to compare to "my cases" which are the other two cases (ideally the 470uF, but I could trade it for the 47uF).So it was mainly used to clarify my question:why is it "acceptable" to have a 4.5A inrush from a 10uF cap but not a 2.5A inrush from my RLC filter? Is it because the 2.5A is drawn for more than a few 100s of us (unlike the 10uF cap which is only drawn for a few us)?(edit: and increase the R of the RLC, yes I might do that either way - current draw is max 150mA - but first I wanted to understand what is acceptable and what is not)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 21, 2022, 09:44:15 am
content: Ah yeah, and in that case, well, I can't speak for every power source out there -- but I have to assume most won't care, and if they do, it's highly unlikely to damage the device. If the standard doesn't say anything about it (I haven't read it in quite a while myself) then you don't have anything to worry about.Tim

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 21, 2022, 10:29:52 am
content: Noted, thanksAnd just FYI, this is what I could find from the standard:*https://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#45actually does not say what will pass or fail the test, all it says is if you stay below 100mA you pass* I think the answer here from metacollin is quite detailed about what to consider:https://electronics.stackexchange.com/questions/36375/understanding-usb-inrush-current-requirementsFunny enough in practice it seems everything works: I tried hot plugging a 470uF through a 1ohm res on its USB port and the computer did not complain one bit.

author: Saimoun
author_rank: Frequent Contributor
timestamp: November 21, 2022, 02:54:46 pm
content: Just FYI - posting here thinking some people could get inspired from this.Reading metacollin's reply on stackexchange (link above) made me realize I did not take into account the bus capacitance (>120uF as per the USB specs).So I tried simulating the whole thing on LTspice, the best I could.My circuit has different sections with each their capacitance and I wanted to see what impact it would have on the Host Vbus.The switch S1 is the USB cable, plugging at 1ms, then the powerswitch U2 turns on at 2ms which charges the capacitor (47uF) as well as power for VDDA.

author: dmills
author_rank: Super Contributor
timestamp: November 21, 2022, 05:59:34 pm
content: One neat approach to this I have seen is to build a simple 2 transistor/2 resistor Widlar current source (Used here as a current limiter) upstream of the bulk cap.The limit then is how long are you prepared to wait for the cap to charge.This is particular useful in modest pulse power applications like led barcode scanners and suchlike where you need rather large bulk caps to support the peak power demand.