dspic30f4011闭环控制无刷直流电机程序

上传者: 14915121 | 上传时间: 2019-12-21 20:31:26 | 文件大小: 20KB | 文件类型: rar
基于dspic30f4011的无刷直流电机程序 #include "p30f4011.h" #include "oled.h" #include "Mypid.h" #include "timer.h" #include "interrupt.h" #include "ADC.h" #include "moter.h" //配置位 _FOSC(0X0304);//FCKSM = 00;时钟切换使能 FOS = 11主振荡器XT晶振模式外部4MHz _FWDT(0X0000);//关狗 _FBORPOR(0X3A2);//MCLREN禁止 欠压2.7V 上电延时16MS _FGS(0X03); void Delay_1ms(unsigned int t);//t = 1000大概1s void System_Init(void)//系统初始化 { TRISB = 0x0000; TRISE = 0x0000; PWMCON1 = 0x0000;//通用IO } int main() { System_Init(); Timer1_Init(); ADC_Init(); Init_pid(); set = 350;//设置PID基准 OLED_Init(); //初始化OLED OLED_Clear(); disn(4,0,55);disn(5,0,69);disn(6,0,76);disn(7,0,67);disn(8,0,79);disn(9,0,77);disn(10,0,69);//Welcome while(1) { disn(4,1,Filter()/10000);disn(5,1,Filter()000/1000);disn(6,1,Filter()00/100);disn(7,1,Filter()0/10);disn(8,1,Filter()); disn(4,2,rout/10000);disn(5,2,rout000/1000);disn(6,2,rout00/100);disn(7,2,rout0/10);disn(8,2,rout); duty_cycle(Filter());//进入占空比调节 // if((PWM == 0)&&(Filter()>351)) // motor_FFZ(); // if((PWM == 1)&&(Filter()<349)) // motor_FFW(); if((PWM == 0)&&(Filter()!=350)) motor_FFW(); if((PWM == 1)&&(Filter()!=350)) motor_FFZ(); } }

文件下载

资源详情

[{"title":"( 30 个子文件 20KB ) dspic30f4011闭环控制无刷直流电机程序","children":[{"title":"19.PID Moter.X","children":[{"title":"delay.c <span style='color:#111;'> 249B </span>","children":null,"spread":false},{"title":"Moter.h <span style='color:#111;'> 146B </span>","children":null,"spread":false},{"title":"oled.c <span style='color:#111;'> 4.30KB </span>","children":null,"spread":false},{"title":"ADC.h <span style='color:#111;'> 92B </span>","children":null,"spread":false},{"title":"Moter.c <span style='color:#111;'> 607B </span>","children":null,"spread":false},{"title":"main.c <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"oled.h <span style='color:#111;'> 1.23KB </span>","children":null,"spread":false},{"title":"Timer.h <span style='color:#111;'> 115B </span>","children":null,"spread":false},{"title":"mypid.c <span style='color:#111;'> 2.11KB </span>","children":null,"spread":false},{"title":"Timer.c <span style='color:#111;'> 343B </span>","children":null,"spread":false},{"title":"dist","children":null,"spread":false},{"title":"Mypid.h <span style='color:#111;'> 354B </span>","children":null,"spread":false},{"title":"Interrupt.h <span style='color:#111;'> 774B </span>","children":null,"spread":false},{"title":"ADC.c <span style='color:#111;'> 682B </span>","children":null,"spread":false},{"title":"delay.h <span style='color:#111;'> 134B </span>","children":null,"spread":false},{"title":"nbproject","children":[{"title":"Package-default.bash <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"Makefile-impl.mk <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"configurations.xml <span style='color:#111;'> 8.29KB </span>","children":null,"spread":false},{"title":"Makefile-local-default.mk <span style='color:#111;'> 1.89KB </span>","children":null,"spread":false},{"title":"private","children":[{"title":"private.xml <span style='color:#111;'> 209B </span>","children":null,"spread":false},{"title":"configurations.xml <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false},{"title":"SuppressibleMessageMemo.properties <span style='color:#111;'> 69B </span>","children":null,"spread":false},{"title":"private.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"Makefile-variables.mk <span style='color:#111;'> 441B </span>","children":null,"spread":false},{"title":"project.xml <span style='color:#111;'> 713B </span>","children":null,"spread":false},{"title":"Makefile-default.mk <span style='color:#111;'> 11.06KB </span>","children":null,"spread":false},{"title":"Makefile-genesis.properties <span style='color:#111;'> 411B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"debug","children":[{"title":"default","children":null,"spread":false}],"spread":false},{"title":"bmp.h <span style='color:#111;'> 5.30KB </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 3.30KB </span>","children":null,"spread":false},{"title":"font.h <span style='color:#111;'> 12.75KB </span>","children":null,"spread":false},{"title":"build","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明