在实际工业生产过程中,神经网络在线自适应整定比例-积分-微分(PID)参数的方法比PID控制器能更好地适应不同被控对象的不同特性。然而,常用的单片机单元(MCU)不能满足实时性和高可靠性的应用场景。因此,在本文中,提出了一种采用Xilinx现场可编程门阵列(FPGA)解决方案的基于BP神经网络(BPNN)PID控制器的闭环运动控制系统。在控制器的设计中,根据模块化的设计思想将其划分为几个子模块。前向传播模块用于完成从输入层到输出层的前向传播操作。PID模块实现PID算法到寄存器传输级(RTL)的映射,并负责完成控制量的输出。主状态机模块产生控制每个子模块的顺序执行的使能信号。错误反向传播和权值更新模块完成网络各层权值的更新。控制系统的外围模块分为两个主要部分。转速测量模块完成编码器输出脉冲信号的采集和电机转速的测量。脉宽调制(PWM)信号产生模块产生具有不同占空比的PWM波以控制电机的转速。采用Modelsim和Simulink联合仿真对系统进行仿真验证,并在开发平台上进行了测试分析。结果表明,该系统能够实现PID控制参数的自整定,还具有性能可靠的特点,高实时性能,抗干扰能力强。与单片机相比,收敛速度远远超过三个数量级,这证明了它的优越性。
In the actual industrial production process, the method of adaptively tuning proportional-integral-derivative (
PID) parameters online by neural network can adapt to different characteristics of different controlled objects better than the controller with
PID. However, the commonly used microcontroller unit (MCU) cannot meet the application scenarios of real time and high reliability. Therefore, in this paper, a closed-loop motion control system based on BP neural network (BPNN)
PID controller by using a Xilinx field programmable gate array (FPGA) solution is proposed. In the design of the controller, it is divided into several sub-modules according to the modular design idea. The forward propagation module is used to complete the forward propagation operation from the input layer to the output layer. The
PID module implements the mapping of
PID arithmetic to register transfer level (RTL) and is responsible for completing the output of control amount. The main state machine module generates enable signals that control the sequential execution of each sub-module. The error backpropagation and weight update module completes the update of the weights of each layer of the network. The peripheral modules of the control system are divided into two main parts. The speed measurement module completes the acquisition of the output pulse signal of the encoder and the measurement of the motor speed. The pulse width modulation (PWM) signal generation module generates PWM waves with different duty cycles to control the rotation speed of the motor. A co-simulation of Modelsim and Simulink is used to simulate and verify the system, and a test analysis is also performed on the development platform. The results show that the proposed system can realize the self-tuning of
PID control parameters, and also has the characteristics of reliable performance, high real-time performance, and strong anti-interference. Compared with MCU, the convergence speed is far more than three orders of magnitude, which proves its superiority.