Go Down

Topic: PWM to mitigate inrush current? (Read 589 times) previous topic - next topic

aruffell

May 22, 2020, 12:08 am Last Edit: May 22, 2020, 03:57 am by aruffell
I am building a RetroPie arcade which uses an Arduino Nano for its power management system. The Nano turns on and off all the peripheral devices in the arcade, and can put it into standby for quick resume of play.

The issue I have run into is that the audio amplifier I picked has a 2A (or at least that is what I was able to catch with my bench DMM), at least, inrush current spike. The Mean Well power supply seems to momentarily sag when the amp is powered. Since this can happen when the RPI is already powered, it occasionally causes it to reset.

I tried adding a 6800uF CAP (just what I had) on the power rail but it did not resolve the issue. I tried a larger power supply but that too did not help.

A TI paper said that one way to address this issue would be to slow down the charge of the capacitors... which got me thinking...

Can I power the amp using PWM to ramp up power to it? The idea would be to go from 0 to 100% in a couple seconds and leave it at that. Would this address the inrush issue in a safe way?

MarkT

There are three approaches to this I think - one is to add a constant current limit circuit between supply and
amp.  This will lose a volt or so however.

Secondly you could use a soft-start arrangement where a series resistor is in circuit to limit the current when
power is first applied, then short-circuited after a second or two once the caps are basically charged.

Thirdly use an inductor to smooth the current pulses that PWM would otherwise produce - supplys tend to
cut out on instantaneous current, not average current.  An inductor prevents the supply seeing the full
current pulses as it smooths variations in current.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

aruffell

@MarkT - thank you for the suggestions.

I can't go with option one as the amp is already powered at its low input voltage spec which results in lower power output which I factored in when I chose it.

This is the amp I am using:

https://www.amazon.com/gp/product/B07KWS33LP

I also swapped out the power supply with a cheaper clone of the Meanwell power supply I'd like to use which also had 24V rail. Even on its own rail, the RPI was complaining of undervoltage when the amp was powered on.

The 3rd option is something that would require better electronics knowledge than I have so I will likely not go for it.

The 2nd option sounds like the description of what an NTC is for. I guess that would be my solution if I can figure out which one to use. I believe the max current the amp uses is under 2A @ 12V. The current spike I measured with my bench DMM in trend mode was just under 2A, but I am not sure that is the actual spike (meaning I wonder if it is actually higher).

Wawa

Inrush current into the power supply caps is what the supply can deliver.
Could be a lot more than 2Amp. You can only measure that with a scope, not with a slow DMM.

Current draw of a class-D amplifier depends on supply voltage and speaker impedance.
With 8-ohm satellite speakers (not including woofer), and a 24volt supply, that could already be ~4Amp full blast.
I expect you need a 24volt/10A supply for that board.

How are the RPI/Nano powered.
Should be a separate supply, or that buck supply should be buffered with a cap and diode between the two supplies.
Leo..

dlloyd

Quote
A TI paper said that one way to address this issue would be to slow down the charge of the capacitors... which got me thinking...
I had to solve a similar issue but on a totally different circuit. Had to drive qty 40 100A impulse relays each having a 12V/6 ohm coil. Instead of using an 12V/80A power supply, I was able to use just one 12V/6.5A supply to drive all those relays. The solution was to just have the smaller supply charge a 1 Farad capacitor with a 2.5A polyswitch connected in series. That was more than 10 years ago, and I think its still in service.

Anyways, I would think that perhaps a suitable polyswitch directly charging a capacitor could solve the problem. There are many types and sizes to choose from, some have a faster trip time than others. If your amplifier is oversized, and your continuous current draw is under 0.5 amp, then a 500mA polyswitch limiting the max current to 1 amp just might work.

Smajdalf

If a MOSFET is used for the switching maybe slowing down the turn on by a large Gate resistor and possibly a capacitor could solve this. But of course the transistor will dissipate a lot of power during turn on/off. It can easily die if it is too small. (I have no idea how large transistor you need for this - using two transistors is probably better.)
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

Paul__B

It is simple.

You need to power the Pi with its own separate power supply.  :smiley-roll:

aruffell

#7
May 22, 2020, 03:04 pm Last Edit: May 22, 2020, 03:10 pm by aruffell
Inrush current into the power supply caps is what the supply can deliver.
Could be a lot more than 2Amp. You can only measure that with a scope, not with a slow DMM.

Current draw of a class-D amplifier depends on supply voltage and speaker impedance.
With 8-ohm satellite speakers (not including woofer), and a 24volt supply, that could already be ~4Amp full blast.
I expect you need a 24volt/10A supply for that board.

How are the RPI/Nano powered.
Should be a separate supply, or that buck supply should be buffered with a cap and diode between the two supplies.
Leo..
I was suspecting that what I caught, even after setting the DMM to Fast Mode, was probably not the full spike. I attached the image of the screen showing my measurement. It shows just under 2A but in a previous measurement it clearly reached 2A. I have a scope but I don't have a current probe. I guess I could likely figure it out using a large low ohm resistor but have not done so yet.

