Silicon ChipCircuit Surgery - June 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Publisher's Letter: Publisher's Statement
  6. Publisher's Letter
  7. Feature: Techno Talk by Mark Nelson
  8. Feature: Net Work by Alan Winstanley
  9. Back Issues: Net Work by Alan Winstanley
  10. Project: AM/FM/CW Scanning HF/VHF RF Signal Generator by Andrew Woodfield
  11. Project: A low-cost 3.5-inch touchscreen for the Arduino or Micromite by Tim Blythman
  12. Project: Ultra-low-distortion Preamplifier with Tone Controls Part 3 by John Clarke
  13. Feature: Circuit Surgery by Ian Bell
  14. Feature: Practically Speaking by Mike Hibbett
  15. Feature: Make it with Micromite by Phil Boyce
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Max’s Cool Beans by Max the Magnificent
  18. PCB Order Form
  19. Advertising Index

This is only a preview of the June 2020 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • Techno Talk (June 2020)
  • Techno Talk (June 2020)
  • Techno Talk (July 2020)
  • Techno Talk (July 2020)
  • Techno Talk (August 2020)
  • Techno Talk (August 2020)
  • Techno Talk (September 2020)
  • Techno Talk (September 2020)
  • Techno Talk (October 2020)
  • Techno Talk (October 2020)
  • (November 2020)
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
  • Techno Talk (June 2025)
  • Techno Talk (July 2025)
  • Techno Talk (July 2025)
