Networked control system time-delay compensation method based on predictive control
11543787 · 2023-01-03
Assignee
Inventors
- Jingbo Zhao (Shandong, CN)
- Bingxin Xue (Shandong, CN)
- Zhong Wang (Shandong, CN)
- Jingxuhui Zhu (Shandong, CN)
- Tengfei Qiu (Shandong, CN)
- Xinchao Liu (Shandong, CN)
Cpc classification
Y02P90/02
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
G06N3/006
PHYSICS
G06N3/043
PHYSICS
G06N3/086
PHYSICS
International classification
G06F17/11
PHYSICS
Abstract
The present invention discloses a networked control system (NCS) time-delay compensation method based on predictive control. The method comprises the following steps: (1) acquiring random time-delay data in an NCS, and preprocessing the data; (2) predicting the current time-delay by using a fuzzy neural network (FNN) optimized by a particle swarm optimization (PSO) algorithm; (3) compensating the predicted time-delay by using an implicit proportional-integral-based generalized predictive control (PIGPC) algorithm; (4) determining whether a preset work end time is up according to a clock in the NCS; if yes, ending the process; if no, returning to step (2). The method disclosed by the present invention can accurately predict and effectively compensate the NCS time-delay and has excellent development prospect.
Claims
1. A networked control system (NCS) time-delay compensation method based on predictive control, comprising the following steps: (1) acquiring random time-delay data in an NCS, and preprocessing the data; (2) predicting the current time-delay by using a fuzzy neural network (FNN) optimized by a particle swarm optimization (PSO) algorithm; (3) compensating the predicted time-delay by using an implicit proportional-integral-based generalized predictive control (PIGPC) algorithm; (4) determining whether a preset work end time is up according to a clock in the NCS; if yes, ending the process; if no, returning to step (2); wherein step (1) includes: collecting a group of continuous random time-delay data; utilizing first five time-delay values as an input sample 1 and a sixth time-delay value as an output sample 1 to form a first sample pair; utilizing second to sixth time-delay values as an input sample 2 and a seventh time-delay value as an output sample 2 to form a second sample pair; by such analogy, forming 300 sample pairs as data for training the FNN.
2. The NCS time-delay compensation method based on predictive control according to claim 1, wherein optimization of the FNN by the PSO algorithm at step (2) is: optimizing a connection weight and a membership function of the FNN by using the PSO algorithm, that is, setting elements of a position vector x.sub.i of a particle swarm to be expectation and standard deviation of the connection weight and the membership function of the FNN; such optimization specifically comprises the following steps: 1), randomly initializing a position and a velocity of each particle, and determining parameters including a population size, an inertia weight and an acceleration factor; 2), calculating a fitness value of each initial particle, wherein p.sub.i is the optimal position of the current particle, and p.sub.g is the optimal position of the particle swarm; 3), updating the position and the velocity of each particle according to formulae (5) and (6), and iterating to generate a new particle; wherein mathematical expressions of the PSO algorithm are:
v.sub.id(t+1)=wv.sub.id(t)+c.sub.1r.sub.1(p.sub.id−x.sub.id(t))+c.sub.2r.sub.2(p.sub.gd−x.sub.id(t)) (5)
x.sub.id(t+1)=x.sub.id(t)+v.sub.id(t+1) (6) in the expressions, i is the number of particles, i=1, 2, . . . , m; d is a space dimension, d=1, 2, . . . , D; t is time; w is the inertia weight and a nonnegative number; c.sub.1 and c.sub.2 are acceleration factors and are defined as constants; r.sub.1 and r.sub.2 are random numbers and are uniformly distributed between 0 and 1; p.sub.id is the optimal position of a particle i; p.sub.gi is the optimal position of a particle swam; x.sub.id(t) is the position of the particle i at the time t, x.sub.id(t+1) is the position of the particle i at the time t+1, and x.sub.id(t)∈[−x.sub.max, x.sub.max]; v.sub.id(t) is the velocity of the particle i at the time t, v.sub.id(t+1) is the velocity of the particle i at the time t+1, and v.sub.id(t)∈[−v.sub.max, v.sub.max]; x.sub.max and v.sub.max are nonnegative numbers; 4), returning to step 2), and stopping iteration till the convergence criterion is met, wherein a global extremum is an optimal solution of a training problem.
3. The NCS time-delay compensation method based on predictive control according to claim 1, wherein step (2) specifically comprises: inputting the 301.sup.st to 305.sup.th time-delay values as the input sample into the optimized FNN to obtain a first prediction value of network time-delay; then inputting the 302.sup.nd to 306.sup.th time-delay values as the input sample into the optimized FNN to obtain a second prediction value of the network time-delay; by such analogy, completing prediction on the network time-delay.
4. The NCS time-delay compensation method based on predictive control according to claim 2, wherein the convergence criterion at step 4) is: a threshold of a fitness function is 0.001, and the fitness function is as follows:
5. The NCS time-delay compensation method based on predictive control according to claim 1, wherein step (3) specifically comprises: according to the implicit PIGPC algorithm, obtaining a controller increment Δu(k) when the time-delay exists, further obtaining a control value u(k), and finally transmitting the optimal control value u(k) to an actuator.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) To describe the technical solutions in the embodiments of the present invention or the prior art more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments or the prior art.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
DESCRIPTION OF THE EMBODIMENTS
(9) The following clearly and completely describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention.
(10) The present invention provides an NCS time-delay compensation method based on predictive control. The method can accurately predict and effectively compensate NCS time-delay and has excellent development prospect.
(11) 1 FNN Optimized by the PSO Algorithm
(12) 1.1 FNN Model
(13) An FNN is a product by combining fuzzy set theory and a neural network. The FNN not only has massive parallel processing capacity, self learning ability and adaptive ability of the neural network, but also can process fuzzy information and achieve a fuzzy inference function so as to have excellent performance.
(14) An FNN prediction model is a multiple-input single-output four-layer network model, as shown in
(15) The first layer is the input layer. The number of neurons of the input layer is the same as the number of input variables. An input vector is x=(x.sub.1, x.sub.2, . . . , x.sub.n).sup.T. y is a variable of the output layer. An output variable is a future time-delay predicted value and only one, so the output layer only has one neuron. The j.sup.th fuzzy rule of a system can be expressed as follows:
R.sub.j:if x.sub.1=X.sub.1j,x.sub.2=X.sub.2j, . . . ,x.sub.n=X.sub.nj, then y=Y.sub.j (1)
(16) In the formula, Y.sub.j is a result of the j.sup.th rule, and j is decided by the number of the neurons of the fuzzy rule layer; X.sub.ij is a fuzzy subset corresponding to the input variables, i=1, 2, . . . , n, and j is decided by the number of the fuzzy subsets of each input variable.
(17) The second layer is the fuzzified layer for calculating a membership degree of each input variable. By utilizing a normal distribution function as the membership function, a calculation formula that the i.sup.th input variable meets the fuzzy subset X.sub.ii is as follows:
(18)
(19) In the formula, m.sub.ij is an expectation of the normal distribution function, σ.sub.ji is a standard deviation, and the membership of the input variable is completely decided by the parameters m.sub.ij and σ.sub.ji.
(20) The third layer is the fuzzy rule layer. In the design, connection weights of the fuzzified layer and the fuzzy rule layer are defined as follows according to the fuzzy set theory:
(21)
(22) In the formula, μ.sub.X.sub.
(23) The third layer and the fourth layer of the FNN complete a fuzzy decision making function. If supposing a system has m rules, the design conducts a defuzzifying by using a weighing average method to obtain an output as follows:
(24)
(25) In the formula, w.sub.j is the connection weight between the fuzzy rule layer and the output layer.
(26) To train the FNN, parameters to be determined comprises the expectation m.sub.ij and the standard difference σ.sub.ji of the normal distribution function as well as the connection weight w.sub.j. The neural network commonly uses a gradient descent algorithm. Such algorithm has a low speed of convergence, is easy to generate a local optimization problem, and is hard to obtain a global optimal solution. To solve this problem, the present invention optimizes parameters of the FNN by using the PSO algorithm having the global optimization performance.
(27) 1.2 PSO Algorithm
(28) 1.2.1 Mathematical Description of a PSO Algorithm
(29) If an objective is searched in a certain D-dimensional space, a swarm consists of m particles. Each particle in the swarm has its position, the position of an i.sup.th particle is represented by x.sub.i=(x.sub.i1, x.sub.i2, . . . x.sub.iD), i=1, 2, . . . , m, and the velocity of the i.sup.th particle is a D-dimensional vector and is represented by v.sub.i=(v.sub.i1, v.sub.i2, . . . , v.sub.iD). When each particle passes through a new position, the new position is compared with all positions through which the particle passes previously. After the i.sup.th particle flies to a certain position, an optimal position through which the i.sup.th particle passes is p.sub.i=(p.sub.i1, p.sub.i2, . . . , p.sub.iD). The positions through which all particles in the swarm pass are compared to obtain optimal positions through which all particles pass, and the optimal positions are represented by p.sub.g=(p.sub.g1, p.sub.g2, . . . , p.sub.gD). Each particle changes the position according to the following formulae:
v.sub.id(t+1)=wv.sub.id(t)+c.sub.1r.sub.1(p.sub.id−x.sub.id(t))+c.sub.2r.sub.2(p.sub.gd−x.sub.id(t)) (5)
x.sub.id(t+1)=x.sub.id(t)+v.sub.id(t+1) (6)
(30) In the formulae, i is the number of particles, i=1, 2, . . . , m; d is a space dimension, d=1, 2, . . . , D; t is time; w is an inertia weight and a nonnegative number; c.sub.1 and c.sub.2 are acceleration factors and are defined as constants; r.sub.1 and r.sub.2 are random numbers and are uniformly distributed between 0 and 1; p.sub.id is the optimal position of a particle i; p.sub.gi is the optimal position of a particle swam; x.sub.id(t) is the position of the particle i at the time t, x.sub.id(t+l) is the position of the particle i at the time t+1, and x.sub.id(t)∈[−x.sub.max, x.sub.max]; v.sub.id(t) is the velocity of the particle i at the time t, v.sub.id(t+1) is the velocity of the particle i at the time t+1, and v.sub.id(t)∈[−v.sub.max, v.sub.max]; x.sub.max and v.sub.max are nonnegative numbers.
(31) 1.2.2 Flow Chart of the PSO Algorithm
(32) A flow chart of the PSO algorithm is shown in
(33) 1.2.3 Steps for Optimizing a Fitness Function and Parameters
(34) A connection weight and a membership function of the FNN are optimized by using the PSO algorithm, that is, elements of a position vector x.sub.i of a particle swarm are set to be expectation and standard deviation of the connection weight and the membership function of the FNN. The training of the FNN is mainly used for making a parameter error in the network minimum, so the fitness function can be defined as follows:
(35)
(36) In the formula, N.sub.s is the number of training set samples, Y.sub.i is an expected output, and y.sub.i is an actual output.
(37) Parameter optimization by the PSO algorithm specifically comprises the following steps:
(38) 1), randomly initializing a position and a velocity of each particle, and determining parameters including population size, inertia weight and acceleration factor;
(39) 2), calculating a fitness value of each initial particle, wherein p.sub.i is the optimal position of the current particle, and p.sub.g is the optimal position of the particle swarm;
(40) 3), updating the position and the velocity of each particle according to formulae (5) and (6) to generate a new particle;
(41) 4), returning to step 2), and stopping iteration till the convergence criterion is met, wherein a global extremum is an optimal solution of a training problem.
(42) 2 Design of an NCS Controller Based on an FNN-PSO and an Implicit PIGPC Algorithm
(43) 2.1 Implicit Proportional-Integral-Based Generalized Predictive Control (PIGPC) Algorithm
(44) The GPC algorithm needs to calculate the Diophantine equation and rolling inverse optimization so as to have long calculation time and low efficiency. However, the implicit GPC algorithm is improved based on the standard GPC algorithm, does not need to calculate the Diophantine equation and the like, but cannot immediately feed back and has low robustness. Therefore, based on the GPC algorithm and the implicit GPC algorithm, an implicit PIGPC algorithm is provided. The implicit PIGPC algorithm has the advantages of combining a feedback structure of a PI controller and a strong prediction function of the GPC algorithm and does not needs to calculate the Diophantine equation so as to have high efficiency and robustness, as shown in
(45) An objective function of the implicit GPC algorithm is:
J(k)=E{Σ.sub.j=1.sup.p[e(k+j)].sup.2+Σ.sub.j=0.sup.N.sup.
(46) wherein e(k+j)=y.sub.s(k+j)−y (k+j) represents an error between an expected value and an actual value.
(47) Based on formula (8), an objective function of an implicit PIGPC algorithm is defined such that a proportional integral structure is provided as follows:
J(k)=E{Σ.sub.j=1.sup.p[K.sub.p[Δe(k+j)].sup.2+K.sub.i[e(k+j)].sup.2]+Σ.sub.j=0.sup.N.sup.
(48) wherein K.sub.p≥0 represents a proportion factor, and K.sub.i≥0 represents an integral factor.
(49) By considering a to-be-controlled object, a CARIMA model is utilized for description, and can be represented as:
(50)
(51) wherein z.sup.−1 represents a backshift operator corresponding to an amount of a backward sensor sampling cycle, and is expressed by a formula: z.sup.−1y(k)=y(k−1), z.sup.−1u(k)=u(k−1); A, B, C are polynomial of z.sup.−1; B(z.sup.−1) may represent a time lag of the to-be-controlled object; to an m.sub.1 time lag system, b.sub.0˜b.sub.m.sub.
(52) to provide the principle and method of the GPC, if supposing C(z.sup.−1)=1, a pulse transfer function between the input u and the output y of the control system is as follows:
(53)
(54) C(z.sup.−1)=1 is substitute into the formula (10), the following can be obtained:
(55)
(56) An output prediction model at the k+j time is as follows:
(57)
(58) To solve a predicted output value when a system outputs y(k+j|k) at k+j time, the following Diophantine equation is considered:
1=E.sub.j(z.sup.−1)A(z.sup.−1)Δ+z.sup.−jF.sub.j(z.sup.−1) (14)
G.sub.j(z.sup.−1)=E.sub.j(z.sup.−1)B(z.sup.−1)={tilde over (G)}.sub.j(z.sup.−1)+z.sup.−jH.sub.j(z.sup.−1) (15)
(59) A prediction output at k+j time is as follows:
if f(k+j)=H.sub.j(z.sup.−1)Δu(k−1)+F.sub.j(z.sup.−1)y(k),
(60) a prediction output at the k+j time can also be represented as follows:
(61) A predicted value
e(k+j)=y.sub.s(k+j)−{tilde over (G)}.sub.j(z.sup.−1)Δu(k+j−1|k)−f(k+j) (17)
(62) An error increment Δe(k+j) is defined as:
Δe(k+j)=[Δy.sub.s(k+j)−Δf(k+j)]−[{tilde over (G)}.sub.j(z.sup.−1)Δu(k+j−1|k)−{tilde over (G)}.sub.j-1(z.sup.−1)Δu(k+j−2|k)] (18)
(63) The formulae (17) and (18) are substituted into the objective function J(k)=E{Σ.sub.j=1.sup.p[K.sub.p[Δe(k+j)].sup.2+K.sub.i[e(k+j)].sup.2]+Σ.sub.j=0.sup.N.sup.
(64)
the following can be obtained:
(65)
(66) So, the control increment Δu(k) can be represented as:
Δu(k)=R.sub.pΔE(k)+R.sub.iE(k) (20)
wherein ΔE(k)=Δy.sub.s(k)−Δf(k), E(k)=y.sub.s(k)−f(k),
(67) so a control value of the PIGPC is as follows:
u(k)=u(k−1)+R.sub.pΔE(k)+R.sub.iE(k) (21)
(68) A control law of the PI controller is
ū(k)=P(k)+I(k)=K.sub.pē(k)+(I(k−1)+K.sub.iē(k)) (22)
ū(k−1)=K.sub.pē(k−1)+I(k−1) (23)
(69) By subtracting the formula (23) from the formula (22), the following is obtained:
Δū(k)=K.sub.pΔē(k)+K.sub.iē(k) (24)
(70) A control value of the PI controller is:
ū(k)=ū(k−1)+K.sub.pΔē(k)+K.sub.iē(k) (25)
(71) By comparing the formula (21) with the formula (25), it can be seen that the both have the same form, the PI controller and the implicit GPC algorithm are combined to obtain the structure of the implicit PIGPC controller.
(72)
(73) Therefore, a control increment of the implicit PIGPC can be represented as:
Δu(k)=(λI+K.sub.pG.sub.i.sup.TS.sup.TSG.sub.i+K.sub.iG.sub.i.sup.TG.sub.i).sup.−1[K.sub.pG.sub.i.sup.TS.sup.T(Sy.sub.s(k)−Sf(k))+K.sub.iG.sub.i.sup.T(y.sub.s(k)−f(k))] (26)
(74) If Ω=K.sub.iI+K.sub.pS.sup.TSΔu(k), Δu(k) can be represented as:
Δu(k)=(λI+G.sub.i.sup.TΩG.sub.i).sup.−1G.sub.i.sup.TΩ(y.sub.s(k)−f(k)) (27)
(75) Compared with the GPC algorithm, there is no additional calculation, and the Diophantine equation and the matrix inversion do not need to be calculated for many times. Compared with the implicit GPC algorithm, PI control with the feedback structure is added, so, the efficiency is improved, and the algorithm is also optimized.
(76) 2.2 Design of Time-Delay Compensation Controller Based on an FNN-PSO and an Implicit PIGPC Algorithm
(77) The key of a time-delay compensation strategy research is: the current network time-delay cannot be measured. The current time-delay is predicted by selecting a proper prediction method with the aid of historical data and future input.
(78) The time-delay compensation strategy is implemented generally by the following steps:
(79) (1) acquiring time-delay in the past time, and processing the past data;
(80) (2) predicting the current time-delay according to the past data and the future input by using the FNN-PSO;
(81) (3) obtaining a controller increment Δu(k) according to the implicit PIGPC algorithm, further obtaining a control value u(k), and finally transmitting the optimal control value u(k) to an actuator;
(82) (4) determining whether a preset work end time is up; if yes, ending the process; if no, returning to step (2).
(83) 3 Prediction Model Building and Simulation Analysis
(84) 3.1 Prediction Model Building
(85) Prediction of the network time-delay utilizes a rolling prediction method. First five time-delay values are utilized as an input sample 1, and a sixth time-delay value is utilized as an output sample 1 to form a first sample pair; second to sixth time-delay values are utilized as an input sample 2, and a seventh time-delay value is utilized as an output sample 2 to form a second sample pair; by such analogy, 300 sample pairs are formed to be utilized as data for training the FNN.
(86) Then the 301.sup.st to 305.sup.th time-delay values as the input sample and the input vector are inputted into the trained FNN to obtain a first prediction value of network time-delay; then the 302.sup.nd to 306.sup.th time-delay values as the input sample are inputted into the optimized FNN to obtain a second prediction value of the network time-delay; by such analogy, 20 network time-delay predicted values are obtained.
(87)
(88) (1) building and training an FNN: determining a structure of a neural structure by using a clustering algorithm, selecting the number of fuzzy memberships by utilizing a Kohonen network, determining that each input variable is divided into two fuzzy subsets, so that the structure of the FNN is 5-10-32-1; next training the FNN by using the training data;
(89) (2) optimizing network parameters: initializing the PSO algorithm, and setting the population size to be 30, the acceleration factor to be c.sub.1=c.sub.2=2, the fitness threshold to be 0.001 and the maximum allowable iteration times to be 350;
(90) (3) predicting the model: verifying the model by using test data and obtaining a final prediction result.
(91) 3.2 Simulation Results and Discussion
(92) Two types of the FNNs are constructed. One type of the FNN utilizes the gradient descent algorithm to train the FNN while the other type of the FNN utilizes the PSO algorithm to train the FNN.
(93) According to
(94) To verify effectiveness of the time-delay compensation algorithm, a direct current servo system is selected as the to-be-controlled object
(95)
(96) The type of the network selects Ethernet, the sampling period is 20 ms and the transmission rate is 80000 bits/s. The system adds turbulence nodes such that the network generate a load. The time-delay prediction utilizes the FNN optimized by the PSO.
(97) The above illustration of the disclosed embodiments can enable a person skilled in the art to implement or practice the present invention. Various modifications to these embodiments are readily apparent to a person skilled in the art, and the generic principles defined herein may be practiced in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not limited to the embodiments shown herein but falls within the widest scope consistent with the principles and novel features disclosed herein.