This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
university:courses:electronics:electronics-lab-pulse-width-modulation [19 Apr 2018 14:20] – add new circuit Antoniu Miclaus | university:courses:electronics:electronics-lab-pulse-width-modulation [27 Jan 2021 22:36] (current) – use wp> interwiki links Robin Getz | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Objective ===== | ===== Objective ===== | ||
- | In this laboratory we examine | + | In this laboratory we examine pulse width modulation and its usage within a variety of applications. |
- | Pulse Width Modulation (PWM) Signal | + | Pulse Width Modulation (PWM) is a method for encoding |
+ | |||
+ | It is 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. | ||
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. | 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. | ||
Line 17: | Line 19: | ||
The __frequency__ determines how fast the PWM completes a cycle, and therefore how fast it switches between high and low states. | 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. | + | 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 | + | |
===== Materials ===== | ===== Materials ===== | ||
Line 29: | Line 29: | ||
1 10kΩ potentiometer | 1 10kΩ potentiometer | ||
- | ===== Pulse Width Modulation | + | ===== Pulse Width Modulator - 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 | + | 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 thought |
- | In its simplest form PWM output signals | + | Besides that, there are also other several ways of generating pulse-width modulated |
- | Using this approach, the output waveform can be made to follow | + | One of the simplest methods of generating a PWM signal is to compare 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 a PWM representation of any desired waveform shape. With machines, sinusoidal and trapezoidal waveform shapes are among the most common. | ||
Consider the circuit in Figure 1. | Consider the circuit in Figure 1. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
- | <WRAP centeralign> | + | <WRAP centeralign> |
- | 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. | + | 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. Thus, a higher modulation signal will result in an output that is at a high level for a greater fraction of the PWM period. |
==== Hardware Setup ==== | ==== Hardware Setup ==== | ||
Line 51: | Line 53: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
==== Procedure ==== | ==== 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. | + | Use the first waveform generator as the carrier signal providing a 4V amplitude |
+ | |||
+ | Supply the op amp with +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 . | ||
In the figure there are presented the two signal generator channels containing the two input signals (orange - carrier signal, purple - modulation signal). | In the figure there are presented the two signal generator channels containing the two input signals (orange - carrier signal, purple - modulation signal). | ||
Line 63: | Line 67: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | 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 of the output signal on channel 2 of the scope is presented in Figure 4. |
- | + | ||
- | A plot with the output signal on channel 2 of the scope is presented in Figure 4. | + | |
<WRAP centeralign> | <WRAP centeralign> | ||
Line 71: | Line 73: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | 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 the instantaneous magnitude |
- | If instantaneous magnitude of the modulation signal is greater | + | |
+ | If the peak of the modulation | ||
- | ===== Pulse Width Control using Reference | + | ===== Pulse Width Control using a DC modulation |
==== Background ==== | ==== Background ==== | ||
- | For this particular application we will use a simple operational amplifier in a switching mode configuration (see [[university: | + | For this particular application we will use a simple operational amplifier in a switching mode configuration (see [[university: |
Consider the circuit in Figure 5. | Consider the circuit in Figure 5. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
- | <WRAP centeralign> | + | <WRAP centeralign> |
The circuit works as a simple comparator where the negative input of the operational amplifier is connected to the | 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. | + | carrier |
==== Hardware Setup ==== | ==== Hardware Setup ==== | ||
- | Build the following breadboard circuit for Pulse Width Control using Reference | + | Build the following breadboard circuit for Pulse Width Control using a DC modulation |
<WRAP centeralign> | <WRAP centeralign> | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
==== Procedure ==== | ==== 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. | + | Use the first waveform generator as source Vin to provide a 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. | 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. | ||
Line 107: | Line 110: | ||
<WRAP centeralign> | <WRAP centeralign> | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
- | The output signal is a squared shaped determined by the two possible output values. We can notice | + | The output signal is a PWM representation of the input voltage. Notice |
- | ===== PWM with Astable Multivibrator===== | + | ===== Fixed 50% PWM with Astable Multivibrator===== |
==== Background ==== | ==== Background ==== | ||
Line 117: | Line 120: | ||
Consider the circuit in Figure 8. | Consider the circuit in Figure 8. | ||
- | <WRAP centeralign> | + | <WRAP centeralign> |
<WRAP centeralign> | <WRAP centeralign> | ||
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: | 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: | ||
- | 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 | + | 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 capacitor |
+ | |||
+ | The advantage of this circuit | ||
+ | |||
+ | ==== Hardware Setup ==== | ||
+ | |||
+ | Build the following breadboard circuit for PWM with Astable Multivibrator. | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ==== Procedure ==== | ||
+ | |||
+ | Supply the circuit to +/-5V from the power supply. Configure the scope so that the output signal | ||
+ | |||
+ | A plot with the output signal on channel 1 of the scope is presented in Figure 10. | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | Note that the duty cycle of the output signal is approximately around 50% while the low/high voltage values tend to reach the positive/ | ||
+ | |||
+ | ===== 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 the circuit slightly. | ||
+ | |||
+ | Consider the circuit presented in Figure 11. | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | The resistor R< | ||
+ | |||
+ | ==== Hardware Setup ==== | ||
+ | |||
+ | Build the following breadboard circuit for adjusting the duty cycle for PWM with Multivibrators. | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | ==== Procedure ==== | ||
+ | |||
+ | Supply the circuit to +/-5V from the power supply. Configure the scope so that the output signal is displayed on channel 1 and the voltage on the capacitor (at the negative input of the op amp) is displayed on channel 2. | ||
+ | |||
+ | Vary the potentiometer value and notice the duty cycle change. A plot example is presented in Figure 13. | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | <WRAP centeralign> | ||
+ | |||
+ | In this example the duty cycle was set to around 25%. Whenever the duty cycle is altered, | ||
+ | |||
+ | ===== Going Further with the Lab ===== | ||
+ | |||
+ | All the activities in this laboratory are based on a simple op-amp (OP97) configured as comparator. The ADALP2000 Parts Kit contains also the comparator AD8561, designed for this single purpose. Therefore, the performance of the PWM circuits might be increased by using this part. | ||
+ | |||
+ | Build the above discussed circuits using AD8561 from the Parts Kit and discuss any noticeable changes of the circuit behavior and the input/ | ||
+ | |||
+ | <WRAP round download> | ||
+ | **Lab Resources: | ||
+ | * Fritzing files: [[downgit> | ||
+ | * LTspice files: [[downgit> | ||
+ | </ | ||
+ | ===== Further Reading ===== | ||
+ | Some additional resources: | ||
+ | * [[wp> | ||
+ | * [[university: | ||
+ | * [[adi> | ||
+ | **Return to Lab Activity [[university: | ||