基于单片机的伺服电机转速控制系统
- 格式:doc
- 大小:1.73 MB
- 文档页数:64
内蒙古科技大学毕业设计说明书(毕业论文)
I 基于单片机的伺服电机转速控制系统
摘 要
传统的晶闸管直流调速系统,其控制回路都是采用模拟电子线路构成的,晶闸管触发器多数还是采用分立元件组成的,这使得控制回路的硬件设备极其复杂,安装调试困难,相对故障率较高。针对传统的晶闸管直流调速系统的一些不足,提出了一种基于单片机的伺服电机转速控制系统的设计方法,并介绍了PID控制算法的设计。
本设计使用AT89C52作为控制芯片,以PI(比例-积分)调节控制算法为基础, 采用软件编程产生脉宽比可控的脉宽调制信号,再通过功率放大电路H桥驱动电路来控制伺服电机电枢电压,从而完成对伺服电机转速的调节,达到了较好的控制性能。同时通过4*4小键盘输入设定的伺服电机转速,用光电编码器来测定伺服电机转速,显示在4位LED上。
关键词:直流调速;PID控制算法;AT89C52;脉宽调制;伺服电机 内蒙古科技大学毕业设计说明书(毕业论文)
II The Servo Motor Speed Control System Based On MCU
Abstract
The conventional DC drive system of SCR, which Control loop is consisting of simulate
electronic circuits, and the SCR trigger is mostly made up of the discrete component, so the
hardware devices are extremely complex in the Control loop,the installation and trial run
difficultly, the relative failure rate is high. To solve the problems, this paper presents one kind
design method of the servo motor speed control system based on MCU, and introduces the
design of the PID control algorithm.
This design uses AT89C52 as the controller chip, takes PI (proportion - integral) regulation
control algorithm to be the foundation, adopts software programming to get the signal for
Pulse-Width-Modulation, and controls the armature voltage of servo motor through H bridge
driving circuit in power amplification electric circuit, thus it completes to adjust the servo
motor rotational-speed, and achieves the good control performance. Meanwhile it sets the
servo motor rotational-speed through the 4*4 small keyboard, and minutes the speed of the
servo motor by the optical encoder, then shows the speed of the servo motor on the 4 LED.
Key word: Direct-current speed regulation; PID control algorithm; AT89C52;
Pulse-Width-Modulation; Servo motor 内蒙古科技大学毕业设计说明书(毕业论文)
III 目 录
摘 要 ......................................................................................................................................... I
Abstract ......................................................................................................................................II
第一章 引 言 ............................................................................................................................ 1
1.1 课题的研究背景及意义 ............................................................................................. 1
1.2 转速控制系统设计目标及技术要求 ......................................................................... 3
第二章 伺服电机转速控制系统设计 ...................................................................................... 4
2.1 系统硬件组成原理 ..................................................................................................... 4
2.2 PID控制算法简介 ....................................................................................................... 4
2.2.1 位置式PID控制算法 ...................................................................................... 6
2.2.2 增量式PID算法 .............................................................................................. 8
第三章 硬件部分的设计 ........................................................................................................ 12
3.1 直流电机调速原理 ................................................................................................... 12
3.2 PWM波形发生电路 .................................................................................................. 13
3.2.1 PWM基本原理 ............................................................................................... 13
3.2.2 PWM信号的产生 ........................................................................................... 14
3.3 PWM功率放大电路 .................................................................................................. 15
3.3.1 H桥驱动电路原理 ......................................................................................... 15
3.3.2 PWM驱动电路原理图 ................................................................................... 17
3.4 测速电路 ................................................................................................................... 18
3.5 键盘电路 ................................................................................................................... 19
3.6 LED显示电路 ........................................................................................................... 21
3.7 AT89C52的时钟电路 ............................................................................................... 23 内蒙古科技大学毕业设计说明书(毕业论文)
IV 3.8 AT89C52的复位电路 ............................................................................................... 24
第四章 软件部分的设计 ........................................................................................................ 26