Circuit Surgery Regular clinic by Ian Bell Class-D, G and H amplifiers R egular PE author Julian Edgar suggested this month’s topic after reading an article by Mike Spence on Texas Instruments’ support forum discussing ‘look-ahead’ voltagerail boosting in class-D audio amplifiers (these circuits are also known as class-G and H amplifiers). There was also a post on amplifier classes recently from Tom Mot on the PE forum: ‘I’m fairly new to speaker amplifiers, but I understand the different classes (ie, Class-A, Class-AB, Class-D). But how would I identify the class of an amplifier, for instance if I was buying an amplifier online and the class was not mentioned (which often seems to be the case, from my experience) – how could I know the class of the amp?’ In direct response to Tom’s post we cannot say much beyond the reply on the forum from Richard Gabric; that if the information is not supplied it would be difficult to know, but class D is widely used in modern designs. This may be particularly likely for lower-costs designs, and portable personal electronics, but class D is also used in high-quality amplifiers. In this article we will look briefly at the other classes used in audio (that is A, B and AB – C, E and F are mainly used for radio-frequency signals) before concentrating on D, G and H. Classes A, B and AB A class-A amplifier is based on a single transistor operating as a linear amplifier – for example, the circuit in Fig.1. The circuit requires biasing (not shown) to put the transistor into its forward active mode, and set up at about half the supply voltage at the output with no signal present. This is a relatively simple circuit, but the bias conditions require the transistor to be conducting continuously with no signal, which wastes a significant amount of power in proportion to that provided to the load. This is characterised as amplifier efficiency – the ratio of the power actually delivered to the load (the loudspeaker in an audio amplifier) to that taken from the supply. Class-A amplifiers have poor efficiency. To improve efficiency it would be possible to bias a single transistor so that it was not conducting when there was no signal – increasing input voltage would switch the transistor on, allowing it to act as an amplifier. Unfortunately, this would result in only half of the signal being amplified – a change of the signal in the opposite direction would not switch the transistor on, and no amplification would occur. This problem can be overcome by using a pair of complementary transistors – one conducts for the positive half of the waveform and the other for the negative. This is the class-B amplifier, which is shown in Fig.2. The circuit is much more efficient than the class-A amplifier, but suffers from a problem called ‘crossover distortion’. When the signal voltage is small both transistors are off, so there is dead band in the output for low signal voltages, which means that the amplifier does not fully reproduce the signal waveform shape at its output. Class-AB amplifiers overcome crossover distortion by applying a bias voltage to each transistor in a circuit similar to class B. The bias ensures that both transistors are just + V C C conducting with no signal. Even a small change in the signal away from zero will be amplified by one of the transistors, reducing crossover distortion. The no-signal bias level can be much smaller than for class-A amplifier, thus providing better efficiency. Class AB is a compromise between classes A and B and can be designed to set the desired level of trade-off between efficiency and linearity. Note that the circuits in Fig.1 to 3 show the basic circuit topology, but not details of the circuitry required to create a working design. Efficiency and class D Class-D amplifiers are more efficient than class A, B and AB. This has been the key driving force in the significant increase in their use in recent years. The need to maximise battery life in devices such as mobile phone, and the increasing awareness of the need for greener technology, both favour energyefficient approaches to circuit design. Efficient electronics also tends to be physically smaller and lighter, which is another significant advantage in portable devices, and in achieving modern slim aesthetics in mains-powered products. Amplifiers waste any power that is dissipated in the output transistors. Ideally, all the power from the supply should go to the load; however, linear amplifiers (A, B and AB) involve some voltage being dropped across the transistor (collectoremitter (CE), or drain-source (DS)) while they are conducting, which leads to power dissipation in the transistor (equal to VCEICE or VDSIDS). As we have seen, depending + V C C + V C C Out In V bias + Out In In Out + V bias C C Fig.1. Basic class-A amplifier architecture. 40 Fig.2. Basic class-B amplifier architecture. C C Fig.3. Basic class-AB amplifier architecture. Practical Electronics | June | 2020 2 5 % duty cycl e 5 0 % duty cycl e 7 5 % duty cycl e Fig.4. Fundamentals of duty cycle. on the circuit design, the transistors may also have a bias current that means they are conducting with no signal present – this leads to continuous power wastage even when no signal is present. Class-D amplifiers achieve their high efficiency by switching their output transistors (which are usually MOSFETs) fully on and fully off. In the off state, very little current flows through the transistor – IDS is close to zero, so VDSIDS is very small. A MOSFET operated as a switch has a low voltage across it in the on state – VDS is close to zero, so VDSIDS is again very small. The switching nature of the class-D amplifier means that its output is like a square wave, or more specifically a train of pulses, so how can it reproduce an audio (music or speech) signal which is nothing like a square wave? The answer is that the pulses are produced (the transistors are switched) at much higher frequencies than the audio signal and are manipulated in such a way that if the pulses are passed through a low-pass filter, which removes frequencies at the pulse-switching rate, then the output of the filter will be the audio signal. The manipulation of the pulses is referred to as ‘modulation’. There is more than one modulation technique that can be used for class-D amplifiers. Two widely used approaches are pulse-width modulation (PWM) and pulsedensity modulation (PDM). These names are descriptive of what happens. In PWM, the width of pulses at a fixed frequency is varied in sympathy with the audio signal. In PDM, the number of fixed-width pulses per unit time is varied. In both cases, for the time). After 30ms the duty cycle increases to 50% (equal on and off times) and at 60ms it increases to 75%. The other trace (blue) shows an average value obtained by low-pass filtering the pulse waveform. This represents signal power Fig.6. LTspice schematic for a PWM modulator concept circuit. delivered to the load in a PWM system. As can be seen in Fig.5, when the a fixed pulse height (voltage), the average PWM duty cycle changes, the averaging value of the modulated signal (the pulse process means that it takes a while for train) is equal to the modulating signal (the the power level to settle down to the new audio) and can be obtained by a suitable value – this is normal for a low-pass filter low-pass filter. We will look at PWM in with a step input (the duty cycle has more detail as it is the simplest case, undergone an instantaneous changes in although many modern class-D amplifiers this example, whereas most audio signals actually use PDM. would change more smoothly). There is also a very small amount of ripple Pulse-width modulation (PWM) in the level with each pulse in Fig.5. The width of pulses produced at a The exact waveforms in a real system fixed frequency (repetition rate) can be will depend on pulse frequency and the described in terms of their duty cycle (see properties of the filtering process. Fig.5 Fig.4). Duty cycle is the proportion of the is for illustrative purposes only and does cycle period that the pulse is high for. A not aim to represent a specific system. pulse train with a 50% duty cycle is an ideal square wave, which is on for exactly half the period. Lower duty cycles have PWM uses and filtering proportionally shorter pulses and higher In addition to class-D amplifiers, PWM ones have longer pulses, as shown in is used in a wide variety of applications Fig.4. A pulse width modulator generates including switch-mode power supplies, a train of pulses such that the duty cycle and motor speed and LED brightness of each pulse is set by the modulating control. In some cases the load itself signal value at the instant each pulse is low-pass filters the pulses to provide the produced. Duty cycle has a limited range averaging function. A simple example of 0 to 100%, so excessive signal values of this is applying power to a heating will run out of duty cycle range – this is element where the element and/or the similar to a linear amplifier clipping large item being heated has a thermal time signal peaks due to its output range being constant much longer than the pulse limited by the supply voltage. duration. For control of LED brightness As indicated above, the modulating for human observation, the LEDs are signal can be recovered from the PWM actually switched on and off (flashed) pulse train by averaging the pulse signal with the PWM pulses, so the averaging voltage over time (low-pass filtering). processing occurs within the observer due The waveforms in Fig.5 illustrate the to persistence of vision. More specifically, process of averaging a PWM signal. A the PWM pulses to the LED must be faster constant frequency (1kHz) and voltage than the flicker fusion frequency, which (1V) pulse waveform (red trace) starts is the frequency at which a modulated with a 25% duty cycle (the pulse is 1V light source appears to have constant for 25% of the time and 0V for 75% of intensity to a human observer. Fig.5. Example PWM waveform. Practical Electronics | June | 2020 41 Fig.7. Relationship between the audio, triangle and PWM signals for a PWM modulator (simulation of the circuit in Fig.6). Each triangle cycle lasts 30µs. Fig.8. Simulation of the circuit in Fig.6 showing a complete cycle of the audio sinewave. For class-D audio amplifiers the loudspeaker and human ear are able to provide the filtering required to recover (demodulate) the original audio signal. An important design requirement is that to avoid potentially damaging effects, loudspeakers should not be driven with high-amplitude square waves in the audio range (20Hz to 20kHz). Fortunately, PWM pulse-train frequencies of hundreds of kilohertz to megahertz cause very little direct cone movement, and speakers will respond to the average signal level – that is the original audio signal. Furthermore, V D D the human ear also acts as a filter for signals above about 20kHz, which is well below the pulse frequency. However, class-D amplifiers using relatively low pulse frequencies may require an LC filter for demodulation. Filters may also be required on class-D amplifier outputs for reasons other than demodulation. For example, highfrequency switching can result in an amplifier producing EMI (electromagnetic interference) if an unfiltered PWM signal is sent down relatively long speaker wires without filtering. Often, ferrite beads can be used for EMI suppression rather than larger and more expensive LC filters. Class-D amplifier circuit structure Out+ Osci llator In C lass- D m odulator V D D Out– Fig.9. Outline schematic of a filterless class-D amplifier. 42 The basic structure of a class-D modulator is shown in the LTspice schematic in Fig.6. This is not intended as a practical design – it illustrates the basic concept, and LTspice provides a convenient means of drawing the waveforms. The circuit comprises a comparator driven by the audio signal and a triangle wave – both waves have zero DC offset. The audio signal is represented by a 1kHz sinewave of ±1.8V amplitude. The triangle waveform has the same amplitude as the supply voltage, ±2.5V. The triangle wave frequency is 33kHz, much lower than a typical real class-D amplifier switching frequency, but better for illustration of the general shape of the waveforms. The comparator will switch on (produce a high output voltage) when the audio signal is more positive than the trianglewave voltage. So for more positive audio voltages the output will be on for a greater proportion of the triangle wave cycle (see Fig.7). Thus, the output duty cycle will vary from 0% for an audio input voltage of −2.5V to 100% for an audio input of +2.5V. The example audio signal has a lower amplitude than these extremes, so that the modulator switches throughout the audio waveform cycle (see Fig.8). Fig.9 shows an outline schematic of a filterless class-D amplifier. Typically, the modulator has complementary outputs which drive two MOSFET push-pull switches in an H-bridge arrangement, as shown. In practice, the circuit may be more complex – for example, with feedback from the output to an error amplifier before the modulator in order to improve output signal quality. If a demodulation filter is used it will typically be a balanced secondorder LC filter, as shown in Fig.10. Note that the circuit in Fig.9 is a fundamentally analogue design – the ‘D’ in ‘class D’ does not mean ‘digital’. In digital audio systems the PWM (or PDM) output can be digitally generated, however the audio may still be converted to analogue (by a DAC) for modulation because fine control of the pulse modulation requires digital clock frequencies many times faster than the pulse rate. Class-G amplifiers At a given supply voltage, the efficiency of all the amplifier classes discussed above reduces for low signal levels – a significant proportion of the wasted power is independent of the signal level, but is dependent on the supply voltage, so a relatively high proportion is wasted at low signal levels. For typical audio signals, such as music, the level may be relatively low for a significant proportion of the time, and, in typical usage, amplifiers may be run at relatively low volumes much of the time; only being turned up loud occasionally. For the lower level signals the amplifier could operate at a lower supply level, and would be more efficient, but then would not be able to Out+ L 1 C 1 C 2 Out– L 2 Fig.10. Typical class-D amplifier output filter (if used). Practical Electronics | June | 2020 Fig.11. LTspice schematic to generate illustrative waveform for a class-G amplifier based on a class-D amplifier. in different contexts, but often the distinguishing factor is that class G has two fixed supply rails and the amplifier switches between them, whereas class H has a single variable power supply. Thus class H is like driving the supply rail of one amplifier from another amplifier. Class-G and H ICs correctly reproduce louder passages of music, or satisfy the user when high volume was required. A solution to this supply/efficiency/ output issue is to run the amplifier at a relatively low supply voltage most of the time, but switch the supply to a higher voltage (‘boost’ it) when a higher output power is needed. Amplifiers operating in this way are referred to as ‘class G’. Class-G amplifiers can be based on classAB or class-D circuits. The version based on class D is sometimes called class DG. Fig.11 shows a version of the circuit in Fig.6 in which the supply is switched between two levels depending on the audio signal level. Again, this circuit is just for showing the basic concept and for producing illustrative waveforms – it is not a practical design. As before, the pulse rate is lower than in a typical real design to provide a clearer waveform drawing. The supply voltage switching is modelled using a pair of voltagecontrolled voltage sources (E1 and E2) with a table function to set the ranges of audio voltages to control the two supply levels. The triangle waveform amplitude is matched to the supply voltage using a behavioural source (B1) to multiply a 1V waveform by the supply voltage. The PWM waveform for a single cycle of the audio signal is shown in Fig.12. Class-H amplifiers Class-H amplifiers extend the concept of controlling the supply voltage by providing either a continuously variable or stepped supply voltage matched to the signal. Specifically, for signals above a certain level, the supply is set to a voltage just above the signal output level and sufficient for amplifier operation. Again, this can be applied to both class-AB and D amplifiers. Example waveforms for a class-D version are shown in Fig.13. The LTspice circuit in Fig.11 was adapted to produce this, with the continuously variable supply being modelled using two behavioural sources in place of the E1 and E2 tablebased controlled sources. The behavioural source voltage was set using the equation V=max(3,abs(V(audio))+1.4). The pulse frequency is a little higher than the previous examples to help emphasise the pulse amplitude shape, although the individual pulses are less clear. The difference between class G and H can be confusing or inconsistent Fig.12. Amplifier waveforms from the circuit in Fig.11. Design of class-D amplifiers operating in class-G or H modes is far from trivial. Fortunately, some ICs are available which implement most of the functionality. For example, the MAX98307 from Maxim Integrated is a ‘3.3W, Mono Class DG Multilevel Speaker Amplifier’ and the TAS2562 from Texas Instruments is ‘6.1W Boosted Class-D Audio Amplifier with IV Sense’. Both devices cost in the order of a pound or two for one-off (GBP, Mouser UK prices at the time of writing) and are aimed at applications such as mobile phones, tablet PCs, Bluetooth speakers and consumer audio devices. The MAX98307 has an audio input and is relatively straightforward. The TAS2562 (the subject of the article which prompted Julian to suggest this topic) is a more complex beast, with digital audio input at up to a 96kHz sample rate via I2S/TDM/I2C interfaces. It has a large number of control registers to customise device configuration (the datasheet runs to 114 pages). Texas Instruments provide software that can calculate register values and programme the device for development purposes. The TAS2562 can operate in both class-G and class-H modes with the objective of extending battery life in portable/personal electronic devices with audio output. It uses an integrated DC-DC converter to produce the ‘boost’ supply voltage needed when higher output power is required. All class-G and H amplifiers require a means of measuring the signal and using this to adjust the supply ready for the signal level being amplified. This is relatively straightforward for the TAS2562 because it receives a stream of digital audio and holds multiple samples in its internal digital signal processing logic. Therefore, while a given sample is being applied to class-D modulator, the power supply control system can ‘look ahead’ at the later waveform samples to decide what to do with the supply voltage. The look ahead period can be in the range 1 to 20 samples, with something around 13 being typical at a 48kHz sample rate. This value is set by a control register. Simulation files Fig.13. Illustrative waveform for a class-H amplifier based on a class-D amplifier. Practical Electronics | June | 2020 Most, but not every month, LTSpice is used to support descriptions and analysis in Circuit Surgery. The examples and files are available for download from the PE website. 43