You are on page 1of 101

台灣新竹‧交通大學‧電機控制工程研究所‧808實驗室

電源系統與晶片、數位電源、馬達控制驅動晶片、單晶片DSP/FPGA控制
Lab-808: Power Electronic Systems & Chips Lab., NCTU, Taiwan
http://pemclab.cn.nctu.edu.tw/

利用PSIM與MATLAB學習
DC-DC Converter之頻率響應模擬
國立交通大學 電機與控制工程研究所

2018年10月5日
Lab808: 電力電子系統與晶片實驗室
Power Electronic Systems & Chips, NCTU, TAIWAN
LAB808
NCTU 台灣新竹•交通大學•電機控制工程研究所

Filename: \A01 投影片:電力電子 (研究所)\PE-00:Blank Slides.ppt 1/112


Contents

1. Setup PSIM
2. Setup MATLAB
3. PSIM 基本操作
4. Buck Converter開迴路頻率響應模擬
5. Buck Converter閉迴路頻率響應模擬

2/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

1. Setup PSIM

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

3/112
下載PSIM 9.0.3

4/112
Opening The PSIM 9.0.3 File

Clicking the .exe

5/112
Setup Steps

1 2

3 4

6/112
Setup Steps (Con’t)

1 2

記錄此安裝路徑

3 取消勾選然後Finish 4

7/112
Setup Steps (Con’t)

將資料夾內檔案複製至安裝路徑下並取代原本的檔案

8/112
Setup Steps (Con’t)

雙擊Register登入註冊值,即可正常使用PSIM

9/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

2. Setup MALAB

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

10/112
Setup Steps

1.到交大網站: 3.依照網站指示完成安裝
https://ca.nctu.edu.tw/installation/category/matlab

2.下載MATLAB單機版

11/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

3. PSIM基本操作

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

12/112
Open A New File

1 New workspace

13/112
Main Working Functions

Run simulation 觀看波形圖

常用元件

14/112
Selecting Elements

所有元件

15/112
Placing Elements

1.點選元件後在電路圖
中連續點左鍵即可連續
放置相同元件,如要取
消則按Esc

2.在未放下元件前點選
滑鼠右鍵則可以將元件
旋轉90度

16/112
Placing Elements (Cont.)

注意:點各元件左鍵
兩下可以修改各元
件值,其中Current
旋轉90度、 拉線 flag的值設為1,即
鏡射、翻轉 可在模擬後查看元
件通過的電流大小

注意:勾選Display
可以在元件旁顯示
名稱和元件特性數

17/112
Series RL Circuit

L
+ +
Vd +


R Vo
- -

18/112
Probe Setting

Run simulation
Differential or press F8
voltage probe

Voltage and current probe

19/112
Simulation Control Setting

Total time : Simulation length

Print time : Display starting time

20/112
Waveform Display Selection

21/112
Waveform Display

22/112
Add Screen

Click to add waveforms in another screen

23/112
Add/Delete Curves

Click to add waveforms in the same screen

24/112
Zoom in

Click to zoom in

25/112
Measure

Click to measure signal

Values of measurement

26/112
View Menu

Step1:Click to choose a curve

Step2:View each values

27/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

4. Buck Converter之開迴路頻率響應

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

28/112
Introduction

◼ Analog voltage mode control scheme ◼ 教學目的


of the synchronous buck converter
➢ 利用PSIM得到左系統之開迴路頻率響應

➢ 小信號擾動之穩態工作點:
V𝑔 = 5𝑉, V𝑜 = 1.8𝑉, 𝐼𝑜 = 5𝐴

◼ 模擬步驟

1.確認轉換器是否到達指定工作點

➢ 透過時域響應確認穩態

2.開迴路頻率響應模擬
𝑜 𝑣ො (𝑗𝜔) 𝑣ො (𝑗𝜔)
➢ 以10%擾動掃描 𝑑(𝑗𝜔)
෠ 、 𝑖Ƹ 𝑜(𝑗𝜔)
𝑜

➢ 與理論之頻率響應比較

➢ 觀察擾動對應之時域模擬,得知掃描結果之線性度
(Nature Sampled PWM)

29/112
Static Characteristic of Ideal Buck Converter

◼ Ideal buck converter ◼ Static Characteristic

low pass filter 𝑉𝑜


𝐷
𝑉𝑖𝑛
𝑖𝑜 (𝑡)
𝑖𝑖𝑛 (𝑡) 𝑣𝐿 (𝑡)

𝐿 𝑖𝑐 (𝑡)

𝑉𝑖𝑛 𝑣𝑠𝑤 (𝑡) 𝐶 𝑅 𝑣𝑜 (𝑡)


𝐷
1

Ideal conversion ratio :

𝑣𝑠𝑤 (𝑡) 𝑉𝑜
𝑀 𝐷 = =𝐷
𝑉𝑖𝑛 𝑉𝑖𝑛
𝑣𝑠𝑤 (𝑡) = 𝑉𝑖𝑛 𝐷
Ideal efficiency:

𝐷𝑇𝑠 𝑇𝑠 η = 100%

30/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

4.1穩態工作點確認

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

31/112
Buck Converter PSIM Model

32/112
LC Filter Construction

(2) 雙擊元件設定參數

(1) 選取RLC元件
33/112
PWM Model Construction
同名稱的Label互相連接

(1)

(3)
(4)

(2)

(1) (2) (3) (4)

34/112
Add Current Sources

