Monday, 27 April 2015

RS 485 description and Interfacing with Micro-controller

Introduction to RS-485

RS-485 is a multipoint communications standard set by the Electronics Industry Alliance (EIA) and Telecommunications Industry Association (TIA). RS-485 supports several connection types, including DB-9 and DB-37. Because of lower impedance receivers and drivers, RS-485 supports more nodes per line than RS-422.

RS-485 is also known as EIA-485 or TIA-485.RS-485 is effective in applications with significant electrical interference (noise) requiring a long transmission distance. Thus, the standard is often used in industrial applications. It is as an inexpensive local area network (LAN) connection that allows multiple receivers to connect within a multidrop configuration. RS-485 does not include a communications protocol.

Data transmission rates range from 35 Mbps (up to 33 feet)-100 Kbps (up to 4,000 feet). Because star and ring configurations are not recommended, equipment installed along RS-485 transmission lines (known as nodes, stations or devices) are connected as series. However, if necessary, star or ring configurations may be accommodated with special star/hub repeaters.

RS-485 uses a two-wire twisted pair bus. Although not always required, RS-485, like RS-422, may be configured with four wires as full-duplex. With certain restrictions, RS-422 and RS-485 may be co-configured.

Additionally, the RS-485 specification is used by Small Computer System Interface (SCSI)-2 and SCSI-3. RS-485 also may be used to allow remote connectivity between PCs and remote devices.

Connections of RS485
Figure 1: 2-Wire RS-485 Connections
Figure: 4-Wire Connections
 Interfacing with Micro-controller

The microcontrollers’ capabilities can be extended to communicate with other devices such as sensors, motors, switches, memories, etc., with proprietary circuits, but the circuit complexity and power consumption will be increased.
In order to overcome this problem, the protocol concept comes into the picture for reducing the circuit complexity. There are various types of serial communications that exist such as RS-232, I2C, SPI, RS-485 protocol, and so on. Among these, the RS-485 serial protocol is mostly used for high-speed and long- distance data transmission.
The RS-485 protocol is most commonly used in master to slave  or slave to slave communication wherein the master can be any type controller like  8051 microcontroller, and the slave devices can be various peripherals like ADC, EEPROM, DAC and other similar devices in the embedded system. A number of slave devices are connected to the master device with the help of the RS-485 serial bus, wherein each slave consists of a unique address to communicate with it. The following steps are used to communicate the master device to the slave:
RS-485 Master and Slave interface
RS-485 Master and Slave interface
Step1: First, the master device issues a start condition to inform all the slave devices so that they listen on the serial data line.
Step2: The master device sends the address of the target slave device which is compared with all the slave devices addresses as connected to the Tx+ and RX- lines. If any of the address matches, that device is selected.
Step3: The slave device is matched with the received address from the master, and thereafter the communication is established between both the master and slave devices on the data bus.
Step4: Both the master and slave receive and transmit the data depending on whether the communication is read or write.Then, the master can transmit 8-bit of data to the receiver.
A slave-to-slave communication like a master to slave communication, but master slave communication has slave nodes that cannot communicate with each other. In the slave-to-slave communication, each node can communicate to all other salves devices through an address.

Master to Slave Write operation:

The master and slave devices are interchange the packets of information serially by the RS-485 communication. Each packet contains the synchronization of bytes: address bytes and data bytes. Each slave has a unique address to receive the packets of data. The communication always initiates from the master device.

Advantages of RS-485 Communication

  • The RS-485 supports long distance up to 1200 meters. The speed of the communication is 1Mbp/s
  • It is protected from noise due to differential voltages
  • It is widely used in industrial automation and other wireless sensor networks
  • It has higher speed beyond 115200 baud rate
  • It allows 32 slave devices to communicate  at a time on the same data line
  • It is more suitable for system-to-system communication

                                                                                                                           Tanay Jani
                                                                                                                     BE-Q-21
                                                                                                            

Saturday, 25 April 2015

Case study, implemetation and examples of ProfiBus


                                       PROFIBUS
                                     
Introduction :
Profibus stands process field bus. it is mainly used in automation technology . Profibus is an industry-standard communications bus protocol used in process automation and sensor networks using programmable logic controllers. Profibus is a protocol for field bus communication in automation technology. Profibus links automation systems and controllers with decentralized field devices such as sensors, actuators, and encoders. Profibus networks exchange data using a single bus cable.
Profibus is a vendor-independent, open field bus standard for a wide range of applications in manufacturing and process automation. Vendor independence and openness are ensured by the international standards en 50170 and en 50254.profibus allows communication between devices Of different manufacturers without any special interface adjustment. Profibus can be used for Both high-speed time critical applications and complex communication tasks.





There are two variations of PROFIBUS in use today; the most commonly used PROFIBUS DP, and the lesser used, application specific, PROFIBUS PA:
·         PROFIBUS DP (Decentralised Peripherals) is used to operate sensors and actuators via a centralised controller in production (factory) automation applications. The many standard diagnostic options, in particular, are focused on here.
·         PROFIBUS PA (Process Automation) is used to monitor measuring equipment via a process control system in process automation applications. This variant is designed for use in explosion/hazardous areas (Ex-zone 0 and 1). The Physical Layer (i.e. the cable) conforms to IEC 61158-2, which allows power to be delivered over the bus to field 




Benefits:
Easy to use and universal
  • PROFIBUS is based on standards and modularity. User benefits are ease of use and flexibility. The single communication protocol enables fully integated solutions of continuous as well as discrete and safety-related processes to run on the same bus.
    This eliminates the need for separate systems and allows hybrid automation.
  • In process automation, the device profile ensures compatible device behavior on the bus enabling the user to choose any “profile device” of his choice.
  • Diagnostic data display is sorted according to the NAMUR NE 107 standard:
    The operator can detect the status reliably and react appropriately.
Efficient and productive
  • Efficient industrial processes require high machine and plant availability. The integrated redundancy of PROFIBUS is unreached  when it comes to uninterrupted operation.
  • As important are the extensive diagnostic messages sent from bus, field devices and process to inform about the current status and to enable timely, status-based intervention.
    The result is higher availability combined with reduced maintenance costs.
  • PROFIBUS is optimized for distributed I/O applications. Up to 126 I/O devices can be connected to a PROFIBUS DP cable. Since each I/O device can handle hundreds of connection points, this provides a very large number of connection possibilities for a single controller.
Proactive
  • PROFIBUS enables proactive management over the life cycle of a plant. When more advanced device technology is to be deployed, plant operation must not be interrupted when installing the new devices. The solution: starting in profile for PA Devices version 3.02, new devices can temporarily adopt the functionality of predecessor versions. In  this  way plant operation is not interrupted, and the additional functions can be integrated during the next maintenance phase. The ability to take advantage of device innovations is assured, and the inventory of replacement devices is significantly reduced
Innovative
  • PROFIBUS is known for its high degree of innovation: User requests are gathered and implemented rapidly. PA Profile 3.02 with its NAMUR-compliant diagnostics concept is an example.
  • Other examples are the high-effective redundancy concepts and the proxy technology, enabling the user to PROFIBUS systems to the Ethernet level (PROFINET).
  • Existing plants can be modernized and expanded at any time with PROFIBUS:
    HART technology is integrated easily, safety-related and drive tasks are solved with PROFIsafe and PROFIdrive, respectively.
  • PROFIBUS supports advanced asset management strategies that allow plants and equipment to be better managed and maintained.

Implementing the communication protocol
A broad spectrum of base technology components and development tools (PROFIBUS ASICs, PROFIBUS stacks, bus monitors, test tools and commissioning tools) and services are available for implementation of the PROFIBUS protocol. Additionally, PI competence Center and many suppliers offer support in this regard. An overview of this is found in the product catalog from PI. When implementing a PROFIBUS interface, it must be considered that the device behavior is determined by the PROFIBUS protocol and the implemented application. For this reason, the entire field device is tested during a certification test along with an eventual pretesting of the used base technology. 
  • Interface modules

    For small to medium quantities of devices, PROFIBUS interface modules are suitable which are available in a wide variety of versions on the market. They can be attached to the main PCB of the device as a supplementary module. They implement the full bus protocol and offer an easy-to-use user interface for each application.
  • Protocol chips

    For larger quantities of devices, the use of protocol chips with or without additional microcontroller is the best solution with the following alternatives:
    • Single chips, where all PROFIBUS protocol functions are integrated on the chip and which do not require a separate microcontroller (fig. 1, left). This is a hardware-only solution with a fixed functional scope. This solution using single chip ASICs is recommendable for basic IO devices. Only the components for the bus connection are required externally. 
    • Chips, which implement smaller or larger portions of the protocol, are combined with an additional microcontroller and firmware offered for the chip (fig. 1, center) to provide the  full implementation of the PROFIBUS protocol. With this form of implementation, for instance, the essential layer-2 portions of the PROFIBUS protocol are implemented with a communication module.
    • Protocol chips which already include a micro-controller in the communication module. In conjunction with firmware offered for the chip (fig. 1, right), the application communicates via an easy-to-use user interface. This soltion is used for highly time-critical applications, because the protocol chips with an integrated microcontroller already handles the entire PROFIBUS protocol autonomously and an externally-connected microcontroller can then be used entirely for the application.
Fig. 1:Different protocol chip solutions

Often the PROFIBUS chip and the supplemental protocol sofware (stack) come from different sources which increases the number of possible solutions and shows the the openness and multi-vendor capability of PROFIBUS. Pure software solutions can seldom be found on the market.
Case Study:
Project
It isn't often that an engineering team has the opportunity to build a new sugar refinery. In fact, the new refinery in Gramercy, LA is the first new one in the United States in 40 years. The refinery is a joint venture of agriculture company Cargill and the Louisiana Sugar Growers Association, involving a $220 million investment. 

Solution
Managers wanted PROFIBUS to be a key component in the new plants automation to achieve better process control, improved product quality and productivity, but - with PROFIBUS as new technology - they received many additional benefits including better energy efficiency, steam reduction, and a very smooth start up.
Siemens PCS 7 controllers formed the base platform along with redundant servers for the operator stations. Another server was dedicated to administrative tasks. PROFIBUS DP and PA constituted the control network with designers implementing fiber-optic ring to-pologies. Motor control was housed in three motor control centers that were delivered pre-wired with capability for the PROFIBUS ring in and out. The fiber ring helped during development and commissioning. Management did not wish to shut down processing so, when engineers commissioned a process, they simply unplugged the ring, plugged in the new process and re-made the ring connection.


Simocode Pro smart motor overload with PROFIBUS provided motor control, protection and key diagnostic, statistical and maintenance data. It also allowed remote configuration and eliminated the need for a controller to check initial rotation at commissioning. Managers reported that implementation of the entire refinery using this process "worked great!" 

Conclusion :
Besides many benefits in achieving better process control, better products quality, higher energy efficiency etc. PROFIBUS also helped significantly to perform installation and start up of the plant in a very smooth way.

Monday, 20 April 2015

FM Wave Generation

Frequency Modulation

Another means of encoding a wave of information is by producing a complex
wave whose frequency is varied in proportion to the instantaneous amplitude of the
information wave. Such an encoding is frequency modulation. The result of this
encoding or modulation process is a complex modulated wave whose instantaneous
frequency is a function of the amplitude of the modulating wave and differs from the
frequency of the carrier from instant to instant as the amplitude of the modulating wave
varies.
The following equation provides the equivalent formula for FM:

v(t) Asin( t M sin( t)) c f i = w + w

where,
v(t) is the instantaneous voltage
A is the peak value of the carrier
wc is the carrier angular velocity
Mf is the modulation index
wi is the modulating signal angular velocity

The FM formula is really complex. In figure 1 is the waveform of a FM signal. To solve
for the frequency components of an FM wave requires the use of the Bessel functions.
They show that frequency-modulating carrier with a pure sine actually generates an
infinite number of sidebands spaced at multiples of the intelligence frequency, fm, above
and below the carrier. Fortunately, the amplitude of these sidebands approaches a
negligible level the farther away they are from the carrier, which allow FM transmission
within finite bandwidths.

                                                  Figure 1: FM Signal Representation
The Bessel functions solution to the FM equation is

where
1 = carrier component
2 = component at ± fi around the carrier
3 = component at ± 2fi around the carrier
4 = component at ± 3fi around the carrier
To solve for the amplitude of any side-frequency component, Jn is equal to

In figure 2 is an example of a FM spectrum

                                                                 Figure 2: FM Spectrum
Center Frequency
The center frequency is that frequency assigned to the carrier, but during
modulation the carrier is not always present in the complex modulated wave and the
instantaneous frequency of the complex modulated wave varies above and below the
frequency assigned to the carrier. This assigned frequency, then, is the “center” about
which the instantaneous frequencies of the modulated wave vary.

Frequency Deviation
In FM the shift in frequency is proportional to the amplitude of the modulating
wave. A weak modulating wave will have a small peak amplitude, which will produce a
small peak frequency variation. A strong modulating wave whose peak amplitude is the
maximum that the modulating system is designed to handle will produce the maximum
peak frequency variation. Any of these peak variations from the center frequency is
called the frequency deviation (fd).
The maximum value of the frequency deviation (fD) is a system constant, and
when it is intended that the modulated wave be radiated, its magnitude is established by
law.

Frequency Swing
The overall extreme of the excursion of instantaneous frequencies from maximum
negative to maximum positive is called the frequency swing. Frequency swing,
therefore, is equal to twice the maximum design frequency deviation. In FM the
frequency swing is a system constant and is usually expressed in terms of the maximum
frequency deviation as ±fD.

Deviation Ratio
Any modulating system is intended to accommodate some specific band of
modulating frequencies. Therefore the lower limit and especially the upper limit of this
band are of importance in the design of the equipment. The upper frequency is the most
important because it determines the maximum bandwidth requirements. In FM, the
highest modulating frequency (fM) is a system constant. The ratio of the maximum
frequency deviation (fD) to the highest modulating frequency (fM) is called the deviation
ratio (D).
The deviation ratio is strictly an equipment characteristic and is a quantity used to set the
circuit bandwidth of a modulating system.

Modulation Index
There is a very important signal characteristic that resembles the deviation ratio
and under certain circumstances is equal to it. It is the ratio,

Notice, however, that fd is any frequency deviation, not necessarily maximum and fm is
any modulating frequency, not necessarily the highest. There are system restrictions that
apply; for example fd cannot exceed fD and fm cannot be greater than fM.

Bandwidth Calculations
Since the sidebands are separated by multiples of the modulating frequency, the
frequency of the highest important sidebands is given by
The overall bandwidth from the highest to the lowest side frequency whose amplitude is
15 % (or greater) of the unmodulated carrier is twice this value. In figure 3 is the
commercial FM bandwidth allocation for two adjacent stations
                         Figure 3: Commercial FM bandwidth allocation for two adjacent stations

FM Generation Circuit (Reactance Modulator)
The reactance modulator is a very popular means of FM generation and is shown
in figure 4. The reactance modulator is an amplifier designed so that its input impedance
has a reactance that varies as a function of the amplitude of the applied input voltagemodulating
signal).

                                                       Figure 4: FM Reactance Modulator

Sunday, 19 April 2015

Orthogonal frequency-division multiplexing (OFDM)

What is OFDM? 

             Orthogonal frequency-division multiplexing (OFDM) is a method of encoding digital data on multiple carrier frequencies. OFDM has developed into a popular scheme for wide band digital communication, used in applications such as digital television and audio broadcasting, DSL Internet accesswireless networkspower line network, and 4G mobile communications.Orthogonal Frequency Division Multiplexing or OFDM is a modulation format that is being used for many of the latest wireless and telecommunications standards.
OFDM has been adopted in the Wi-Fi arena where the standards like 802.11a, 802.11n, 802.11ac and more. It has also been chosen for the cellular telecommunications standard LTE / LTE-A, and in addition to this it has been adopted by other standards such as WiMAX and many more.
Although OFDM, orthogonal frequency division multiplexing is more complicated than earlier forms of signal format, it provides some distinct advantages in terms of data transmission, especially where high data rates are needed along with relatively wide bandwidths.
      Traditional view of receiving signals carrying modulation
                                   Traditional view of receiving signals carrying modulation

To see how OFDM works, it is necessary to look at the receiver. This acts as a bank of demodulators, translating each carrier down to DC. The resulting signal is integrated over the symbol period to regenerate the data from that carrier. The same demodulator also demodulates the other carriers. As the carrier spacing equal to the reciprocal of the symbol period means that they will have a whole number of cycles in the symbol period and their contribution will sum to zero - in other words there is no interference contribution.

The spectrum of an OFDM, orthogonal frequency division multiplexing signal
                                                                  OFDM Spectrum

