基于自由摆的平板控制系统(完结稿)
- 格式:pdf
- 大小:1.64 MB
- 文档页数:17
1
摘要
为了满足自由摆的平板控制系统的设计要求,本系统采用WTH118 的电位器作为执行系统的核心,摆杆发生偏转时,通过其滑动时两端 电压值得变化来反映偏转角度的大小;选用STC12C5A08S2单片机作为 可能控制和处理系统的核心,其内部集成的8路10位A/D转换能方便采 集和转换电位器变化的电压值,且该单片机可针对电机控制,正符合 系统的设计要求,同时其高速、低功耗和超强的抗干扰适合各种场合; 最终使28BYJ_48带减速的步进电机执行并控制平板。基于以上各系 统,单片机通过采集电压值分析并处理、运算输出偏转角度最终控制 电机转动,从而保持平板平衡。
四、系统程序设计.............................................................................................................8 4.1 电动机正反转及速度控制函数........................................................................9 4.2 AD 转换函数..........................................................................................................10 4.3 动态显示函数...................................................................................................... 11 4.4 延时函数................................................................................................................11 4.5 初始化函数........................................................................................................... 11 4.6 主函数.................................................................................................................... 12
五、系统测试及性能分析............................................................................................12 5.1 定点测试................................................................................................................12 5.2 动态性能测试........................................................................................................................ 12 5.3 存在干扰的情况...................................................................................................................12 5.3 性能分析...................................................................................................................................12
一、系统设计思想.............................................................................................................4
二、系统设计方案.............................................................................................................5 2.1 控制模块..................................................................................................................5 2.2 执行模块..................................................................................................................5 2.3 驱动模块..................................................................................................................5
三、系统电路设计.............................................................................................................6 3.1 单片机模块................................................................................................................................6 3.2 角度显示模块....................................................................................................................... 7 3.3 步进电机驱动模块............................................................................................................... 7 3.4 串行通讯模块.......................................................................................................................... 8 3.5 电源模块.....................................................................................................................................8
自动化专业课程设计
题 目:基于自由摆的平板控制系统 姓 名:魏明磊 学 号:2220103917 指导老师:颜德文
目录
摘要...............................................................................................................................2
2
voltage come from WTH118 .This MCU is fit for controlling motor and designing requirement ,and then their high speed、low power consumption and strong anti-jamming are use for variety situations. Stepper motor with deceleration device control and execute board. So MCU control of the motor rotation and keep it balance through collecting voltage and dealing with it based on above systems. Keywords: STC12C5A08S2 SCM,28BYJ_48 stepper motor,WTH118 potentiometer
摆杆摆动
电位器 (角度传感)
STC12C5A60S2 单片机
3
基于自由摆的平板控制系统
一.系统设计思想
根据题目要求,摆杆在摆动时,方向不同,要求单片机做出方向判断从而及时调
整电机保证平板平衡。
考虑到电位器滑动时电压随即变化,可以将角度的变化转化为电压的数值,且两
者是一一对应的,这里的电位器起到了角度传感的作用。优点是:反映灵敏,精确度
高,价格优廉。
总体框图:
关键词:STC12C5A08S2单片机,28BYJ_48步进电机,WTH118电位 器
Abstract In order to meet requirements of the free pendulum balance control system, we carried out a comparion of the formula of Micro Switch and the program of Angle Sensor and finally defined to use WTH118 as the core of execution system ,and its changed voltage can reflect the deflection angle when pendulum is deflcting ; we selected STC12C5A08S2 as the core of control and process system ,its intergrated A/D conversion is useful to collect and transform the changed