This is an old revision of the document!









Experiment 6: Operational Amplifier II - Pulse Width Modulation

  • Circuits on the breadboard
  • Integrator
  • Non-inverting Schmitt trigger
  • Triangle–square-wave generator
  • Pulse-width modulation and control of a DC motor

Challenge description

Pulse-width modulation (PWM) is widely used in modern electronics to control the power delivered to electrical loads. Typical applications include LED brightness control and motor speed control.

In PWM, the voltage applied to a load is rapidly switched on and off. When PWM is used to control an LED, a sufficiently high switching frequency prevents the human eye from perceiving the individual switching events. Instead, only the average brightness is perceived.

The brightness of the LED is determined by the duty cycle of the rectangular signal, which is defined as the ratio of the on-time to the signal period.

A constant supply voltage is available for the experiment. This raises the following questions:

  • How can a constant voltage be converted into a PWM signal?
  • How can the duty cycle of this signal be adjusted to control the brightness of the LED?

To answer these questions, two operational-amplifier circuits are investigated: the Schmitt trigger and the integrator. First, both circuits are analyzed separately. Afterwards, they are combined to form an oscillator that generates the required PWM signal. Finally, the circuit is modified to enable brightness control of the LED.




Rectangular-to-Triangle Signal Conversion - Integrator

The operation of an OPV in the linear operating range can be enforced by means of circuitry by feeding back the output signal, i.e., returning it to the inverting input (- input). In the circuit shown, the negative feedback is provided by a capacitor.

lab_electrical_engineering:integrator_circuit.svg

Analysis of the circuit:
Negative feedback

$\Rightarrow u_\mathrm{d} = 0 \Rightarrow i_R = \frac{u_\mathrm{e}}{R}$

$i_R=i_C$ (because OPV input current $i_\mathrm{n} = 0$)

$u_\mathrm{a}=-u_C=-\frac{1}{C}\int i_\mathrm{C}\,dt=-\frac{1}{RC}\int u_\mathrm{e}\,dt$
The integrated input voltage appears at the output. The product of resistance and capacitance has the character of a time constant:

$T_\mathrm{i}=RC$

lab_electrical_engineering:integrator_u-t-diagramme.svg





The figure shows the output voltage of an integrator with a square wave voltage at the input. The output voltage at the start $u_\mathrm{a}(t=0)$ depends on the charge state of the capacitor when switched on.

To analyze the behavior of the integrator, the following circuit is used:
lab_electrical_engineering:integrator_experiment.svg

Supply voltages (from power supply unit):

$UCC=+3~V, UEE~=-3~V$

Values of the components used:

$R1.3=10~kΩ, C1=10~nF$

  1. Calculate the time constant $T_\mathrm{i}$ of the integrator from the given values.







  2. Assumption: the capacitor is initially uncharged. A voltage $u_\mathrm{e}=+3~V$ is applied to the input.
    How long does it take for the output voltage to reach $u_\mathrm{Tr}=-3~V$? Document your calculation.












  3. Roughly sketch the voltage curves that you expect at the TR output when you apply a bipolar square wave signal to the $u_\mathrm{e}$ input.


    Output TR

    lab_electrical_engineering:oscilloscope_screen.svg


    Channel 1:$\frac {Volt}{Div}=$


    Time basis: $\frac {T}{Div}=$
  4. Build the circuit on the MEXLE-board. Make sure that the jumper at the bottom of the op-amp is set to the left so that the op-amp is supplied with +/- 3V. Connect channel 1 on the oscilloscope to $U_\mathrm{e}$ and channel 2 to TR. Connect the function generator to the $U_\mathrm{e}$ input. Set to square wave (bipolar) with a frequency of 3kHz and a voltage of 3 V (amplitude). Switch on the power supply.


    C1 = 10 nF, f = 3 kHz

    lab_electrical_engineering:oscilloscope_screen.svg


    Channel 1: $\frac {Volt}{Div}=$

    Channel 2: $\frac {Volt}{Div}=$


    Time basis: $\frac {T}{Div}=$
  5. Compare your measurement with the calculation from part 2 and the forecast from part 3. Explain your result.









Triangle-to-Rectangular Conversion - Schmitt Trigger

The operation of an OPV in the saturation range can be enforced in the circuit by feeding back the output signal, i.e., returning it to the non-inverting input (+ input). In the circuit shown, the feedback is provided by resistor $R_\mathrm{2}$.
lab_electrical_engineering:non_inverting_schmitt_trigger_circuit.svg

