Author Topic: RC filter in overcurrent protection circuit for moving average transients  (Read 2705 times)

0 Members and 2 Guests are viewing this topic.

Offline tinfeverTopic starter

  • Regular Contributor
  • *
  • Posts: 178
  • Country: us
  • I like to make life harder for myself
I'm working on an overcurrent protection circuit with a current shunt, amplifier, RC filter, and comparator that will be used for power connectors supplying a load. The challenge is that this OCP circuit must not trip under normal loading conditions which includes high transients.

I’m trying to figure out how to design the RC filter so the comparator will never trip under the permitted transients. I think I might have figured it out but I’m not completely confident my solution can be guaranteed to hold in all scenarios.

In short, the connector load only has to stay within its maximum sustained current/power limit (40A) measured with a 1 second moving average. It can draw much more than the sustained limit for shorter moving average intervals, up to an instantaneous maximum of 3x the sustained limit (120A).

For example, it can pull 40A (1x) with a 1 second moving average, 80A (2x) with a 10ms moving average, and 120A (3x) with a 100us moving average, according to the chart below. The load must stay within these limits concurrently for all moving average time intervals. (This is all dictated by an industry standard.)



Proposed circuit:


(Current sense amplifier output goes through RC filter and then comparator. Comparator threshold would be set to 1.5x sustained limit (60A equivalent signal level)

Of course, an RC filter is going to have a different response than a moving average filter. However, I think it should be possible to have an RC filter that is sufficiently slow that it will always be more lenient that the 1 second moving average constraint the load will stay within.


(1 second moving average vs 1M+650nF RC in LTSpice)

I think, in theory, as long as the filter attenuates more at all frequencies than the moving average limit of the load, the current sense signal will be attenuated enough so that the comparator doesn’t trip under allowed transients. However, the moving average filter frequency response is going to have dips of infinite attenuation at multiples of the averaging window period. Theoretically if the load transient current was a 1Hz sine wave, it would average out to be perfectly flat at zero, but the RC filtered output could be higher and cause a false overcurrent trip.

I think this might be manageable because I’m setting the comparator threshold at 1.5x the permitted sustained level. Since the load is limited to an instantaneous maximum of 3x nominal, as long as the filter is attenuating by 20log(2/0.5) = 12.48db (2 and 0.5 are 3x and 1.5x transient amplitudes relative to a DC value of 1) by the first moving average “dip” at 1Hz, it won’t matter what the load does since the signal will be attenuated below the comparator threshold.

Simulating in the time-domain, this seems correct. Even in a worst-case scenario of a 3x transient sine load around 1x nominal (technically impossible due to negative values, and would violate some of the limits at other averaging windows), it is still attenuated to below the 1.5x comparator threshold.



So I think this solution works? Does this seem correct?


The more I think about having a continuous spectrum of moving average intervals with different amplitude thresholds, and try to figure what that would look like in the frequency-domain, the more confused I get.



I’ve plotted the frequency response of a few of the moving average windows and then applied gain to reflect the higher levels permitted for the shorter averaging windows, but I have no idea what this means, if it means anything.

If these are the limits of the load, shouldn’t the amplitude actually be higher at higher frequencies? What about the moving average limits longer than 1 second, won’t those roll off even sooner and pose even stricter limits? How can you plot the frequency domain limit of something that must be concurrently compliant with an entire spectrum of moving average filters with varying time windows and thresholds?

« Last Edit: December 11, 2023, 07:15:33 pm by tinfever »
 

Offline MasterT

  • Frequent Contributor
  • **
  • !
  • Posts: 851
  • Country: ca
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #1 on: December 12, 2023, 05:52:01 pm »
What I see, is 2x must change t by x100, and 3x by 10.000. Obviously high non linearity presents, and reflected in equation as ln(t).
There is no solution in linear RC filter in any form or order.  Log (ln) approximation as simple as single diode, or more advanced BJT based log amplifier is an answer.
 

Offline slugrustle

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #2 on: December 13, 2023, 08:34:34 pm »
Initial analysis on RC time constant looks reasonable.  It looks like your load is DC.  If I were trying to validate a circuit like this, I would run transient simulations with current step inputs at 40A (R = 1x), 120A (R = 3x), and several values in between and see if the time it takes the overload indicator to trip is within the curve or not.  Let me know if I'm off base.  Have you tried something like that?
 

Offline tinfeverTopic starter

  • Regular Contributor
  • *
  • Posts: 178
  • Country: us
  • I like to make life harder for myself
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #3 on: December 16, 2023, 03:30:05 am »
Initial analysis on RC time constant looks reasonable.  It looks like your load is DC.  If I were trying to validate a circuit like this, I would run transient simulations with current step inputs at 40A (R = 1x), 120A (R = 3x), and several values in between and see if the time it takes the overload indicator to trip is within the curve or not.  Let me know if I'm off base.  Have you tried something like that?


Thanks. I've been thinking something similar and I've tried a few different things. I guess I'm just afraid of missing some edge case and then having nuisance trips shutting the entire system down, which would be an absolute disaster. These are going into computer systems so the power consumption is software workload dependent, thus I have to assume the end devices will behave in the worst possible way within spec.

Below are the results of applying many (143) different variations of pulse waveform to both the moving average and RC filter.

T1 = stepped from 100us to 1s with three points per decade
P1 = 4 - 0.2171*ln(T1*1E6) to choose the maximum power level for that pulse
P2 = stepped from 0 to 0.99 in steps of 0.1
T2 = calculated from other three values to create a cycle average of 1





I'm concerned about how the RC filter rises faster than the moving average filter during the ramp-up. I'm not quite sure how this is possible since the RC filter should be higher attenuation at all frequencies, I think. Other than that, this is fine. The worst case pulse waveform seems to be around T1=300ms and P2 = 0.99.


(T1 = 300ms, P2 = 0.99)

I also previous tried sort of what you're suggesting, testing trip response time from a 40A (1x nominal) step to various overcurrent levels with the threshold set at 1.5x. The curves don't intersect, and this was with smaller C values in the RC filter too. Interestingly, I think when I plotted the frequency response of these higher freq. roll-off filters vs the 1s moving average, they didn't attenuate as much, so I'm not actually sure they would be perfectly safe.



I'm sure there must be a mathematical solution to all of this. I'm also sure it will be way over my head at this time. I used some of the math from the second answer here (https://dsp.stackexchange.com/questions/9966/what-is-the-cut-off-frequency-of-a-moving-average-filter) to determine that I'd need an RC filter cutoff frequency of 0.32Hz to match the "stop band ripple" of a 1s moving average filter. Hence at least a 497nF capacitor assuming at 1M resistor.

What I see, is 2x must change t by x100, and 3x by 10.000. Obviously high non linearity presents, and reflected in equation as ln(t).
There is no solution in linear RC filter in any form or order.  Log (ln) approximation as simple as single diode, or more advanced BJT based log amplifier is an answer.



That's an interesting filter. I haven't seen that before. When I tried simulating it, the attenuation at high frequency plateaued which is interesting. However, in the time-domain it seemed to act more like a peak detector. Maybe I don't have the right values, but I'm not sure this is quite what I need anyways. I'm also trying to keep the BOM count as low as possible since I have to do 40 channels of these protection circuits, so even adding a diode starts adding up fast.


« Last Edit: December 16, 2023, 03:34:26 am by tinfever »
 

Offline Solder_Junkie

  • Frequent Contributor
  • **
  • Posts: 561
  • Country: gb
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #4 on: December 16, 2023, 09:10:21 am »
I have made several protection boards using an LTC4368, the normal load is around 25 Amps, but switch on surges reach more than 40 Amps. The peaks trip the over current in around 8uS unless there is RC filtering to delay things. The RC filter “fix” delays the over current trip to cater for up to 1mS of excess current.

See this thread for details, inc an LT Spice model:
https://www.eevblog.com/forum/projects/ltc4368-over-current-protection/

SJ
 

Offline slugrustle

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #5 on: December 16, 2023, 05:42:33 pm »
Your allowed ratio vs. time plot with the various filters testing square wave pulse transients from 1x to higher ratios looks pretty convincing to me.  That's exactly the kind of thing I was getting at.  Torture test the circuit in LTspice like you might wish to test it on the bench and compare the results to the limit curve you're designing against.  I agree with you that there's gotta be some math for this or something, but the nice part about a test like this is it's directly representative of the pass criterion and you don't have to worry about making mistakes with the theory (I would worry about that if I tried to use the theory, heh).

With that big question out of the way (in my mind), a few remaining concerns about the circuit:
1. 1MΩ is a very high impedance.  Check this against the input bias current of your comparator.  You might get a lot of drop across this resistor (1V/µA).  Comparator input bias current also affects the comparator reference voltage.
2. I'm not sure how much tolerance you can live with in the capacitor of the RC filter, but film caps will be much better in that regard than X7R ceramics which have initial tolerance, DC bias loss, aging, and temperature effects.
3. Make sure that, on 5V rail startup, the voltage on the comparator inverting input rises more quickly than the voltage at the noninverting input.  The RC filter will help, just be sure to check.
4. Going in the other direction from point #3, it doesn't hurt to put a small capacitance in parallel with R106 to reject noise from the 5V rail from affecting your comparator reference.
5. How accurate is your 5V rail?  This will directly impact the accuracy of your comparator reference voltage.
6. There's a lot going into preventing a nuisance trip against the limit curve you've been given, but it looks like the protection against pretty high current transients would take a while to kick in.  Certainly longer than 100µs.  Just make sure these transients won't happen or your power supply is ok with them.

I wonder what kind of circuit it would take to really implement the limit curve in your first post.  Using two comparators (slow for 1x level, fast for 3x level) gets a bit closer, but that interpolating line is tough.  Maybe other people use a dedicated protection IC or a DSP or something like that.
 

Offline tinfeverTopic starter

  • Regular Contributor
  • *
  • Posts: 178
  • Country: us
  • I like to make life harder for myself
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #6 on: December 17, 2023, 06:26:03 am »
I think you're right that this has been analyzed enough to move ahead. I appreciate the thoughts!

I'm considering using an INA381 for the combined current sense amplifier + comparator, and unfortunately they don't specify the input bias currents for the comparator in the datasheet. I did find a question on TI's website about it though, where someone from TI says the comparator inputs "have input impedances of hundreds of MΩ". If I assume a worst case of 100M, and then hope that figure holds over temperature, that should mean the error is minimal.
https://e2e.ti.com/support/amplifiers-group/amplifiers/f/amplifiers-forum/810006/ina381-input-impedance-cmpref-pin/2997954)

This design is extremely space constrained and slightly cost constrained, so I'll have to go with MLCC caps. Although I just checked and there are actually 1206 1uF film caps, interestingly. Anyways, thankfully this circuit doesn't have to be accurate, as long as it doesn't trip erroneously. Ironically after doing all this analysis I'll probably just use a 2.2uF 0603 MLCC already in the BOM. That should leave enough tolerance to handle DC bias, AC bias, aging, temperature, and initial tolerances. 2.2uF * 0.9 * 0.6 * 0.9 * 0.78 * 0.9 = 0.78uF worst case
 ...I hope.

Simulation shows that with this specific 2.2uF cap a dead short circuit should trip the circuit in 125ms, which should raise 1m of 16AWG wire by 93C by my calculations (The PSU can source 12V at 900A  but I'm assuming a wire current of 417A limited by 10mOhm terminal contact resistance + 15.5 mOhm wire resistance). Kind of terrifying but technically not on fire.

I haven't quite decided how I'm going to handle the reference voltage. Doing a resistor divider + Vref filter cap for each of the 40 connectors with this circuit seems like overkill, but doing it once and running a Vref trace over the entire board (100mm x 250mm) seems like it might pickup noise easily on the sensitive comparator inputs. I'm thinking of doing it in banks, one resistor divider at the top of each bank of 8 connectors, and then maybe putting a Vref filter capacitor (100nF) at each end of the bank.

I don't envy the designers of the hardware that is actually required to limit itself to that curve. I'm sure it's all done in software but I have no idea how you'd do it. Maybe they can monitor the actual moving averages at several window lengths, and then just reduce the clock speed if they are getting too close to the limit.
« Last Edit: December 17, 2023, 06:42:35 pm by tinfever »
 

Offline slugrustle

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
Re: RC filter in overcurrent protection circuit for moving average transients
« Reply #7 on: December 17, 2023, 05:37:12 pm »
Good find on that forum post about comparator input impedance.  It's a shame that isn't documented a whole lot better in the datasheet.  I'd still want to know if the inputs have bias currents despite high input impedance.

I skimmed the datasheet and also found the attached in Section 8.2.1 Increase Comparator Hysteresis.  Looks like there's a 4µA current source feeding the CMPIN pin that turns on after ALERT asserts active (low).  So watch out for that.  CMPREF seems fine since, as the forum post indicated, they show using it with a resistor divider in the datasheet applications section.  CMPIN seems more fraught despite the forum post (to me; maybe I'm paranoid) because the datasheet always shows it hooked directly to VOUT except in this one section about hysteresis where they finally reveal this switched current source.

TI has some nice parts and reasonable prices and availability, but sometimes I wish their datasheets were better.  I mean, this one is pretty good, but it's missing some important details about the comparator inputs. 

Good luck on this.
 
The following users thanked this post: tinfever


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf