1、I 摘 要 本文介绍了单片机控制步进电机的系统。在电气时代的今天,电动机一直在现代化 的生产和生活中起着十分重要的作用。 步进电机是机电控制中一种常用的执行机构, 其 原理是通过对它每相线圈中的电流和顺序切换来使电机作步进式旋转。本系统的硬件组 成主要有:51 系列单片机、L298N 驱动电路、直流电压源等。同时对系统设计中所用 到的一些软件都进行了介绍。本系统用 51 系列单片机和 L298N 电机驱动芯片并加入了 键盘来控制步进电机实现转向、转速等。系统中使用的是永磁式二相步进电机,相应的 驱动和控制电路对于其整体性能起着非常重要的作用。 经系统调试,能够很好的控制步进电机的正反转、加减速
2、、急停,从而达到预期目 的。整个系统具有结构简单、可靠性高、成本低和实用性强等特点,具有较高的通用性 和应用推广价值。 关键词:51 系列单片机;L298N 驱动电路;正反转;急停 II Abstract This paper, we introduces a stepper motor system which controlled by SCM. In the Electrical era today, Motor has been playing a very important role in the modernization of production and life. Step
3、per motor is a common used implementing agency in motor control. The principle is by switching the coil current and the order in its each phase to make a step-by-step rotary motor. The hardware of the system including: 51 series SCM, L298N driving circuit, DC voltage source , etc. At the same time s
4、ome of the software that used in system designing are introduced. The system used 51 SCM and L298N motor drive chip and joined the keyboard to control the stepper motor to achieve the direction and speed of rotation, etc. A Permanent Magnet two-phase stepper motor is used in the system. The correspo
5、nding drive and control circuit plays a very important role to its overall performance. Though system testing, it can be very convenient to control the stepper motor, such as acceleration , deceleration, exigency stop so as to achieve the desired objectives. The whole system is simple in structure w
6、ith characteristics of high reliability, low cost and practicality which has a higher universal characteristic and the promotional and applied value. Keywords: 51 SCM; L298N driving circuit; Positive and reversal rotation; Exigency 沈阳理工大学学士学位论文 III 目 录 1 绪论 . 1 1.1 技术概述 1 1.2 本课题的背景和意义 2 1.3 本设计完成的工作 3 2 单片机控制步进电机系统简介 . 4 2.1 单片机系统概述 4 2.2 AT89C51 功能概述 4 2.2.1 引脚功能说明 . 5 2.2.2 时钟振荡器 . 7 2.3 步进电机概述 7 3 常用软件基础知识 . 9 3.1 C 语言程序设计概述. 9 3.1.1 C 语言出现的历史背景 9 3.1.2 C 语言的特点 10 3.2 Keil 编译器软件简介 12 3.2.1