基于PID控制的直流电机调速系统设计 联系客服

发布时间 : 星期四 文章基于PID控制的直流电机调速系统设计更新完毕开始阅读

基于PID控制的直流电机调速系统

【摘要】:在工业自动控制系统和各种智能产品中常常会用用电机进行驱动、传动和控制,而现代智能控制系统中,对电机的控制要求越来越精确和迅速,对环境的适应要求越来越高。随着科技的发展,通过对电机的改造,出现了一些针对各种应用要求的电机,如伺服电机、步进电机、开关磁阻电机等非传统电机。但是在一些对位置控制要求不高的电机控制系统如传动控制系统中,传统电机如直流电机乃有很大的优势,而要对其进行精确而又迅速的控制,就需要复杂的控制系统。随着微电子和计算机的发展,PID控制技术应用越来越广泛,数字控制系统有控制精确,硬件实现简单,受环境影响小,功能复杂,系统修改简单,有很好的人机交换界面等特点。

本设计以上面提到的数字PID为基本控制算法,以单片机为控制核心,产生占空比受数字PID算法控制的PWM脉冲实现对直流电机转速的控制。同时利用霍尔传感器将电机速度转换成脉冲频率反馈到单片机中,实现转速闭环控制,达到转速无静差调节的目的。

【关键词】:直流电机;单片机;霍尔传感器;PID控制

【Abstract】:In industrial automatic control systems and a variety of smartproducts are

often used to drive electric motor, transmission andcontrol, and modern intelligent control systems, motor control requirements for more accurate and rapid adaptation to the environment have become increasingly demanding high. With the development of technology, through the transformation of the motor, there are some requirements of the motor for various applications such as servo motors, stepper motors, switched reluctance motors and other non-traditional motor. However, insome of the less demanding position control motor controlsystems such as transmission control systems, such asconventional DC motors is a great advantage, but to be preciseand quick control, we need a complex control system. With the development of microelectronics and computers, PID controltechnology becomes more widespread, digital control system, precise control and simple hardware implementation, subject toenvironmental impact, functional complexity, system changessimple, good man-machine interface and other exchangecharacteristics.

The design for the above-mentioned basic digital PID control algorithm for the control of the microcontroller core, produced by the digital PID algorithm to control the duty cycle of the PWMpulse to achieve the DC motor speed control. At the same timethe use of Hall sensors into pulse frequency motor speedfeedback to the microcontroller to achieve closed-loop speedcontrol, to adjust the speed of the purpose of static error-free.

【Key words】:DC motor ; single - chip Microcomputer ; hall position sensor ; PID control

目 录

1

绪 论 ............................................................................................................................................. 1 1.1 1.2 1.3 1.4 2

本课程的选题背景 ................................................................................................................. 1 直流电机简介 ......................................................................................................................... 2 系统开发软硬件概述 ............................................................................................................. 9 本课题研究的基本内容 ....................................................................................................... 12

直流电机PID调速系统设计方案 ............................................................................................... 13 2.1 2.2

系统总体设计方案 ............................................................................................................... 13 系统设计原理 ....................................................................................................................... 28

3 直流电机PID系统硬件设计 ....................................................................................................... 36 3.1 3.2 3.3 3.4

H桥驱动电路设计方案 ....................................................................................................... 36 调速设计方案 ....................................................................................................................... 37 系统硬件电路设计 ............................................................................................................... 38 基于单片机控制流程 ........................................................................................................... 40

4 直流电机PID系统软件设计 ....................................................................................................... 42 4.1 4.2 4.3

如何应用PID控制电机转速 ............................................................................................... 42 调速系统主程序原理框图 ................................................................................................... 48 中断服务程序原理框图 ....................................................................................................... 49

5 6 7 8

结 论 ........................................................................................................................................... 51 致 谢 ........................................................................................................................................... 51 参考文献 ....................................................................................................................................... 52 附 录 ........................................................................................................................................... 53

基于PID控制的直流电机调速系统

1 绪 论

1.1 本课程的选题背景

PID控制器(按闭环系统误差的比例、积分和微分进行控制的调节器)自30年代末期出现以来,在工业控制领域得到了很大的发展和广泛的应用。它的结构简单,参数易于调整,在长期应用中已积累了丰富的经验。特别是在工业过程控制中,由于被控制对象的精确的数学模型难以建立,系统的参数经常发生变化,运用控制理论分析综合不仅要耗费很大代价,而且难以得到预期的控制效果。在应用计算机实现控制的系统中,PID很容易通过编制计算机语言实现。由于软件系统的灵活性,PID算法可以得到修正和完善,从而使数字PID具有很大的灵活性和适用性,其中数字PID控制器是由软件编程在计算机内部实现的。

PWM控制的基本原理很早就已经提出,但是受电力电子器件发展水平的制约,在上世纪80年代以前一直未能实现。直到进入上世纪80年代,随着全控型电力电子器件的出现和迅速发展,PWM控制技术才真正得到应用。随着电力电子技术、微电子技术和自动控制技术的发展以及各种新的理论方法,如现代控制理论、非线性系统控制思想的应用,PWM控制技术获得了空前的发展。到目前为止,已经出现了多种PWM控制技术。

PWM控制技术以其控制简单、灵活和动态响应好的优点而成为电力电子技术最广泛应用的控制方式,也是人们研究的热点。由于当今科学技术的发展已经没有了学科之间的界限,结合现代控制理论思想或实现无谐振软开关技术将会成为PWM控制技术发展的主要方向之一。

在电机控制系统开发中,常常需要消耗各种硬件资源,系统构建时间长,而在调试时很难对硬件系统进行修改,从而延长开发周期。随着计算机仿真技术的出现和发展,可用计算机对电机控制系统进行仿真,从而减小系统开发开支和周期。计算机仿真可分为整体仿真和实时仿真。整体仿真是对系统各个时间段对各个对象进行计算和分析,从而对各个对象的变化情况有直观的整体的了解,即能对系统进行精确的预测,如Proteus就是一个典型的实时仿真软件。实时仿真是对时间点的动态仿真,即随着时间的推移它能动态仿真出当时系统的状态。Proteus是一个实时仿真软件,用来仿真各种嵌入式系统。它能对各种微控制器进行仿真,本系统即用Proteus对直流电

1