One requirement of the OFDM transmitting and receiving systems is that they must be linear. Any non-linearity will cause interference between the carriers as a result of inter-modulation distortion. This will introduce unwanted signals that would cause interference and impair the orthogonality of the transmission.
In terms of the equipment to be used the high peak to average ratio of multi-carrier systems such as OFDM requires the RF final amplifier on the output of the transmitter to be able to handle the peaks whilst the average power is much lower and this leads to inefficiency. In some systems the peaks are limited. Although this introduces distortion that results in a higher level of data errors, the system can rely on the error correction to remove them.
To overcome the effect of multi path fading problem available in UMTS, LTE uses Orthogonal Frequency Division Multiplexing (OFDM) for the downlink - that is, from the base station to the terminal to transmit the data over many narrow band careers of 180 KHz each instead of spreading one signal over the complete 5MHz career bandwidth ie. OFDM uses a large number of narrow sub-carriers for multi-carrier transmission to carry data.
OFDM meets the LTE requirement for spectrum flexibility and enables cost-efficient solutions for very wide carriers with high peak rates. The basic LTE downlink physical resource can be seen as a time-frequency grid, as illustrated in Figure below:
The OFDM symbols are grouped into resource blocks. The resource blocks have a total size of 180kHz in the frequency domain and 0.5ms in the time domain. Each 1ms Transmission Time Interval (TTI) consists of two slots (Tslot).
LTE OFDM
Each user is allocated a number of so-called resource blocks in the time.frequency grid. The more resource blocks a user gets, and the higher the modulation used in the resource elements, the higher the bit-rate. Which resource blocks and how many the user gets at a given point in time depend on advanced scheduling mechanisms in the frequency and time dimensions.The scheduling mechanisms in LTE are similar to those used in HSPA, and enable optimal performance for different services in different radio environments.
OFDM advantages & disadvantages

OFDM advantages

OFDM has been used in many high data rate wireless systems because of the many advantages it provides.
  • Immunity to selective fading:   One of the main advantages of OFDM is that is more resistant to frequency selective fading than single carrier systems because it divides the overall channel into multiple narrowband signals that are affected individually as flat fading sub-channels.
  • Resilience to interference:   Interference appearing on a channel may be bandwidth limited and in this way will not affect all the sub-channels. This means that not all the data is lost.
  • Spectrum efficiency:   Using close-spaced overlapping sub-carriers, a significant OFDM advantage is that it makes efficient use of the available spectrum.
  • Resilient to ISI:   Another advantage of OFDM is that it is very resilient to inter-symbol and inter-frame interference. This results from the low data rate on each of the sub-channels.
  • Resilient to narrow-band effects:   Using adequate channel coding and interleaving it is possible to recover symbols lost due to the frequency selectivity of the channel and narrow band interference. Not all the data is lost.
  • Simpler channel equalisation:   One of the issues with CDMA systems was the complexity of the channel equalisation which had to be applied across the whole channel. An advantage of OFDM is that using multiple sub-channels, the channel equalization becomes much simpler.
OFDM disadvantages
Whilst OFDM has been widely used, there are still a few disadvantages to its use which need to be addressed when considering its use.
  • High peak to average power ratio:   An OFDM signal has a noise like amplitude variation and has a relatively high large dynamic range, or peak to average power ratio. This impacts the RF amplifier efficiency as the amplifiers need to be linear and accommodate the large amplitude variations and these factors mean the amplifier cannot operate with a high efficiency level.
  • Sensitive to carrier offset and drift:   Another disadvantage of OFDM is that is sensitive to carrier frequency offset and drift. Single carrier systems are less sensitive.

Usage
OFDM is used in:
  • Digital Audio Broadcasting (DAB);
  • Digital television DVB-T/T2 (terrestrial), DVB-H (handheld), DMB-T/H, DVB-C2 (cable);
  • Wireless LAN IEEE 802.11a, IEEE 802.11g, IEEE 802.11n, IEEE 802.11ac, and IEEE 802.11ad;
  • WiMAX;
  • ADSL (G.dmt/ITU G.992.1);
  • the LTE and LTE Advanced 4G mobile phone standards.
  • Modern narrow and broadband power line communications



Power Amplifiers

