基于单片机与超声波传感器的步进电机控制器毕业设计
时间:2025-04-02
时间:2025-04-02
摘 要
步进电机是将电脉冲信号转变为角位移或线位移的开环控制元步进电机件。在非超载的情况下,电机的转速、停止的位置只取决于脉冲信号的频率和脉冲数,而不受负载变化的影响,当步进驱动器接收到一个脉冲信号,它就驱动步进电机按设定的方向转动一个固定的角度,称为“步距角”,它的旋转是以固定的角度一步一步运行的。可以通过控制脉冲个数来控制角位移量,从而达到准确定位的目的;同时可以通过控制脉冲频率来控制电机转动的速度和加速度,从而达到调速的目的。因此,步进电机以其精准的控制特性,广泛应用于执行器件中。
本文设计了基于单片机的步进电机控制器,系统采用AT89S52型单片机作为主控制器电路。采用步进电机驱动芯片ULN2003趋动28BYJ-48型四相八拍步进电动机,设计了对应的按键控制电路和LCD状态显示电路。 AT89S52的控制指令通过光耦TLP521-4控制ULN2003,根据计算控制脉冲时序,算出电机转过的步数或圈数,用LCD1602A显示步进电机运行状态和转速。各控制按键功能用无线收发模块PT2262/2272作为辅助,共同实现步进电机的控制。同时整个系统作为一个执行部件,嵌入到其他的微机控制系统中。外部微机通过MAX232芯片将信号转化为RS232协议信号,与主控制器控制器进行通信。AT89S52通过内部程序识别外部微机的控制信号,对控制系统进行控制,使得本系统的应用范围与可靠性大大提高。 关键词 单片机;达林顿管;步进电动机;串口通信
Abstract
Stepping motor is will signal into electrical impulses for angular displacement or line open loop control the displacement of stepping motor parts. In the overload of the cases, motor speed, stop depends only on the position of the pulse signal frequency and pulse count, and do not suffer the effect of load changes, when stepping drive to receive a pulse signal, it will drive stepping motor set according to turn a fixed Angle, called "step from the corner", it is the point of view of the rotation of the fixed step by step of operation. Can through the control pulse to control the number of angular displacement quantity, so as to achieve the purpose of accurate positioning; At the same time can through the control pulse frequency to control motor rotation speed and acceleration, so as to achieve the purpose of speed. Therefore, stepping motor with its precise control characteristics, widely used in execution of the device.In this paper, based on SCM stepping motor controller, system adopts single-chip microcomputer as the main controller AT89S52 type circuit. The control instruction through light AT89S52 decoupling method-4 control ULN2003, according to computation control pulse timing, calculate efficiency or motor turned laps, with LCD1602A display stepping motor running state and speed. The control key function in a wireless transceiver module PT2262/2272 as the assistant to accomplish the step motor control. And the whole system as an executive components, embedded in other microcomputer control system. External microcomputer through the MAX232 chips will signal into RS232 agreement signals, and the main controller controller for communication. AT89S52 devices through the internal process of external microcomputer control signal to identify, for the control system to control, so the system application range and reliability is greatly increased.
Key words: SCM; Optocoupler; Photo-Darling tons; Stepping motor; SPCP-Serial Port
目 录
1 概 述 ............................................................. 1 1.1 研究设计步进电机控制器的意义 .................................. 1 1.2 步进电机基础知识 .............................................. 1 1.2.1 步进电机原理 .............................................. 2 1.2.2 感应子式步进电机工作特点 .................................. 3 1.3 本文主要完成的工作 ............................................ 4 2 系统整体方案的设计 ................................................ 6 2.1 总体方案拟定 .................................................. 6 2.2 步进电机控制器各功能模块介绍 .................................. 7 2.2.1 步进电机控制器模块设计 .................................... 7 2.2.2 输入控制模块设计 .......................................... 7 2.2.3 驱动模块设计 .............................................. 7 2.2.4 输出显示模块设计 .......................................... 8 2.2.5 串口通讯模块设计 .......................................... 8 3 硬件电路设计 ...................................................... 9 3.1 主控制器电路设计及芯片选型 .................................... 9 3.1.1 时钟电路设计 .............................................. 9 3.1.2 复位电路 ................................................. 10 3.1.3 主控制器最小系统设计 ..................................... 11 3.2 输出驱动驱动电路设计 ......................................... 12 3.3 输出状态显示电路设计 ......................................... 13 3.4 串口通讯电路设计 ............................................. 16 4 软件设计 ......................................................... 19 4.1 C51语言...................................................... 19 4.2 整体程序设计框图 ............................................. 20 4.3 步进电机控制程序 ............................................. 20 4.4 液晶显示1602程序设计 ........................................ 22 4.5 微机通讯软件设计 ............................................. 24
5 Proteus仿真分析 ................................................. 28 5.1 步进电 …… 此处隐藏:9984字,全部文档内容请下载后查看。喜欢就下载吧 ……
上一篇:变压器原理和结构
下一篇:招生宣传策划的四大病症