PID adjusting method based on PSO-BP and Kalman filtering

Through the PSO-BP neural network optimization and combined with Kalman filtering processing, the PID controller is solved, and the problem of instability of PID controller in nonlinear systems is achieved, adaptive adjustment and noise interference reduction are achieved, and system performance and stability are improved. sex.

CN119087777APending Publication Date: 2024-12-06YANGTZE DELTA REGION INST (QUZHOU) UNIV OF ELECTRONIC SCI & TECH OF CHINA +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411032413.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

PID controllers perform unstable in nonlinear systems, especially due to the instability of output due to errors caused by noise, which makes it difficult to adjust adaptively.

Method used

The parameters of the PID controller are optimized based on PSO-BP neural network, combined with Kalman filtering to reduce noise interference, the proportion, integral and differential term parameters are adjusted adaptively through the BP neural network, and the initial weight is optimized using the PSO particle swarm algorithm. Filter the output value to improve system stability.

Benefits of technology

The performance of nonlinear systems is improved in complex scenarios, adaptive adjustment of PID controllers and reduced noise interference are achieved, and the optimization effect of PID controllers is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119087777A_ABST
    Figure CN119087777A_ABST
Patent Text Reader

Abstract

The invention discloses a PID adjustment method based on PSO-BP and Kalman filtering, and relates to the field of automatic control, and the method comprises the steps: adding a BP neural network, optimizing the initial connection weight of the BP neural network through a PSO particle swarm optimization algorithm, carrying out the self-adaptive adjustment of a neural output layer of the BP neural network, obtaining the parameters kP, ki and kd, and carrying out the noise reduction through a Kalman filter. And iteratively outputting the optimal PID control value of the nonlinear model. The performance of a nonlinear system in a complex scene is improved, noise interference output by the system is adjusted in a self-adaptive mode, and therefore optimization of a PID controller in a certain set state is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of automatic control, and in particular to a PID adjustment method based on PSO-BP and Kalman filtering. Background Art

[0002] PID control algorithm is widely used in linear systems, with good robustness and stability, and simple design. Due to the fixed control parameters of PID controller, it is usually used in linear systems. For some nonlinear systems, the effect of PID controller will be significantly reduced. At the same time, PID controller itself has some limitations, and the error caused by noise will cause the PID controller to produce unstable output.

[0003] In view of the fact that the error caused by noise in the PID controller itself can lead to unstable output, a PID control method based on PSO-BP and Kalman filtering is urgently needed. Summary of the invention

[0004] The present invention solves the problems of the prior art by using a PID adjustment method based on PSO-BP and Kalman filtering.

[0005] In a first aspect, the present invention provides a PID adjustment method based on PSO-BP and Kalman filtering, comprising:

[0006] Establish a BP neural network and randomly generate unoptimized random initial connection weights w ij (0), w li (0) and calculate the control parameter k P , k i , k d and the system output value y out .

[0007] The initial connection weights of the BP neural network are optimized using the PSO particle swarm algorithm.

[0008] Compare the given value r in (k) and system output value y out (k), calculation error error(k) = r in (k)-y out (k).

[0009] The error signal is passed forward, the weights of the BP neural network are updated, and the system's instant output value is output.

[0010] Reassign k according to the output result P , k i , k d , the result is calculated through the incremental PID algorithm and loaded into the load module.

[0011] The output value y(k+1) of the load module is sent to the Kalman filter module for processing, and the Kalman equation is used to estimate the optimal value, that is, the output y obtained after filtering. out (k+1) and determine whether the requirements are met based on the error error(k+1) to end the loop.

[0012] The PID control method based on PSO-BP and Kalman filtering provided by the present invention improves the performance of nonlinear systems in complex scenarios, and adaptively adjusts the noise interference of the system output, thereby achieving the optimization of the PID controller under a certain given state. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of the present invention, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0014] Figure 1 A schematic diagram of a framework of a PID adjustment method based on PSO-BP and Kalman filtering provided by an exemplary embodiment of the present invention.

[0015] Figure 2 A schematic diagram of the BP neural network structure in a PID control method based on PSO-BP and Kalman filtering provided by an exemplary embodiment of the present invention.

[0016] Figure 3 An algorithm flow chart of a PID control method based on PSO-BP and Kalman filtering provided by an exemplary embodiment of the present invention.

[0017] Figure 4 A control curve comparison diagram of a PID adjustment method based on PSO-BP and Kalman filtering and other methods provided in an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0018] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention.

[0019] The technical concept of the present invention:

