教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 互联网资料 >

三相正弦变频电源的软件设计论文 - 图文(9)

来源:网络收集 时间:2026-08-28
导读: 附录 DelayTime(2142857); //delay 0.2 second P1L_P6=1; //conect power DelayTime(5714285); //delay 1 second LCD_Init(); /// IniStopDisplay(); while(1) { if((Dkey_time++)>=500000) { Dkey_time=500000; //

附录

DelayTime(2142857); //delay 0.2 second P1L_P6=1; //conect power DelayTime(5714285); //delay 1 second LCD_Init(); /// IniStopDisplay(); while(1) {

if((Dkey_time++)>=500000) {

Dkey_time=500000; //out control

if(bOutStatus==0) {

if(!Key_s) {

DelayTime(1000); //delay if(!Key_s) {

SetFrequency(frequency); SetAmp(32768); e_b=0; StartOut(); bOutStatus=1; IniOutDisplay(); Dkey_time=0; } } } else

{

if(Key_s==0) {

DelayTime(1000); if(Key_s==0) {

StopOut(); bOutStatus=0;

36

附录

IniStopDisplay(); Dkey_time=0; } } }

//frequency control

if(Key_up==0)

{

DelayTime(1000); if(Key_up==0)

{

if(frequency<100) {

frequency++;

SetFrequency(frequency); if(bOutStatus==1) OutRefresh(); else StopRefresh(); Dkey_time=0; } } }

else if(Key_down==0) {

DelayTime(1000); if(Key_down==0) {

if(frequency>20) {

frequency--;

SetFrequency(frequency);

if(bOutStatus==1) OutRefresh(); else StopRefresh(); Dkey_time=0; } } } }

37

附录

//AMP control if(bOutStatus) // {

if(bsg==0) {

voltage=(unsigned long)RMS(0)*130)/85);//OutRefresh();

StartSample(frequency); } // }

//DisplayRefresh if(bOutStatus) {

if(Dd_time++>100000) {

Dd_time=100001; if(!bsg)

{

Dd_time=0;

current_u=RMS(3)/4; current_v=RMS(4)/4; current_w=RMS(5)/4; current=current_u;

power=(unsigned

int)((current_u*(unsigned

long)voltage)/10);

OutRefresh(); } } } //

if(bOutStatus)

{

if((current_u<2)||(current_v<2)||(current_w<2)) {

if((current_u>3)||(current_v>3)||(current>3))

int)(((unsigned

AdjustAmp(PI(360-(int)voltage));

{

StopOut();

38

附录

P1L_P6=0;

bOutStatus=0; IniStopDisplay(); DisplayStr(8,3,\

}

}

if((((int)current_u-(int)current_v)>5)||(((int)current_u-(int)current_v)<-5)||(((int)cur

rent_v-(int)current_w)>5)||(((int)current_v-(int)current_w)<-5)) {

StopOut();

P1L_P6=0; bOutStatus=0; IniStopDisplay();

DisplayStr(8,3,\}

if((current_u>36)||(current_v>36)||(current_w>36)) {

StopOut();

P1L_P6=0;

bOutStatus=0; IniStopDisplay();

DisplayStr(8,3,\}

}

} }

XC164单片机的SPWM生成程序:

//#pragma SRC

#include

extern unsigned int const sintab[]; unsigned int SintabU=0; unsigned int SintabV=3333; unsigned int SintabW=6666; unsigned int *pSintab=sintab; unsigned int step=100;

unsigned int modulate=0xffff;

39

附录

unsigned int step_f=20; void StartOut(void) {

DP1L=0x007f;

ALTSEL0P1L=0x0000; CCU6_T12=0;

CCU6_T12PR=1999;

CCU6_T12MSEL=0x0333; //compare mode enable

CCU6_T12DTC=0x073f; //dead time enable,maxdeadtime= …… 此处隐藏:1247字,全部文档内容请下载后查看。喜欢就下载吧 ……

三相正弦变频电源的软件设计论文 - 图文(9).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/444321.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)