Wiki

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
university:courses:electronics:electronics-lab-pulse-width-modulation [20 Apr 2018 16:34] – start extra activity Antoniu Miclaus
Line 1: Line 1:
 +====== Activity: Pulse Width Modulation ======
 +
 +===== Objective =====
 +
 +In this laboratory we examine the pulse width modulation and its usage within a variety of applications.
 +
 +Pulse Width Modulation (PWM) Signal is a method for generating an analog signal using a digital source. A PWM signal consists of two main components that define its behavior: a duty cycle and a frequency. 
 +
 +The __duty cycle__ describes the amount of time the signal is in a high (on) state as a percentage of the total time of it takes to complete one cycle.
 +
 +{{:university:courses:electronics:pwm-signal.png?500|}}
 +
 +The following diagram shows pulse trains at 0%, 25%, and 100% duty cycle.
 +
 +{{:university:courses:electronics:pwm-duty.png?500|}}
 +
 +The __frequency__ determines how fast the PWM completes a cycle, and therefore how fast it switches between high and low states.
 +
 +By varying a digital signal off and on at a fast enough rate, and with a certain duty cycle, the output will appear to behave like a constant voltage analog signal when providing power to devices.
 +
 +The PWM is a technique used in transmission of information by encoding a message into a pulsing signal, also for power control of electronic devices such as motors and as principal algorithm for photo-voltaic solar battery chargers.
 +
 +===== Materials =====
 +
 +ADALM2000 Active Learning Module\\
 +Solder-less breadboard, and jumper wire kit\\
 +1 OP97 operational amplifier\\
 +1 1kΩ resistor
 +1 10kΩ potentiometer
 +
 +===== Pulse Width Modulation Principle =====
 +
 +Pulse Width Modulation (PWM) is a technique to generate low frequency output signals from high frequency pulses. Rapidly switching the output voltage of an inverter leg between the upper and lower DC rail voltages, the low frequency output can be though of as the average of voltage over a switching period.
 +
 +In its simplest form PWM output signals are constructed by comparing two control signals, a carrier signal and a modulation signal. This is known as carrier-based PWM. The carrier signal is a high frequency (switching frequency) triangular waveform. The modulation signal can be any shape.
 +
 +Using this approach, the output waveform can be made to follow any desired waveform shape. With machines, sinusoidal and trapezoidal waveform shapes are among the most common.
 +
 +Consider the circuit in Figure 1.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_carrier-sch.png?500|}} </WRAP>
 +
 +<WRAP centeralign> Figure 1. PWM Principle </WRAP>
 +
 +Following the description of the PWM principle, we use the negative input of the operational amplifier for carrier, while the positive input for the modulation signal.
 +
 +==== Hardware Setup ====
 +
 +Build the following breadboard circuit for Pulse Width Modulation.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_carrier-bb.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 2. PWM Principle breadboard circuit</WRAP>
 +
 +==== Procedure ====
 +
 +Use the first waveform generator as carrier signal providing a 4V amplitude, 2.5V offset, 1 kHz triangle wave excitation to the circuit. Use the second waveform generator as modulation signal with 3V amplitude, 2.5V offset, 50Hz sine wave.
 +
 +In the figure there are presented the two signal generator channels containing the two input signals (orange - carrier signal, purple - modulation signal).
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm-input.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 3. Input Signals </WRAP>
 +
 +Supply the op amp to +5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2.
 +
 +A plot with the output signal on channel 2 of the scope is presented in Figure 4.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm-wav.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 4. PWM output </WRAP>
 +
 + If the peak of the modulation is less than the peak of the carrier signal, the output will follow the shape of the modulation signal.
 +If instantaneous magnitude of the modulation signal is greater than the carried signal at a point in time, the output voltage should be connected to positive side of the supply (high state). If the carrier signal is greater than the modulation signal, the output should be connected to the negative side of the supply (low state).
 +
 +===== Pulse Width Control using Reference Voltage=====
 +
 +==== Background ====
 +
 +For this particular application we will use a simple operational amplifier in a switching mode configuration (see [[university:courses:electronics:electronics-lab-opamp-comparator|Activity: Op Amp as Comparator]] for further details) in order to emphasize the pulse width control of the output signal.
 +
 +Consider the circuit in Figure 5.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_ref_voltage-sch.png?500|}} </WRAP>
 +
 +<WRAP centeralign> Figure 5. Pulse Width Control using Reference Voltage </WRAP>
 +
 +The circuit works as a simple comparator where the negative input of the operational amplifier is connected to the 
 +input waveform, while the positive input acts as a threshold voltage which establishes when the transitions between high voltage output and low voltage output occur. The potentiometer acts as a voltage divider for the input reference voltage, adjusting the threshold voltage, and implicitly the duty cycle of the output signal.
 +
 +==== Hardware Setup ====
 +
 +Build the following breadboard circuit for Pulse Width Control using Reference Voltage.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_ref_voltage-bb.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 6. Pulse Width Control using Reference Voltage - Breadboard circuit </WRAP>
 +
 +
 +==== Procedure ====
 +
 +Use the first waveform generator as source Vin to provide a 5V amplitude, 1 kHz triangle wave excitation to the circuit. Use the second waveform generator as constant voltage source with 5V amplitude.
 +Supply the op amp to +5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2.
 +
 +An animated plot is presented in Figure 7.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_ref_voltage-wav.gif|}} </WRAP>
 +
 +<WRAP centeralign> Figure 7. Pulse Width Control using Reference Voltage - waveforms </WRAP>
 +
 +The output signal is a squared shaped determined by the two possible output values. We can notice that, by varying the potentiometer value, the duty cycle of the signal changes, while the frequency remains constant.
 +
 +===== PWM with Astable Multivibrator=====
 +
 +==== Background ====
 +
 +Consider the circuit in Figure 8.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_multivibr-sch.png?500|}} </WRAP>
 +
 +<WRAP centeralign> Figure 8. PWM with Astable Multivibrator </WRAP>
 +
 +The circuit shows an astable multivibrator using a single operational amplifier. The functionality is easy to understand while considering the functional principle of a Schmitt trigger (comparator circuit with hysteresis studied in [[university:courses:electronics:electronics-lab-opamp-comparator|Activity: Op Amp as Comparator]]):
 +The input of the Schmitt trigger, which is identical to the inverting input of the operational amplifier, is connected to the output of the circuit via a resistor capacitor network. While the potential at the capacitor and so at the input of the Schmitt trigger is lower than the lower threshold, the output voltage equals the positive supply voltage of the circuit. Now the capacitor is charged via the resistor R<sub>3</sub>, until the upper threshold of the Schmitt trigger is reached. As a result, the output voltage of the operational amplifier tilts to the negative supply voltage. Now the capacitor is discharged via R<sub>3</sub>, until the voltage across those device reaches the lower threshold of the Schmitt trigger. The output voltage of the operational amplifier tilts to the positive supply voltage and the whole process starts again. Besides the lower number of required elements, an advantage of this multivibrator is the better quality of the output signal. Even at very low switching frequencies, the slew rate of the output signal is very high and there are almost no distortions.
 +
 +==== Hardware Setup ====
 +
 +Build the following breadboard circuit for PWM with Astable Multivibrator.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_multivibr-bb.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 9. PWM with Astable Multivibrator Breadboard Circuit </WRAP>
 +
 +==== Procedure ====
 +
 +Supply the circuit to +/-5V from the power supply. Configure the scope so that the input signal is displayed on channel 1 and the output signal is displayed on channel 2.
 +
 +A plot with the output signal on channel 1 of the scope is presented in Figure 10.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_multivibr-wav.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 10. PWM with Astable Multivibrator output waveform </WRAP>
 +
 +Note that the duty cycle of the output signal is approximately around 50% while the low/high voltage values tend to reach the positive/negative supply values. 
 +
 +===== Extra Activity =====
 +
 +In the previous example we generated a 50% fixed duty cycle PWM using astable multivibrators. But how can we adjust the duty cycle? For this we will need to alter, slightly, the circuit.
 +
 +Consider the circuit presented in Figure 11.
 +
 +<WRAP centeralign> {{:university:courses:electronics:pwm_dc_multivibr-sch.png|}} </WRAP>
 +
 +<WRAP centeralign> Figure 10. Adjusting the duty cycle for PWM Multivibrators</WRAP>
 +
  
university/courses/electronics/electronics-lab-pulse-width-modulation.txt · Last modified: 27 Jan 2021 22:36 by Robin Getz