基于STM32的直流电机PWM调速控制(12)

2021-04-05 14:26

}

}

case 5: if((huoer1==1)&&(huoer3==0)) PWM1_VAL=500; else PWM1_VAL=900; if((huoer1==0)&&(huoer2==1)) PWM2_VAL=500; else PWM2_VAL=900; if((huoer2==0)&&(huoer3==1)) PWM3_VAL=500; else PWM3_VAL=900; if((huoer1==0)&&(huoer3==1)) PWM4_VAL=500; else PWM4_VAL=900; if((huoer1==1)&&(huoer2==0)) PWM5_VAL=500; else PWM5_VAL=900; if((huoer2==1)&&(huoer3==0)) PWM6_VAL=500; else PWM6_VAL=900; break; case 6: if((huoer1==1)&&(huoer3==0)) PWM1_VAL=550; else PWM1_VAL=900; if((huoer1==0)&&(huoer2==1)) PWM2_VAL=550; else PWM2_VAL=900; if((huoer2==0)&&(huoer3==1)) PWM3_VAL=550; else PWM3_VAL=900; if((huoer1==0)&&(huoer3==1)) PWM4_VAL=550; else PWM4_VAL=900; if((huoer1==1)&&(huoer2==0)) PWM5_VAL=550; else PWM5_VAL=900; if((huoer2==1)&&(huoer3==0)) PWM6_VAL=550; else PWM6_VAL=900; break;

case 7: if((huoer1==1)&&(huoer3==0)) PWM1_VAL=600; else PWM1_VAL=900; if((huoer1==0)&&(huoer2==1)) PWM2_VAL=600; else PWM2_VAL=900; if((huoer2==0)&&(huoer3==1)) PWM3_VAL=600; else PWM3_VAL=900; if((huoer1==0)&&(huoer3==1)) PWM4_VAL=600; else PWM4_VAL=900; if((huoer1==1)&&(huoer2==0)) PWM5_VAL=600; else PWM5_VAL=900; if((huoer2==1)&&(huoer3==0)) PWM6_VAL=600; else PWM6_VAL=900; break; }

4. 系统软件仿真

根据已知条件,利用keil4进行软件仿真,这里前提是假设霍尔传感器的三个值huoer1,huoer2,huoer3为别为0、1、0,然后分别假设flag的值为1 和7 ,仿真可以得到GPIOA6的PWM波形如下,这样,可以看出程序PWM脉宽进行了调整,但是,在实际的过程中,应根据电动车的速度,适当的设置系统的频率等参数。


基于STM32的直流电机PWM调速控制(12).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2020年部编版七年级道德与法制下册教学计划

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: