{$cfg_webname}
主页 > 电子信息 > 单片机 >

基于AT89C51单片机的伺服电机控制系统(匀速及变速控制)

来源:wenku163.com  资料编号:WK1632726 资料等级:★★★★★ %E8%B5%84%E6%96%99%E7%BC%96%E5%8F%B7%EF%BC%9AWK1632726
资料介绍
摘  要
本片设计方案主要是利用单片机AT89C51实现对伺服电机的匀速及变速控制,并试用于电脑彩色喷印机已实现对喷印过程的平稳控制,并能精确控制喷印位置。
伺服电动机在伺服系统中控制机械元件运转的发动机.是一种补助马达间接变速装置。又称执行电动机,在自动控制系统中,用作执行元件,把所收到的电信号转换成电动机轴上的角位移或角速度输出。分为直流和交流伺服电动机两大类,其主要特点是,当信号电压为零时无自转现象,转速随着转矩的增加而匀速下降。
作用:伺服电机,可使控制速度,位置精度非常准确。(毕业设计网 )
直流伺服电机分为有刷和无刷电机。
有刷电机成本低,结构简单,启动转矩大,调速范围宽,控制容易,需要维护,但维护方便(换碳刷),产生电磁干扰,对环境有要求。因此它可以用于对成本敏感的普通工业和民用场合。
无刷电机体积小,重量轻,出力大,响应快,速度高,惯量小,转动平滑,力矩稳定。控制复杂,容易实现智能化,其电子换相方式灵活,可以方波换相或正弦波换相。电机免维护,效率很高,运行温度低,电磁辐射很小,长寿命,可用于各种环境。
交流伺服电机也是无刷电机,分为同步和异步电机,目前运动控制中一般都用同步电机,它的功率范围大,可以做到很大的功率。大惯量,最高转动速度低,且随着功率增大而快速降低。因而适合做低速平稳运行的应用。
控制系统采用MCS51系列单片机AT89C51作为处理器系统,时钟可达12MHz,运算速度快,控制功能完善,其内部具有128字节RAM,而且内部还有4kb的EPROM不需要外扩展存储器,可使系统整体结构更为简单、实用。
AT89C51是一种4k字节闪烁可编程可擦除只读存储器(FPEROM—Flash Programmable and Erasable Read Only Memory)的低电压,高性能CMOS8位微处理器,俗称单片机。AT89C2051是一种带2k字节闪烁可编程可擦除只读存储器的单片机。单片机的可擦除只读存储器可以反复擦除100次。该器件采用ATMEL高密度非易失存储器制造技术制造,与工业标准的MCS-51指令集和输出管脚相兼容。由于将多功能8位CPU和闪烁存储器组合在单个芯片中,ATMEL的AT89C51是一种高效微控制器,AT89C2051是它的一种精简版本。AT89C单片机为很多嵌入式控制系统提供了一种灵活性高且价廉的方案。
关键词  AT89C51单片机 伺服电机 速度控制方式 位置控制方式
. Abstract
The film design is the use of SCM AT89C51 achieve the uniform and the servo motor speed control, and tested in a computer color jet printing machine has been on the jet printing process to achieve a smooth control, and can precisely control jet printing location.
Servo motor control in the servo system mechanical components operation of the engine. Motor is a kind of indirect subsidy speed devices. Also known as the Executive Motor, in the automatic control system that is used for the implementation of components of the received signal into motor axis angular velocity or displacement output. DC and AC divided into two categories servo motor, and its main feature is that, when the signal voltage zero without rotation phenomenon, the increase in speed and torque with the decline in uniform.
Role: servo motors, can control the speed, location accuracy is very accurate.
Into a DC servo motor brush and brushless motor.
Brush Motor low cost, simple structure, starting torque, speed range, and easy to control, the need to protect, but easy maintenance (F Brush), resulting in electromagnetic interference, on the environment is required. Therefore it can be used for cost-sensitive industrial and civil ordinary occasions.
Brushless motor small size, light weight, output, fast response, high-speed, inertia of small, smooth rotation, torque stability. Control complex, easy to implement intelligent, and its electronic commutation is flexible, square wave commutation or sinusoidal commutation. Motor maintenance-free, high efficiency, low operating temperature, electromagnetic radiation small, long-life, can be used for various environmental.
AC servo motor brushless motor is divided into synchronous and asynchronous motors, motion control in general use synchronous motor, the scope of its power, can do great power. The inertia of the maximum rotational velocity is low, and with the rapid increase of power reduced. Thus suitable for low-speed applications running smoothly.
MCS51 control system uses a series of SCM AT89C51 as processor system, up to 12 MHz clock, and computing speed, improved control functions, with its internal 128 bytes of RAM and 4 KB of internal EPROM have no need of expansion memory, the overall structure of the system more simple and practical.
AT89C51 is a flicker with 4K bytes can be programmable EEPROM (FPEROM-Flash Programmable and Erasable Read Only Memory), low-voltage, high-performance CMOS8-bit microprocessor, commonly known as SCM. AT89C2051 is a flicker with 2 K bytes EEPROM can be programmable MCU. SCM can be EEPROM can be erased repeated 100 times. The device is ATMEL manufacture high-density non-volatile memory technology, and industry-standard instruction set MCS-51 compatible and output pins. Due to the eight-CPU and flash memory portfolio in a single chip, ATMEL the AT89C51 is an efficient microcontrollers, AT89C2051 is a streamlined version of it. AT89C MCU for many embedded control system provides a more flexible and inexpensive options.
Key words:AT89C51 SCM servo motor speed control position control mode