[0020] The PID control algorithm is based on system feedback and adjusts the controller output according to the current error through the proportional term k P , integral term k i and the differential term k dThe output is adjusted continuously. However, due to the fixed control parameters, the performance of the traditional PID control algorithm is significantly reduced for nonlinear models in complex scenarios. The BP neural network has good adaptive learning ability. Considering introducing the BP neural network into the PID control algorithm and optimizing the initial weights through the PSO particle swarm algorithm, it can adaptively adjust the neuron output layer and obtain the parameter k P , k i , k d Then the Kalman filter is used to reduce the noise interference, so as to achieve the optimization of the PID controller under a certain given state.

[0021] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0022] Embodiment 1: The present invention is based on the above characteristics, such as Figure 1 The system framework diagram shown in the figure proposes a control method for nonlinear models in complex scenarios, namely, a PID regulation method based on PSO-BP neural network and Kalman filtering.

[0023] Step 1: Establish a BP neural network and randomly generate unoptimized random initial connection weights w ij (0), w li (0) and calculate the control parameter k P , k i , k d and the system output value y out .

[0024] The BP neural network adopts a 4-5-3 three-layer BP neural network structure, such as Figure 2 As shown, the input layer X(k) = [x1(k), x2(k), x3(k), x4(k)] T , x1(k), x2(k), x3(k) and x4(k) represent the given input value r at time k respectively in (k), system output value y out (k), system error error(k) and constant value 1. ij (k) represents the connection weight between the i-th neuron in the hidden layer and the j-th neuron in the input layer, w li (k) represents the connection weight between the lth neuron in the output layer and the ith neuron in the hidden layer.

[0025] The input net of the i-th neuron in the hidden layer at time k i (k) and output yj (k) are

[0026]

[0027] y i (k) = f(net i (k))

[0028] The hidden layer activation function f(·) and the output layer activation function g(·) are respectively

[0029] f(·)=tanh(·)

[0030]

[0031] The input net of the lth neuron in the output layer at time k l (k) and output k l (k)

[0032]

[0033] k l (k) = g(net l (k))

[0034] The output of the output layer K(k) = [k1(k), k2(k), k3(k)] T , k1(k), k2(k) and k3(k) correspond to the control parameters k at time k respectively p (k),k i (k) and k d (k).

[0035] Step 2: Optimize the initial connection weights of the BP neural network through the PSO particle swarm algorithm.

[0036] In D-dimensional space, an initial particle group A containing M particles is randomly generated. M ], the mth particle has position X m =[X m1 ,X m2 ,...,X mD ] and speed V m =[V m1 ,V m2 ,...,V mD ]Two features, X mD and V mD represents the position and velocity of the mth particle in the Dth dimension. The global extreme value P is tracked in each iteration. gbest and individual extreme value P pbest To update the particle value. The update formula is:

[0037]

[0038] Where n is the current iteration number; is the position of the individual extreme point of the mth particle in the Dth dimension; is the position of the global extreme point of the population in the Dth dimension; denote the speed of the mth particle in the Dth dimension at the nth and n+1th iterations respectively; Respectively represent the position of the mth particle at the nth and n+1th iterations in the Dth dimension; c1 and c2 represent learning factors, which are usually positive numbers; r1 and r2 represent pseudo-random numbers uniformly distributed in the range [0,1]. The position and velocity of the particle are limited to the interval [-X max ,X max ]、[-V max ,V max ]Inside.

[0039] Figure 3 It is a flow chart of BP neural network algorithm optimized by particle swarm algorithm, which uses particle swarm algorithm to optimize the initial weights of BP neural network.

[0040] Step 3: Compare the given value r in (k) and system output value y out (k), calculation error error(k) = r in (k)-y out (k).

[0041] Step 4: Pass the error signal forward, update the weights of the BP neural network, and output the system's immediate output value.

[0042] Step 5: Reassign k according to the output result P , k i , k d , the result is calculated by the incremental PID algorithm and loaded into the load module. The incremental PID algorithm is:

[0043]

[0044] Δu(k) is the incremental value of the output value of the PID controller. After the output value of the PID controller is applied to the load and driven by the load, an unstable output signal y(k+1) with noise is obtained, which is sent to the Kalman filter module for processing. The Kalman equation is used to estimate the optimal value, that is, the output y obtained after filtering. out Repeat steps 3-5, and end the loop based on the error error(k+1) to determine whether the requirements are met.

[0045] Embodiment 2: The present invention provides a PID adjustment method based on PSO-BP and Kalman filtering, such as Figure 1 As shown, including:

[0046] The controlled object is a second-order nonlinear system, and the system transfer function is Sampling time t s =1ms. Interference noise w n and measurement noise v n are all white noises with a covariance of 1 and an amplitude of 0.01. Figure 3 In the initial weight setting optimized by particle swarm algorithm, the particle swarm population size is set to M = 20, the learning factors c1 and c2 are both 1.5, the maximum number of iterations N is set to 100, and the initial weights are obtained by offline training.

