2013全国电子设计大赛瑞萨杯
2013年瑞萨杯全国大学生电子设计竞赛
设计报告
简易旋转倒立摆及控制装置设计报告书(C题)
【本科组】
2013年9月7日
摘 要
本旋转倒立摆以MC9S12XS128单片机最小系统为控制核心,由BTN7970电机实现驱动,采用WDD35D电位式角度传感器进行检测。系统由单片机发出指令,控制减速电机的转动,以带动旋转臂运动,从而控制摆杆的运动状态,摆杆的状态信息用电位式角度传感器检测并传送给单片机。本系统含液晶显示模块,构造简洁,能实现赛题要求的功能。
关键词:旋转倒立摆 角度传感器 减速电机 电机控制芯片
Abstract :
The design uses MC9S12XS128 SCM system as a core, conbined with WDD35D potentiometer angle sensor and BTN7970 motor control chip to achieve an integrated rotary inverted pendulum control system, which can control the motion state of the pendulum by operating the gear motor. The system is a simple rotary inverted pendulum control device that constitutes by power supply, sensor, motor drive, liquid crystal display, and other modules, characterized by its concise structure and functional diversification.
Keywords:
Rotary inverted pendulum, Angle sensor, Gear motor, Motor control chip
目 录
1设计任务与要求 ............................................................................................................ 2
1.1设计任务 ............................................................................................................. 2 1.2设计要求 ............................................................................................................. 2
1.2.1基本要求 .................................................................................................. 2 1.2.2发挥部分 .................................................................................................. 3 1.3题目分析 ............................................................................................................. 3 2系统方案的论证与选择 ................................................................................................ 3
2.1 单片机最小系统的论证与选择 ........................................................................ 3 2.2 电机模块的论证与选择 .................................................................................... 4
2.2.1电机方案比较 ........................................................................................ 4 2.2.2电机驱动芯片方案比较 ........................................................................ 5 2.2.3最终方案选择 ........................................................................................ 5 2.3 角度感器的论证与选择 .................................................................................... 6 3系统理论分析与计算 .................................................................................................... 7
3.1 系统机械结构 .................................................................................................. 7 3.2 电机选型分析 .................................................................................................. 7 3.3摆杆状态的检测和计算 ..................................................................................... 8 3.3 驱动与控制的算法 ............................................................................................ 8 4系统硬件设计 ................................................................................................................ 8
4.1驱动模块电路设计 ............................................................................................ 8 4.2电路原理图(见附录1) ................................................................................. 9 5系统软件设计 ................................................................................................................ 9
5.1系统框架图 ........................................................................................................ 9 5.2系统总流程图 .................................................................................................. 10 5.3程序清单(见附录2) ................................................................................... 10 6测试方案与测试结果 .................................................................................................. 10
6.1测试方案 ........................................................................................................... 10 6.2 测试条件与仪器 .............................................................................................. 11 6.3 测试结果及分析 .............................................................................................. 11
6.3.1测试数据 ................................................................................................ 11 6.3.2测试分析与结论 .................................................................................... 11
7.结论和总结 .................................................................................................................. 12
7.1对设计的小结 ................................................................................................... 12 7.2设计收获体会 ................................................................................................... 12 7.3对设计进一步完善的建议 ............................................................................... 12 附录1:电路原理图 ...................................................................................................... 13 附录2:源程序 .............................................................................................................. 14
1