Code điều khiển vòng kín

Một phần của tài liệu Nghiên cứu, phát triển bộ PLL số cho các ứng dụng sử dụng biến áp áp điện (Trang 76 - 81)

#include"DSP281x_Device.h"

#include"DSP281x_Examples.h"

#define T_1 50000// Hang so thu nhat cua bo loc (us)

#define T_2 5000// Hang so thu hai cua bo loc (us)

#define U_b 5//(V)

#defineK_015000 // (Don vi nay s-1*V-1) He so cua DCO

#define f_0 90000// Tan so lam viec trung tam cua DCO - Hz

Uint32 f=91000; // Bien luu tan so lam viec cua PLL

Uint32 T_lech =0; Uint32 goclechpha =0; Uint32 T_lech_percent =75; Uint32 T_lech_rect =90; // do

int duty =45;// thoi gian ns

Uint32 T=0 ; // chu ki cua U1

Uint32 T_cross=0;// thoi gian lech pha giua 2 tin hieu ngat

float Uc_cur=0.1;

float Uf_pre=0.1;

float Uf_cur=0.1;

signedint Q=0;// gia tri Q

float T_pos=0.0,T_neg=0.0;//(us)

int flag_phase=0; // Co bao da lay duoc T_cross

int flag=0;// Co bao toi chu ki tinh toan moi

Uint32 count=0;

// Prototype statements for functions found within this file.

interrupt void XINT_1_ISR(void);// ISR1 xac dinh xung len cua U1

interrupt void XINT_2_ISR(void);// ISR2 xac dinh xung len cua U2

voidSPLL(void);

voidGet_phase_dif(void);

voidUpdate_PT_In(void);

voiddelay_ms(long ms)

{

DELAY_US(ms*1000);

}

voidpwm_chan1(Uint32 tansoHz,int duty100) (adsbygoogle = window.adsbygoogle || []).push({});

{

EvaRegs.T1PR=75000000/tansoHz;

EvaRegs.CMPR1 =75000000/tansoHz * duty100 /100 ;

}

voidGpio_select(void);

voidmain() { T=1000000000/f; pwm_chan1(f,duty); delay_ms(100); while(1) { if(flag_phase==1)

SPLL();

goclechpha=((float)T_cross/(float)T*360);

Update_PT_In(); flag_phase=0;

}

} }

voidSPLL(void)// tinh toan

{ T_lech=T*(360-T_lech_rect)/360; T_cross+=T_lech; while(T_cross>=T) { T_cross-=T; }

//Tinh toan cho PFD

if(T_cross<T/2)// U se som pha so voi I, can giam tan so xuong

{

T_neg=T_cross; T_pos=0;

}

else// U tre pha so voi I, can tang tan so len

{

T_neg=0;

T_pos=T-T_cross;

}

//tinh toan cho bo loc

if(T_pos >0)

{

Uc_cur = Uc_pre + (float)(U_b - Uc_pre) * T_pos / (T_1 + T_2);

Uf_cur = Uc_cur + T_pos * T_2 * ((float)U_b-Uc_cur)/(T * (T_1 + T_2));

elseif(T_neg >0)

{ (adsbygoogle = window.adsbygoogle || []).push({});

Uc_cur = Uc_pre * (1- ((float)T_neg / (T_1 + T_2)));

Uf_cur = Uc_cur * (1- ((float)T_2 * T_neg/(T * (T_1 + T_2))));

} else { Uc_cur = Uc_pre; Uf_cur = Uc_cur; }

// Tinh toan cho DCO

f=f_0+K_0*Uf_cur;

T=1000000000/f;

// update cac gia tri tinh toan cho lan tinh toan tiep theo

Uc_pre=Uc_cur; Uf_pre=Uf_cur;

TÀI LIỆU THAM KHẢO

[1]. Đỗ Mạnh Cường, “Piezoelectric Transformer Integration Posibility in High Power Density Applications”, Technische Universitat Dresden, 2008.

[2]. Gregory Ivensky, Isaac Zafrany and Shmuel Ben-Yaakov, “Generic operation characteristics of piezoelectric transformers”, IEEE Trans. Power Electron, vol. 17, Nov. 2002, pp. 1049-1057

[3]. Eddy Wells, “Comparing magnetic and piezoelectric transformer approaches in CCFL applications”, Texas Instruments Incorporated, 2005.

[4]. Alfredo Vázquez Carazo, “50 years of Piezoelectric Transformers. Trends in the technology”, Department of R&D Engineering, Face Electronics, 2004.

[5]. Bronstein, S., and Ben-Yaakov, S., “Design Considerations for Achieving ZVS in a Half Bridge Inverter that Drives a Piezoelectric Transformer with No Series Inductor”, Power Electronics Specialists Conference, 02. 2002 IEEE 33rd Annual, 2002.

[6]. Lin C. H., Lu Y., Lo Y. K., Pai K. J. and Wang Y. Y., “Inductor less piezoelectric transformer electronic ballast for linear flourescent lamp”, Applied Power Electronics

Conference and Exposition, APEC 2001. Sixteenth Annual IEEE , 2001.

[7]. Ben-Yaakove, S., Ivensky, G., “Drivers and Rectifiers for Piezoelectric Elements”,

IEEE Power Electronics Specialist Conference, PESC-2005, 2005.

[8]. Chang-Hua Lin, Ying-Chi Chen, Ying Lu, “DPLL Technique Applied to Backlight Module for Eliminating Temperature Effect in Piezoelectric Transformer”, Dept. of Computer and Communication Engineering, St. John's University, 2005.

[9]. E. Dailago and A. Danioni, “Resonance frequency tracking control for piezoelectric transformer DC-DC converter”, ELECTRONICS LETTERS - October 2001.

[10]. Võ Minh Chính, Phạm Quốc Hải, Trần Trọng Minh, Điện tử công suất, Nhà xuất bản khoa học kĩ thuật, 2005.

[11]. Roland E. Best, Phase-Locked Loops - Design, Simulation, and Applications, McGraw-Hill, 1999.

[12]. J. Díaz, J.A. Martín-Ramos, M.J. Prieto and F. Nuño, “A Double-Closed Loop DC/DC Converter Based On A Piezoelectric Transformer”, GIJON-ASTURIAS- SPAIN, 1999.

[13]. Spectrum Digital Incorporated, “eZdspTM F2812 Technical Reference”, September 2003.

TEXAS INSTRUMENTS, “TMS320F2810, TMS320F2811, TMS320F2812, TMS320C2810, TMS320C2811, TMS320C2812 - Digital Signal Processors Data Manual”, TI,2007.

[15]. Nguyễn Phùng Khoang, MATLAB & SIMULINK dành cho kĩ sư điều khiển tự động,

Nhà xuất bản khoa học kĩ thuật, 2001.

[16]. Nguyễn Trinh Đường, Lê Hải Sâm, Lương Ngọc Hải và Nguyễn Quốc Cường,

Một phần của tài liệu Nghiên cứu, phát triển bộ PLL số cho các ứng dụng sử dụng biến áp áp điện (Trang 76 - 81)