The speakers are 4 ohms, and I assume the sub as well (I can't see the back of it). I do not need anywhere close to full power as this is a two player table top arcade. The only reason I went with this amplifier was that it could be powered at 12V and it was 2.1. I had an itch to add a sub to my arcade to see how it would sound. Well... if I can the arcade not to reboot, I will keep it as it sounds cool (the bass....).

The power supply I used in a similar arcade, and chose to use again, is the Mean Well RD-65A. It has 2 rails: 12V 3A (~4A max) and 5V 6A (~8A max). With a smaller 10W stereo amp it works great...

https://www.meanwell.com/productPdf.aspx?i=166

One of the images attached shows my spartan layout inside the arcade. No space for another power supply unless I redo it all. :(

The LED marquee is powered at 12V and it draws 1A or less at the brightness level it is set at (50% or so via PWM).

The power amp is powered by the 12V rail and my measurements showed it generally was between 300 and 800mA at the desired volume. I tried to blast it as loud as it would go and never saw it exceed 1.5A but I may be missing fast spikes. I was using test sounds to drive the amp.

The RGB LED arcade buttons are all powered at 5V. The power requirement is low but I don't know the exact amount. There are 20 RGB LED buttons with a small control board. They could, but rarely are, all turned on.

The Arduino Nano is on a shield that require 7 to 12V. If I power it at 12V the Arduino's regulator gets hot and eventually burns out. I have an LM2596 board that reduces the 12V to 8V and is capable of 3A. There are 2 regulators on the Arduino shield that provide the 3.3V and 5V for the things powered by the shield.

https://www.amazon.com/gp/product/B008BHB4L8

The Raspberry Pi 4 is powered by the 5V rail. The rail is set to 5.2V which I believe is the upper limit of the USB bus that is directly connected to the RPI power input. The RPI is sitting on top of a USB3 SSD interface in case you wonder. I have 500GB worth of storage space.

https://www.amazon.com/gp/product/B07VXF2HJG



aruffell

If a MOSFET is used for the switching maybe slowing down the turn on by a large Gate resistor and possibly a capacitor could solve this. But of course the transistor will dissipate a lot of power during turn on/off. It can easily die if it is too small. (I have no idea how large transistor you need for this - using two transistors is probably better.)
The amp and RPI are both turned on using a relay. I could switch to a MOSFET though... I have a DFRobot board that has a 20A MOSFET on it. It is the one I was thinking of driving with PWM to achieve the slow power up. What confuses me is that the stuff I read talks about slowing down the voltage rise, and PWM just changes the duty cycle but leaves the voltage at its normal level so I may have just answered my original question... I can't do it with PWM. I was just hoping I was wrong.

aruffell

[...] The solution was to just have the smaller supply charge a 1 Farad capacitor with a 2.5A polyswitch connected in series. That was more than 10 years ago, and I think its still in service.

Anyways, I would think that perhaps a suitable polyswitch directly charging a capacitor could solve the problem. There are many types and sizes to choose from, some have a faster trip time than others. If your amplifier is oversized, and your continuous current draw is under 0.5 amp, then a 500mA polyswitch limiting the max current to 1 amp just might work.
A youtube video talking about NTCs also mentioned polyswitches. I believe one decreases its resistance when it heats up, and the other just turns off, right? Based on what I read, it would seem that an NTC is what I need but I have not figured out yet how to pick the right one.

herbschwarz

Do the speakers "thump" when you switch the amp on?
If so, there is part of the current surge.  Can you switch
the amp on, wait a while, then switch on the pi?

dlloyd

Here, it says Typically, NTC-based limiting is used for most applications. However, there are certain scenarios that require a PTC thermistor over an NTC thermistor. These include equipment with a near-zero reset time, extreme temperature conditions, and systems that experience frequent shorts.

If you consider the current surge as being caused by a temporary short or overload, then I think a PTC would be better. However, if you try NTC and then PTC, you'd find which type performs better with your application.


Smajdalf

From datasheets I got impression that common PTC "fuses" take looong time to fire - tens or hundreds of ms even with considerable overcurrent. Is it a good device to prevent brownout?
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

dlloyd

#13
May 22, 2020, 09:17 pm Last Edit: May 22, 2020, 09:22 pm by dlloyd
Quote
From datasheets I got impression that common PTC "fuses" take looong time to fire - tens or hundreds of ms even with considerable overcurrent. Is it a good device to prevent brownout?
PTC Example 10ms trip, 0.35A hold

Pick a PTC size that would handle the continuous load current of the amp, the capacitor would handle the peaks.
I don't think it needs to be this fast ... could use slower through hole type.
The power supply circuit would be modified like this:

Power Supply -----> PTC ---> Filter Capacitor 1 ---> Amplifier (soft start)
               |
                -----------> Filter Capacitor 2 ---> Everything Else


EDIT: Disclaimer: Reply #6 could be the simplest solution!

Smajdalf

#14
May 23, 2020, 05:13 pm Last Edit: May 23, 2020, 05:14 pm by Smajdalf
PTC Example 10ms trip, 0.35A hold
I wonder where Digikey got the 10ms number. From the datasheet:

it takes 100ms to trip when the current is 8(!)A. I think this is a LOT of charge from the power supply caps drained before the fuse trips - 800 mC, for example 8V drop for 100 000 uF cap.
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

Go Up