(PWM) (2023.02.13)
(PWM) (2023.02.13)
Mini-project
CUHK-IE 1
IERG3820
Mini-project
CUHK-IE 2
What is PWM?
• Represent an Analog Signal amplitude with
different duty cycle Pulse.
• A reference ramp signal is used to compare
with your input signal (VTH).
• Pulses start with ramp signal start.
• Pulses stop when the ramp signal greater http://www.circuitstoday.com/pwm-generation-and-control-using-arduino
than the analog signal.
http://microchip.wikidot.com/pwr3101:transition-to-digital-pwm
CUHK-IE 3
How to make a ramp signal?
• Charge a capacitor with a constant current.
• The voltage across the capacitor is current
dependent.
http://www.seas.upenn.edu/~ese205/labs/capacitors2/capacitors2.html
CUHK-IE 4
How to make a constant current?
• Constant current source; Q1, Q2, R1 and VR1.
• The current is controlled by VR1.
• Current mirror; Q2
• Constant current charges C1.
Ramp signal
CUHK-IE 5
Bit rate control, clock signal
• We used this circuit in delta modulation board.
CUHK-IE 6
Bit rate control, clock signal
IERG1810
• We used this circuit in delta modulation board.
CUHK-IE 7
Measure Clock(TP1) and RAMP (TP4)
• Find the relationship of the signals at TP1(clock), TP4(ramp) and
TP2(Start of ramp signal)
• What is the function of U1B & D1 in this circuit?
TP1
Clock
TP2
(Start of ramp signal)
TP4
TP4 RAMP
RAMP
TP1
Clock
TP2
CUHK-IE (Start of ramp signal) 8
PWM coder circuit
• A simple audio amplifier.
• A comparator.
• A bipolar to unipolar circuit.
Audio Comparator
amplifier
(adjustable Unipolar
offset) circuit
RAMP
CUHK-IE 9
PWM coder circuit IERG1810
• A simple audio amplifier.
• A comparator.
• A bipolar to unipolar circuit.
Audio Comparator
amplifier
(adjustable Unipolar
offset) circuit
IERG1810
RAMP
CUHK-IE 10
PWM coder circuit
Audio Comparator
amplifier
(adjustable
Unipolar
offset)
circuit
Input
signal
RAMP
TP3
TP4
TP6
TP7
CUHK-IE 11
IERG3820
Mini-project
CUHK-IE 12
How to retrieve the analog signal from
a PWM signal?
1. First edge (the red line) of the PWM signal
• It is the start point of the ramp signal.
2. Second edge (the orange line) of the PWM
signal represent the analog level of this bit
(the red dot).
3. Do sample-and-hold for the retrieved analog
signals (the green lines).
• Refer to the experiment sample-and-
hold.
4. A low pass filter to reject high frequency
harmonics.
http://microchip.wikidot.com/pwr3101:transition-to-digital-pwm
CUHK-IE 13
PWM decoder circuit?
• A edge selector with a delay circuit selects suitable edge
(rising/falling).
• The output of the edge selector controls the ramp start and
sample the analog level (Sample & Hold).
Finding First edge (TP1)
of the PWM signal
Analog switch
Finding second edge (TP3) (Sample & Hold)
CUHK-IE of the PWM signal 14
PWM decoder circuit?
• A edge finder circuit with a delay circuit.
• The output of the edge finder controls the ramp start and
sample the analog level.
Regenerated RAMP
signal (TP2)
CUHK-IE 15
PWM decoder circuit?
• A edge finder circuit with a delay circuit.
• The output of the edge finder controls the ramp start and
sample the analog level.
Regenerated RAMP
signal (TP2)
CUHK-IE 16
PWM decoder circuit?
• How to find the First edge (TP1) of the PWM signal? Current mirror
(same as PWM
Finding First edge (TP1) encoder)
of the PWM signal
U2A
Pin 2
U2A
Pin 4
U1A
Pin 3 (TP2)
CUHK-IE 17
PWM decoder circuit?
• How to find the First edge (TP1) of the PWM signal? Current mirror
(same as PWM
Finding First edge (TP1) encoder)
of the PWM signal
Delay
U2A
Pin 4
U1A
Pin 3 (TP1)
RAMP
(TP2) CUHK-IE 18
PWM decoder circuit?
• How to find the Second edge (TP3) of the PWM signal?
Analog switch
Finding second edge (TP3) of (Sample & Hold)
the PWM signal
U2F
Pin 12
U2E
Pin 10
U1B
Pin 6
CUHK-IE 19
PWM decoder circuit?
• How to find the Second edge (TP3) of the PWM signal?
Analog switch
Finding second edge (TP3) (Sample & Hold)
of the PWM signal
U2F
Pin 12
U2E
Pin 10
U1B
Pin 6
CUHK-IE 20
Sample data and audio amplifier audio
amplifier
• Use the Second
edge (TP3) to do Sampled
data
sample and hold
on RAMP signal. RAMP
First
edge
Analog switch
(Sample & Hold)
TP2
RAMP Second
edge
TP1
First edge
TP3
Second edge
Time base
TP4 = 2us
Sampled data
CUHK-IE 21
Sample data and audio amplifier audio
amplifier
• Use the Second
edge (TP3) to do Sampled
data
sample and hold
on RAMP signal. RAMP
First
edge
Analog switch
(Sample & Hold)
TP2
RAMP Second
edge
TP1
First edge
TP3
Second edge
CUHK-IE 22
END
CUHK-IE 23