1、 毕业设计(论文)毕业设计(论文) 题目题目 电磁运动控制系统电磁运动控制系统 院院 别别 电子信息工程学院电子信息工程学院 专专 业业 应用电子技术应用电子技术 班班 级级 智能电子智能电子 11 11 I 摘摘 要要 本设计以单片机 STC89C52RC 为核心,通过对电磁铁线圈内电压的控制, 改变电磁铁的磁场力的大小,实现摆杆按指定的摆角和周期摆动。采用 SYD35D4 角度传感器来实现摆杆摆角信号的采集,经 A/D 转换器 MAX1113 转换 为数字信号,送至单片机 STC89C52RC 进行处理,用 L298N 作为驱动电路,使 达到控制摆角和周期。该设计进行了系统方案、硬件电路图
2、和软件流程图的设 计,并通过软件编程,实现了设计要求,并用 LCD 显示预置摆角、预置周期, 实时显示了测量摆角、测量周期。 关键词关键词:单片机;电磁控制;角度传感器;摆角;周期 II AbstractAbstract This design STC89C52 microcontroller as the core , through control of the solenoid Coil currents, changing the size of the magnetic force of electro-magnet, swing by electromagnetic control
3、 at a specified angle and periodic oscillations. Rocker swing angle of using the SYD35D4 angle sensor to signal acquisition, the a/d converter MAX1113 converts digital signals sent to a MCU STC89C52, and L298N as a driver in order to control the swing angle and cycles. System solutions, the design o
4、f hardware circuit diagram and software flow chart design and software programming, achieving the design requirements, and angle LCD intuitive display preset, preset cycle, measuring angle, the testing cycle is shown in real time. Keywords:Keywords: STC89C52 microcontroller,electromagnetic control,a
5、ngle sensor,swing angle,period III 目录目录 任务书 . 1 摘 要 . I Abstract II 目录 . III 前 言 . 1 第 1 章方案设计与论证 2 1.1 电磁控制系统方案 . 3 1.2 转角采集方案 3 1.3 驱动及控制方案 4 1.4 主控系统的方案 . 4 1.5 系统总体方案 5 第 2 章系统硬件电路设计 6 2.1 单片机 STC89C52RC . 6 2.2 L298N 简介 7 2.3 电磁铁控制模块 7 2.3.1 电磁铁电流控制的分析 . 8 2.3.2 数字 PID 控制算法的计算 . 8 2.4 角度传感器 9 2
6、.4.1 角度测量原理 9 2.4.2 角度测量算法 . 10 2.4.3 角度测量电路 . 10 2.5 A/D 转换电路 . 10 2.6 键盘电路 . 11 2.7 声光提示电路. 11 2.8 LCD 显示电路 . 12 2.9 电源电路 . 13 第 3 章系统软件设计 . 14 IV 3.1 程序功能描述与设计思 14 3.1.1 程序功能描述 . 14 3.1.2 程序设计思路 . 14 3.2 程序流程图 . 14 3.2.1 主程序流程图 . 14 3.2.2 角度控制子程序流程图 . 14 第 4 章系统测试. 17 4.1 测试仪器与方法 17 4.2 角度测量 . 17 4.3 停止时间的测量 17 4.4 测试结果与分析 17 结论 19 致谢 20 参考文献 21 附录:硬件电路图. 23 1 前前 言言 设计一个电磁控制运动系统,该装置由电磁控制装置、摆杆等部分构成。 按下启动按钮,由静止点开始,控制摆