CN114185264B - PID controller parameter setting method based on physical information neural network - Google Patents

PID controller parameter setting method based on physical information neural network Download PDF

Info

Publication number
CN114185264B
CN114185264B CN202111482562.0A CN202111482562A CN114185264B CN 114185264 B CN114185264 B CN 114185264B CN 202111482562 A CN202111482562 A CN 202111482562A CN 114185264 B CN114185264 B CN 114185264B
Authority
CN
China
Prior art keywords
neural network
pid controller
physical information
controlled system
representing
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.)
Active
Application number
CN202111482562.0A
Other languages
Chinese (zh)
Other versions
CN114185264A (en
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.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN202111482562.0A priority Critical patent/CN114185264B/en
Publication of CN114185264A publication Critical patent/CN114185264A/en
Application granted granted Critical
Publication of CN114185264B publication Critical patent/CN114185264B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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.

Abstract

The invention discloses a PID controller parameter setting method based on a physical information neural network, which relates to the technical field of industrial process control and comprises the following steps: constructing a dynamics model of a controlled system and setting an objective function of the controlled system; expressing control variables in a controlled system by using a PID controller form to obtain a state equation of a dynamic model; constructing a physical information neural network according to a state equation of the dynamic model, and establishing a total loss function; and optimizing the total loss function based on a gradient descent method to obtain the optimal PID controller parameters. The method combines the physical information of the system, accords with the physical rule, converts the PID controller parameter setting problem into the internal parameter optimizing process of the physical information neural network, and the physical information neural network training process follows the training data sample distribution rule, so that the PID controller parameter setting process is efficient and intelligent, and the obtained PID controller parameter is more reasonable and accurate.

Description

PID controller parameter setting method based on physical information neural network
Technical Field
The invention relates to the technical field of industrial process control, in particular to a PID controller parameter setting method based on a physical information neural network.
Background
The proportional (P) -integral (I) -derivative (D) controller has a simple structure, is the most common controller used in the current industrial control, and realizes the required control effect by adjusting three parameters of the PID controller. The core work of the PID controller is parameter regulation in the control process, namely three parameters of a comparison example (P), an integration (I) and a differentiation (D) are set, so that the dynamic and static performances of the system meet the requirements, and certain performance indexes reach the optimal. The adopted PID control method in the current industrial process requires engineers to manually test and misplaced parameters of three parameters of the PID according to accumulated working experience and knowledge and different control target requirements, and the parameter tuning process is time-consuming and labor-consuming; once the production conditions change, the PID parameters need to be readjusted, and the defects of large overshoot, large steady state error and the like can occur. The traditional setting method of the parameters of the PID controller comprises a critical proportion method, a reaction curve method and an attenuation curve method, wherein the methods are all manually and quantitatively calculated to obtain initial parameters of the PID controller, and then fine adjustment is carried out according to the control effect to obtain a relatively ideal control effect. However, according to the adjusting method of modeling according to the physical rule and manual calculation, when facing a complex controlled object, the calculated amount is increased, the calculation time consumption is increased, the initial parameters of manual calculation have errors, and reasonable control parameters cannot be obtained. In the method for setting PID control parameters by using an intelligent algorithm, a PID controller parameter setting method based on a BP neural network is common, and a data set is formed to carry out a large number of sample training on the BP neural network by acquiring a large number of system input and output relation parameters under the PID controller in the early stage so as to realize the nonlinear relation between the three parameter inputs and the system output of fitting P, I, D. The method only constructs a black box model of a neural network in a pure data driving mode to describe the relation between input and output, and does not utilize the actual physical information of the system; secondly, in the neural network training process, a large amount of sample data is often required, so that the workload of collecting the sample data is huge, and the efficiency of the parameter setting process is low. The black box model obtained in a pure data driven manner based on supervised learning cannot completely replace the actual physical model of the industrial process; limited by the basic physical laws of the control object, it is sometimes difficult to obtain reasonable control model descriptions, and even unreliable control models can be obtained against the physical laws of the control object.
The prior art provides a parameter setting method, device, storage medium, terminal and system of a PID controller, wherein the method comprises the following steps: acquiring input and output sampling data of a PID control system, and calculating a control error of a PID controller according to the sampling data; if the control error exceeds a preset threshold value, obtaining output data of a PID controller, and sending the output data of the PID controller to a neural network model to obtain identification output data; and sending the identification output data to a single neuron controller, controlling the single neuron controller to adjust parameters of the neural network model according to the identification output data, obtaining an adjusted neural network model, and determining parameters of a PID controller according to the adjusted neural network model. The method only constructs a black box model of a neural network to describe the relation between input and output in a pure data driving mode, does not utilize actual physical information of a system, is unreasonable in model description, and finally obtains an inaccurate PID controller.
Disclosure of Invention
The invention provides a PID controller parameter setting method based on a physical information neural network, which is used for overcoming the defects that the existing PID controller parameter setting process depends on manual experience and has low efficiency and parameter setting results deviate from the physical rule of an actual system, combining the physical information of the system and following the distribution rule of training data samples, so that the PID controller parameter setting process is efficient and intelligent, the obtained PID controller parameters are more reasonable and accurate, and the ideal control effect is achieved.
In order to solve the technical problems, the technical scheme of the invention is as follows:
the invention provides a PID controller parameter setting method based on a physical information neural network, which comprises the following steps:
s1: constructing a dynamics model of a controlled system and setting an objective function of the controlled system;
s2: expressing control variables in a controlled system by using a PID controller form to obtain a state equation of a dynamic model;
s3: constructing a physical information neural network according to a state equation of the dynamic model, and establishing a total loss function;
s4: and optimizing the total loss function based on a gradient descent method to obtain the optimal PID controller parameters.
Firstly, constructing a dynamics model of a controlled system, wherein the dynamics model contains actual physical information of the controlled system, accords with a physical rule, and aims at expressing a control problem to be solved actually; the control variables in the controlled system are expressed in a PID controller form, a state equation of a dynamic model is obtained, and then a physical information neural network is constructed according to the state equation, so that the physical information neural network also has actual physical information of the controlled system, and the PID controller parameter setting problem is converted into an internal parameter optimizing process of the physical information neural network; the total loss function of the physical information neural network comprises regularization factors conforming to the physical rule of the controlled system, the total loss function is optimized by using a gradient descent method, and the obtained optimal PID controller parameters are more reasonable and accurate and are more conforming to the physical information of the controlled system.
Preferably, in the step S1, the constructed dynamics model of the controlled system is specifically:
where z (t) represents the actual output at time t, u (t) represents the control variable input at time t,representing the first derivative of z (t).
Before the dynamic model of the controlled system is built, the working mechanism of the controlled system needs to be clarified, and a reasonable dynamic model is built according to discipline knowledge such as mechanics, electricity, electromechanics and the like so as to prepare for the subsequent steps.
Preferably, in the step S1, the objective function of the controlled system is specifically:
wherein t is f Representing a given time domain, z 1 (t) represents the actual output of the controlled system at time t,indicating the desired output of the controlled system at time t.
And setting an objective function according to the control problem to be actually solved, namely realizing that the actual output of the controlled system better accords with the expected output of the controlled system in a given time domain.
Preferably, in the step S2, the specific method for representing the control variable in the controlled system by using the PID controller form is as follows:
the PID controller equation for the control variable is:
wherein k is p ,k I ,k D Respectively representing proportional parameter, integral parameter and differential parameter of PID controller, e (t) represents tracking error of controlled system,represents the first derivative of e (t), where e (t) =z 1 (t)-q d ,q d Indicating the desire for the setting.
Preferably, in the step S2, the specific method for obtaining the state equation of the kinetic model is as follows:
introducing a state variable x (t) = [ x ] 1 (t),x 2 (t),x 3 (t),x 4 (t),x 5 (t)]Order-making
x 1 (t)=z 1 (t),x 2 (t)=z 2 (t)
z 2 (t) represents the actual output of the controlled object at time t,representing z 2 Substituting the first derivative of (t) into a PID controller equation to obtain:
u(t)=k p (x 1 (t)-q d )+k I x 5 (t)+k D x 3 (t)
definition of PID controller parameter vector k= [ K ] P k I k D ] T And replacing the control variable input in the dynamics model of the controlled system, and converting the dynamics model of the controlled system into:
the above expression is expressed by the state variables:
and the initial value of the system is set to 0, the state equation of the dynamics model is expressed as:
where f (·) =0 represents the state equation of the kinetic model.
And adding a PID controller equation of the control variable into a state equation of the dynamic model, so that the control problem to be solved actually is converted into a problem of obtaining the parameters of the PID controller, and preparing for the construction of a subsequent physical information neural network.
Preferably, in the step S3, the specific method for constructing the physical information neural network according to the state equation of the dynamics model is as follows:
establishing a fully connected neural network NN (w, b) to approximate a state variable x (t):
in the method, in the process of the invention,representing a fully connected neural network, w representing the weight of the fully connected neural network, b representing the bias of the fully connected neural network;
and then the parameter vector K= [ K ] of the PID controller P k I k D ] T Adding the model into a fully-connected neural network, and establishing a normally-differential network NN_ODE (K) to approach a control variable u (t):
the constructed physical information neural network is expressed as:
in the method, in the process of the invention,representation->Is a first derivative of (a).
Preferably, in the step S3, the total loss function established is specifically:
MSE=MSE p +MSE f +MSE i
where MSE represents the total loss function, MSE p Is a loss function that tracks the desired output, MSE f Representing a loss function of the state equation, MSE i A loss function representing the initial value of the system.
The total loss function consists of three parts, the first part MSE p Is a data driving part; the last two parts are the automatic differentiation technology of the neural network to calculate the residual tau of the ordinary differential equation f Sum initial value residual tau i Constraint is used as a regular term to obtain a loss function MSE of a state equation f And a loss function MSE of the initial value of the system i The method can effectively prevent the situation of over-fitting when the total loss function is optimized by adding the total loss function.
Preferably, the fully-connected neural network comprises an input layer, a plurality of hidden layers and an output layer;
the input layer, the hidden layer and the output layer are sequentially connected; the input variable of the input layer is time t, and the output data of the output layer is state variable x (t); the mapping relation between the neurons of the adjacent hidden layers is as follows:
in the method, in the process of the invention,represents the activation function, M represents the number of neurons per hidden layer, +.>Weights representing the mapping of the mth neuron of the ith-1 layer hidden layer to the jth neuron of the ith layer hidden layer,/>A bias representing the mapping of neurons of the i-1 th hidden layer to the j-th neurons of the i-th hidden layer; />An mth neuron representing an i-1 th hidden layer;
the mapping relationship between the input layer and the output layer is expressed as:
where w represents the weight of the fully connected neural network and b represents the bias of the fully connected neural network.
The input and output of the fully-connected neural network are the input and output states of a dynamic model state equation, so that the trained fully-connected neural network is not a black box model in the past, but is a neural network conforming to the physical rule of a controlled system.
Preferably, in the step S4, the total loss function is optimized by using an adam optimizer based on a gradient descent method. The adam optimizer can flexibly select proper learning rates for different parameters, so that parameter updating has independence.
Preferably, in the step S4, the specific method for obtaining the parameters of the optimal PID controller is as follows:
setting iteration times, the number of state equation points, the number of actual measurement points, the initial learning rate and the exponential decay rate in an adam optimizer, iteratively calculating the loss value of a total loss function and gradient information of network parameters of a physical information neural network, outputting corresponding optimal PID controller parameters when the loss value is smaller than a preset loss threshold, and otherwise, performing the next iterative calculation.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that:
firstly, constructing a dynamics model of a controlled system, wherein the dynamics model contains actual physical information of the controlled system, accords with a physical rule, and sets an objective function to represent a control problem to be solved actually; the control variables in the controlled system are expressed in a PID controller form, a state equation of a dynamic model is obtained, and then a physical information neural network is constructed according to the state equation, so that the physical information neural network also has actual physical information of the controlled system, and the PID controller parameter setting problem is converted into an internal parameter optimizing process of the physical information neural network; the total loss function of the physical information neural network not only comprises a data driving part with supervised learning, but also comprises regularization factors conforming to the physical law of the controlled system, and the total loss function is optimized by using a gradient descent method, so that the obtained optimal PID controller parameters are more reasonable and accurate, and the optimal PID controller parameters are more conforming to the physical information of the controlled system. Compared with the traditional neural network which needs a large amount of training data to approach the objective function, the physical information neural network is used for setting the PID controller parameters, only a small amount of training data is needed to obtain the optimal PID controller parameters, and the generalization capability is higher.
Drawings
FIG. 1 is a flow chart of a PID controller parameter tuning method based on physical information neural network according to embodiment 1;
fig. 2 is a schematic control principle diagram of the flexible joint mechanical arm in embodiment 3.
FIG. 3 is a block diagram of a fully-connected neural network according to example 3;
fig. 4 is a structural diagram of a physical information neural network according to embodiment 3;
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the present patent;
for the purpose of better illustrating the embodiments, certain elements of the drawings may be omitted, enlarged or reduced and do not represent the actual product dimensions;
it will be appreciated by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The technical scheme of the invention is further described below with reference to the accompanying drawings and examples.
Example 1
The embodiment provides a PID controller parameter setting method based on a physical information neural network, as shown in fig. 1, including:
s1: constructing a dynamics model of a controlled system and setting an objective function of the controlled system;
s2: expressing control variables in a controlled system by using a PID controller form to obtain a state equation of a dynamic model;
s3: constructing a physical information neural network according to a state equation of the dynamic model, and establishing a total loss function;
s4: and optimizing the total loss function based on a gradient descent method to obtain the optimal PID controller parameters.
In a specific implementation process, the method provided by the embodiment firstly builds a dynamics model of the controlled system, wherein the dynamics model contains actual physical information of the controlled system, accords with a physical rule, and an objective function represents a control problem to be solved in practice; the control variables in the controlled system are expressed in a PID controller form to obtain a state equation of a dynamic model, and then a physical information neural network is constructed according to the state equation, so that the physical information neural network also has actual physical information of the controlled system, and the PID parameter setting problem is converted into an internal parameter optimizing process of the physical information neural network; the total loss function of the physical information neural network comprises regularization factors conforming to the physical rule of the controlled system, the total loss function is optimized by using a gradient descent method, and the obtained optimal PID controller parameters are more reasonable and accurate and are more conforming to the physical information of the controlled system.
Example 2
The embodiment provides a PID controller parameter setting method based on a physical information neural network, which comprises the following steps:
s1: constructing a dynamics model of a controlled system and setting an objective function of the controlled system;
before a dynamic model of a controlled system is built, the working mechanism of the controlled system needs to be clarified, and a reasonable dynamic model is built according to discipline knowledge such as mechanics, electricity, electromechanics and the like so as to prepare for subsequent steps; setting an objective function according to the control problem to be actually solved, namely realizing that the actual output of the controlled system better accords with the expected output of the controlled system in a given time domain;
the dynamic model of the constructed controlled system is as follows:
where z (t) represents the actual output at time t, u (t) represents the control variable input at time t,representing the first derivative of z (t);
the objective function is:
wherein t is f Representing a given time domain, z 1 (t) represents the actual output of the controlled system at time t,representing the expected output of the controlled system at the time t;
s2: expressing control variables in a controlled system by using a PID controller form to obtain a state equation of a dynamic model;
adding a PID controller equation of a control variable into a state equation of a dynamic model, converting a control problem to be solved into a problem of obtaining PID controller parameters, and preparing for construction of a subsequent physical information neural network;
the PID controller equation for the control variable is:
wherein k is p ,k I ,k D Respectively representing proportional parameter, integral parameter and differential parameter of PID controller, e (t) represents tracking error of controlled system,represents the first derivative of e (t), where e (t) =z 1 (t)-q d ,q d Representing a desire for a setting;
introducing a state variable x (t) = [ x ] 1 (t),x 2 (t),x 3 (t),x 4 (t),x 5 (t)]Order-making
x 1 (t)=z 1 (t),x 2 (t)=z 2 (t)
z 2 (t) represents the actual output of the controlled object at time t,representing z 2 Substituting the first derivative of (t) into a PID controller equation to obtain:
u(t)=k p (x 1 (t)-q d )+k I x 5 (t)+k D x 3 (t)
definition of PID controller parameter vector k= [ K ] P k I k D ] T And replacing the control variable input in the dynamics model of the controlled system, and converting the dynamics model of the controlled system into:
the above expression is expressed by the state variables:
and the initial value of the system is set to 0, the state equation of the dynamics model is expressed as:
wherein f (·) =0 represents the state equation of the kinetic model;
s3: constructing a physical information neural network according to a state equation of the dynamic model, and establishing a total loss function;
first, a fully connected neural network NN (w, b) is established to approximate a state variable x (t):
in the method, in the process of the invention,represents a fully connected neural network, w represents a fully connected neural networkWeight, b represents bias of the fully connected neural network;
the fully-connected neural network comprises an input layer, a plurality of hidden layers and an output layer;
the input layer, the hidden layer and the output layer are sequentially connected; the input variable of the input layer is time t, and the output data of the output layer is state variable x (t); the mapping relation between the neurons of the adjacent hidden layers is as follows:
in the method, in the process of the invention,represents the activation function, M represents the number of neurons per hidden layer, +.>Weights representing the mapping of the mth neuron of the ith-1 layer hidden layer to the jth neuron of the ith layer hidden layer,/>A bias representing the mapping of neurons of the i-1 th hidden layer to the j-th neurons of the i-th hidden layer; />An mth neuron representing an i-1 th hidden layer;
the mapping relationship between the input layer and the output layer is expressed as:
wherein w represents the weight of the fully connected neural network, and b represents the bias of the fully connected neural network
And then the parameter vector K= [ K ] of the PID controller P k I k D ] T Adding into a fully-connected neural network to establish a normally-differential networkThe complex nn_ode (K) approximates the control variable u (t):
the constructed physical information neural network is expressed as:
in the method, in the process of the invention,representation->Is the first derivative of (a);
the total loss function established is:
MSE=MSE p +MSE f +MSE i
where MSE represents the total loss function, MSE p Is a loss function that tracks the desired output, MSE f Representing a loss function of the state equation, MSE i A loss function representing the initial value of the system.
The total loss function consists of three parts, the first part MSE p Is a data driving part; the last two parts are obtained by utilizing an automatic differential technology to obtain a residual tau of a normal differential equation f Sum initial value residual tau i Constraint is used as a regular term to obtain a loss function MSE of a state equation f And a loss function MSE of the initial value of the system i The method can effectively prevent the situation of over-fitting when the total loss function is optimized by adding the total loss function.
S4: and optimizing the total loss function based on a gradient descent method to obtain the optimal PID controller parameters.
And (3) optimizing the total loss function by using an adam optimizer, setting iteration times, the number of state equation points, the number of actual measurement points, the initial learning rate and the exponential decay rate in the adam optimizer, iteratively calculating the loss value of the total loss function and gradient information of network parameters of the physical information neural network, and outputting the corresponding optimal PID controller parameters when the loss value is smaller than a preset loss threshold value, otherwise, performing the next iteration calculation.
Example 3
The embodiment provides a PID controller parameter setting method based on a physical information neural network, which is used for solving the control problem of a flexible joint mechanical arm system, and as shown in fig. 2, the control principle of the flexible joint mechanical arm system is as follows: setting an expected rotation angle of the mechanical arm, feeding back the angle position of the current mechanical arm by using an angle sensor, calculating an error between an expected value and the current value, transmitting the error into a controller, controlling a motor to rotate by a corresponding angle by using the controller, and finally enabling the position of the mechanical arm to rotate to the expected angle through spring transmission.
Firstly, constructing a dynamic model of a flexible joint mechanical arm system:
wherein the control variable u (t) is an input control torque, N represents the moment of inertia of the motor, M represents the mass of the mechanical arm, L represents the length of the mechanical arm, and I represents the moment of inertia of the mechanical arm; μ represents the elastic coefficient of the joint, g represents the gravitational constant, and λ represents the friction with a finite norm. θ 1 (t) represents the actual output of the controlled system, namely the actual rotation angle of the joint of the mechanical arm, theta 2 (t) represents the actual output of the controlled object, i.e. the actual rotation angle of the motor;
in a given time domain t f In, the position of the mechanical arm is rotated to the expected angle of the mechanical arm under the action of the control torque u (t)Setting the objective function of the flexible joint mechanical arm system as:
The control variable u (t) in the flexible joint mechanical arm system is expressed by a PID controller form:
where e (t) represents the system output angle tracking error,represents the first derivative of e (t), e (t) =θ 1 (t)-q d ,q d Representing the desire; k (k) P ,k I ,k D Proportional parameters, integral parameters and differential parameters of the PID controller respectively;
introducing a state variable x (t) = [ x ] 1 (t),x 2 (t),x 3 (t),x 4 (t),x 5 (t)]Wherein
x 1 (t)=θ 1 (t)
x 2 (t)=θ 2 (t)
Substituting into the PID controller equation:
u(t)=k p (x 1 (t)-q d )+k I x 5 (t)+k D x 3 (t)
the initial state of the system is as follows:
x 1 (0)=x 2 (0)=x 3 (0)=x 4 (0)=x 5 (0)=0
the state equation set of the dynamic model of the flexible joint mechanical arm system is as follows:
in this embodiment, μ=986, i=0.98, j=1.02, m=0.21, l=0.12, g=9.8;
the above set of state equations is organized as follows:
wherein k= [ K ] P k I k D ] T Representing the parameter vector of the PID controller, and rewriting the state equation set into a differential equation form:
the basic idea in the process of constructing a physical information neural network to set parameters of a PID controller according to a state equation set of a dynamics model is that a fully connected neural network NN (w, b) is firstly established to approach a state variable x (t):
in the method, in the process of the invention,representing a fully connected neural network, w representing the weight of the fully connected neural network, b representing the bias of the fully connected neural network;
as shown in fig. 3, the fully-connected neural network comprises an input layer, a plurality of hidden layers and an output layer; in this embodiment, the fully-connected neural network includes 4 hidden layers connected in sequence, each hidden layer being composed of 40 neurons;
the input layer, the hidden layer and the output layer are sequentially connected; the input variable of the input layer is time t, and the output data of the output layer is state variable x (t); the mapping relation between the neurons of the adjacent hidden layers is as follows:
in the method, in the process of the invention,represents the activation function, M represents the number of neurons per hidden layer, +.>Weights representing the mapping of the mth neuron of the ith-1 layer hidden layer to the jth neuron of the ith layer hidden layer,/>A bias representing the mapping of neurons of the i-1 th hidden layer to the j-th neurons of the i-th hidden layer; />An mth neuron representing an i-1 th hidden layer;
the mapping relationship between the input layer and the output layer is expressed as:
wherein w represents the weight of the fully connected neural network, and b represents the bias of the fully connected neural network;
as shown in fig. 4, the PID controller parameter vector k= [ K ] P k I k D ] T Adding the model into a fully-connected neural network, and establishing a normally-differential network NN_ODE (K) to approach a control variable u (t):
substituting the state equation set in the form of differential equation, the constructed physical information neural network is expressed as:
in the method, in the process of the invention,representation->Is a first derivative of (a).
Up to this point, the construction is completed including the PID controller parameter vector k= [ K ] P k I k D ] T Is a physical information neural network structure;
solving the residual tau of the ordinary differential equation by utilizing the automatic differential technology f Sum initial value residual tau i The constraint is put into a total loss function MSE as a regular term, and the established total loss function is specifically:
MSE=MSE p +MSE f +MSE i
where MSE represents the total loss function, MSE p Is a loss function that tracks the desired output, MSE f Representing a loss function of the state equation, MSE i A loss function representing an initial value of the system;
the total loss function consists of three parts, the first part MSE p Is a data driving part, x is known by an objective function of the flexible joint mechanical arm system 1 (t) where the physical information neural network is a predictor of the first state,is the actual value of the first state, MSE p In setting the parameters of the PID controller, only the first state is selected as the data driving part, rewritten as:
wherein x is 1 (t j ) Is the predicted value of the first output variable at the j-th moment in the physical information neural network,is the sample value at a given j-th time, N p The number of real measurement points; the last two parts are the automatic differentiation technology of the neural network to calculate the residual tau of the ordinary differential equation f Sum initial value residual tau i Constraint is used as a regular term to obtain a loss function MSE of a state equation f And a loss function MSE of the initial value of the system i The method comprises the following steps:
wherein x is i (0) Is the initial value of the prediction and,is the actual initial value, N 0 Is the number of initial states in the state equation, N f The number of the selected points on the state equation;
loss function MSE f And a loss function MSE of the initial value of the system i The method can effectively prevent the situation of over-fitting when the total loss function is optimized by adding the total loss function.
The overall loss function is then optimized, since it already contains the PID controller parameter vector k= [ K ] P k I k D ] T And the weight and bias parameters (w, b) of each layer of the fully connected neural network, and the total loss function can be optimized and solved by utilizing an automatic differentiation technology; in this embodiment, an adam optimizer is used for optimization: the network parameters of the physical information neural network and the parameter vector of the PID controller are updated by calling an adam optimizer to calculate the value and the parameter gradient of the total loss function through the deep XDE library, and the method is specifically as follows:
calling a model module, and setting optimization super parameters such as weights in an adam optimizer, a learning rate and residual regularization items;
and calling a model/train module to train the neural network, and setting training parameters, such as: iteration times, callback to monitor PID controller parameters;
specifying total loss function calculation by an adam optimizer on the state equation set and the initial value residual error, and minimizing the total loss function MSE to obtain corresponding optimal PID controller parameters.
It is to be understood that the above examples of the present invention are provided by way of illustration only and not by way of limitation of the embodiments of the present invention. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are desired to be protected by the following claims.

