CN116449686A - PID control method and device for optimizing RBF neural network by improving sparrow population algorithm - Google Patents

PID control method and device for optimizing RBF neural network by improving sparrow population algorithm Download PDF

Info

Publication number
CN116449686A
CN116449686A CN202310705764.XA CN202310705764A CN116449686A CN 116449686 A CN116449686 A CN 116449686A CN 202310705764 A CN202310705764 A CN 202310705764A CN 116449686 A CN116449686 A CN 116449686A
Authority
CN
China
Prior art keywords
sparrow
neural network
value
population
individual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310705764.XA
Other languages
Chinese (zh)
Inventor
谢静如
常琳
蒋华涛
仲雪君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sirun Beijing Technology Co ltd
Original Assignee
Sirun Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sirun Beijing Technology Co ltd filed Critical Sirun Beijing Technology Co ltd
Priority to CN202310705764.XA priority Critical patent/CN116449686A/en
Publication of CN116449686A publication Critical patent/CN116449686A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B11/00Automatic controllers
    • G05B11/01Automatic controllers electric
    • G05B11/36Automatic controllers electric with provision for obtaining particular characteristics, e.g. proportional, integral, differential
    • G05B11/42Automatic controllers electric with provision for obtaining particular characteristics, e.g. proportional, integral, differential for obtaining a characteristic which is both proportional and time-dependent, e.g. P. I., P. I. D.
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0499Feedforward networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/086Learning methods using evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Automation & Control Theory (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Physiology (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention relates to a PID control method and a device for optimizing RBF neural network by improving a sparrow population algorithm, wherein the method comprises the steps of improving a sparrow search algorithm to obtain an improved sparrow search algorithm, and outputting global optimal parameters by the improved sparrow search algorithm; taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network; training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating the adjustment value of the output PID when the convergence condition is met. According to the invention, through improving the sparrow search algorithm, optimizing the RBF neural network and finally controlling the PID parameters, the convergence speed, noise resistance and repair capability of the control system are further improved, the learning speed is improved, and the like.

Description

PID control method and device for optimizing RBF neural network by improving sparrow population algorithm
Technical Field
The invention belongs to the technical field of vehicle control, and particularly relates to a PID control method and device for optimizing an RBF neural network by improving a sparrow population algorithm.
Background
In an autonomous vehicle, a PID controller is the most basic controller, the controller must be accurate to avoid the vehicle from deviating from the target track, and the controller must operate smoothly, otherwise discomfort to passengers is caused, the conventional PID controller cannot meet the control of the autonomous vehicle, an improved sparrow search algorithm is introduced into the neural network, and self-learning, self-organizing, adaptive control performance and the like of the neural network are introduced into the design of the PID controller.
Current PID algorithm controls include: a genetic-based PID control algorithm, a particle swarm-based PID control algorithm, a self-adaptive PID control algorithm, and the like. In the particle swarm PID control method, a particle swarm algorithm is applied to self-adaptive PID control, PID parameters are dynamically changed in real time, and the particle swarm algorithm can perform parallel iterative approximation and has the characteristics of few parameters, easiness in implementation and the like. In PID control based on genetic algorithm, firstly, the range of parameters is determined, then coding is carried out according to the precision requirement, the initial population is selected, the adaptive function is determined, copying, crossing and mutation are carried out in genetic operation, and finally the preset index is reached. In the self-adaptive PID control algorithm, a self-adaptive PID regulator can be configured through poles, closed-loop pole distribution is selected according to an optimization strategy, feedback control is designed, PID controller parameters are set, model parameters are obtained through a weighted recursive least square method, and finally the self-adaptive PID controller is obtained.
The improved PID control algorithms of the neural network which have been studied at present are: PID control algorithm based on BP neural network, PID control method based on RBF neural network. In the PID control algorithm based on the BP neural network, the optimization can also be performed by using a sparrow search algorithm, an initial connection matrix and a threshold value of the neural network are determined by using the sparrow search algorithm, a performance index function of the BP neural network is taken, and the weight of the BP neural network is optimized so as to obtain the optimal PID parameters. In the PID control algorithm based on the RBF neural network, the particle swarm can be utilized to optimize the RBF neural network, or the training speed and the approximation effect of the fuzzy RBF neural network are improved through PID control of the fuzzy RBF neural network, and the established fuzzy RBF neural network is optimized.
In summary, the PID control method of the BP neural network has slow learning speed, so the convergence speed of the network is slow, and longer training time is required. Compared with a global approximation network, the RBF neural network has the advantages that the convergence speed is high, correction of all weights and thresholds is not needed in the training and learning process, the training time is shortened, the RBF neural network is simple in topological structure, the best approximation effect can be achieved, and the traditional sparrow search algorithm has good search performance, but the phenomenon of population diversity reduction and unbalance between exploration and utilization can occur in the later iteration stage, and the convergence speed is slow.
Along with the continuous development of control theory and the continuous improvement of working condition complexity, the parameter setting of a general PID controller has strong dependence on experience, is sensitive to initial values, has complicated and time-consuming setting process, lacks self-setting capability, and can not meet the requirements of a modern control system.
Disclosure of Invention
In view of the above, the invention aims to overcome the defects of the prior art, and provides a PID control method and a PID control device for optimizing RBF neural network by improving sparrow population algorithm, so as to solve the problem that the parameter setting of a PID controller in the prior art cannot meet the current control requirement.
In order to achieve the above purpose, the invention adopts the following technical scheme: a PID control method for optimizing RBF neural network by improving sparrow population algorithm comprises the following steps:
improving the sparrow search algorithm to obtain an improved sparrow search algorithm, wherein the improved sparrow search algorithm outputs a global optimal parameter;
taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network;
training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating the adjustment value of the output PID when the convergence condition is met.
Further, the improvement of the sparrow search algorithm to obtain an improved sparrow search algorithm includes:
initializing a sparrow population, and setting parameters of the sparrow population;
calculating fitness values of N sparrow individuals in the sparrow population, sequencing the N sparrow individuals according to the fitness values, and determining a current optimal fitness value and a current worst fitness value; each sparrow individual in the sparrow search algorithm is composed of a center and variance of a base function and weights from an implicit layer to an output layer, and an objective function is a mean square error of a sample true value and a predicted value;
selecting the first pd sparrows with the front fitness value as discoverers, and updating the positions of the discoverers according to a position updating formula of the discoverers;
selecting sparrows except the sparrows serving as discoverers from the N sparrows as joiners, and updating the positions of the joiners according to a position updating formula of the joiners;
selecting Sd sparrows from the sparrow population as early warning persons, and updating the positions of the early warning persons according to a position updating formula of the early warning persons;
recalculating fitness values of N sparrow individuals in the sparrow population, and leadingmCrossing and mutating fitness values of individual sparrows;
determining the current iteration sparrow position according to the fitness value of the current position of each sparrow and the fitness value reserved by the sparrow in the previous iteration, and replacing the parent position by adopting the child position with strong adaptability;
comparing the individual fitness of the self-adaptive crossover and variation with the historical optimal individual fitness, and performing global updating;
judging whether the current iteration number reaches the set maximum iteration number, if so, outputting a global optimal parameter, and if not, continuing iteration.
Further, the sparrow population is
The fitness function of the sparrow population is
Where d represents the dimension of the problem to be optimized and n represents the number of sparrows.
Further, the location update formula of the finder is as follows
Wherein,,is shown in the firsttIn the belt (th)iIndividual firstjThe position of the dimension is determined by the position of the dimension,trepresents the number of iterations, +.>Is a standard normal random number, -/->Represented as a 1 x dim matrix, dim being the dimension value, < >>And->Respectively an early warning person and an early warning threshold value, when +.></>When the foraging area is safe, foraging can be performed in a larger atmosphere, and when +.> In the case of unsafe foraging, the finder needs to flyRemoving a safety area;
wherein,,iis the firstiThe position information of the individual sparrows,ifrom 1 to 7,ia minimum of 1, a maximum of 7,N30, proof ofMiddle->Not equal to->,/>The method comprises the steps of carrying out a first treatment on the surface of the Thus, the improved discoverer expression converges.
Further, the location update formula of the subscriber is as follows
In the method, in the process of the invention,is->The most adaptable individual position in the generation population, < ->Is the current +>Individuals with worst fitness value among generations, +.>Is the current +>Individuals with worst fitness value among generations, +.>Matrix of 1 x dimWherein the element is a random value of 1 or-1, ">,/>Is the population number;
because ofTherefore->The number of the joiners is increased to 10 on the basis of the joiners,ithe value range is [8, 10 ]],i/nNot equal to->Therefore->Thus, the improved joiner expression converges.
Further, the location update formula of the precaution person is as follows
In the method, in the process of the invention,and->For the global best and worst individual fitness values at this time, +.>Representing the fitness value of individuals in the current population, +.>,/>Set to a smaller constant to avoid the occurrence of a denominator of 0In case of->Indicating that the individual is currently at the periphery of the population, the position needs to be changed to a safe area to obtain a better fitness value when +.>When the individual is in the center of the middle population, the individual randomly approaches other safe individuals to reduce the risk of capturing the individual, and the condition is->The following formula is derived to obtain +.>,/>Obeying a normal distribution with variance of 1 and mean of 0, i.e. +.>,/>Is in the range of +.>Therefore, the improved precaution expression is less than 1, and the improved precaution expression is convergent.
Further, the fitness value of N sparrow individuals in the sparrow population is calculated, and the number of sparrows is calculatedmThe fitness value of each sparrow individual crosses and varies, including:
pairing sparrow individuals according to probability in the following wayCrossing selected paired sparrows,
wherein, sparrows with crossed positions,/>Is a random number in (0, 1);
the probability is based on the following wayVariant to sparrow individual, d-th dimension variable of optimum value of individual +.>The variation is carried out at random,
wherein,,is a random disturbance variable.
Further, the calculating the adjustment value of the output PID when the convergence condition is satisfied includes:
and when the training times are larger than the error of the preset value and smaller than the target value, performing system modeling by adopting a transfer function, and calculating the PID adjustment value by automatically adjusting the PID parameters.
Further, the RBF neural network includes:
an input layer, a hidden layer and an output layer;
the transformation from the input layer space to the hidden layer space adopts nonlinear transformation, and the transformation from the hidden layer space to the output layer space adopts linear transformation.
The embodiment of the application provides a PID control device for improving sparrow population algorithm and optimizing RBF neural network, which comprises the following components:
the improved module is used for improving the sparrow search algorithm to obtain an improved sparrow search algorithm, and the improved sparrow search algorithm outputs global optimal parameters;
the optimization module is used for taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network;
the calculation module is used for training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the end condition, and calculating an adjustment value of the output PID when the convergence condition is met.
By adopting the technical scheme, the invention has the following beneficial effects:
the invention provides a PID control method and a PID control device for optimizing RBF neural networks by improving a sparrow population algorithm, wherein the improved sparrow search algorithm is obtained by improving the sparrow search algorithm, and the improved sparrow search algorithm outputs global optimal parameters; taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network; and then training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating the adjustment value of the output PID when the convergence condition is met.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of the steps of the PID control method of the improved sparrow population algorithm optimized RBF neural network of the present invention;
FIG. 2 is a schematic flow chart of a PID control method for optimizing RBF neural network by improving sparrow population algorithm in the invention;
FIG. 3 is a schematic diagram of the RBF neural network topology provided by the invention;
FIG. 4 is a schematic diagram of a PID control method for optimizing RBF neural network by using the improved sparrow population algorithm provided by the invention;
FIG. 5 is a schematic diagram of the PID control device for optimizing RBF neural network by improving sparrow population algorithm.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, based on the examples herein, which are within the scope of the invention as defined by the claims, will be within the scope of the invention as defined by the claims.
In the PID control algorithm based on the BP neural network, the BP neural network can be optimized by utilizing a particle swarm, an intelligent algorithm is combined with PID control, the BP neural network is utilized to have self-adaptive capacity, PID parameters are set, a BP-PID control system with real-time online adjustment capacity is constructed, then the overall optimization capacity of the PSO algorithm is utilized to optimize aiming at the problem of BP-PID initial parameter setting, meanwhile, the self-adaptive strain step algorithm is provided aiming at the defect of PSO fixed search step length, the convergence speed is improved, and experimental results based on simulation data show that the method has higher control precision and control stability compared with the traditional BP-PID control system. And in addition, the BP neural network is combined with the traditional PID controller, and the BP neural network is utilized to carry out self-adaptive online adjustment on the P (proportional element), the I (integral element) and the D3 parameters (differential element), so that the stability and the control precision of the PID system facing the non-stationary nonlinear system are improved.
The optimization algorithm of the sparrow search algorithm in the background technology firstly determines an initialization population in the sparrow search algorithm, sets a fitness function to calculate an initial fitness value and determines the topological structure of the BP neural network; updating the position of the finder and the position of the follower, randomly selecting an early warning person, updating the position calculation fitness, updating an optimal value, judging whether a condition is met, giving the obtained value to the BP neural network as an initial weight and a threshold value when the condition is met, and iterating again when the condition is not met; and training the BP neural network by using the optimal weight, calculating an error at the same time, judging whether the error meets the requirement, and calculating corresponding PID parameters if the error meets the requirement, otherwise, retraining until the requirement is met. The sparrow search algorithm divides the population into an explorer, a follower and an early warning person. The sine and cosine algorithm is introduced, the learning factors are defined, learning shadows are fused into the position movement update of the seeker, the learning factors are fused into the position movement of the seeker, the seeker is judged to search according to the set early warning value, and the Levy flight strategy is fused into the position update of the follower. And adding the random step length s into the position update of the follower to obtain the position update of the follower, and carrying out hazard early warning observation by the early warning person and carrying out the position update to drive the population to fly to other positions when sensing the hazard. And determining an initial connection matrix and a threshold value of the neural network through a sparrow search algorithm, taking a performance index function of the BP neural network, and optimizing the weight of the BP neural network so as to obtain the optimal PID parameter. In a PID control algorithm based on an RBF neural network, a particle swarm optimization RBF neural network can be utilized, a clustering sample is firstly collected, a clustering reduction algorithm is utilized to perform clustering analysis on the sample, the center number of a basic function is determined, a particle swarm optimization algorithm is initialized, the particle swarm digit of a variation particle swarm optimization algorithm is determined, the particle swarm optimization is performed by utilizing the evolution rule of the particle swarm, the speed and the position of the particle are regulated in real time to obtain an optimal solution of the particle, the first optimal solution is coded to obtain the center position and the width of the basic function, then the unit output of an implicit layer and an output layer of the RBF neural network is calculated, the network structure of the RBF neural network is determined, the parameter of the RBF neural network is optimized by utilizing the evolution rule of the particle swarm, and the parameter optimal solution of the RBF neural network is obtained. In the PID control algorithm based on the RBF neural network, through the PID control of the fuzzy RBF neural network, researchers propose to perform single-kind clustering on training samples of the fuzzy RBF neural network by adopting the clustering method, and the initial values of structural parameters of the fuzzy RBF neural network and the number of hidden layer neurons are determined by utilizing the clustering result, so that the training speed and the approximation effect of the fuzzy RBF neural network are improved. PID parameters are set on line through the mapping relation between the input and the output of the fuzzy RBF neural network, and the optimal combination of the PID parameters is realized, so that the PID controller has self-adaptability and intelligence, the initial value of the fuzzy RBF neural network parameters is determined by adopting a K-means hierarchical clustering method, the training speed and the approximation effect of the fuzzy RBF neural network are improved, and the effect of optimizing the established fuzzy RBF neural network is achieved.
In summary, the above method has the following problems:
the PID control method based on BP neural network has slow learning speed, so the convergence speed of the network is slow, and longer training time is needed. The method is easy to fall into the defects of local optimal solution, local minimum value, low robustness and the like, so that the accuracy of PID control parameters is low.
The hidden node of the BP neural network adopts the inner product of an input mode and a weight vector as an independent variable of an activation function, has the global approximation characteristic of nonlinear mapping, has very slow learning speed and cannot meet the application of real-time requirements, and the Radial Basis Function (RBF) neural network is a local approximation network, so that the convergence speed is higher in the training learning process compared with the global approximation network, all weights and thresholds are not required to be corrected, the training time is shortened, the RBF neural network has a simple topological structure, and the most excellent approximation effect can be realized. Therefore, the RBF neural network is introduced, the training algorithm of the RBF neural network supports online and offline training, the data center and the expansion constant of the network structure and the hidden layer unit can be dynamically determined, the learning speed is high, and better performance is shown than that of the BP algorithm.
Because the sparrow search algorithm is provided with a relatively late time, although the basic sparrow search algorithm has good search performance, the phenomenon of population diversity reduction and unbalance between exploration and utilization can occur in the later iteration period, and the convergence speed is slow. Therefore, the invention adopts the adaptive genetic algorithm to improve the sparrow searching algorithm.
Along with the continuous development of control theory and the continuous improvement of working condition complexity, the parameter setting of a general PID controller has strong dependence on experience, is sensitive to initial values, has complicated and time-consuming setting process, lacks self-setting capability, and can not meet the requirements of a modern control system.
The following describes a specific PID control method and device for optimizing RBF neural network by improving sparrow population algorithm provided in the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, the PID control method for optimizing the RBF neural network by using the improved sparrow population algorithm provided in the embodiment of the present application includes:
s101, improving a sparrow search algorithm to obtain an improved sparrow search algorithm, wherein the improved sparrow search algorithm outputs a global optimal parameter;
the sparrow search algorithm (Sparrow Search Algorithm, SSA) is a novel group intelligent optimization algorithm, mainly inspired by the foraging behavior and the anti-predation behavior of the sparrows, and mainly realizes position optimization by simulating the foraging behavior and the anti-predation behavior of the sparrows so as to find the local optimal value of part of the NP problem. Sparrow search algorithms fall into three general categories: the discoverer, the joiner and the early warning person, wherein the discoverer has a higher adaptability value and is responsible for providing foraging areas and directions for the joiner, the joiner can always follow the discoverer for obtaining better food and monitor the discoverer and fight for the food, and the early warning person immediately sends out an alarm signal after discovering the predator, so that the whole sparrow can perform anti-predation behavior.
In some embodiments, as shown in fig. 2, the modification of the sparrow search algorithm to obtain an improved sparrow search algorithm includes:
initializing a sparrow population, and setting parameters of the sparrow population;
calculating fitness values of N sparrow individuals in the sparrow population, sequencing the N sparrow individuals according to the fitness values, and determining a current optimal fitness value and a current worst fitness value; each sparrow individual in the sparrow search algorithm is composed of a center and variance of a base function and weights from an implicit layer to an output layer, and an objective function is a mean square error of a sample true value and a predicted value;
selecting the first pd sparrows with the front fitness value as discoverers, and updating the positions of the discoverers according to a position updating formula of the discoverers;
selecting sparrows except the sparrows serving as discoverers from the N sparrows as joiners, and updating the positions of the joiners according to a position updating formula of the joiners;
selecting Sd sparrows from the sparrow population as early warning persons, and updating the positions of the early warning persons according to a position updating formula of the early warning persons;
recalculating fitness values of N sparrow individuals in the sparrow population, and leadingmCrossing and mutating fitness values of individual sparrows;
determining the current iteration sparrow position according to the fitness value of the current position of each sparrow and the fitness value reserved by the sparrow in the previous iteration, and replacing the parent position by adopting the child position with strong adaptability;
comparing the individual fitness of the self-adaptive crossover and variation with the historical optimal individual fitness, and performing global updating;
judging whether the current iteration number reaches the set maximum iteration number, if so, outputting a global optimal parameter, and if not, continuing iteration.
Each individual in the sparrow search algorithm is composed of a center and variance of a base function and weights from an implicit layer to an output layer, and an objective function is a mean square error of a true value and a predicted value of a sample.
Constructing a sparrow population:
where d represents the dimension of the problem to be optimized and n represents the number of sparrows.
Sparrow population fitness function:
for the position updating formula of the discoverer, specifically, adding a sine function into the original discoverer formula, removing the random number,
wherein,,is shown in the firsttIn the belt (th)iIndividual firstjThe position of the dimension is determined by the position of the dimension,trepresents the number of iterations, +.>Is a standard normal random number, -/->Represented as a 1 x dim matrix, dim being the dimension value, < >>And->Respectively an early warning person and an early warning threshold value, when +.></>When the foraging area is safe, foraging can be performed in a larger atmosphere, and when +.> When the foraging area is unsafe, the finder needs to fly to the safe area.
It will be appreciated that since i is the location information of the ith sparrow, an increase in i from 1 to 7,i is at a minimum of 1 and a maximum of 7 and N is 30, as demonstratedMiddle->Not equal to->,/>The improved discoverer expression converges.
For the position updating formula of the joiner, specifically, the sine function and the inverse proportion function are added to the original formula,
in the method, in the process of the invention,is->The most adaptable individual position in the generation population, < ->Is the current +>Individuals with worst fitness value among generations, +.>Is the current +>Individuals with worst fitness value among generations, +.>Matrix of 1 x dim, wherein the elements are random values of 1 or-1,/->,/>For the number of the population to be counted,
it will be appreciated that becauseTherefore->The number of the participants is increased to ten based on the number of the participants, i is 8 at the minimum and 10 at the maximum>Not equal to->Therefore->The expression therefore converges.
For the position updating formula of the precaution person, specifically adding a sine function into the precaution person formula,
in the method, in the process of the invention,and->For the global best and worst individual fitness values at this time, +.>Representing the fitness value of individuals in the current population, +.>,/>Setting a smaller constant to avoid the situation that the denominator is 0 when +.>Indicating that the individual is currently at the periphery of the population, the position needs to be changed to a safe area to obtain a better fitness value when +.>When representing that the individual is currently inThe middle population is close to other safe individuals randomly, so that the risk of catching the individuals is reduced.
It will be appreciated that for the conditionsThe following formula is derived to obtain +.>Obeying a normal distribution with variance of 1 and mean of 0, i.e. +.>,/>Is in the range of +.>Therefore, the improved precaution expression is less than 1 and is convergent.
Then recalculate each individual fitness and sort, the individuals with the front fitness carry out self-adaptive crossing and mutation, the adaptive crossing and mutation adopted in the method can prevent the sparrow population from entering the local minimum, the fitness of each sparrow individual is sorted firstly, the child fitness and the father fitness are compared, the individuals with poor fitness are eliminated, the sparrow population can be prevented from being trapped in the local minimum, and the population quality and precision are improved.
In the cross operation, firstly, sparrow individuals are paired, and according to probabilityCrossing selected paired sparrows, crossed sparrows +.>,/>Is a random number in (0, 1), and its expression is as follows:
mutation operation: according to probabilityVariant to sparrow individual, d-th dimension variable of optimum value of individual +.>Randomly mutating (i.e. making a mutation)>Is a random disturbance variable, the formula is +.>Obeys normal distribution.
In practice, the probability of crossover and mutation、/>The method is generally difficult to control and has a difficult expected effect, and the adaptive crossover and mutation operation adopted by the method can be automatically regulated and is defined as follows:
wherein the method comprises the steps of,/>Is constant (I)>Is the global fitness optimum, +.>Is the average value of the fitness of the sparrow population,is the maximum adaptability of sparrow population, +.>Is the minimum fitness of sparrow population.
After the child fitness after evolution is calculated, replacing the parent position by the child position with strong adaptability, comparing the individual fitness of self-adaptive crossover and variation with a history optimal individual, globally updating, judging whether a condition is met, and giving the output global optimal parameter to the RBF neural network as an initialization network weight and a threshold value when the condition is met.
S102, taking the global optimal parameter as an initialized network weight and a threshold of the RBF neural network;
in some embodiments, as shown in fig. 3, the RBF neural network includes:
an input layer, a hidden layer and an output layer;
the transformation from the input layer space to the hidden layer space adopts nonlinear transformation, and the transformation from the hidden layer space to the output layer space adopts linear transformation.
As shown in fig. 3, the RBF neural network is composed of an input layer, a hidden layer, and an output layer. The transformation from the input layer space to the hidden layer space is nonlinear, while the transformation from the hidden layer space to the output layer space is linear.
It can be understood that the best network weight threshold is selected for RBF neural network training.
The topology structure of RBF neural network is a three-layer forward network, in which the input layer is formed from signal source nodes, only plays the role of transferring data information, does not make any conversion on the input information, the second layer is hidden layer, the number of nodes is determined according to need, the kernel function (function) of hidden layer neuron is Gaussian function, and makes space mapping conversion on the input information, the third layer is output layer, and is in response to input mode, the function of output layer neuron is linear function, and the information output by hidden layer neuron is output after being linearly weighted as output result of whole neural network. There are 3 parameters for RBF solution: the center of the basis function, variance, and implicit layer to output layer weights.
And S103, training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating an adjustment value of the output PID when the convergence condition is met.
In the training process, the training error is calculated, whether the error meets the termination condition is judged, if the error does not meet the condition, the training is required to be carried out again, the training times are updated if the error meets the condition, when the training times are larger than the error of a preset value and smaller than a target value, the transfer function is adopted to carry out system modeling, and the PID parameter is automatically adjusted to calculate the PID adjustment value.
The PID control method for optimizing the RBF neural network by improving the sparrow population algorithm has the working principle that: referring to fig. 4, the sparrow search algorithm is first modified to obtain a modified sparrow search algorithm, and the modified sparrow search algorithm outputs a global optimum parameter; taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network; and then training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating the adjustment value of the output PID when the convergence condition is met.
The adaptive genetic sparrow search algorithm is improved firstly, and the adaptive genetic sparrow search algorithm after crossing and mutation operation is provided, so that the adaptive genetic sparrow search algorithm has good robustness for different problems, and population trapping in a local optimal value can be avoided. And then, the optimized RBF neural network is provided to optimize the adjusting parameters of the PID control system, innovations are made for the PID controller of the past BP neural network, and the response time and the parameter setting time are shortened. In addition, the RBF neural network after the sparrow search algorithm is improved can improve the optimization precision, shorten the learning time and has the characteristics of high convergence rate and good stability. Compared with the common PID control, the improved PID control has the capability of self-learning and self-setting control parameters.
As shown in fig. 5, an embodiment of the present application provides a PID control device for optimizing RBF neural network by improving sparrow population algorithm, including:
the improvement module 201 is configured to improve the sparrow search algorithm to obtain an improved sparrow search algorithm, where the improved sparrow search algorithm outputs a global optimal parameter;
an optimization module 202, configured to take the global optimal parameter as an initialized network weight and a threshold of the RBF neural network;
the calculation module 203 is configured to train the optimized RBF neural network, determine whether a convergence condition is satisfied when the training error satisfies the end condition, and calculate an adjustment value of the output PID when the convergence condition is satisfied.
The PID control device for optimizing RBF neural network by improving the sparrow population algorithm provided by the application has the working principle that the improved module 201 improves the sparrow search algorithm to obtain an improved sparrow search algorithm, and the improved sparrow search algorithm outputs global optimal parameters; the optimization module 202 takes the global optimal parameter as an initialized network weight and a threshold of the RBF neural network; the calculation module 203 trains the optimized RBF neural network, judges whether a convergence condition is satisfied when the training error satisfies the end condition, and calculates an adjustment value of the output PID when the convergence condition is satisfied.
It can be understood that the above-provided method embodiments correspond to the above-described apparatus embodiments, and corresponding specific details may be referred to each other and will not be described herein.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. The PID control method for optimizing RBF neural network by improving sparrow population algorithm is characterized by comprising the following steps:
improving the sparrow search algorithm to obtain an improved sparrow search algorithm, wherein the improved sparrow search algorithm outputs a global optimal parameter;
taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network;
training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the ending condition, and calculating the adjustment value of the output PID when the convergence condition is met.
2. The method of claim 1, wherein the modifying the sparrow search algorithm to obtain a modified sparrow search algorithm comprises:
initializing a sparrow population, and setting parameters of the sparrow population;
calculating fitness values of N sparrow individuals in the sparrow population, sequencing the N sparrow individuals according to the fitness values, and determining a current optimal fitness value and a current worst fitness value; each sparrow individual in the sparrow search algorithm is composed of a center and variance of a base function and weights from an implicit layer to an output layer, and an objective function is a mean square error of a sample true value and a predicted value;
selecting the first pd sparrows with the front fitness value as discoverers, and updating the positions of the discoverers according to a position updating formula of the discoverers;
selecting sparrows except the sparrows serving as discoverers from the N sparrows as joiners, and updating the positions of the joiners according to a position updating formula of the joiners;
selecting Sd sparrows from the sparrow population as early warning persons, and updating the positions of the early warning persons according to a position updating formula of the early warning persons;
recalculating fitness values of N sparrow individuals in the sparrow population, and leadingmCrossing and mutating fitness values of individual sparrows;
determining the current iteration sparrow position according to the fitness value of the current position of each sparrow and the fitness value reserved by the sparrow in the previous iteration, and replacing the parent position by adopting the child position with strong adaptability;
comparing the individual fitness of the self-adaptive crossover and variation with the historical optimal individual fitness, and performing global updating;
judging whether the current iteration number reaches the set maximum iteration number, if so, outputting a global optimal parameter, and if not, continuing iteration.
3. The method of claim 2, wherein the sparrow population is
The fitness function of the sparrow population is
Where d represents the dimension of the problem to be optimized and n represents the number of sparrows.
4. A method according to claim 3, wherein the location update formula of the finder is
Wherein,,is shown in the firsttIn the belt (th)iIndividual firstjThe position of the dimension is determined by the position of the dimension,trepresents the number of iterations, +.>Is a standardNormally distributed random numbers, ++>Represented as a 1 x dim matrix, dim being the dimension value, < >>And->Respectively, early warning person and early warning threshold value, when</>When the foraging area is safe, foraging can be performed in a larger atmosphere, and when +.> When the foraging area is unsafe, the discoverer needs to fly to the safe area;
iis the firstiThe position information of the individual sparrows,ifrom 1 to 7,ia minimum of 1, a maximum of 7,N30, proof ofMiddle->Not equal to->,/>The method comprises the steps of carrying out a first treatment on the surface of the Thus, improved hairThe present expression converges.
5. The method of claim 2, wherein the location update formula of the enrollee is
In the method, in the process of the invention,is->The most adaptable individual position in the generation population, < ->Is the current +>Individuals with worst fitness value among generations, +.>Is the current +>Individuals with worst fitness value among generations, +.>Matrix of 1 x dim, wherein the elements are random values of 1 or-1,/->,/>For the number of the population to be counted,
because ofTherefore->The number of the joiners is increased to 10 on the basis of the joiners,ithe value range is [8, 10 ]],i/nNot equal to->Therefore->Thus, the improved joiner expression converges.
6. The method of claim 2, wherein the location update formula of the precaution person is
In the method, in the process of the invention,and->For the global best and worst individual fitness values at this time, +.>Representing the fitness value of individuals in the current population, +.>,/>Setting a smaller constant to avoid the situation that the denominator is 0 when +.>Indicating that the individual is currently at the periphery of the population and needs to be changedThe location is moved to the safe area to obtain a better fitness value when +.>When the individual is in the center of the middle population, the individual can randomly approach other safe individuals to reduce the risk of catching the individual, and the condition is thatThe following formula is derived to obtain +.>,/>Obeying a normal distribution with variance of 1 and mean of 0, i.e. +.>,/>Is in the range of +.>Therefore, the improved precaution expression is less than 1, and the improved precaution expression is convergent.
7. The method according to claim 2, wherein the calculating the fitness value of the N individual sparrows in the sparrow population is performed bymThe fitness value of each sparrow individual crosses and varies, including:
pairing sparrow individuals according to probability in the following wayCrossing selected paired sparrows,
wherein, sparrows with crossed positions,/>Is a random number in (0, 1);
the probability is based on the following wayVariant to sparrow individual, d-th dimension variable of optimum value of individual +.>The variation is carried out at random,
wherein,,is a random disturbance variable.
8. The method according to claim 2, wherein calculating the adjustment value of the output PID when the convergence condition is satisfied comprises:
and when the training times are larger than the error of the preset value and smaller than the target value, performing system modeling by adopting a transfer function, and calculating the PID adjustment value by automatically adjusting the PID parameters.
9. The method of claim 1, wherein the RBF neural network comprises:
an input layer, a hidden layer and an output layer;
the transformation from the input layer space to the hidden layer space adopts nonlinear transformation, and the transformation from the hidden layer space to the output layer space adopts linear transformation.
10. A PID control device for optimizing RBF neural network by improving sparrow population algorithm, comprising:
the improved module is used for improving the sparrow search algorithm to obtain an improved sparrow search algorithm, and the improved sparrow search algorithm outputs global optimal parameters;
the optimization module is used for taking the global optimal parameter as an initialized network weight and a threshold value of the RBF neural network;
the calculation module is used for training the optimized RBF neural network, judging whether the convergence condition is met when the training error meets the end condition, and calculating an adjustment value of the output PID when the convergence condition is met.
CN202310705764.XA 2023-06-15 2023-06-15 PID control method and device for optimizing RBF neural network by improving sparrow population algorithm Pending CN116449686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310705764.XA CN116449686A (en) 2023-06-15 2023-06-15 PID control method and device for optimizing RBF neural network by improving sparrow population algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310705764.XA CN116449686A (en) 2023-06-15 2023-06-15 PID control method and device for optimizing RBF neural network by improving sparrow population algorithm

