资料详情

基于单片机的步进电机控制系统设计与实现毕业论文+原理图+程序

头像

电子类

编号:5143

基于单片机的步进电机控制系统

设计与实现

摘  要

步进电机是一种纯粹的数字控制电动机,是一种受电脉冲信号控制的无刷式直流电动机,是现代定位驱动装置的核心,广泛应用在机械、电力、纺织、电子、仪表、印刷以及航空航天、船舶、兵器等国防工业等领域。基于单片机的步进电机控制系统具有稳定度高、成本低、控制方便、应用范围广等特点。

本系统是由STC89C52单片机核心处理模块,遥控器命令输入模块,ULN2003及28BYJ-48步进电机组成的电机模块,12864液晶输出模块共同组成的基于单片机的步进电机控制系统。

本设计以载波为38KHZ的红外遥控器作为用户的控制端,它的功能是把用户的命令转换为红外信号。红外信号由TL1838接收,它可以将光信号转换为电信号,并将其发送给微控制器STC89C52。STC89C52对电信号进行相应处理即可获得用户所发出的指令,并依此来控制28BYJ48型四相八拍电机并以12864液晶作为当前状态的显示器。用户可以对步进电机进行加速、减速、正转、反转的控制。本步进电机控制系统具有精度高、运行稳定、控制方便、维护简单、应用范围广等特点。

关键词:STC89C52    12864液晶    步进电机   红外遥控

Design and Implementation of Stepper Motor Control System Based on MCU

Abstract

Stepper motor is a kind of pure digital control motor and brushless dc motor  controlled by electric pulse signal type. Stepper motor is the core of the modern orientation drive, widely used in machinery, electric power, textile, electronics, instruments, printing and aerospace, ships, weapons, and other areas of the defense industry, etc. The characteristics of the stepping motor control system based on single chip microcomputer include high stability, low cost, convenient control and wide application , etc.

The stepper motor control system consists of core processor using the single chip processor, command input control module using IR remote control , display module using 12864 LCD and 28BYJ48 stepping motor module which using ULN2003 as driver.

The infrared remote control with carrier for 38 KHZ is used as the control end of  the user, which can convert the users’ commands into the infrared signal. The TL1838 can receive the infrared signal and convert it into electrical signal, which input to tSTC89C52.The MCU can obtain instructions of users by processing the incoming signal and control stepping motor of the 28BYJ48 type, the current status can be shown by 12864 LCD. Users could control acceleration, deceleration, forward, inversion for the stepping motor. The features of the control system of stepper motor includes high precision, stable running, convenient control and simple maintenance and wide application, etc.

Key word: MCU; 12864 LCD; Stepper Motor; Infrared remote control


目     录

1 引言 1

2 总体设计方案 2

2.1 系统设计原理 2

2.2 总体设计框图 2

3系统硬件模块的组成 3

3.1单片机控制模块 3

3.1.1 STC89C52主要结构 3

3.1.2 STC89C52功能特性描述 3

3.1.3 时钟电路 6

3.1.4复位电路 6

3.2 步进电机模块 7

3.2.1 步进电机简介 7

3.2.2步进电机的结构 8

3.2.3 28BYJ-48步进电机工作原理 8

3.3 ULN2003芯片概述与特点 9

3.4 红外线发射接收模块 10

3.4.1 红外线遥控的介绍 10

3.4.2红外通信基本原理 10

3.4.3 红外遥控发射系统 12

3.4.4 红外遥控接收系统 12

3.4.5 TL1838与单片机的接口 14

3.5 12864显示模块 14

3.5.1 12864液晶的特点 14

3.5.2 12864液晶的引脚说明 15

3.5.3 12864液晶的读写操作 17

3.5.4 12864液晶的控制指令 17

3.5.5 12864液晶接口电路 20

3.6 蜂鸣器模块 20

3.6.1 蜂鸣器介绍 20

3.6.2 蜂鸣器的接口电路 21

4 软件设计与调试 22

4.1 主程序流程图 22

4.2程序设计思路 23

4.2.1 遥控器的解码 23

4.2.2 步进电机的控制 23

4.2.3 显示屏的控制 24

4.2.4 蜂鸣器的控制 24

4.2.5 模块中的通信 24

5 编程与下载软件 25

5.1 Keil软件 25

5.2 STC-ISP下载软件 26

6 硬件电路制作 27

6.1 原理图的绘制 27

6.2 电路实现的基本步骤 27

7 结 论 30

谢  辞 31

参考文献 32

附  录 33