Claims (6)

1. The PID controller parameter setting method based on the physical information neural network is characterized by comprising the following steps of:
s1: constructing a dynamics model of a controlled system and setting an objective function of the controlled system;
s2: expressing control variables in a controlled system by using a PID controller form to obtain a state equation of a dynamic model; the specific method comprises the following steps:
the PID controller equation for the control variable is:
wherein k is p ,k I ,k D Respectively representing proportional parameter, integral parameter and differential parameter of PID controller, e (t) represents tracking error of controlled system,represents the first derivative of e (t), where e (t) =z 1 (t)-q d ,q d Indicating the expected output of the controlled system at time t, z 1 (t) represents the actual output of the controlled system at time t; t is t f Representing a given time domain;
the specific method for obtaining the state equation of the dynamic model is as follows:
introducing a state variable x (t) = [ x ] 1 (t),x 2 (t),x 3 (t),x 4 (t),x 5 (t)]Order-making
x 1 (t)=z 1 (t),x 2 (t)=z 2 (t)
z 2 (t) represents the actual output of the controlled object at time t,representing z 2 Substituting the first derivative of (t) into a PID controller equation to obtain:
u(t)=k p (x 1 (t)-q d )+k I x 5 (t)+k D x 3 (t)
definition of PID controller parameter vector k= [ K ] P k I k D ] T And replacing the control variable input in the dynamics model of the controlled system, and converting the dynamics model of the controlled system into:
the above expression is expressed by the state variables:
and the initial value of the system is set to 0, the state equation of the dynamics model is expressed as:
wherein f (·) =0 represents the state equation of the kinetic model;
s3: constructing a physical information neural network according to a state equation of the dynamic model, and establishing a total loss function; the specific method comprises the following steps:
establishing a fully connected neural network approximation state variable x (t):
in the method, in the process of the invention,representing a fully connected neural network, w representing the weight of the fully connected neural network, b representing the bias of the fully connected neural network;
and then the parameter vector K= [ K ] of the PID controller P k I k D ] T Adding the method into a fully-connected neural network, and establishing a normally-differential network approximation control variable u (t):
the constructed physical information neural network is expressed as:
in the method, in the process of the invention,representation->Is the first derivative of (a);
the established total loss function is specifically:
MSE=MSE p +MSE f +MSE i
where MSE represents the total loss function, MSE p Is a loss function that tracks the desired output, MSE f Representing a loss function of the state equation, MSE i A loss function representing an initial value of the system;
s4: and optimizing the total loss function based on a gradient descent method to obtain the optimal PID controller parameters.
2. The method for setting parameters of a PID controller based on a physical information neural network according to claim 1, wherein in step S1, the dynamic model of the constructed controlled system is specifically:
where z (t) represents the actual output at time t, u (t) represents the control variable input at time t,representing the first derivative of z (t).
3. The method for setting parameters of a PID controller based on a physical information neural network according to claim 2, wherein in step S1, the objective function of the controlled system is specifically:
wherein z is 1 (t) represents the actual output of the controlled system at time t, q d Indicating the desired output of the controlled system at time t.
4. The PID controller parameter tuning method based on physical information neural network of claim 3, wherein the fully connected neural network comprises an input layer, a plurality of hidden layers and an output layer;
the input layer, the hidden layer and the output layer are sequentially connected; the input variable of the input layer is time t, and the output data of the output layer is state variable x (t); the mapping relation between the neurons of the adjacent hidden layers is as follows:
in the method, in the process of the invention,represents the activation function, M represents the number of neurons per hidden layer, +.>Weights representing the mapping of the mth neuron of the i-1 th hidden layer to the j-th neuron of the first hidden layer,/for the mth neuron of the i-1 hidden layer>A bias representing the mapping of neurons of the i-1 th hidden layer to the j-th neurons of the first hidden layer; />An mth neuron representing a hidden layer of the first-1 layer;
the mapping relationship between the input layer and the output layer is expressed as:
where w represents the weight of the fully connected neural network and b represents the bias of the fully connected neural network.
5. The method for setting parameters of a PID controller based on a physical information neural network according to claim 1, wherein in the step S4, the total loss function is optimized by an adam optimizer based on a gradient descent method.
6. The method for setting parameters of the PID controller based on the physical information neural network according to claim 1, wherein in the step S4, the specific method for obtaining the parameters of the optimal PID controller is as follows:
setting iteration times, the number of state equation points, the number of actual measurement points, the initial learning rate and the exponential decay rate in an adam optimizer, iteratively calculating the loss value of a total loss function and gradient information of network parameters of a physical information neural network, outputting corresponding optimal PID controller parameters when the loss value is smaller than a preset loss threshold, and otherwise, performing the next iterative calculation.
CN202111482562.0A 2021-12-06 2021-12-06 PID controller parameter setting method based on physical information neural network Active CN114185264B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111482562.0A CN114185264B (en) 2021-12-06 2021-12-06 PID controller parameter setting method based on physical information neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111482562.0A CN114185264B (en) 2021-12-06 2021-12-06 PID controller parameter setting method based on physical information neural network

Publications (2)

Publication Number Publication Date
CN114185264A CN114185264A (en) 2022-03-15
CN114185264B true CN114185264B (en) 2023-09-19

Family

ID=80542541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111482562.0A Active CN114185264B (en) 2021-12-06 2021-12-06 PID controller parameter setting method based on physical information neural network

Country Status (1)

Country Link
CN (1) CN114185264B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114609899A (en) * 2022-03-17 2022-06-10 华中科技大学 Purifying box environment measurement and control method and system based on multi-sensor cooperation
CN114859796A (en) * 2022-06-09 2022-08-05 中国第一汽车股份有限公司 Vehicle control method, electronic device and storage medium
CN114789453B (en) * 2022-06-22 2022-09-30 季华实验室 Mechanical arm dynamic PID control method and device, electronic equipment and storage medium
CN115061365B (en) * 2022-07-22 2022-11-11 浙江中控技术股份有限公司 Method for constructing parameter setting model and industrial process control method
CN115972216B (en) * 2023-03-17 2023-06-30 中南大学 Parallel robot forward motion solving method, control method, equipment and storage medium
CN116184812A (en) * 2023-04-24 2023-05-30 荣耀终端有限公司 Signal compensation method, electronic equipment and medium
CN116619383B (en) * 2023-06-21 2024-02-20 山东大学 Mechanical arm PID control method and system based on definite learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614432A (en) * 2018-06-11 2018-10-02 北京航空航天大学 A kind of network environment electric machine controller algorithm for design based on particle cluster algorithm
CN111273544A (en) * 2020-04-01 2020-06-12 河海大学常州校区 Radar pitching motion control method based on prediction RBF feedforward compensation type fuzzy PID
WO2021163309A1 (en) * 2020-02-11 2021-08-19 Siemens Aktiengesellschaft Frequency-compensted neural networks for fluid dynamics design problems

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11922134B2 (en) * 2019-09-25 2024-03-05 Siemens Aktiengesellschaft Physics informed neural network for learning non-Euclidean dynamics in electro-mechanical systems for synthesizing energy-based controllers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614432A (en) * 2018-06-11 2018-10-02 北京航空航天大学 A kind of network environment electric machine controller algorithm for design based on particle cluster algorithm
WO2021163309A1 (en) * 2020-02-11 2021-08-19 Siemens Aktiengesellschaft Frequency-compensted neural networks for fluid dynamics design problems
CN111273544A (en) * 2020-04-01 2020-06-12 河海大学常州校区 Radar pitching motion control method based on prediction RBF feedforward compensation type fuzzy PID

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
兰鹏等.PINNs算法及其在岩土工程中的应用研究.岩土工程学报.2021,第43卷(第3期),第586-592页. *
冀霖.基于BP神经网络的机器人柔性关节运动精度研究.中国优秀硕士学位论文全文数据库信息科技辑.2020,(第7期),第I140-171页. *

Also Published As

Publication number Publication date
CN114185264A (en) 2022-03-15

Similar Documents

Publication Publication Date Title
CN114185264B (en) PID controller parameter setting method based on physical information neural network
US11574192B2 (en) Controller training based on historical data
CN108427985B (en) Plug-in hybrid vehicle energy management method based on deep reinforcement learning
Sokolov et al. Complete stability analysis of a heuristic approximate dynamic programming control design
CN108520155B (en) Vehicle behavior simulation method based on neural network
CN109507882B (en) RBF-ARX model-based rapid robust prediction control method
CN111310965A (en) Aircraft track prediction method based on LSTM network
CN109670580A (en) A kind of data recovery method based on time series
EP3938854A1 (en) Method of performing a process and optimizing control signals used in the process
CN115271186B (en) Reservoir water level prediction and early warning method based on delay factor and PSO RNN Attention model
CN116460860B (en) Model-based robot offline reinforcement learning control method
WO2019086760A1 (en) Generation of a control system for a target system
CN110097929A (en) A kind of blast furnace molten iron silicon content on-line prediction method
CN115963752A (en) Voice coil motor position servo control system based on deep learning and training method of mathematical model
CN101285816A (en) Copper matte air refining procedure parameter soft sensing instrument and its soft sensing method
CN110322342B (en) Method and system for constructing loan risk prediction model and loan risk prediction method
CN114384931B (en) Multi-target optimal control method and equipment for unmanned aerial vehicle based on strategy gradient
CN112327958B (en) Fermentation process pH value control method based on data driving
CN114139677A (en) Unequal interval time sequence data prediction method based on improved GRU neural network
CN117444978B (en) Position control method, system and equipment for pneumatic soft robot
Qin et al. A reinforcement learning-based near-optimal hierarchical approach for motion control: Design and experiment
CN112015081B (en) Parameter self-tuning method of SISO (SISO) compact-format model-free controller based on PSO-LSTM (particle swarm optimization-least Square transform) cooperative algorithm
Liu et al. Fixed‐time self‐structuring neural network cooperative tracking control of multi‐robot systems with actuator faults
CN113985900B (en) Four-rotor unmanned aerial vehicle attitude dynamic characteristic model, identification method and self-adaptive soft prediction control method
Mokshin et al. Research of methods for predicting performance indicators on the example of an oil field

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
GR01 Patent grant
GR01 Patent grant