(1)由Element選擇元件 (2) 根據定義之操作點設定電流大小


(V𝑔 = 5𝑉, V𝑜 = 1.8𝑉, 𝐼𝑜 = 5𝐴)

35/112
Transistor Parameters Setting

(1) double click (2) 將電晶體設定成理想開關

36/112
Triangular Wave Setting

(1) double click

(2)
V_peak_to_peak : 載波峰對峰值

Frequency : 載波頻率
(3) 設定成
trailing-edge pwm
Duty Cycle : 載波工作週期
𝑟(𝑡)
D=1 DC Offset : 載波抬升值
1V
0V t
1𝑢𝑠

37/112
Simulation Control Setting

double click

使time step << 𝑇𝑠


本例設為0.001倍

Total time 使電路進入穩態

38/112
Duty Cycle Setting
(3) 開始模擬
(1) 計算操作點對應之duty cycle

➢ 定義之操作點:

V𝑔 = 5𝑉, V𝑜 = 1.8𝑉, 𝐼𝑜 = 5𝐴

➢ Ideal conversion ratio:

𝑉𝑜
𝑀 𝐷 = =𝐷
𝑉𝑖𝑛

1.8
= = 0.36
5

(2) 設定duty cycle

39/112
Duty Cycle Setting

(4) 觀察穩態是否到達指定操作點 查看數值

未達到1.8V

40/112
穩態工作點確認(𝑽𝒈 = 𝟓𝑽, 𝑽𝒐 = 𝟏. 𝟖𝑽, 𝑰𝒐 = 𝟓𝑨)

(6) 確認沒有遺漏之探棒

(7) 微調duty使穩態進入操作點:0.36 → 0.39


8

(8) 執行模擬

41/112
穩態工作點確認(𝑽𝒈 = 𝟓𝑽, 𝑽𝒐 = 𝟏. 𝟖𝑽, 𝑰𝒐 = 𝟓𝑨)

(9) 操作點確認完成

各變數皆到達操作點

42/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

4.2開迴路頻率響應

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

43/112
𝒖到ෝ
如何得到ෝ 𝒗𝒐 之頻率響應?

振幅10%之弦波, 𝑉𝑔 = 5𝑉
1.8V
頻率𝑓𝑝𝑒𝑟𝑡 = 1𝐾𝐻𝑍~200𝐾𝐻𝑍 PWM Modulator

30𝑚Ω 1𝜇𝐻 𝑣𝑜 (𝑡) = 𝑉𝑜 + 𝑣ො𝑜 (𝑡)

𝑢(𝑡)
ො 0.8𝑚Ω
𝐼𝑜 = 5𝐴
𝑈 = 0.39 𝑉𝑟 =1V 200𝜇𝐹

𝑓𝑠 =1MHZ

𝑣ො𝑜 (𝑗𝜔)
◼ 模擬對象:𝐺𝑣𝑑 𝑗𝜔 = ෝ(𝑗𝜔)
𝑢

◼ 利用PSIM之AC Sweep功能,自動掃描𝑢ො 𝑝𝑒𝑟𝑡 (𝑡)且取得𝑣ො𝑜 (𝑡)在𝑓𝑝𝑒𝑟𝑡 下之基本波,繪製成bode plot。

◼ 利用Matlab繪製理論之頻率響應,與PSIM模擬比較。

44/112
頻率響應模擬:𝑮𝒗𝒅 𝒋𝝎

45/112
頻率響應模擬:𝑮𝒗𝒅 𝒋𝝎

2
1.加入duty擾動
2 2.設定AC Sweep

46/112
頻率響應模擬:𝑮𝒗𝒅 𝒋𝝎

2.設定AC Sweep

2 Flag for point=0:


Points are distributed linearly in LOG10 scale

Flag for point=1:


Points are distributed linearly in linear scale

1.加入duty擾動
與擾動源同名

若曲線不夠完整可增加其它頻率

47/112
頻率響應模擬:𝑮𝒗𝒅 𝒋𝝎

48/112
頻率響應模擬:𝑮𝒗𝒅 𝒋𝝎

1. 設定simulation control
2. 開始掃描 Time step:
設為開關週期0.1%

Total time:
使電路進入穩態

49/112
Simulation Result for 𝑮𝒗𝒅 𝒋𝝎

50/112
以Matlab比較理論與模擬之頻率響應

1. 將PSIM模擬之頻率響應存成txt檔

51/112
以Matlab比較理論與模擬之頻率響應

2. 將Matlab .m檔,建立在與.txt檔相同的目錄 PSIM txt檔

3. Matlab程式

%% define variable;
clc;
clear;
L=1e-6;
C=2e-4; 13個掃描頻率
rC=8e-4;
rL=3e-2;
fs=1e06;
Vg=5;
f=logspace(log10(fs/1000),log10(fs),100);
s=j*2*pi*f;
data_size=13;
linewidth=2; 建立理論之頻率響應

%% Average model of buck


Gvd=Vg.*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));

%% simulated
% Gvd 匯入PSIM數據
f_Gvd=dlmread('Gvd.txt','',[1 0 data_size 0]);
amp_Gvd=dlmread('Gvd.txt','',[1 1 data_size 1]);%db
phase_Gvd=dlmread('Gvd.txt','',[1 2 data_size 2]);
52/112
以Matlab比較理論與模擬之頻率響應