1. Class A Power Amplifiers
The purpose of class A bias is to make the amplifier relatively free from distortion by keeping the signal waveform out of the region between 0V and about 0.6V where the transistor’s input characteristic is non linear. Class A design produces good linear amplifiers, but are wasteful of power. The output power they produce is theoretically 50%, but practically only about 25 to 30%, compared with the DC power they consume from the power supply. Class A power amplifiers use the biasing method illustrated in Fig. 5.2.1. This method causes a standing bias current to be flowing during the whole waveform cycle, and even when no signal is being amplified. The standing bias current (the Quiescent Current) is sufficient to make the collector voltage fall to half the supply voltage, and therefore power (P = IC x VCC/2) is being dissipated by the transistor whether any signal is being amplified or not. This was not a great problem in class A voltage amplifiers, where the collector current was very small, but in power amplifiers output currents are thousands of times larger, so efficient use of power is crucial.

Transformer Coupled Class A Output
The circuit shown in fig 5.2.2 is a class A power output stage, but its efficiency is improved by using an output transformer instead of the resistor as its load. The transformer primary winding has high apparent impedance (ZP) at audio frequencies because of the action of the transformer in ‘magnifying’ the impedance of the loudspeaker. As shown by the formula:  
ZP = ZLS (NP/NS)2
The apparent impedance of the primary winding (ZP) will be the actual impedance of the loudspeaker (ZLS) multiplied by the square of the turns ratio. Although the impedance of the transformer primary winding is high, its DC resistance (at 0Hz) is practically zero ohms. Therefore while a class A voltage amplifier might be expected to have a collector voltage of about half supply, a class A power amplifier will have a DC collector voltage approximately equal to the supply voltage (+12V in Fig. 5.2.2) and because of the transformer action, this allows a voltage swing of 12V above and below the DC collector voltage, making a maximum peak to peak signal voltage (Vpp) available of 24V. With no signal, the quiescent collector current of the (medium power) output transistor may typically be about 50mA. When a signal is applied, the collector current will vary substantially above and below this level. Class A power amplifiers, using the relatively linear part of the transistors characteristics are less subject to distortion than other bias classes used in power amplifiers, and although their inferior efficiency improves when output transformers are used, the introduction of a transformer can itself produce additional distortion. This can be minimised by restricting amplitude of the signal so as to utilise less than the full power of the amplifier, but even under optimum conditions the efficiency of class A presents problems. With substantially less than 50% of the power consumed from the supply going into the signal power supplied to the loudspeaker, the wasted power is simply produced as heat, mainly in the output transistor(s). In large high power amplifiers class A is not practical. For example an amplifier used to produce 200W to a large loudspeaker system would need a 400W amplifier producing at its most efficient, 200W of wasted heat that must be dissipated by very large transistors and even larger heat-sinks if overheating, and subsequent component failure is to be avoided. Class A output stages are therefore used mainly in low to medium power output stages of 1 to 2 watt and below, such as domestic radio or TV receivers and headphone amplifiers.

2. Class B Power Amplifiers
In amplifiers using class B bias, illustrated in figure there is no standing bias current (the quiescent current is zero) and therefore the transistor conducts for only half of each cycle of the signal waveform. This dramatically increases efficiency, compared with class A. Theoretically nearly 80% efficiency can be achieved with this bias and in practical circuits, efficiencies of 50% to 60% are possible.   

The downside for this increased efficiency is that the transistor only amplifies half the waveform, therefore producing severe distortion. However, if the other half of the waveform can be obtained in some other way without too much distortion, then class B amplifiers can be used to drive most types of output device. The aim is to obtain a good power gain with as much of the energy consumed from the power supply going into the load as possible. This should be as consistent with reasonable linearity (lack of distortion), as possible. Power output stages do however produce more distortion than do voltage or current amplifiers.
 RF Power Amplifiers Using Class B
The class B bias can be used in a radio frequency (RF) output stage. Although the circuit would produce severe distortion as only half of the signal wave form produces a current in the load, because the load in this case is a tuned circuit resonating at the signal frequency, the resonating effect of the tuned circuit ‘fills in’ the missing half cycles. This method is only suitable at RF, as at lower frequencies the inductors and capacitors needed for the resonant circuit would be too large and costly for most applications. Because of the superior efficiency of class B it is a popular choice for power amplifiers, but to overcome the severe distortion caused by class B, audio amplifiers use a push-pull circuit.

