A decoupling capacitance can also be thought of as a small current supply at the point of load.
When a device's power pin needs a fast transient current, the decoupling caps should supply it. Otherwise, it will try to come through the inductance of the power/ground conductors and a voltage spike will be induced. V = L di/dt.
You can usually easily calculate the minimum required decoupling capacitance, for simple devices like amplifiers, or look at the datasheet for other types of devices, or use knowledge of the device and its load.
You need to know how much current might be required, in what length of time. Often, if you know what the output current can do, and how fast it should do it, then you can assume that the power pin has to be able to supply that current.
You also need to know how much you are allowed to let the power rail voltage change, when the current is supplied. It will sag when current is drawn from the capacitors and it will spike from the current coming through the rail inductance.
Use the capacitor equation:
i = C ∙ dv/dt
but use an approximate linear form of that, solved for C:
C ≥ (1/2)Δi ∙ Δt / Δv
Or, with capacitor ESR:
C ≥ ((1/2)Δi ∙ Δt) / (Δv - (Δi ∙ ESR))
Remember that C is in Farads. If you want the answer in microFarads, multiply the right side by 1000000.
Example:
If the worst-case transient current is 10 Amps in 1 us and we want the rail voltage to change by no more than 1 Volt, then we have:
C ≥ (1/2)10 ∙ 0.000001 / (1 - (10 ∙ ESR))
At this point, we can see that ESR must be much less than Δv/Δi !! The higher the ESR is, and the closer to Δv/Δi it is, the more excessive the capacitance requirement becomes. If calculating an electrolytic's capacitance, here, it is useful to first re-solve the equation using an approximation for the ESR, i.e. ESR = 0.02 / (C ∙ Capacitor_Voltage_Rating).
For the example, if we assume that the ESR = 0.01 Ohm, we get C ≥ 5.56 uF.
But if the ESR was 0.09 Ohm, the required capacitance would be ≥ 50 uF!
METHOD 2:
You could also do the same thing in a different-looking (but actually equivalent) way:
If you know the rise time of the current that the power pin might require, then you can use the following:
Choose the maximum change in rail voltage, Δv, that you can tolerate for the maximum-possible transient change of the supplied current, Δi.
That gives you a "target impedance":
Z
target = Δv/Δi
Since the magnitude of the impedance of a capacitance is
Z = 1 / (2 π f C), we can solve for C for a given Z (Ohms) and frequency f as:
C = 1 / (2 π f Z)
The frequency that is equivalent to an example rise time of 1 us is:
f = 1 / ( π ∙ trise )
f = 318 kHz
So we must stay within our target impedance limit up to at least 318 kHz, to be able to not have a rail voltage disturbance greater than Δv for any Δi.
We can calculate that in order to maintain our target impedance of Δv/Δi, we would need a total capacitance of at least
C >= 1 / (2 ∙ π ∙ f ∙ Δv/Δi)
For example, if we want to be able to draw 10 Amps in 1 us and not have the rail voltage sag by more than 1 Volt:
= 1 / (2 ∙ 3.14 ∙ 318000 ∙ (1/10))
= 5 uF or more would be required.
Note that the capacitor ESR was not accounted for, in this example. But the ESR must be much less than the target impedance!
FOR HIGHER FREQUENCIES:
For higher frequencies (i.e. faster slew rates, not repetition rates), you must find the maximum inductance that can be tolerated, in the decoupling network. This will basically tell you the maximum allowable LENGTH of the decoupling capacitors' round-trip connections, including the cap's lead spacing.
I don't have time to go into a lot of detail and would have to re-derive the equations. What I will show is not going to be totally accurate, since it won't account for all of the impedance components. But it will give you the basic idea. Anyway, once you get to high frequencies, you might as well use some expensive electromagnetic simulation/solver software, if you want to try to make everything optimal (or even just functional).
For an inductance,
V = L di/dt
So the maximum decoupling inductance we can tolerate would be:
L ≤ Δt ∙ Δv / Δi
Our previous example was NOT "high frequency". In that case, with 10 Amps in 1 us and less than 1 V rail disturbance, we would get
L ≤ 0.1 uH
But if we wanted 1 Amp in 0.1 us with no more than 0.1 Volt delta (still easy), we'd get
L ≤ 10 nH
If the common estimate of PCB trace self-inductance is used, which is 1 nH per mm, we could have 10 mm round trip, including the capacitor's lead spacing.
What will happen, for almost any more-stringent case, is that the maximum allowable inductance will not be achievable with ANY capacitor's lead spacing, not to mention trace lengths. In that case, you have to start using multiple capacitors in parallel. Theoretically, the inductance and ESR will be divided by the number of capacitors placed in parallel. BUT, if there is any mutual inductance, it partially wrecks the algebra for the inductance reduction and you won't achieve the 1/ncaps factor. It will help to place the caps such that their currents do not share the same conductor. At this point, of course, you would be using a multilayer PCB, with separate planes for power and ground, etc., and you wouldn't be able to do the proper calculations by hand.
Bypassing is also needed, in many cases. For most amplifier chips, and transistor amplifier circuits, there is a hidden high-frequency positive feedback loop through the power supply rail and a bypass cap is needed to short-circuit the high frequencies from rail to ground, to prevent HF instability or marginal stability (oscillation or ringing). Use a physically-small cap, placed within 2 mm of the power pin, with the shortest-possible connection to the load or device ground.
Here is a link to a paper that is pretty good, and has the right equations, but might be overkill for most DIYers:
http://www.si-list.net/files/published/sun/cpmt_1999.pdf
That paper was mentioned here:
http://www.sigcon.com/Pubs/news/1_6.htm
And here is a real treasure trove of design information (except they call them bypass caps instead of decoupling caps):
**broken link removed** capacitors
Cheers,
Tom