%% plot fr
%Gvd
%amplitude
figure(1) 理論之magnitude繪製
subplot(2,1,1);
semilogx(f,20*log10(abs(Gvd)),'b','DisplayName','theoretical','LineWidth',linewidth);
grid on
hold on
semilogx(f_Gvd,amp_Gvd,'bo','DisplayName','simulated','LineWidth',linewidth);
title('d2vo');
xlabel('frequency(HZ)'); PSIM模擬之magnitude bode plot繪製
ylabel(‘Magnitude(dB)');
legend('show');
%phase 理論之phase bode plot繪製
subplot(2,1,2);
semilogx(f,180/pi.*phase(Gvd),'b','DisplayName','theoretical','LineWidth',linewidth);
hold on
semilogx(f_Gvd,phase_Gvd,'bo','DisplayName','simulated','LineWidth',linewidth);
grid on
xlabel('frequency(HZ)'); PSIM模擬之phase bode plot繪製
ylabel('phase(dB)');
legend('show');
xlabel('frequency(HZ)');
ylabel('phase(dB)');
legend('show');
axis([1e3 1e6 -180 0]);
53/112
以Matlab比較理論與模擬之頻率響應

4. Matlab程式執行結果

54/112
如何確定𝑢到
ො 𝑣ො𝑜 為LTI系統?

(a) 由電路模擬得知𝑣ො𝑜 波形

振幅10%之弦波, 𝑉𝑔 = 5𝑉
頻率𝑓𝑚 = 1𝐾𝐻𝑍~200𝐾𝐻𝑍 1.8V
PWM Modulator

30𝑚Ω 1𝜇𝐻 𝑣𝑜 (𝑡) = 𝑉𝑜 + 𝑣ො𝑜 (𝑡)

𝑢ො 𝑝𝑒𝑟𝑡 (𝑡) 0.8𝑚Ω


𝐼𝑜 = 5𝐴
𝑈 = 0.39 𝑉𝑟 =1V 200𝜇𝐹
𝑓𝑠 =1MHZ

(b) 由掃描之頻率響應計算𝑣ො𝑜 波形 ◼ 兩方法得到之𝑣ො𝑜 (𝑡)一致性為何?

𝐺𝑣𝑑 (𝑠) ➢ 從(a)觀察𝑣ො𝑜 (𝑡)在擾動頻率下之THD

➢ 比較(a)、(b)之𝑣ො𝑜 (𝑡)基本波有無不同
𝑢ො 𝑝𝑒𝑟𝑡 (𝑡) 𝑣෠𝑜ҧ (𝑡)
➢ 觀察(a)是否符合LTI系統之定義

55/112
𝑣ො𝑜 (𝑡)之THD分析

1.設定duty擾動(10% , 1kHZ) 2.按右鍵關掉AC Sweep和 3.設定simulation control


AC Sweep Probe

每10個time step
輸出1次數據

4.開始模擬

56/112
𝑣ො𝑜 (𝑡)之THD分析

(2)
5.得到擾動量:𝑣ො𝑜 𝑡 = 𝑣𝑜 𝑡 − 𝑉𝑜

(1)

(3)

57/112
𝑣ො𝑜 (𝑡)之THD分析

6.截取一個完整週期

58/112
𝑣ො𝑜 (𝑡)之THD分析

7. 9.THD分析結果

8.

59/112
𝑢ො 𝑡 × 0.05 𝑣ො𝑜 (𝑡) 𝑣෠𝑜ҧ (𝑡)
𝑣ො𝑜 (𝑡)之THD分析
➢ sine perturbation in duty
𝑣෠𝑜ҧ (𝐽𝜔)
Frequency:1k~200KHZ 𝐺𝑣𝑑 𝐽𝜔 =
𝑢ො 𝐽𝜔
Magnitude:10%

𝑢ො 𝑡 × 0.25 𝑣ො𝑜 (𝑡) 𝑣෠𝑜ҧ (𝑡)


magnitude:-23.8dB;phase:-171.4˚
Frequency:100KHZ ;THD:8.4%

𝑢ො 𝑡 × 0.02 𝑣ො𝑜 (𝑡) 𝑣෠𝑜ҧ (𝑡)

magnitude:-11.4dB;phase:-171.2˚
Frequency:50KHZ ;THD:2%

magnitude:-32dB;phase:-169˚
➢ 從時域響應可觀察到,ෝ 𝒗𝒐 (𝒕)之THD隨擾動頻率增加,所以擾動頻率越高, Frequency:166KHZ ;THD:23%
ෝ𝒐 (𝒕)就越難以線性系統近似。
𝒗
60/112
如何得到開迴路輸出阻抗?

𝑣ො𝑜 (𝑗𝜔)
𝑉𝑔 = 5𝑉 𝑍𝑜 𝑗𝜔 = −
1.8V 𝑖𝑜Ƹ (𝑗𝜔)
PWM Modulator

30𝑚Ω 1𝜇𝐻 𝑣𝑜 (𝑡) = 𝑉𝑜 + 𝑣ො𝑜 (𝑡)

0.8𝑚Ω 𝑖Ƹ𝑜 (𝑡)

𝑉𝑟 =1V 200𝜇𝐹
𝑈 = 0.39 𝐼𝑜 = 5𝐴
𝑓𝑠 =1MHZ

振幅10%之弦波,
𝑓𝑝𝑒𝑟𝑡 = 1𝐾𝐻𝑍~200𝐾𝐻𝑍

◼ 利用PSIM之AC Sweep功能,繪製成bode plot。

◼ 利用Matlab比較理論與模擬之頻率響應

61/112
頻率響應模擬:𝒁𝑶 𝒋𝝎

1.加入電流擾動:選擇壓控電流源

62/112
頻率響應模擬:𝒁𝑶 𝒋𝝎
𝑣ො𝑜 (𝑗𝜔)
2. 為了模擬𝑍𝑜 𝑗𝜔 = − ,電流擾動源要乘負號 3. 歸零duty擾動
𝑖Ƹ𝑜 (𝑗𝜔)

63/112
頻率響應模擬:𝒁𝑶 𝒋𝝎

4. 將擾動源加進AC Sweep,擾動大小為10% × 5A 5. 設定simulation control

6. 執行模擬

64/112
Simulation Result for 𝒁𝑶 (𝒋𝝎)

65/112
以Matlab比較理論與模擬之𝒁𝑶 (𝒋𝝎)

1. 將PSIM模擬之頻率響應存成txt檔

2. 將Matlab .m檔,建立在與.txt檔相同的目錄

3. Matlab程式
%% defineclear;
clc;
clear;
L=1e-6;
C=2e-4;
rC=8e-4;
rL=3e-2;
fs=1e06;
Vg=5;
f=logspace(log10(fs/1000),log10(fs),100);
s=j*2*pi*f;
data_size=13;
linewidth=2;
%% Average model of buck
zo=(s.*L+rL).*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));
%% simulated
%Zo
f_Zo=dlmread(‘Zo.txt','',[1 0 data_size 0]);
amp_Zo=dlmread('Zo.txt','',[1 1 data_size 1]);%db
phase_Zo=dlmread('Zo.txt','',[1 2 data_size 2]); 66/112
以Matlab比較理論與模擬之頻率響應

%output impedance
figure(2)
%magnitude
subplot(2,1,1);
semilogx(f,20*log10(abs(zo)),'b','DisplayName','theoretical','LineWidth',linewidth);
hold on
semilogx(f_Zo,amp_Zo,'bo','DisplayName','simulated','LineWidth',linewidth);
grid on
title(‘open loop output impedance-Zo');
xlabel('frequency(HZ)');
ylabel('amplitude(dB)');
legend('show');
axis([1e3 1e6 -60 -10]);
%phase
subplot(2,1,2);
semilogx(f,180/pi.*phase(zo),'b','DisplayName','theoretical','LineWidth',linewidth);
hold on
semilogx(f_Zo,phase_Zo,'bo','DisplayName','simulated','LineWidth',linewidth);
grid on
xlabel('frequency(HZ)');
ylabel('phase(dB)');
legend('show');
axis([1e3 1e6 -100 50]);

67/112
以Matlab比較理論與模擬之頻率響應

4. Matlab程式執行結果

68/112
Power Electronic Systems & Chips Lab., NCTU, Taiwan

5.Buck Converter之閉迴路頻率響應

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機控制工程研究所

69/112
Averaged Small-Signal Modeling of the Buck Converter

◼ Open loop structure of the buck converter ◼ transfer functions of the model
𝑆
𝑉𝑔 = 5𝑉 1+
𝜔𝐸𝑆𝑅
𝑣𝑜 𝑡 = 𝐺𝑣𝑑 s = 𝑉𝑔
𝑆2 𝑆
2 + 𝑄𝜔 + 1
PWM Modulator
𝑟𝐿 𝑉𝑜 + 𝑣ො𝑜 (𝑡) 𝜔0 0
𝑢= 𝐿
𝑈 + 𝑢(𝑡)

𝑟𝑐 𝑖𝑜 (𝑡) 𝑆 𝐿
= 𝐼𝑜 + 𝑖𝑜Ƹ (𝑡) 1+ 1+𝑠
𝑉𝑟 𝐶 𝜔𝐸𝑆𝑅 𝑟𝐿
𝑍𝑜 s = 𝑟𝐿
𝑆2 𝑆
𝑓𝑠 2 + 𝑄𝜔 + 1
𝜔0 0

◼ Averaged small-signal model 1


𝐺𝑝𝑤𝑚 s = =1
𝑉𝑟
𝑖መ𝑜ҧ (𝑡)

𝐿
𝑍𝑜 (𝑠) 1 1 𝐶
𝜔𝐸𝑆𝑅 = ,𝜔0 = ,𝑄 =
𝑟𝑐 𝐶 𝐿𝐶 𝑟𝑐 +𝑟𝐿
𝑢(𝑡)
ො 𝑣෠𝑜ҧ (𝑡)
𝐺𝑝𝑤𝑚 (𝑠) 𝐺𝑣𝑑 (𝑠)

70
Averaged Small-Signal Modeling of the Buck Converter

◼ Analog voltage mode control scheme ◼ Closed loop transfer functions


of the synchronous buck converter
𝑢 𝑡 𝑣𝑜 𝑡 ➢ Voltage sensor:𝐻 s = 1

➢ System dynamic is determined by


𝑣𝑟𝑒𝑓 𝑡
loop Gain 𝑇 s :
𝑣𝑠 𝑡 𝑇 s = 𝐺𝑐 𝑠 𝐺𝑝𝑤𝑚 𝑠 𝐺𝑣𝑑 𝑠 H(s)

𝑣ത෠𝑜 (𝑠) 𝑇 s
➢ = 1+𝑇
𝑣ො 𝑟𝑒𝑓 (𝑠) s
◼ Small-signal block diagram 𝑖መ𝑜ҧ (𝑡)

𝑍𝑜 (𝑠)
𝑣ො𝑟𝑒𝑓 (𝑡) 𝑍𝑜 (𝑠) ➢ 𝑍𝑜,𝑐𝑙 (𝑠) =
𝑢(𝑡)
ො መ
𝑑(𝑡) 1+𝑇 s
𝑣෠𝑜ҧ (𝑡)
𝐺𝑐 (𝑠) 𝐺𝑝𝑤𝑚 (𝑠) 𝐺𝑣𝑑 (𝑠)

𝑣෠𝑠ҧ (𝑡)
𝐻(𝑠) 71
Phase lead Controller Design
◼ Design Target ◼ 設計完成之PD控制器波德圖
𝑠
1+
使用右式之phase-lead控制器,提升 𝜔𝑧
𝐺𝑃𝐷 𝑠 = 𝐺𝑃𝐷0 𝑠
系統頻寬及穩定度,規格如下◦ 1+ 𝑇𝑃𝐷 (𝑗𝜔)
𝜔𝑝
𝑓𝑠 𝐺𝑃𝐷 (𝑗𝜔)
𝑓𝑐 = = 100KHZ,phase margin = 55°
10 𝑓𝑐 =
100𝐾𝐻𝑍
◼ Design techniques 𝐺𝑣𝑑 (𝑗𝜔)

➢ 根據phase margin規格計算須補償之角度

∠𝐺𝑃𝐷 𝑗𝜔𝑐 = 55° − 180 − ∠𝐺𝑣𝑑 𝑗𝜔𝑐 = 46.4°

➢ 計算極零點位置,使∠𝐺𝑃𝐷 𝑗𝜔𝑐 = 46.4°

1 − sin( ) 1 + sin( )
Z = 2f C  2 .(40 KHZ ) P = 2f C  2 .(250 KHZ )
1 + sin( ) 1 − sin( ) ∠𝐺𝑃𝐷 𝑗𝜔𝑐
= 46.4˚
設計之極零點位置使𝑓𝑐 處之相位θ為最大值 (∠𝐺𝑃𝐷 𝑗𝜔𝑐 > ∠𝐺𝑃𝐷 𝑗𝜔 )
P.M.= 55˚
➢ 計算𝐺𝑃𝐷0 ,使 𝑇𝑃𝐷 (𝑗𝜔𝑐 ) = 𝐺𝑣𝑑 (𝑗𝜔𝑐 ) G𝑃𝐷 (𝑗𝜔𝑐 ) = 1
-171.4˚
1
G𝑃D0 = ≈ 6.2 = 15.84𝑑𝐵
𝜔
1 + 𝑗 𝜔𝐶
𝑧
𝐺𝑣𝑑 𝑗𝜔𝐶 𝜔𝐶
1+𝑗𝜔
𝑝
72/112
Drawing 𝑮𝑷𝑫 𝒋𝝎 with Matlab

%% define variable
clc;clear;
fs=1e06;
f=logspace(log10(fs/1000),log10(fs),100); x-axis vector
s=j*2*pi*f;

%% transfer function
Gpd=6.2.*(1+s/(2*pi*4e04))./(1+s/(2*pi*2.5e05));

%% plot frequency response


figure(1) first windows
%magnitude
subplot(2,1,1); subplot in the window
semilogx(f,20*log10(abs(Gpd)),'b','LineWidth',2);
grid on
title('PD controller');
xlabel('frequency(HZ)'); drawing magnitude subplot
ylabel('magnitude(dB)');
axis([3e3 1e6 15 35]);
%phase drawing phase subplot
subplot(2,1,2);
semilogx(f,180/pi.*phase(Gpd),'b','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('phase(dB)');
axis([3e3 1e6 0 50]);
73/112
PID Controller Design

◼ Design Target ◼ Bode plot of 𝐺𝑃𝐼𝐷 𝑠 and 𝐺𝑃𝐷 𝑠

➢ 將PD串上PI,改善低頻增益,但不影響
頻寬及穩定度◦ 𝑔𝑎𝑖𝑛 𝑎𝑡 𝑓𝑐
= 23.83dB
◼ Design techniques
𝜔𝐼
𝐺𝑃𝐼 𝑠 = 𝐺𝑃𝐼∞ (1 + )
𝑠

𝜔𝑐
➢ 一般來說,為降低對P.M.及𝑓𝑐 的影響, 𝜔𝐼 =
10

𝜔𝐼 = 2𝜋 × 8𝑘𝐻𝑍 此處設為8kHZ ∠𝐺𝑃𝐷 𝑗𝜔𝑐 =46.4˚

∠𝐺𝑃𝐼 𝑗𝜔𝑐 = ∠𝐺𝑃𝐼 𝑗𝜔𝑐 𝐺𝑃𝐷 𝑗𝜔𝑐 − ∠𝐺𝑃𝐷 𝑗𝜔𝑐


= −4.6˚
∠𝐺𝑃𝐼 𝑗𝜔𝑐 𝐺𝑃𝐷 𝑗𝜔𝑐
設計之PI零點對穩定度影響不大 = 41.8˚

➢ 𝐺𝑃𝐼∞ = 1,使gain crossover frequency不改變◦

右圖之增益圖中, 𝐺𝑃𝐼 𝑗𝜔𝑐 ≅ 0𝑑𝐵

74
Drawing 𝑮𝑷𝑰𝑫 𝒋𝝎 and 𝑮𝑷𝑫 𝒋𝝎 with Matlab
%% define variable
… the same way as 𝑮𝑷𝑫 𝒋𝝎 code
%% transfer function
Gpd=6.2.*(1+s/(2*pi*4e04))./(1+s/(2*pi*2.5e05)); 𝑮𝑷𝑫 (𝒔)
Gpid=Gpd.*(1+2*pi*8e03./s);
%% plot frequency response add 𝑮𝑷𝑰𝑫 (𝒔) to 𝑮𝑷𝑫 𝒋𝝎 code
figure(1)
%magnitude Draw multiple lines on the same plot with hold on
subplot(2,1,1);
semilogx(f,20*log10(abs(Gpd)),'k--','LineWidth',2);
hold on
semilogx(f,20*log10(abs(Gpid)),'b','LineWidth',2);
grid on
title('PID controller');
xlabel('frequency(HZ)');
ylabel('magnitude(dB)'); add 𝑮𝑷𝑰𝑫 𝒋𝝎 plot to previous code
axis([1e3 1e6 15 35]);
%phase
subplot(2,1,2);
semilogx(f,180/pi.*phase(Gpd),'k--','LineWidth',2);
hold on
semilogx(f,180/pi.*phase(Gpid),'b','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('phase(dB)');
axis([1e3 1e6 -80 70]);
75/112
PID Controller with High Frequency Pole

◼ Design Target ◼ Bode plot of 𝐺𝑃𝐼 𝑠 𝐺𝑃𝐷 𝑠 、𝐺𝑃𝐷 𝑠 and 𝐺𝑐 𝑠

➢ 完成整體之補償器𝐺𝑐 𝑠 ,將前面設計之𝐺𝑃𝐼𝐷 𝑠
串上高頻極點,以降低開關諧波影響◦
𝑔𝑎𝑖𝑛 𝑎𝑡 𝑓𝑐 (GC) 2.9dB
𝑠 高頻抑制效果
𝜔𝐼 1+ 1
= 23.79dB
𝜔𝑧 獲得改善
𝐺𝐶 𝑠 = 𝐺𝑃𝐼∞ (1 + ).𝐺𝑃𝐷0 𝑠 . 𝑠
𝑠 1+ 1+
𝜔𝑝 𝜔𝑝2

➢ 𝑓𝑐 = 100KHZ,phase margin > 45°

◼ Design techniques
46.4˚
➢ 高頻極點須遠離𝑓𝑐 ,使相位落後不影響
phase margin

𝜔𝑃2 = 2𝜋 × 1𝑀𝐻𝑍 36.11˚

整體設計之phase margin為45˚,比PD控制低10˚

𝜃 = 180 + ∠𝑇𝑢 𝑗𝜔𝑐 + ∠𝐺𝑐 𝑗𝜔𝑐 = 45˚


-171˚ 36.11˚
76
Drawing 𝑮𝒄 𝒋𝝎 with Matlab
%% define variable
…the same way as 𝑮𝑷𝑰𝑫 𝒋𝝎 code
%% transfer function
Gpd=6.2.*(1+s/(2*pi*4e04))./(1+s/(2*pi*2.5e05));
Gpid=Gpd.*(1+2*pi*8e03./s);
Gc=Gpid./(1+s/(2*pi*1e06)); add 𝑮𝒄 𝒔 to 𝑮𝑷𝑰𝑫 𝒋𝝎 code
%% plot frequency response
figure(1)
%magnitude
subplot(2,1,1);
semilogx(f,20*log10(abs(Gc)),'b','LineWidth',2);
hold on
semilogx(f,20*log10(abs(Gpd)),'k--','LineWidth',2);
hold on
semilogx(f,20*log10(abs(Gpid)),'g--','LineWidth',2);
grid on
title('PID controller');
xlabel('frequency(HZ)');
add 𝑮𝒄 𝒋𝝎 plot to 𝑮𝑷𝑰𝑫 𝒋𝝎 code
ylabel('magnitude(dB)');
axis([1e3 1e6 15 35]);
%phase
subplot(2,1,2);
semilogx(f,180/pi.*phase(Gc),'b','LineWidth',2);
hold on
semilogx(f,180/pi.*phase(Gpd),'k--','LineWidth',2);
hold on
semilogx(f,180/pi.*phase(Gpid),'g--','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('phase(dB)'); 77/112
axis([1e3 1e6 -80 70]);
Closed Loop Gain 𝑻(𝒋𝝎)

◼ Loop gain specification ◼ Bode plot of 𝑻(𝒋𝝎)

➢ 𝑓𝑐 = 100KHZ,phase margin > 45°

◼ Loop gain parameters

𝑇 s = 𝐺𝑐 𝑠 𝐺𝑝𝑤𝑚 𝑠 𝐺𝑣𝑑 𝑠 H(s)


𝑠 𝑆
𝑓𝑐 = 100𝐾𝐻𝑍
𝜔𝐼 1+ 1 1+
𝜔𝑧 𝜔𝐸𝑆𝑅
= 𝐺𝑃𝐼∞ (1 + ).𝐺𝑃𝐷0 𝑠 . 𝑠 . 𝑉𝑔 𝑆2 𝑆
𝑠 1+ 1+ + +1
𝜔𝑝 𝜔𝑝2
𝜔2
0
𝑄𝜔0

1
𝐺𝑝𝑤𝑚 s = = 1, 𝐻 s = 1
𝑉𝑟
𝐺𝑃𝐼∞ = 1,𝜔𝐼 = 2𝜋 × 8𝑘𝐻𝑍
P.M.=45˚
G𝑃𝐷0 = 6.2 ,𝜔𝑧 = 2𝜋 × 40𝑘𝐻𝑍,𝜔𝑝 = 2𝜋 × 250𝑘𝐻𝑍

𝜔𝑃2 = 2𝜋 × 1𝑀𝐻𝑍
1
𝑉𝑔 = 5,𝜔𝐸𝑆𝑅 = = 2π × 995𝐾𝐻𝑍
𝑟𝑐 𝐶
𝐿
1 𝐶
𝜔0 = = 2π × 11.25𝐾𝐻𝑍,𝑄 = = 2.3 78
𝐿𝐶 𝑟𝑐 +𝑟𝐿
Drawing 𝑻(𝒋𝝎) with Matlab
%% define variable
…the same way as 𝑮𝒗𝒅 𝒋𝝎 code
%% transfer function add transfer functions
Gvd=Vg.*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));
zo=(s.*L+rL).*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));
Gpd=6.2.*(1+s/(2*pi*4e04))./(1+s/(2*pi*2.5e05));
Gpid=Gpd.*(1+2*pi*8e03./s);
Gc=Gpid./(1+s/(2*pi*1e06));
Tc=Gvd.*Gc;
%% plot frequency response
%amplitude plot 𝑻(𝒋𝝎)
figure(1)
subplot(2,1,1);
semilogx(f,20*log10(abs(Tc)),'k','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('amplitude(dB)');
hold on
axis([1e3 1e6 -40 50]);
%phase
subplot(2,1,2);
semilogx(f,180/pi.*phase(Tc),'k','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('phase(degree)');
axis([1e3 1e6 -180 -50]); 79
Drawing Closed Loop Output impedance 𝒁𝒐,𝒄𝒍 (𝒋𝝎) with
Matlab

◼ Closed loop output impedance


𝑍𝑜 (𝑠)
𝑍𝑜,𝑐𝑙 (𝑠) =
1+𝑇 s
◼ Code to draw 𝒁𝒐 (𝒋𝝎) and 𝒁𝒐,𝒄𝒍 (𝒋𝝎)
%% define variable
…the same way as 𝑮𝒗𝒅 𝒋𝝎 code

%% transfer function
Gvd=Vg.*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));
zo=(s.*L+rL).*(1./(s.*C)+rC)./((s.*L+rL)+(1./(s.*C)+rC));
Gpd=6.2.*(1+s/(2*pi*4e04))./(1+s/(2*pi*2.5e05));
Gpid=Gpd.*(1+2*pi*8e03./s);
Gc=Gpid./(1+s/(2*pi*1e06));
Tc=Gvd.*Gc;
zo_cl=zo./(1+Tc); add transfer function 𝒁𝒐,𝒄𝒍 (𝒔)

80
Drawing Closed Loop Output impedance 𝒁𝒐,𝒄𝒍 (𝒋𝝎) with
Matlab
%% plot frequency response
%amplitude
figure(1) draw 𝒁𝒐 (𝒋𝝎) and 𝒁𝒐,𝒄𝒍 (𝒋𝝎)
subplot(2,1,1);
semilogx(f,20*log10(abs(zo_cl)),’b','LineWidth',2)
hold on
semilogx(f,20*log10(abs(zo)),'k','LineWidth',2)
grid on
xlabel('frequency(HZ)');
ylabel('amplitude(dB)');
hold on
axis([1e3 1e6 -80 -10]);
%phase
subplot(2,1,2);
semilogx(f,180/pi.*phase(zo_cl),’b','LineWidth',2);
hold on
semilogx(f,180/pi.*phase(zo),'k','LineWidth',2);
grid on
xlabel('frequency(HZ)');
ylabel('phase(degree)');
axis([1e3 1e6 -90 110]);

81
Drawing Closed Loop Output impedance 𝒁𝒐,𝒄𝒍 (𝒋𝝎) with
Matlab

𝒁𝒐 (𝒋𝝎)

𝒁𝒐,𝒄𝒍 (𝒋𝝎)

82
How to Verify Loop Gain 𝑻(𝒋𝝎) by PSIM

振幅10%之弦波,
𝑣ො𝑝𝑒𝑟𝑡 (𝑡) 𝑉𝑔 = 5𝑉
𝑓𝑝𝑒𝑟𝑡 = 1𝐾𝐻𝑍~200𝐾𝐻𝑍 1.8V
PWM Modulator
𝑒𝑦 (𝑡) 𝑒𝑥 (𝑡) 30𝑚Ω 1𝜇𝐻 𝑣𝑜 (𝑡) = 𝑉𝑜 + 𝑣ො𝑜 (𝑡)
𝑉𝑟𝑒𝑓 = 1.8𝑉 𝐺𝑐 (𝑠)
0.8𝑚Ω
200𝜇𝐹 𝐼𝑜 = 5𝐴
𝑉𝑟 =1V
𝑓𝑠 =1MHZ
𝑣𝑠 (𝑡) = 𝑣𝑜 (𝑡)

𝒆𝒚 𝒋𝝎
◼ 若在duty加入擾動,則− = − 𝑮𝒗𝒅 𝒋𝝎 × −𝑮𝒄 𝒋𝝎 = 𝑻 𝒋𝝎
𝒆𝒙 𝒋𝝎

𝒆𝒚 𝒋𝝎
◼ 利用PSIM之AC Sweep功能,掃描出− 的bode plot。
𝒆𝒙 𝒋𝝎

◼ 利用Matlab比較理論與模擬之頻率響應

83
Closed loop Buck Converter Psim Model

feedback 𝑣𝑜 to controller

disable the settings for


the open loop test

build a feedback controller

84
Type Ⅲ Controller Construction
1. Add Type Ⅲ controller

85
Type Ⅲ Controller Construction
2. Set controller parameters

double click

double click

reference to the table in p.77 86


Check of the Steady State Operation Point

each variable reaches defined


operation Point

87
Loop Gain Simulation Steps

1. Set simulation control 4. set AC Sweep

2. add perturbation source


3. add AC Sweep Probe
(loop)

88
Loop Gain Simulation Steps

1. add perturbation source:


perturbation source parameters
does not need to be set in AC
Sweep mode
2. add AC Sweep Probe (loop)

(1)

(2)
(2)

89
Loop Gain Simulation Steps
(4)
3. set AC Sweep
4. run simulation
(3)

90
Loop Gain Simulation Result

91
Steps to Compare the Theoretical and Simulated
𝑻(𝒋𝝎) with Matlab
◼ Code to plot theoretical 𝑻(𝒋𝝎) ◼ Steps to add Simulated 𝑻(𝒋𝝎)

1. Save simulation 𝑻(𝒋𝝎) as .txt file:


2. Add the simulated transfer function to Matlab

%% simulated
%T
f_T=dlmread('T.txt','',[1 0 13 0]);
amp_T=dlmread('T.txt','',[1 1 13 1]);%db
phase_T=dlmread('T.txt','',[1 2 13 2]);

3. Add the simulated bode plot to Matlab

hold on
semilogx(f_T,amp_T,'ko','LineWidth’,2);

hold on
semilogx(f_T,phase_T,'ko','LineWidth',2);

92
Theoretical and Simulated 𝑻(𝒋𝝎)

simulated 𝑻(𝒋𝝎)

theoretical 𝑻(𝒋𝝎)

93
How to Verify 𝒁𝒐,𝒄𝒍 (𝒋𝝎) by PSIM
𝑣ො𝑜 (𝑗𝜔)
𝑍𝑜,𝑐𝑙 𝑗𝜔 = −
𝑉𝑔 = 5𝑉 1.8V 𝑖Ƹ𝑜 (𝑗𝜔)
PWM Modulator
30𝑚Ω 1𝜇𝐻 𝑣𝑜 (𝑡) = 𝑉𝑜 + 𝑣ො𝑜 (𝑡)
𝑉𝑟𝑒𝑓 = 1.8𝑉 𝐺𝑐 (𝑠)
0.8𝑚Ω 𝑖Ƹ𝑜 (𝑡)
200𝜇𝐹 𝐼𝑜 = 5𝐴
𝑉𝑟 =1V
𝑓𝑠 =1MHZ
𝑣𝑠 (𝑡) = 𝑣𝑜 (𝑡)

振幅10%之弦波,
𝑓𝑝𝑒𝑟𝑡 = 1𝐾𝐻𝑍~200𝐾𝐻𝑍

◼ 利用PSIM之AC Sweep功能,繪製𝑍𝑜,𝑐𝑙 𝑗𝜔 bode plot。

◼ 利用Matlab比較理論與模擬之頻率響應

94
𝒁𝒐,𝒄𝒍 (𝒋𝝎) Simulation Steps

1. Set simulation control


5. Set AC Sweep
6. Enable AC Sweep Probe 4. Set perturbation

2. Set v_pert to zero


3. disable AC Sweep Probe
(loop)

95
Steps to Compare the Theoretical and Simulated
𝒁𝒐,𝒄𝒍 (𝒋𝝎) with Matlab
1. Save simulation 𝒁𝒐,𝒄𝒍 (𝒋𝝎) as .txt file:
2. Add the simulated transfer function to 𝒁𝒐,𝒄𝒍 (𝒋𝝎) code
%% simulated
%Zo,cl
f_zo_cl=dlmread('Zo,cl.txt','',[1 0 data_size 0]);
amp_zo_cl=dlmread('Zo,cl.txt','',[1 1 data_size 1]);%db
phase_zo_cl=dlmread('Zo,cl.txt','',[1 2 data_size 2]);
3. Add the simulated bode plot to 𝒁𝒐,𝒄𝒍 (𝒋𝝎) code
%amplitude
hold on;
semilogx(f_zo_cl,amp_zo_cl,'bo','LineWidth’,2);
%phase
hold on;
semilogx(f,180/pi.*phase(zo_cl),'b','LineWidth',2);

96
Steps to Compare the Theoretical and Simulated
𝒁𝒐,𝒄𝒍 (𝒋𝝎) with Matlab

Simulated 𝒁𝒐,𝒄𝒍 (𝒋𝝎)

Theoretical 𝒁𝒐 (𝒋𝝎)

Theoretical 𝒁𝒐,𝒄𝒍 (𝒋𝝎)

97
Power Electronic Systems & Chips Lab., NCTU, Taiwan

Smart Power Processing for Energy Saving

Thanks for your kind attention!


Knowledge, Innovation, and Education

電力電子系統與晶片實驗室
Power Electronic Systems & Chips Lab.
交通大學 • 電機與控制工程研究所

98/112
99/112
100/112
101/112

You might also like