Crossover Distortion
The main problem with class B push pull output stages is that each transistor conducts for NOT QUITE half a cycle. As shown in Fig. 5.3.4 distortion occurs on each cycle of the signal waveform as the input signal waveform passes through zero volts. Because the transistors have no base bias, they do not actually begin to conduct until their base/emitter voltage has risen to about 0.6V. As a result, there is a ‘Dead Zone’ of about 1.2 V around the zero volts line (between -0.6V and +0.6V) where the signal waveform is not amplified, causing a "missing" section from the output signal, resulting in unwanted distortion during the "crossover" from one transistor to the other.
The effect of this distortion on the output depends to some degree on the amplitude of the output signal, the larger the amplitude the less significant the missing 1.2 volts becomes. Also the distortion will be less severe at high frequencies where the rate of change of the wave, as it passes through zero is much faster, causing a shorter ‘step’ in the waveform. The large and varying current drawn by a powerful class B amplifier also puts considerable extra demand on the DC power supply and as the current drawn varies with the amount of signal applied, the smoothing capabilities of the power supply must be efficient enough to prevent this varying current from creating voltage changes at audio frequencies on the power supply lines. If these are not adequately removed, unintended audio feedback into earlier amplifier stages can occur and cause problems with instability. This extra demand on power supply complexity adds to the cost of class B power amplifiers. Crossover distortion is more of a problem in low and medium power class B amplifiers and the method used to eliminate it, is to use a class B amplifier that has some bias (and quiescent current) added so that the output transistors are conducting continually, and so avoiding the ‘dead zone’ of class B. As this method has some properties of both class A and class B it is called Class AB.

3. Class AB Power Amplifiers
The class AB push-pull output circuit is slightly less efficient than class B because it uses a small quiescent current flowing, to bias the transistors just above cut off as shown in figure but the crossover distortion created by the non-linear section of the transistor’s input characteristic curve, near to cut off in class B is overcome. In class AB each of the push-pull transistors is conducting for slightly more than the half cycle of conduction in class B, but much less than the full cycle of conduction of class A. As each cycle of the waveform crosses zero volts, both transistors are conducting momentarily and the bend in the characteristic of each one cancels out. Another advantage of class AB is that, using a complementary matched pair of transistors in emitter Follower mode, also gives cheaper construction. No phase splitter circuit is needed, as the opposite polarity of the NPN and PNP pair means that each transistor will conduct on opposite half cycles of the waveform. The low output impedance provided by the emitter follower connection also eliminates the need for an impedance matching output transformer.
Matching of current gain and temperature characteristics of complementary (NPN/PNP) transistors however, is more difficult than with just the single transistor type as used in class B operation. Also with no emitter resistors, due to the use of emitter follower mode, temperature stability is more difficult to maintain. Class AB therefore, can have a greater tendency towards thermal runaway. The figure illustrates the method of applying the class AB bias to a complementary pair of transistors. The two resistors R1 and R2 apply voltages to the output transistor bases so that Trl (NPN) base is about 0.6V more positive than its emitter, and Tr2 (PNP) base is about 0.6V more negative than its emitter, which is at half of VCC.

4. Class C Power Amplifiers
In Class C, the bias point is placed well below cut-off as shown in figure and so the transistor is cut-off for most of the cycle of the wave. This gives much improved efficiency to the amplifier, but very heavy distortion of the output signal. Class C is therefore not suitable for audio amplifiers. It is however commonly used in high frequency sine wave oscillators and certain types of RF amplifiers, where the pulses of current produced at the amplifier output can be converted to complete sine waves of a particular frequency by the use of LCR resonant circuits.

5. Class D Power Amplifiers 
In class D audio amplifiers, the basic operation of which is shown in Fig. 5.6.2, the audio signal is first converted to a type of digital signal called ‘Pulse Width Modulation’. This is not a digital signal within the normally accepted definition of ‘Digital’ but only in that it has two levels, high and low. When such a signal is amplified, very little power is dissipated in the amplifier, resulting in much greater efficiency than in conventional analogue amplifiers. The PWM signal is finally converted back into analogue form at the output.

Pulse Width Modulation

The figure illustrates how the audio signal is converted into a ‘pulse width modulated’ form using a comparator, which compares the audio signal, made up of relatively low frequency sine waves, with a much higher frequency triangular waveform. The output of the comparator switches to a high level if the instantaneous voltage of the triangular wave is higher than that of the audio wave, or to a low level if it is lower.The comparator output therefore consists of a series of pulses whose widths vary in relation to the instantaneous voltage of the sine wave. The average level of the PWM signal has the same shape (though inverted in this case) as the original audio signal.