The output voltage $u_\mathrm{a}$ can only take two values, either $\mathrm{+}U_\mathrm{sat}$ or $\mathrm{-}U_\mathrm{sat}$. It switches between these two values when no voltage drops at the differential input of the OPV, ($u_\mathrm{d}=0$).
Then $i_\mathrm{R2}=\frac{u_\mathrm{a}}{R_\mathrm{2}}$ and $u_\mathrm{e}=-R_\mathrm{1} \cdot i_\mathrm{R1}$. Since the OPV input current is $i_\mathrm{p}=0$, the currents through the resistors must be equal, and the following relationship applies for the switching points: $u_\mathrm{e}=-\frac{R_\mathrm{1}}{R_\mathrm{2}}\cdot u_\mathrm{a}=\mp\frac{R_\mathrm{1}}{R_\mathrm{2}}\cdot U_\mathrm{sat}$


lab_electrical_engineering:non_inverting_schmitt_trigger_characteristic_input_output_signal.svg

The image shows the input/output characteristic curve of the circuit known as a “non-inverting Schmitt trigger.” The reaction to any input signal is shown on the right. The circuit only switches to $\mathrm{+}U_\mathrm{sat}$, when the positive switching threshold at the input is reached. It only switches to $\mathrm{-}U_\mathrm{sat}$, when the negative switching threshold at the input is reached.

To analyze the behavior of the schmitt trigger, the following circuit is used:

lab_electrical_engineering:schmitt_trigger_circuit_experiment.svg


Supply voltages (from power supply unit):
UCC = + 3V, UEE = - 3V

Values of the components used:
R2 = 20kΩ, R3 = 27kΩ

  1. Calculate the switching thresholds using the given values.




























  2. Roughly sketch the voltage curves that you expect at the SQ output when you apply a triangular signal to Ue whose amplitude just reaches the switching points.

    Output SQ

    lab_electrical_engineering:oscilloscope_screen.svg


    Channel 1:$\frac {Volt}{Div}=$


    Time basis: $\frac {T}{Div}=$


  3. Set up the Schmitt Trigger on the MEXLE-Board. Perform the following measurements on the Schmitt Trigger:
    • Connect channel 1 on the oscilloscope to 𝑈𝑒 and channel 2 to SQ.
    • Connect the function generator to the Ue input. Set it to triangle with a frequency of 1kHz and a voltage of 3 V (amplitude).
    • Sketch the oscilloscope screen image.


Ue = 3 V (amplitude), f = 1 kHz

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$



  1. Sketch the oscilloscope screen image you would expect for 1 V (amplitude).

    Ue = 1 V (amplitude), f = 1 kHz

    lab_electrical_engineering:oscilloscope_screen.svg


    Channel 1: $\frac {Volt}{Div}=$

    Channel 2: $\frac {Volt}{Div}=$


    Time basis: $\frac {T}{Div}=$



  2. Compare your measurements with the calculation from sub-task 1 and the forecast
    Explain the results.








Combination of Integrator and Schmitt Trigger - Oscillator

The circuits previously analyzed individually are now connected to form a complete system.
The integrator and the Schmitt trigger together form an oscillator. The output signal of the Schmitt trigger is fed back to the input of the integrator. Therefore, the output signal simultaneously acts as the input signal of the overall system.

lab_electrical_engineering:oscillator_overview.svg

Due to this feedback, the circuit generates a periodic signal without requiring an external input signal, apart from the supply voltages of the operational amplifiers.

The Schmitt trigger generates a rectangular signal that is integrated into a triangular signal until one of the switching thresholds is reached. At this point, the output state changes and the process repeats continuously, producing a stable oscillation.

When the circuit is first powered on, the oscillator starts due to small disturbances such as noise, offset voltages of the operational amplifiers, or slight asymmetries in the circuit. These small deviations move the system away from the unstable equilibrium point and initiate the oscillation.

To analyze the behavior of the oscillator (triangle-rectangle generator), the following circuit is used:

lab_electrical_engineering:oscillator_circuit.svg
Supply voltages (from power supply unit):
UCC = + 3V, UEE = - 3V