Publications (1)

Publication Number Publication Date
CN116449686A true CN116449686A (en) 2023-07-18

Family

ID=87122274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310705764.XA Pending CN116449686A (en) 2023-06-15 2023-06-15 PID control method and device for optimizing RBF neural network by improving sparrow population algorithm

Country Status (1)

Country Link
CN (1) CN116449686A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118039022A (en) * 2024-04-11 2024-05-14 国能龙源环保有限公司 Sulfur dioxide concentration prediction method and device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112329934A (en) * 2020-11-17 2021-02-05 江苏科技大学 RBF neural network optimization algorithm based on improved sparrow search algorithm
CN114545766A (en) * 2022-02-28 2022-05-27 上海电机学院 BP neural network PID control method optimized by sparrow search algorithm
CN114690117A (en) * 2022-04-01 2022-07-01 徐州工业职业技术学院 Indoor three-dimensional positioning method for optimizing GRNN based on improved sparrow algorithm
CN115374689A (en) * 2022-01-17 2022-11-22 浙江科技学院 Air quality index prediction method based on improved sparrow search algorithm optimization

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112329934A (en) * 2020-11-17 2021-02-05 江苏科技大学 RBF neural network optimization algorithm based on improved sparrow search algorithm
CN115374689A (en) * 2022-01-17 2022-11-22 浙江科技学院 Air quality index prediction method based on improved sparrow search algorithm optimization
CN114545766A (en) * 2022-02-28 2022-05-27 上海电机学院 BP neural network PID control method optimized by sparrow search algorithm
CN114690117A (en) * 2022-04-01 2022-07-01 徐州工业职业技术学院 Indoor three-dimensional positioning method for optimizing GRNN based on improved sparrow algorithm

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
凌胜: "(基于STSSA-PID神经网络多变量解耦控制器优化", 佳木斯大学学报(自然科学版), vol. 41, no. 3, pages 16 - 19 *
宋健 等: "改进麻雀搜索算法的RBF神经网络水质预测", 《计算机系统应用》, vol. 32, no. 4, pages 255 - 261 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118039022A (en) * 2024-04-11 2024-05-14 国能龙源环保有限公司 Sulfur dioxide concentration prediction method and device and computer equipment

Similar Documents

Publication Publication Date Title
Han et al. An adaptive-PSO-based self-organizing RBF neural network
Lu et al. Generalized radial basis function neural network based on an improved dynamic particle swarm optimization and AdaBoost algorithm
CN110308649B (en) PID parameter optimization method based on PSO-SOA fusion algorithm and applied to industrial process control
CN110488611B (en) Bionic robot fish motion control method, controller and bionic robot fish
Li et al. Artificial evolution of neural networks and its application to feedback control
CN114170789B (en) Intelligent network link lane change decision modeling method based on space-time diagram neural network
CN113031555B (en) Intelligent purification system for harmful gas in environment of livestock and poultry house
CN116449686A (en) PID control method and device for optimizing RBF neural network by improving sparrow population algorithm
CN111553469A (en) Wireless sensor network data fusion method, device and storage medium
CN105427241B (en) Distortion correction method for large-view-field display equipment
CN111459221B (en) MPPT control method for photovoltaic power generation system
Fang et al. A course control system of unmanned surface vehicle (USV) using back-propagation neural network (BPNN) and artificial bee colony (ABC) algorithm
CN112348155A (en) Optimization method and system of fuzzy neural network model
CN106896724B (en) Tracking system and tracking method for sun tracker
CN114545766A (en) BP neural network PID control method optimized by sparrow search algorithm
Song Robust initialization of a Jordan network with recurrent constrained learning
CN115128978A (en) Internet of things environment big data detection and intelligent monitoring system
Biswas et al. Multi-objective simulated annealing variants to infer gene regulatory network: A comparative study
CN116722541A (en) Power system load prediction method and device based on convolutional neural network
CN116469574A (en) WOA-BILSTM-based infectious disease prediction method
Wang et al. Research on the prediction model of greenhouse temperature based on fuzzy neural network optimized by genetic algorithm
Chan et al. Evolutionary computation for on-line and off-line parameter tuning of evolving fuzzy neural networks
CN114139937A (en) Indoor thermal comfort data generation method, system, equipment and medium
CN114330119A (en) Deep learning-based pumped storage unit adjusting system identification method
Wang et al. Improved Particle Swarm Optimization Algorithm Based on Gaussian-Grid Search Method.

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20230718

RJ01 Rejection of invention patent application after publication