基于PID算法的LabVIEW温控系统设计与仿真
2021-04-04崔业梅杨焕峥
崔业梅 杨焕峥






摘 要:为了提高温控系统的控制精度,采用热电偶测量温控系统的温度,将采集的电压信号进行放大,由STM32F103芯片进行A/D转换、运行PID算法、输出PWM信号对温控系统的温度进行快速与稳定控制,并通过该芯片的串口将当前温度值上传上位机,上位机运行LabVIEW软件,编有程序框图和前面板程序,程序框图包含串口发送和接收数据程序,前面板包含数据波形、仪表显示。通过Proteus和LabVIEW软件联合仿真表明,系统控制温度精度高、快速与稳定、界面友好,通过进一步提高温度控制范围,可适用于更多加热场合。
关键词:温度控制;算法;虚拟仪器;微控制器;仿真
中图分类号:TP368;TN72 文献标识码:A 文章编号:2096-4706(2021)18-0040-04
Abstract: In order to improve the control accuracy of the temperature control system, the thermocouple is used to measure the temperature of the temperature control system, amplify the collected voltage signal, conduct A/D conversion by STM32F103 chip, run PID algorithm and output PWM signal to quickly and stably control the temperature of the temperature control system, upload the current temperature value to the upper computer through the serial port of the chip, and the upper computer runs LabVIEW software, The program block diagram and front panel program are compiled. The program block diagram includes the serial port sending and receiving data program, and the front panel includes data waveform and instrument display. The joint simulation of Proteus and LabVIEW software shows that the system has high temperature control accuracy, fast and stable, friendly interface, and can be applied to more heating occasions by further improving the temperature control range.
Keywords: temperature control; algorithm; virtual instrument; microcontroller; simulation
0 引 言
溫控系统在各种加热场合应用广泛,研究温度控制具有重要意义。测温元件热电偶可以将检测的温度转变为电压信号输出。由运算放大器芯片构成的放大电路可以将热电偶输出的电压信号进行放大[1]。PID算法是控制行业经典的算法,被广泛用于温度控制、电机转速控制等[2,3]。意法半导体集团的STM32F103芯片内部包含有A/D转换、串口通信、定时器等功能模块,可以运行PID算法等程序,可以采用“多合一”STM32CubeIDE集成软件对该芯片进行图形化的配置、编写功能程序、进行程序编译与下载等工作[4]。LabVIEW软件可用于图形化的虚拟仪器编程,实现数据采集、系统设计、界面显示等功能[5]。Proteus软件可以绘制STM32F103等芯片构成的电路,并结合LabVIEW软件进行功能仿真[6]。虚拟串口助手软件可以在两个串口进行连接调试时使用。……