Values of the components used:
R1 = 200 kΩ, R1.3 = 10 kΩ, R2 = 20 kΩ, R3 = 27 kΩ, C1 = 10 nF

  1. Build the circuit on the MEXLE-board. R1 is a 200 kΩ potentiometer. Set it to a value of 200 kΩ. Perform the following measurements:
    • Connect channel 1 of the oscilloscope to TR and channel 2 to SQ. Switch on the power supply.
    • Now try to generate a minimum and maximum frequency with your circuit by turning the potentiometer R1 to the left and right stops. Perform this experiment with two capacitance values: $C1=10~nF$ and $C1=1~nF$. Enter the measured frequency values in the following table.

      lab_electrical_engineering:table_frequency_values_triangle_rectangle.svg







  2. Sketch the oscilloscope screen image at minimum and maximum frequency for the following capacitance values:

    $C1=10~nF$ and $C1=1~nF$.

    Label the lines with TR and SQ, respectively. Specify the oscilloscope settings you used.


C1 = 10 nF, f = ƒmin
lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$


Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$


C1 = 10 nF, f = ƒmax
lab_electrical_engineering:oscilloscope_screen.svg Channel 1: $\frac {Volt}{Div}=$


Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$















C1 = 1 nF, f = ƒmin
lab_electrical_engineering:oscilloscope_screen.svg

Channel 1: $\frac {Volt}{Div}=$


Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$


C1 = 1 nF, f = ƒmax
lab_electrical_engineering:oscilloscope_screen.svg Channel 1: $\frac {Volt}{Div}=$


Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$


















3. Explain how this circuit works in a few sentences.


















4. Why is it useful to use R1 as a potentiometer to vary the frequency rather than R2 or R3?

















Duty Cycle Adjustment


After combining the Schmitt trigger and the integrator, the circuit generates a periodic signal with a fixed duty cycle. For many PWM applications, however, it is necessary to adjust the duty cycle in order to control the average power delivered to the load.
In the case of an LED, changing the duty cycle directly affects the perceived brightness. Therefore, the oscillator circuit is modified so that the duty cycle can be varied to control the brightness of the LED.


To analyze how to adjust the duty cycle of the PWM-signal, the following circuit is used:

lab_electrical_engineering:duty_cycle_experiment.svg

  1. Build the circuit on the MEXLE-board. Connect channel 1 of the oscilloscope to TR and channel 2 to SQ. The duty cycle can be adjusted using R1. Perform the measurements for the minimum, maximum, and midpoint duty-cycle settings with the capacitances C1 = 10nF and C1 = 1nF. Sketch the oscilloscope screen for each case.














C1 = 10 nF, minimum duty cycle

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$
C1 = 10 nF, maximum duty cycle

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$












C1 = 10 nF, middle position

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$
C1 = 1 nF, minimum duty cycle

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$












C1 = 1 nF, maximum duty cycle

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$
C1 = 1 nF, middle position

lab_electrical_engineering:oscilloscope_screen.svg


Channel 1: $\frac {Volt}{Div}=$

Channel 2: $\frac {Volt}{Div}=$


Time basis: $\frac {T}{Div}=$






  1. Explain how this circuit works in a few sentences.









LED Brightness Control using PWM

In the final part of the experiment, LEDs are connected to the circuit and their brightness is controlled using the generated PWM signal. By adjusting the duty cycle, the average power delivered to the LEDs changes, resulting in a corresponding change in brightness.

To analyze how to adjust the brightness of LED-lamps, using a PWM-signal, the following circuit is used:


lab_electrical_engineering:pwm_brightness_adjustment_experiment.svg

  1. Build the circuit on the MEXLE-board. To do this, connect two LEDs in anti-parallel. What value must the series resistor for the LEDs have? An LED requires approx. 20 mA to operate.



















  2. Use the circuit variant with C1 = 10 nF. Vary the duty cycle and document the result.













  3. What are the advantages of this type of brightness control? Name some applications.















  4. How would the circuit have to be designed if only one LED is to be operated with brightness control?







For this experiment, you should be able to apply and explain the following concepts:

  1. “golden rules” for the negatively feedback, idealized operational amplifier
  2. deviating properties of the real operational amplifier (e.g., output swing range, slew rate)
  3. output-voltage waveform $U_A$ of the inverting integrator (inverting integrator) for different input voltages $U_E$, e.g.
    1. DC voltage
    2. square-wave voltage
    3. arbitrary voltage waveform
  4. integration time constant of the inverting integrator
  5. Schmitt trigger
    1. difference in feedback compared to the inverting integrator
    2. idealized relationship between $U_E$ and $U_A$
    3. idealized line diagram: $U_E$ and $U_A$ as a function of time
    4. switching thresholds
    5. threshold voltage
    6. hysteresis
    7. real behavior: output “in saturation”
  6. structure of the triangle–square-wave generator