小车倒立摆答辩资料.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
小车倒立摆答辩资料.ppt

基于ATmeg16单片机的简易直线单级倒立摆系统设计 姓 名: 专业班级: 指导教师: 倒立摆系统整体方案图 ATmeg16单片机 Nokia5110液晶显示器 BTS7960驱动器 直流电动机 摆杆 小车 WDD35D-4型角位移传感器 干扰 OMRON 编码器 PID控制器 倒立摆简化物理模型示意图 倒立摆的实物模型示意图 单级倒立摆的控制算法设计 PID公式: 其中,t为时间参数,u(t)为输出量,r(t)输入量;err(t)=u(t)-r(t) PID增量式算法(离散化): C语言实现: typedef struct PID { int SetPoint; //设定目标 Desired Value long SumError; //误差累计 double Proportion; //比例常数Proportional Cons double Integral; //积分常数 Integral Const double Derivative; //微分常数 Derivative Const int LastError; //Error[-1] int PrevError; //Error[-2] } PID; //函数描述:增量式 PID 控制计算 int IncPIDCalc(int NextPoint) { int iError, iIncpid; //当前误差 iError = sptr-SetPoint - NextPoint; //增量计算 iIncpid = sptr-Proportion * iError //E[k]项 - sptr-Integral * sptr-LastError //E[k-1]项 + sptr-Derivative * sptr-PrevError; //E[k-2]项 //存储误差,用于下次计算 sptr-PrevError = sptr-LastError; sptr-LastError = iError; //返回增量值 return(iIncpid); } PID控制系统LabVIEW程序方框图 纯比例调节前面板框图 PID调节作用前面板框图 ICCV7 for AVR编程界面 ATmeg16单片机程序烧录界面 Main函数清单如下: #includeiom16v.h /* common defines and macros */ #includemacros.h #include AD.h #include USART.h #include PWM.h #include 5110.h #typedef uint unsigned int #typedef uchar unsigned char #define You_value 338 #define Zuo_value 738 #define headstand_value688 //设定AD值目标Desired Value int SetPoint=headstand_value; //设定AD值目标 int variation; //AD值变化量 int Proportion0=3; //完成 int Proportion1=2; // int Proportion2=5; //5 int Proportion3=3; //3 int Proportion4=4; //2-8 int Proportion5=2; int Proportion6=8; //2-4 int Proportion7=8; //2-8 int Pro

您可能关注的文档

文档评论(0)

x5511167 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档