学校代码: 11509
学 号:1005073029
Hefei University
毕业设计(论文)
BACHELOR DISSERTATION
论文题目:基于MCS51单片机步进电机的控制系统设计与实现 学位类别: 工 学 学 士 学科专业: 10级自动化2班 作者姓名: 导师姓名:
完成时间: 2014年5月12日
基于MCS51单片机步进电机的控制系统设计与实现
中 文 摘 要
步进电机最早出现在十九世纪初期,经过一段时期的发展步进电机被广泛应用在各个领域,因为其具有良好的控制作用。所以对步进电机控系统进一步的探索有着更为深远的意义。
本设计是基于单片步进电机的控制系统,硬件设计采用STC89C52单片机为控制核心;选取ULN2003作为驱动器提供脉冲频率,驱动步进电机运转;通过键盘的加减速按钮、正反转按钮和停止按钮来控制步进电机的速度、方向和停止,最后通过测试传感器将这几个参数显示在12864液晶显示器上。软件设计采用KEIL软件工具进行C语言编写,通过各个模块端口的定义,编写出了步进电机加减速控制和正反转的程序,最后通过各模块程序调试对硬件电路施行控制。
本设计以经济实用为原则,通过软硬件结合的设计,实现了对步进电机转动速度和方向的有效控制。该系统具有控制性好,设计成本低等优点。
关键字:STC89C52;步进电机;控制系统;测速传感器
Stepper motor control system design and implementation based on
MCS51 microcontroller
ABSTRACT
The stepping motor was invented in the early 1800s, after a long period of development of the stepper motor is widely used in various fields, because it has good control effect. Therefore, the study of the stepper motor control system has a very important significance.
This design is stepper motor control system based microcomputer, hardware design uses STC89C52 microcontroller as the control core; select ULN2003 as driver provides pulse frequency drive stepper motor rotation; through acceleration and deceleration button keyboard, forward and reverse button and stop buttons to control the stepper motor speed, direction and stops, Then these several parameters was displayed on the LCD monitor 12864 by the speed sensor. Software design using KEIL software tools for C language, defined each module port, and write a stepper motor control acceleration and deceleration and reversing the process. finally to control the hardware circuit through debugging.
The design principle of economical and practical, through combination of software and hardware designed to achieve the effective control of the stepper motor rotation speed and direction. The system has good controllability and low coat.
Keywords: STC89C52; stepper motor; control systems; speed sensor
目 录
第一章 绪论 ..................................................................................................................................... 1
1.1课题背景 ............................................................................................................................ 1 1.2课题研究的目的及意义 .................................................................................................... 2 1.3系统设计的主要任务 ........................................................................................................ 2 第二章 总体方案设计 ..................................................................................................................... 3
2.1系统总体设计与分析 ......................................................................................................... 3 2.2各模块功能说明 ................................................................................................................ 3 2.3本章小结 ............................................................................................................................ 4 第三章 控制系统硬件分析与设计 ............................................................................................... 5
3.1.中央处理器模块 ............................................................................................................... 5
3.1.1单片机 .................................................................................................................... 5 3.1.2复位电路 ................................................................................................................ 7 3.1.3振荡电路 ................................................................................................................ 8 3.2显示模块 ............................................................................................................................ 8 3.3驱动模块 ............................................................................................................................ 9
3.3.1步进电机 .............................................................................................................. 10 3.3.2 ULN2003 ............................................................................................................... 11 3.4电源模块 .......................................................................................................................... 12 3.5键盘模块 .......................................................................................................................... 12 3.6本章小结 .......................................................................................................................... 13 第四章 控制系统软件分析与设计 ............................................................................................... 14
4.1 主程序流程图 ................................................................................................................. 14 4.2 12864显示程序流程图 .................................................................................................. 15 4.3正反转程序流程图 .......................................................................................................... 16 4.4加减速程序流程图 .......................................................................................................... 17 4.5本章小结 .......................................................................................................................... 17 第五章 系统的测试与结果分析 ................................................................................................... 18
5.1软件测试工具 .................................................................................................................. 18 5.2测试数据与分析 .............................................................................................................. 19
5.2.1圈数测试 .............................................................................................................. 19 5.2.2速度测试 .............................................................................................................. 19 5.3本章小结 .......................................................................................................................... 21 第六章 毕业设计总结 ................................................................................................................... 22 参考文献......................................................................................................................................... 23 致谢 ................................................................................................................................................ 24 附录 ................................................................................................................................................ 25
附录一 系统电路仿真图 ....................................................................................................... 25 附录二 系统实物图 ............................................................................................................... 26 附录三 单片机端口分配表 ................................................................................................... 27 附录四 系统程序 ................................................................................................................... 28
相关推荐: