Professional Documents
Culture Documents
PWM Generator
Theoretical support
PWM stands for ‘Pulse Width Modulation’ and means adjusting the width of the output square
wave. This technique has been used in Telecommunications for encoding purposes, for audio
outputs, Brightness in Smart Lighting Systems, controlling the speed of motors, etc. Pulse width
modulation is used to control the analog circuit by the digital output of the microprocessor. A PWM
wave will be produced by a comparator and a triangular wave generator. The duty cycle will be
inversely proportional to the input voltage.
Block diagram
The frequency of the oscillator in this case will be 2kHz. The oscillator has the purpose of generating
the signal that will later become a triangle waveform with the help of the triangle wave generator.
The triangle wave generator will generate a PWM waveform, with the help of a comparator, with a
duty cycle that is inversely proportional to the input voltage. Most PWM systems will not allow 0%
or 100% modulation, because the output signall would be DC and as a result it may damage other
components in its path. As a result, the amplitude of the triangular wave must be set greater than the
maximum input voltage. Low resistor values in the triangle wave generator can cause excess current
to flow from the OpAmp output, which would disort the triangular waveform.
Comparator
Gain Block
The gain block is the part where a voltage marker will be placed in order to observe the PWM
waveform. The resistor R9 has the purpose of adjusting the output voltage.
Electrical Scheme
Part2
PWM Generator
The Oscillator:
1
f= 2∗R7 = 2kHz
2∗R5∗C1∗ln ( +1)
R6
We set:
The OpAmp used will be an Op-27, that will have +9V and -9V at its inputs
In order to obtain the 2kHz frequency with the real components, their values will be adjusted as
follows:
To show the frequency we can use the FFT Plot or the formula for the period: 1/T
Triangular wave generator
For the triangular wave generator we set the value of R2, so that it will be ~8 times the size of R1 for
an optimal observation of the signal.
In this case we set R1=12.3k and R2=100k, so that the triangular wave will not be disproportionated.
The amplitude of the triangular wave will be 10V using ideal components. (Real values will slightly
change the value of the amplitude)
The comparator contains the potentiometer R15=2.2k, that allows the duty cycle of the output signal
to change. We adjust the resistors R16and R14, so that the duty cycle will vary between [30%; 60%]
𝐷𝑢𝑡𝑦𝐶𝑦𝑐𝑙𝑒
Using the formula: V = 10 − ( ) ∗ 20 we will obtain:
100
9+2
R14= 4−(−2) = 4.03k
2.2
We replace them with real components and make adjustments in order to fit the interval [30%; 60%]
The gain block contains the potentiometer R12=2.2k that will modify the amplitude of the output
signal. We adjust the resistors R11and R9, so that the amplitude will vary between [4; 5]
Calculations:
𝑅11 10
=
2.2+𝑅9 5
𝑅11 10
=
0+𝑅9 4
R9=8.8k
R11=22k
We replace them with real components and make adjustments in order to fit the interval [4; 5]
R9=10.4k
R11=22k
https://www.digikey.com/en/products/detail/analog-
devices-inc/OP27AZ/612651
PWM Generator
1). Amplitude:
As seen from the plot, the duty cycle of the signal varies between [28%; 32%], because of the 5%
tolerances in the circuit. There is a 25% chance that the duty cycle will be between 30.4% and 30.8%
We set the potentiometer to 1, in order to have a 60% duty cycle:
In this case, the duty cycle will vary from between [59.8%; 63.2%], because of the tolerances.
There is a 25% chance that the duty cycle will be between 62% and 62.2%
Next, we will analyse the variance of the amplitude of the output signal.
In this case, the amplitude varies from 3.84 to 4.36 and there is a 15% chance that the amplitude will
be 3.96, 4.08 or 4.36.
Now we set the potentiometer to 1:
The amplitude varies from 4.65 to 5.30. There is a 20% chance that the value of the amplitude will
be between 4.9 and 4.95.
It has several advantages, such as a relatively low cost, accuracy and quick response time and
prevents LEDs from overheating, while maintaining their brightness (in case of Smart Lighting
Systems).
References:
(https://www.atlantis-press.com/proceedings/icsnce-16/25859628, n.d.)
(https://www.powerelectronics.com/technologies/power-management/article/21854863/faqs-pulse-
width-modulation-pwm, n.d.)
(https://webcache.googleusercontent.com/search?q=cache:0P3l1HHS2FAJ:https://www.ti.com/lit/pd
f/slau508+&cd=2&hl=ro&ct=clnk&gl=ro, n.d.)
(https://www.youtube.com/watch?v=P3hpMeWtM7k, n.d.)
(https://en.wikipedia.org/wiki/Pulse-width_modulation, n.d.)
(http://ecee.colorado.edu/~ecen4618/lab2.pdf, n.d.)
(https://en.wikipedia.org/wiki/Duty_cycle, n.d.)
(https://www.ti.com/, n.d.)
(https://eu.mouser.com/Passive-Components/Resistors/_/N-5g9n?P=1yzefxa, n.d.)
(http://www.bel.utcluj.ro/dce/didactic/ed/, n.d.)