DSP Control Loop Design
DSP Control Loop Design
DSP Control Loop Design
Shamim Choudhury
Texas Instruments Inc.
1
Digital Control of DC/DC Converter
DC/DC Buck Converter
Iin Io Vo
L
Vin C RL
Vin = 4V ~ 6V,
Vo = 1.6V, Io = 16A
L = 1uH, C = 1620uF, ESR = 0.004 ohm
PWM Freq = 250kHz,
Digital Control Loop Sampling Freq, fs = 250kHz,
Voltage Control Loop Bandwidth = 20kHz,
Phase Margin = 45 deg
Settling Time < 75uSec
2
Digital Control of DC/DC Converter
N N+1
Sampling period (Ts) Sampling Scheme 1
Sample to PWM Update Delay Td = 0.5Ts
PWM period n n+1 (Computation Delay)
ADC conv time Update
PWM
PWM/
ADC
Int Int
ISR
Code
execution
Context Back-ground
Execute Context spare t
save
Controller restore
N
Sampling period (Ts) N+1 Sampling Scheme 2
Sample to PWM Update Delay Td = 2.0Ts
PWM period n n+1 (Computation Delay)
ADC conv time
Update Update Update
PWM PWM PWM
PWM/ADC
Int Int
ISR
Code
execution 3
Vo(n)
∧ 7FFFFFFF
d A/D
G P (s) =
Vo PWM
∧
d Vo(n)
U(n) Vo
Gc(z) +
E(n) 2V
TMS320F2810 Vref
0 00000000
Vo (n) = Vo K d ⇒ Vo (n) max = Vo max K d
1
⇒ 7 FFFFFFh = Vo max K d ⇒ Kd = , for Vo (n) in Q31
Vo max 4
=> Kd=0.5
Digital Control of DC/DC Converter
Control Design by Emulation
1.62x10-5 s + 2.5
Vref
Gp1(s) = ---------------------------------------
1.685x10-9 s2 + 1.648x10-5 s + 1
Gc(s) = ?, Gc(z) = ?
5
Digital Control of DC/DC Converter
Use Matlab SISOTOOL for the plant Gp1(s) and design the
continuous controller Gc1(s)
Continuous System Bode Plot s-plane root locus
(Matlab) (Matlab)
Settling Time(1%)
< 45uS
BW = 25kHz, PM = 71 deg
Gp1(z)*Gc1(z)
(Matlab)
(Matlab)
8
Digital Control of DC/DC Converter
Direct Digital Control
Iin Vo
L
Vin C
RL
Kd
Ts
d D/A
∧ (ZOH) Vo(n)
Vo
GP (s) =
∧ Hc U(n) Gc(z)
E(n)
+
d
Ts
PM = 33.18 deg
ZOH = -ωTs/2
= -180f/fs
fs = 250kHz,
f = 7.25kHz,
additional
phase lag of 5.2°
PM = 28 deg f = 125kHz,
additional
phase lag of 90° 10
Digital Control of DC/DC Converter
Direct Digital Control
Hc = e-sTd
Vref
Discrete Plant Model,
Gp(z) = Z{ZOH(s).Kd.Gp(s).Hc}
Gp1(z) = (0.0494z - 0.0261)/(z2 - 1.952 z + 0.962), [Td=0, Hc = 1]
11
Direct Digital Control of DC/DC Converter
Use Matlab SISOTOOL for Gp1(z), and design Gc2(z)
Gp1(z)*Gc2(z)
(Td=0)
Loss of PM from
(Gp1*Gc2) to (Gp2*Gc2)
= 61.6-41
= 20.6 deg
13
Direct Digital Control of DC/DC Converter
Bode Plot (Measured)
Gp2(z)*Gc2(z)
14
Direct Digital Control of DC/DC Converter
Transient Response (Fpwm = 250KHz)
Gp2(z)*Gc2(z)
15
Direct Digital Control of DC/DC Converter
Effect of Computation Delay
Bode Plot (Matlab)
Plant with increased computation delay [Td = 2.0Ts],
Gp3(z) = (0.022z^2+0.017z - 0.159)/z^2(z^2 - 1.954 z + 0.963),
Controller with no delay compensation,
Gc2(z)=(14.87 z^2 - 26.91 z + 12.16)/(z^2 - 1.473 z + 0.4731 )
Loss of PM from
(Gp1*Gc2) to Gp3*Gc2
= 61.6 – (-19)
= 80.6 deg
BW = 27.9kHz, PM = -19.0 deg, GM = -2.22dB,
Unstable Loop.
Hc = 360(27900)2(4uS)
= 80.35 deg
16
Direct Digital Control of DC/DC Converter
Transient Response (Fpwm = 250KHz)
Unstable System, Uncompensated for Computation Delay
Gp3(z)*Gc2(z)
17
Direct Digital Control of DC/DC Converter
Redesigned Controller with Delay Compensation
Bode plot (Matlab)
Gp3(z)*Gc3(z)
19
Direct Digital Control of DC/DC Converter
Transient Response (Fpwm = 250KHz)
System Compensated for Computation Delay
Gp3(z)*Gc3(z)
20
Digital Control of DC/DC Converter
Voltage Mode Control: Computation Flow, Benchmark Results
TMS320C28x=150MHz
(32-bit implementation)
Sampling Freq Available
(KHz) Cycles Overhead Cycles Cycles/loop Number of Loops
120
fs/fc=5
100 fs/fc=10
fs/fc=12.5
Phase Lag (Hc)
80
fs/fc=20
60
40
20
0
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2
K
Computation Delay per unit Ts, (Td /Ts)
22
Digital Control of DC/DC Converter
Sampling Frequency (fs) Selection
fs = 12.5*fc
fs = 20*fc
fs = 30*fc
23
Digital Control of DC/DC Converter
PWM Resolution & Limit Cycle
DSP Clock Freq = 150MHz, fpwm = 250kHz, ∆Vpwm Vo
PWM Duty Ratio Resolution
= 1/(150M/250k) = 1/600 = 0.167% Vin
Sense
ADC resolution = 10bits, Vo = 2V (max), PWM circuit
Vo Sensing Resolution ∆Vad = 2V/1024 = 1.95mV
A/D
For Vin = 5V, Applied Volt Resolution ∆Vpwm1 = 5V/600 = 8.33mV,
For Vin = 2V, Applied Volt Resolution ∆Vpwm2 = 2V/600 = 3.33mV, ∆Vad
Vin = 5V
Vin = 2V
Vo = 1.6V
Vo = 0.8V
24