程序清单32三相交流电动机SVPWM开环调速控制程序.docx
- 文档编号:9613561
- 上传时间:2023-02-05
- 格式:DOCX
- 页数:16
- 大小:16.44KB
程序清单32三相交流电动机SVPWM开环调速控制程序.docx
《程序清单32三相交流电动机SVPWM开环调速控制程序.docx》由会员分享,可在线阅读,更多相关《程序清单32三相交流电动机SVPWM开环调速控制程序.docx(16页珍藏版)》请在冰豆网上搜索。
程序清单32三相交流电动机SVPWM开环调速控制程序
程序清单3-2三相交流电动机SVPWM开环调速控制程序
#include
.section/pmIVreset;
jumpstart;
.section/pmIVint4;
jumpPWMTRIP_IRQ;
.section/pmIVint5;
jumpPWMSYNC_IRQ;
.section/datadata1;
.varTHETA_90=0x1922;
.varTHETA_180=0x3244;
.varTHETA_270=0x4b66;
.varTHETA_360=0x6488;
.varSET_F=0x28f5;
.varF_OMEGA=0x2745;
.varTHETA_H=0x0;
.varTHETA_L=0x0;
.varTHETA_I=0x7297;
.varTHETA_S=0x7a3b;
.varT_SAMPLE=0x0D1B;
.varT1_PERIODS=20000;
.varMAX_V=0x2d41;
.varTEMP;
.varTEMP0;
.varTEMP1;
.varOMEGA;
.varSET_V;
.varTHETA_R;
.varTHETA_M;
.varS_S;
.varS_C;
.varSIN_INDX;
.varSIN_THETA;
.varCOS_THETA;
.varUA;
.varUB;
.varSECTOR;
.varCMP_1;
.varCMP_2;
.varCMP_0;
.varSIN_[91]=0,286,572,857,1143,1428,1713,1997,2280,2563,2845,
3126,3406,3686,3964,4240,4516,4790,5063,5334,5604,
5872,6138,6402,6664,6924,7182,7438,7692,7943,8192,
8438,8682,8932,9162,9397,9630,9860,10087,10311,10531,
10749,10963,11174,11381,11585,11786,11982,12176,12365,12551,
12733,12911,13085,13255,13421,13583,13741,13894,14044,14189,
14330,14466,14598,14726,14849,14968,15082,15191,15296,15396,
15491,15582,15668,15749,15826,15897,15964,16026,16083,16135,
16182,16225,16262,16294,16322,16344,16362,16374,16382,16384;
.varNZ_[24]=20066,-11585,0,23170,-20066,11585,20066,11585,0,23170,-20066,
-11585,0,-23170,-20066,11585,-20066,-11585,20066,-11585,20066,
11585,0,-23170;
.section/pmprogram;
start:
IMASK=0X0000;
IOPG=Interrupt_Controller_Page;
NOP;
AX0=0xBB01;
IO(IPR2)=AX0;
IMASK=0x003f;
IOPG=Clock_and_System_Control_Page;
AX0=0X0100;
IO(PLLCTL)=AX0;
IOPG=0X0008;
AR=0x0200;
IO(PWM0_STAT)=AR;
AX0=0X0003;
IO(PWM0_CTRL)=AX0;
AR=5000;
IO(PWM0_TM)=AR;
AX0=0x03FF;
IO(PWM0_SYNCWT)=AX0;
AX0=100;
IO(PWM0_DT)=AX0;
AX0=-2400;
IO(PWM0_CHA)=AX0;
IO(PWM0_CHB)=AX0;
IO(PWM0_CHC)=AX0;
AX0=0X0000;
IO(PWM0_SEG)=AX0;
ENAINT;
MAIN_LOOP:
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
JUMPMAIN_LOOP;
PWMTRIP_IRQ:
.SECTION/PMprogram;
IOPG=0X0008;
AX0=0X0;
IO(PWM0_CTRL)=AX0;
NOP;
jumpPWMTRIP_IRQ;
RTI;
PWMSYNC_IRQ:
.SECTION/codeprogram;
IOPG=0X0008;
ASTAT=0X00;
ENAM_MODE;
MX0=DM(SET_F);
MY0=DM(F_OMEGA);
MR=MX0*MY0(UU);
DM(OMEGA)=MR1;
MX0=DM(SET_F);
MY0=DM(MAX_V);
MR=MX0*MY0(UU);
DM(SET_V)=MR1;
MX0=DM(OMEGA);
MY0=DM(T_SAMPLE);
MR=MX0*MY0(UU);
SI=MR1;
SR=ASHIFTSIBY-1(HI);
SI=MR0;
SR=SRORLSHIFTSIBY-1(LO);
AY0=DM(THETA_L);
AR=SR0+AY0;
DM(THETA_L)=AR;
AY1=DM(THETA_H);
AR=SR1+AY1+C;
DM(THETA_H)=AR;
AX0=DM(THETA_360);
AY0=DM(THETA_H);
AR=AY0-AX0;
IFLEJUMPRND_THETA;
AY0=DM(THETA_360);
SR=LSHIFTAY0BY16(LO);
AX1=DM(THETA_H);
AX0=DM(THETA_L);
AR=AX0-SR0;
DM(THETA_L)=AR;
AR=AX1-SR1+C-1;
DM(THETA_H)=AR;
RND_THETA:
SI=1;
SR=LSHIFTSIBY15(LO);
AY0=DM(THETA_L);
AY1=DM(THETA_H);
AR=SR0+AY0;
AR=AY1+SR1+C;
DM(THETA_R)=AR;
AX0=1;
DM(S_S)=AX0;
DM(S_C)=AX0;
AX0=DM(THETA_R);
DM(THETA_M)=AX0;
AY0=DM(THETA_90);
AR=AX0-AY0;
IFLEJUMPE_Q;
AX0=1;
DM(S_S)=AX0;
AX0=-1;
DM(S_C)=AX0;
AY0=DM(THETA_180);
AX0=DM(THETA_R);
AR=AY0-AX0;
DM(THETA_M)=AR;
IFGEJUMPE_Q;
AX0=-1;
DM(S_S)=AX0;
AX0=-1;
DM(S_C)=AX0;
AY0=DM(THETA_R);
AX0=DM(THETA_180);
AR=AY0-AX0;
DM(THETA_M)=AR;
AY0=DM(THETA_270);
AX0=DM(THETA_R);
AR=AY0-AX0;
IFGEJUMPE_Q;
AX0=1;
DM(S_C)=AX0;
AX0=-1;
DM(S_S)=AX0;
AY0=DM(THETA_360);
AX0=DM(THETA_R);
AR=AY0-AX0;
DM(THETA_M)=AR;
E_Q:
MX0=DM(THETA_M);
MY0=DM(THETA_I);
MR=MX0*MY0(UU);
DM(SIN_INDX)=MR1;
SI=MR1;
SR=LSHIFTSIBY-5(LO);
DM(SIN_INDX)=SR0;
M0=DM(SIN_INDX);
I0=SIN_;
MX0=DM(I0+M0);
DM(SIN_THETA)=MX0;
I0=SIN_;
AX0=DM(SIN_INDX);
SR0=90;
AR=SR0-AX0;
DM(SIN_INDX)=AR;
M0=DM(SIN_INDX);
MX0=DM(I0+M0);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);
AR=AX1+AY1;
AR=AR+SR0+C;
SR0=AR;
AY0=2500;
AR=SR0-AY0;
AX0=AR;
AY0=100;
AR=AX0+AY0;
SR0=AR;
AR=DM(SECTOR);
AY0=0;
AR=AY0-AR;
IFEQJUMPTT8;
AR=DM(SECTOR);
ay0=5;
ar=ay0-ar;
ifeqjumpTT7;
AR=DM(SECTOR);
ay0=4;
ar=ay0-ar;
ifeqjumpTT7;
AR=DM(SECTOR);
ay0=3;
ar=ay0-ar;
ifeqjumpTT6;
AR=DM(SECTOR);
ay0=2;
ar=ay0-ar;
ifeqjumpTT6;
jumpTT8;
TT6:
io(PWM0_CHA)=SR0;
JUMPVV;
TT7:
io(PWM0_CHB)=SR0;
JUMPVV;
TT8:
io(PWM0_CHC)=SR0;
JUMPVV;
VV:
AR=0x0200;
IO(PWM0_STAT)=AR;
RTI;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 程序清单32 三相交流电动机SVPWM开环调速控制程序 程序 清单 32 三相 交流电动机 SVPWM 开环 调速 控制程序