[0047] Test results such as Figure 4 As shown, from the above results, it can be seen that the method of the present invention can complete the adaptive control of the PID controller to the target in a nonlinear system environment under complex scenarios, the overshoot rate = 0%, the adjustment time is significantly reduced, and the curve is more stable without obvious jitter. The method of the present invention has a simple structure and is easy to implement.

[0048] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention is indicated by the claims above.

[0049] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. PID adjustment method based on PSO-BP and Kalman filtering, It is characterized in that include: When PID controls a nonlinear model system, a BP neural network is added, and the initial connection weights of the BP neural network are optimized by the PSO particle swarm algorithm. The output layer of the BP neural network neurons is adaptively adjusted to obtain the parameter k. P , k i , k d , and then use the Kalman filter to reduce noise and iteratively output the optimal PID control value of the nonlinear model.

2. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 1, It is characterized in that The BP neural network is used to randomly generate unoptimized random initial connection weights w ij (0), w li (0), and calculate the control parameter k P , k i , k d and the system output value y out .

3. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 2, It is characterized in that Compare the given value r in (k) and system output value y out (k), calculate the error signal error(k) = r in (k)-y out (k), pass the error signal forward, update the weights of the BP neural network, and output the instant output value of the nonlinear model system.

4. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 3, It is characterized in that Including re-assigning k according to the output of the BP neural network P , k i , k d , the result is calculated by the incremental PID algorithm and loaded into the load module. The output value y(k+1) of the load module is sent to the Kalman filter module for processing. The Kalman equation is used to estimate the optimal value, that is, the output y obtained after filtering. out (k+1), and determine whether the requirements are met based on the error error(k+1) to end the loop.

5. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 4, It is characterized in that in, The BP neural network is a 4-5-3 three-layer BP neural network structure, and the input layer X(k) = [x 1 (k),x 2 (k),x 3 (k),x 4 (k)] T , x 1 (k),x 2 (k),x 3 (k) and x 4 (k) represents the given input value r at time k in (k), system output value y out (k), system error error(k) and constant value 1, wi j (k) represents the connection weight between the i-th neuron in the hidden layer and the j-th neuron in the input layer, w li (k) represents the connection weight between the lth neuron in the output layer and the ith neuron in the hidden layer; The input net of the i-th neuron in the hidden layer at time k i (k) and output y j (k) are y i (k)=f(net i (k)) The hidden layer activation function f(·) and the output layer activation function g(·) are respectively f(·)=tanh(·) The input net of the lth neuron in the output layer at time k l (k) and output k l (k) k l (k)=g(net l (k)) The output of the output layer K(k) = [k 1 (k),k 2 (k),k 3 (k)] T , k 1 (k),k 2 (k) and k 3 (k) corresponds to the control parameters kp(k), k i (k) and k d (k).

6. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 5, It is characterized in that in, For the PSO particle swarm algorithm, an initial particle swarm A containing M particles is randomly generated in the D-dimensional space. 1 ,A 2 ,...,A M ], the mth particle has position X m =[X m1 ,X m2 , ..., X mD ] and speed V m =[V m1 , V m2 , ..., V mD ] Two features, X mD and V mD Represents the position and velocity of the mth particle in the Dth dimension. In each iteration, the global extreme value Pgbest and the individual extreme value Ppbest are tracked to update the particle value. The update formula is: Where n is the current iteration number; is the position of the individual extreme point of the mth particle in the Dth dimension; is the position of the global extreme point of the population in the Dth dimension; and denote the speed of the mth particle in the Dth dimension at the nth and n+1th iterations respectively; and represent the positions of the mth particle at the nth and n+1th iterations in the Dth dimension respectively; c 1 、c 2 represents the learning factor, usually a positive constant; r 1 、r 2 represents a pseudo-random number uniformly distributed in the range [0,1]. The position and speed of the particle are limited to the interval [-X max , X max ]、[-V max , V max ]Inside.

7. The PID adjustment method based on PSO-BP and Kalman filtering according to claim 6, It is characterized in that in, The k is reassigned according to the output result of the BP neural network P , k i , k d , the result is calculated by the incremental PID algorithm and loaded into the load module. The output value y(k+1) of the load module is sent to the Kalman filter module for processing. The Kalman equation is used to estimate the optimal value, that is, the output y obtained after filtering. out (k+1), including: The incremental PID algorithm is: Δu(k)=k p (error(k)-error(k-1))+k i error(k)+k d (error(k)-2error(k-1)+error(k-2)) Δu(k) is the incremental value of the output value of the PID controller. After the output value of the PID controller is applied to the load and driven by the load, an unstable output signal y(k+1) with noise is obtained, which is sent to the Kalman filter module for processing. The Kalman equation is used to estimate the optimal value, that is, the output y obtained after filtering. out (k+1).