伺服系统
用来精确地跟随或复现某个过程的反馈控制系统。又称随动系统。在很多情况下,伺服系统专指被控制量(系统的输出量)是机械位移或位移速度、加速度的反馈控制系统,其作用是使输出的机械位移(或转角)准确地跟踪输入的位移(或转角)。伺服系统的结构组成和其他形式的反馈控制系统没有原则上的区别。
伺服系统一般有两种控制方式:分布式和集中式控制系统。

本控制系统选用松下MSMA082A1C型交流伺服电机,通过以单片机控制器实现对伺服电机的控制。伺服电机的控制方式主要有位置控制、速度控制两种,为了提高其带动喷头运行的平稳性,选用了速度控制方式实现对伺服电机的控制,以利用伺服电机系统自带的S型曲线控制模型,达到理想的控制效果。系统组成框图如图3-1所示,其中单片机控制器向伺服驱动器输出控制信号,再通过伺服驱动器驱动伺服电机按要求动作,同时,控制器接收固定在伺服电机转轴上的光电编码盘随着电机转动而产生的反馈脉冲信号,以实现对伺服电机带动的喷头运行位置的检测控制,形成闭环控制系统。为了实现对喷印位置的精确控制,所以选用了分辨率为2000p/r的光电码盘作位置传感单元,将伺服电机转轴的转角位置变换成电脉冲信号,以供单片机控制器对喷印位置进行跟踪控制。 











目  录
第一章 绪论 1
第二章 总体设计方案确定 6
2.1 引言 6
2.2 伺服系统 6
2.3 AT89C51内部结构与功能 7
2.3.1 AT89C51主要性能 7
2.3.2 AT89C51的结构 8
2.3.3 AT89C51的引脚说明 8
2.4 振荡器和专用寄存器功能 9
2.4.1振荡器特征 9
2.4.2专用功能寄存器(SFR) 10
2.5 指令约束条件和CPU的工作方式 10
2.5.1 指令约束条件 10
2.5.2 程序存储器加密位 11
2.5.3 CPU工作方式 11
2.6 脉冲编码器 12
第三章 系统硬件设计 16
3.1 控制系统设计 16
3.2 单片机控制器的硬件设计 18
3.3 伺服交流电动机参数设定 20
3.4 交流伺服驱动装置 21
(毕业设计网 )
第四章 系统软件设计 23
4.1 流程图设计及计算 23
4.2 显示程序 25
4.3 控制主程序 29
4.4 速度控制子程序 38
4.5 系统总程序 39
第五章 总  结 53
致  谢 54
参考文献 55
附录 56
推荐资料