宋晓伟 樊战亭 田锐

摘 要:对于直流电机模拟调速的局限性,这里设计一种使用PID算法的直流电机数字调速装置。该系统主要由液晶显示模块、电源模块、功能选择模块、电机驱动模块、电机测速模块五大部分组成。以STC89C52单片机为控制核心,通过定时器产生PWM控制MX1508驱动电路来控制电机转速。电机轴上接有码盘,测速模块来获得电机的实际速度。按键输入电机设定速度与当前速度进行PID算法计算来保持电机速度稳定。
关键词:PID算法;STC89C52单片机;PWM;MX1508
中图分类号:TM33 文献标志码:A 文章编号:2095-2945(2018)13-0053-02
Abstract: For the limitation of DC motor analog speed regulation, a DC motor digital speed regulation device using PID algorithm is designed. The system is mainly composed of liquid crystal display module, power module, function selection module, motor driving module, and motor speed measurement module. With STC89C52 single chip microcomputer as the control core, PWM is generated by timer to control the speed of the motor by the MX1508 drive circuit. The motor shaft is connected with a code plate and the speed measurement module is used to obtain the actual speed of the motor. The key input motor setting speed and current speed are calculated by PID algorithm to keep the motor speed stable.
Keyword: PID algorithm; STC89C52 single-chip microcomputer; PWM; MX1508
引言
數字调速系统具有控制精确度高,非常稳定,受环境影响小,效率高等优点,所以在国内外的使用越来越广泛。近年来,直流电动机的机构和控制方式都发生了很大的变化。基于数字PID控制的直流电机控制调速已成为直流电机新的调速方式。这种调速方法具有运行稳定、动态性能好、效率高、对转速的实时显示等优点,更重要的是这种控速方式很容易在单片机控制系统中实现,因此具有很好的发展前景。
本项目采用单片机控制下PID小功率调速,能够为今后研究大功率直流数字调速奠定良好的基础。
1 直流电动机PID转速控制系统
直流电动机转速控制系统由软件设计和硬件电路设计两大部分组成。软件设计主要包括PID算法设计、lcd显示程序设计、功能按键函数设计。硬件电路由驱动模块、测速模块、显示模块、电源模块、功能选择模块等构成。
2 软件设计
2.1 PID算法设计
按偏差的比例、积分、微分进行控制的调节器简称为PID调节器。……