Power supplies: Difference between revisions

(→‎Fault Finding: Exttracted How to safely discharge capacitors into new page.)
Line 90: Line 90:
There may be several reservoir capacitors on the high-voltage side - you must make sure they're all discharged. Sometimes, most of the charge in the capacitors will have drained away through the circuitry attached to it or by leakage, but '''you don't want to discover it hasn't discharged by getting a shock''', so start by assuming they haven't discharged.
There may be several reservoir capacitors on the high-voltage side - you must make sure they're all discharged. Sometimes, most of the charge in the capacitors will have drained away through the circuitry attached to it or by leakage, but '''you don't want to discover it hasn't discharged by getting a shock''', so start by assuming they haven't discharged.


First of all, taking great care not to touch any connections at all, locate the reservoir capacitors on the high voltage side and one-by-one discharge them using a capacitor discharger consisting of a suitably prepared high-power resistor with well-insulated wires (apart from the tips) - for example see [https://www.ifixit.com/Guide/Constructing+a+Capacitor+Discharge+Tool/2177] for more info about constructing a capacitor discharger.
Make sure you know [[How_to_safely_discharge_capacitors|how to safely discharge capacitors]] and do so before proceding.


Using a capacitor discharger won't reduce the voltage instantaneously - to discharge a capacitor value C (farads) to 5% of its initial voltage using a resistor R (ohms) will take 3*R*C seconds - for example a 100uF (100*10^-6 farads) capacitor charged to 300V being discharged through a 10Kohm (10^4 ohms) resistor takes about 3 seconds to leave 15V on the capacitor. A further 3 seconds would reduce that 15V to 5% of 15V, i.e. 0.75V.
You can now safely perform a visual check, looking for any signs of overheating, or any leaking or bulging electrolytic capacitors.
 
Always double-check that the capacitors are in fact discharged using a multimeter - apply the capacitor discharger for longer to reduce the voltage further, aiming for 10V or less.
 
Now you can safely perform a visual check, looking for any signs of overheating, or any leaking or bulging electrolytic capacitors.


Check continuity from the plug through to the bridge rectifier. This will involve the fuse in the plug, maybe another fuse on the circuit board, and often a mains input filter.
Check continuity from the plug through to the bridge rectifier. This will involve the fuse in the plug, maybe another fuse on the circuit board, and often a mains input filter.

Revision as of 11:00, 13 January 2021

This page covers power supplies: different types and how they work, how to diagnose problems, and how to maybe fix them.

Summary

Many pieces of electronic equipment include a power supply unit (often abbreviated to PSU) to convert the raw electrical power from the mains or a battery to the form needed. In this page we explain the several stages in that conversion process and the different ways they can be achieved, and how to recognise the associated components.

Power supplies are often tasked with the control and conversion of a relatively large amount of power in a fairly small space, and some of that power will inevitably be wasted as heat. This heat can lead to failures.

Safety

Warning03.png
Mains driven power supplies can be dangerous to work on unless you fully understand what you're doing. They often contain large capacitors which can store dangerous voltages even after you've disconnected the mains supply.

Why is a power supply needed?

A power supply performs some or all of the following purposes:

  • Voltage conversion or current limiting:
    AC waveform
    The mains electricity supply is 240v, which is much too high for most electronic gadgets and is dangerous if fingers might be exposed to it, so a voltage reduction may be required. In a few cases (e.g. a microwave oven or the supply to a camera flash tube), conversion to a higher voltage is required. Some devices such as florescent tubes and LEDs require a particular current rather than voltage. The device or circuitry which provides this is often referred to as a ballast.
  • Isolation: Even though the voltage might be reduced, if there remains a direct electrical path to the mains it can still be dangerous. Professional power tools, especially if used outdoors, are often powered through an isolation transformer in order to break that path.
  • Rectification:
    Recified AC
    The mains supply is AC, which means it reverses direction 100 times per second (or 120 times in the US and some other countries). Whilst this is fine for heating, some forms of lighting and most electric motors, electronics normally requires DC, which just goes in one direction. Rectification is the technical term for AC to DC conversion.
  • Smoothing:
    Rectified and smoothed AC
    AC momentarily drops to zero as it reverses direction, and if you simply rectify it, it will still be dropping to zero 100 times per second. This may be fine for example if you're just using it to charge a battery, but electronic equipment generally can't cope with this. In audio equipment, for instance, it would cause a very loud buzz which would obliterate the music. Smoothing stores electrical energy to fill in the gaps and smooth the flow, a bit like the way the silencer on a car smooths the exhaust flow to make it quieter.
  • Regulation: If the input mains voltage varies, the rectified and smoothed output will vary in proportion. And unless large and expensive smoothing components are used, there will remain a certain amount of "ripple" which can cause an annoying hum in audio equipment. If the power is supplied by a battery its voltage will drop as it is exhausted. The output voltage may also fall as you take more and more current. Electronic equipment often needs a supply which is not only very smooth but a fairly precise voltage in order that the design may be optimised. Regulation provides this. There are two kinds of voltage regulator:
    • In a linear regulator, excess input power is simply absorbed and turned into heat, just a little if the excess is small or more if it's greater. This is a bit like putting a brick on the accelerator of your car and controlling your speed with the brake. It's wasteful but cheap, nevertheless it may be good enough for low power devices unless they need to squeeze the maximum life out of a battery.
    • In a switching regulator the power is switched on and off up to a few million times per second, with the on-time continually adjusted to compensate for variations in the input or the power drawn by the load. This is like a room thermostat which is on for a greater proportion of the time the colder it is outside, in order to maintain a roughly constant indoor temperature. Just as the thermal inertia of the room smooths out the temperature variations as the thermostat switches on and off, the output of a switching regulator needs to be smoothed. However, the smoothing components can be very much smaller than are required for smoothing rectified mains as they only need to store energy for typically a few millionths instead of a hundredth of a second. A small capacitor is used, and in some configurations, a small coil also stores energy as magnetism.

A well designed switching regulator can be made very efficient, but is more complicated. This used to mean that switching mode power supplies were more expensive, but this is often no longer the case. The cost of the iron and copper in a mains transformer remains high but the cost of the extra electronics in a switching mode power supply has fallen dramatically in recent years.

With just a little experience it's generally easy to tell whether a mains power supply is linear or switching mode, without even opening it, just by weighing it in your hand. A linear power supply will contain a mains transformer with a fairly heavy iron core whereas a switching-mode one will feel much lighter.

A switching-mode power supply as used with a laptop or in a phone charger generally includes all of the above elements but not in the same order. The raw mains input is rectified and roughly smoothed, giving mains voltage DC. This is then fed into a switching regulator. The switching regulator includes a transformer to provide isolation as well as to reduce the voltage to a more manageable level. Since the transformer is operating at a very high switching speed it can be much smaller than a mains transformer handling the same power, since it's transforming the power in very much smaller bites. Without a bulky mains transformer containing a lot of iron and copper, a switching-mode power supply can be made much lighter and more compact.

Linear Power Supplies

Operation

Linear Power Supplies

The animation above shows the various levels of sophistication of a linear power supply. Linear power supplies designed to run off the mains contain an iron cored transformer to provide isolation and voltage reduction and further components as required.

  • An AC power supply just contains the transformer, and maybe a fuse (shown on the input to the transformer). The transformer has 2 windings: the primary connected to the mains, and the secondary connected to the output and generally delivering a much lower voltage. You will rarely see a power supply as simple as this as most low voltage equipment needs DC, not AC.
  • A DC power supply sees the addition of a rectifier, generally consisting of 4 diodes (possibly in a single package with 4 leads) forming a bridge rectifier. The output of this is far from constant, but at least it only goes in one direction, so is good enough for a very simple battery charger.
A linear power supply
  • A smoothed power supply adds a capacitor which stores electric charge during the peaks and delivers it in the gaps between the cycles, and hence is often referred to as a reservoir capacitor. This will always leave a ripple on the output but a big enough capacitor may make it acceptably small.
  • A regulated power supply additionally contains a linear regulator. This not only removes the ripple, but also gives a fairly precise output voltage even if the mains voltage varies.

The photo shows a smoothed power supply which has been hacked with the addition of a linear regulator.

Sometimes you will find a power supply split into two parts, for example with a wall cube plugging into a mains socket and containing a smoothed power supply, and a linear regulator in the equipment itself.

Fault Finding

Fault finding in a linear power supply is straightforward once you understand how it works. You could follow these logical steps:

  • First perform a visual check. Are the mains plug and lead in good condition, with no signs of cracked or damaged insulation? Are there any visible signs of overheating or burning, in particular of the transformer? Check the reservoir capacitor for any signs of bulging or leakage. Was there any burning or overheating smell when it stopped working?
  • Test the fuse, and check for continuity from each of the live and neutral pins on the mains plug through to the transformer.
  • Test each of the 4 diodes with a test meter on the diode range. In the case of a diode bridge in a single package, test between each of the AC inputs and each of the positive and negative outputs.
  • If you can, test the reservoir capacitor. You may be able to test it in-circuit with a capacitor tester but you will get a more reliable result if you can unsolder it. (Some test meters have a capacitance range.)
  • Plug the power supply in, first making sure there is no danger of anyone touching exposed mains on the mains side of the transformer. Perform the following tests:
    • With a test meter on an AC voltage range, check the voltage on the secondary of the transformer (or the input to the bridge rectifier). It should be greater than (up to twice) the rated output voltage of the power supply. If not, the transformer may be faulty or have a broken connection.
    • With a test meter on a DC voltage range, check the voltage on the output of the bridge rectifier, or across the reservoir capacitor. This should be about 1.4 times the AC voltage on the secondary of the transformer. If not, the bridge rectifier may be faulty.
    • With a test meter on a DC voltage range, check the output of the linear voltage regulator. This should be the rated output voltage of the power supply. If not, the linear regulator is probably faulty.

Switching Mode Power Supplies

Operation

Swtching mode power supply - block diagram

In a switching mode power supply the raw AC mains is rectified with a bridge rectifier and then smoothed with a reservoir capacitor, delivering a DC voltage of around 300V (the peak voltage of the AC mains supply). This is used to drive an oscillator which turns the current back into AC or very often simply switches it on and off, typically with a frequency of 50kHz - 1MHz. This then feeds the primary winding of a transformer, serving the dual purpose of reducing the voltage and providing isolation from the mains. Where the transformer is driven with on-and-off DC rather than AC it delivers a mainly unidirectional on/off output on its secondary winding. In this case a bridge rectifier is not required and instead a single diode can be used as a rectifier, mainly just to prevent the current flowing back through the transformer from the reservoir capacitor during the off half-cycles.

An error amplifier compares the output voltage with a reference voltage and feeds a voltage proportional to the difference back to the oscillator via an opto-isolator. So if the output voltage is too high, this causes the oscillator to produce shorter pulses, or pulses at a lower frequency, or maybe even momentarily shuts the oscillator down, and conversely if the output voltage is too low. The opto-isolator consists of a LED and a photo-sensitive transistor in a single package, electrically insulated from one another. Together with the transformer, this enables the output to be completely isolated electrically from the mains supply.

In practice you will often see minor variations on the theme. The error amplifier may not exist as such; often the circuit uses the fact that a LED (as in the opto-isolator) doesn't work at all until you apply a certain minimum voltage, and so this voltage is effectively used as the voltage reference.

The oscillator is usually an integrated circuit but this very often drives a separate power transistor to actually switch the current to the transformer on and off.

There is often a filter comprising a capacitor and/or an inductor between the mains input and the bridge rectifier. This prevents any high frequencies from the oscillator leaking out onto the mains and causing interference in other equipment.

Laptops invariably come with a separate switching mode power supply and charger working as above and delivering 15 - 20V. Within the laptop itself this will drive several further switching mode power supplies to generate the several voltages required internally. These work in broadly the same way except that the bridge rectifier and reservoir capacitor are not needed since they are powered by DC from the charger. Also, there is no need for isolation as that function has already been served by the charger, and so a simple inductor is used instead of a transformer.

Low energy light bulbs often contain a switching mode power supply which again doesn't require the isolation and so may not contain a transformer.

Identification of components

Switching mode power supply - top
Switching mode power supply - bottom

The photos show the top and bottom of a switching mode power supply from a wall cube.

On the underneath you can clearly see the bridge rectifier, the oscillator integrated circuit, and the opto-isolator. The latter spans a very clear divide on the circuit board between the high and low voltage parts. Any switching mode power supply you come across without this divide (such as some cheap Far Eastern chargers) are potentially lethal and must be disposed of. (This power supply has a selectable output voltage, the yellow piece being the voltage selector.)

On the top you can clearly see the reservoir capacitor and the transformer, which like the opto-isolator, spans the high/low voltage divide. A switching transistor, driven by the oscillator, does the hard work of switching the current on and off. There is also a mains input filter.

Fault Finding

Fault-finding a switching mode power supply may be limited to a visual inspection. Beyond that it's much harder than a linear one on account of the greater complexity. Also, the prevalence of surface mount components makes repair much more difficult.

Laptop and some other "wall-cube"-type or free-standing power supplies have sealed cases and are not generally designed to be opened. If you do crack the case open it's unlikely that you would be able to re-seal it to a standard which would pass an electrical safety test. Were it to come open in use, it's likely that highly dangerous live metal parts would be exposed.

Note that it would normally be very dangerous to try to fault find a switching mode regulator by checking voltages with it switched on since it's not usually possible to expose the low voltage side without also exposing the high voltage side, which is directly connected to the mains. In any case, faults are more likely in the high voltage circuits which are often more complicated.

Before doing any fault finding, disconnect from the mains. Note also that even so, the reservoir capacitors on the mains side may retain a dangerous charge for a long time, which could potentially give you a lethal electric shock.

There may be several reservoir capacitors on the high-voltage side - you must make sure they're all discharged. Sometimes, most of the charge in the capacitors will have drained away through the circuitry attached to it or by leakage, but you don't want to discover it hasn't discharged by getting a shock, so start by assuming they haven't discharged.

Make sure you know how to safely discharge capacitors and do so before proceding.

You can now safely perform a visual check, looking for any signs of overheating, or any leaking or bulging electrolytic capacitors.

Check continuity from the plug through to the bridge rectifier. This will involve the fuse in the plug, maybe another fuse on the circuit board, and often a mains input filter.

Check each of the 4 diodes comprising the bridge rectifier. If you can, test the reservoir capacitor.

Beyond this, testing becomes increasingly difficult. The oscillator is often a integrated circuit which would be hard to test, but sometimes it will comprise one or two transistors which you may be able to unsolder and test. Check the markings on any transistors and Google for them. Should these have failed there's a good chance you can find replacements.