91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

三相PWM整流,程序包含矢量控制、前饋解耦、PI處理

資源截圖

代碼片段和文件信息

//======================================================
//?需要更改:UAB、U0的放大倍數“Uo_suobi“\“UAB_suobi“
//?GpioDataRegs.GPADAT.bit.GPIO1?:三相控制子程序運行時間測試
//?GpioDataRegs.GPADAT.bit.GPIO0?:ACD中斷函數運行時間測試
//?GpioDataRegs.GPADAT.bit.GPIO2???:adc_lvbo時間://PI函數運行時間測試
//?GpioDataRegs.GPADAT.bit.GPIO3?:?進入中斷time0的時間
//======================================================
#include?“DSP28x_Project.h“?????//?Device?Headerfile?and?Examples?Include?File
#include?“math.h“
#include?“IQmathLib.h“
#include?“string.h“


//定義變量(裝載或運行的起始地址)
//?These?are?defined?by?the?linker?(see?F2808.cmd)
extern?Uint16?RamfuncsLoadStart;
extern?Uint16?RamfuncsLoadEnd;
extern?Uint16?RamfuncsRunStart;
extern?Uint16?RamfuncsLoadSize;

//把要拷貝到RAM里的函數(...)定義到段ramfuncs
#pragma?CODE_SECTION(ISRTimer0?“ramfuncs“);
#pragma?CODE_SECTION(adc_isr?“ramfuncs“);
#pragma?CODE_SECTION(ISRePWM1?“ramfuncs“);
#pragma?CODE_SECTION(PI_ctr?“ramfuncs“);
#pragma?CODE_SECTION(ISRCap2?“ramfuncs“);
#pragma?CODE_SECTION(threephase_ctr?“ramfuncs“);
#pragma?CODE_SECTION(Temp_protect?“ramfuncs“);
#pragma?CODE_SECTION(sequence?“ramfuncs“);

void?InitFlash(void);

//---------------------------------------------
//?全局變量
//---------------------------------------------
int???control_chose?=?1?;//1:滯環控制????0:前饋解耦
int???CAP2_n;//記錄第幾次進入cap,當為2時表示可以進行PWM輸出
int???Temp_g;
int?? ??Time_period;
int?? ??Time0_period;
//------800V時的電壓采樣倍數
#define?? Uo_suobi??????0.2014652015??//Uo_suobi??為U0_input?的通過運放的縮小比例?Ruor=64.3k??2.5V/0V---2.5V0V
#define? UAB_suobi_ka??0.1506959707??//UAB實際?=?U0_input*UAB_suobi_ka+UAB_suobi_kb??Rabr?=83.9k
#define?? UAB_suobi_kb??-261.8??//2.4-99V/0V---2.464V/1.241V

#define?? Ia_suobi_ka???0.060591??//????類上
#define?? Ia_suobi_kb???-99.24807
#define?? Ib_suobi_ka???0.0607738???//????類上
#define?? Ib_suobi_kb???-99.84911
#define?? Ic_suobi_ka???0.0620848???//????類上
#define?? Ic_suobi_kb???-101.8489933
//--------電流電壓采樣保存
Uint16????IA_nbuf[24];
Uint16????IB_nbuf[24];
Uint16????IC_nbuf[24];
Uint16????UAB_nbuf[24];
Uint16????Uo_nbuf[24];
Uint16????AD_n?=?1;?//第一次進AD中斷為1;?AD采樣幾次???5次結束則TD?=?1;
Uint16 ? IA_buf;
Uint16? ? IB_buf;
Uint16? ? IC_buf;
Uint16? UAB_buf;
Uint16? Uo_buf;
float?? Ia_input;
float?? Ib_input;
float?? Ic_input;
float? ? UAB_input;
float?? Uo_input;
float?????IA[210];
float?????IB[210];
float?????IC[210];
float?????Uo[210];
float?????UAB[210];
//----------------PI調節
float???????ekek1ek2duk;
float?????pi_out_reg?pi_i_reg?e_regup_reg;

#define ki???5?//積分參數
#define? kp???0.5??//?比例參數
#define? kd???0???//?微風參數
//----------------threephase
float32?? SinA;??//交流側三相電壓相位正弦值
float32?? SinB;
float32?? SinC;
float32?? Sin[210];
int????? du_nbuf;//012...209
//-----------PWM定義
Uint32?? EPwm1_TBPRD_Value;
Uint32?? EPwm1_CMPA_Value;
Uint32?? EPwm1_CMPB_Value;
Uint32?? EPwm2_TBPRD_Value;
Uint32?? EPwm2_CMPA_Value;
Uint32?? EPwm2_CMPB_Value;
Uint32?? EPwm3_TBPRD_Value;
Uint32?? EPwm3_CMPA_Value

評論

共有 條評論