Meta-learning-based underactuated ship motion adaptive control method and device
By using a meta-learning-based underactuated ship motion adaptive control method, a model is constructed using ship trajectory data and an adaptive law is calculated. This solves the problem of difficult determination of model parameters in traditional methods and achieves higher control accuracy and stability.
Patent Information
- Application Number
- CN202510091752.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-21
AI Technical Summary
Traditional ship control methods rely on accurate ship models, but uncertainties in the real environment make it difficult to determine model parameters and effectively cope with the nonlinear characteristics of ship motion, resulting in low control accuracy and stability.
An underactuated ship motion adaptive control method based on meta-learning is adopted. By acquiring ship trajectory data, a trajectory model set is constructed, adaptive laws are calculated, and meta-parameters are calculated through meta-learning to achieve adaptive control.
It improves the accuracy and stability of ship motion control, effectively copes with model uncertainties in complex environments, and ensures that the ship moves along the expected trajectory.
Smart Images

Figure CN120010251B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship control technology, and in particular to an underactuated ship motion adaptive control method and apparatus based on meta-learning. Background Technology
[0002] Ships are complex dynamic systems influenced by a variety of factors. Traditional ship control methods rely on accurate ship models, but the actual operating environment of ships contains uncertain disturbances such as currents, waves, wind direction, and wind speed, making it difficult to construct accurate models and determine model parameters. Furthermore, it is difficult to determine the nonlinear characteristics of the ship system a priori, and parameter tuning is complex, easily leading to overfitting or underfitting problems, resulting in low accuracy and stability of ship motion control.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The embodiments of the present invention provide an underactuated ship motion adaptive control method and apparatus based on meta-learning, which effectively improves accuracy and stability.
[0005] On one hand, embodiments of the present invention provide an underactuated ship motion adaptive control method based on meta-learning, comprising the following steps:
[0006] Acquire ship trajectory data, which includes ship status and initial control input;
[0007] Based on the ship trajectory data, a set of ship trajectory models is constructed;
[0008] Calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model;
[0009] Based on the set of ship trajectory models and the adaptive law, meta-parameters are calculated through meta-learning;
[0010] Underactuated ship motion adaptive control is performed based on the aforementioned meta-parameters.
[0011] In some embodiments, constructing a set of ship trajectory models based on the ship trajectory data includes:
[0012] Based on the ship's state and the initial control input, a preset neural network is used to fit the dynamic features to obtain an initial ship trajectory model;
[0013] Based on the ship's state, the initial control input, model parameters, and dynamic relationship functions, calculate the predicted ship state value;
[0014] Based on the predicted ship state values, regularization coefficients, meta-parameters, and number of sampling times, an objective function is constructed.
[0015] Based on the objective function, the initial ship trajectory model is trained using stochastic gradient descent to obtain the target ship trajectory model.
[0016] The multiple target ship trajectory models are combined to obtain the ship trajectory model set.
[0017] In some embodiments, the construction process of the preset neural network includes:
[0018] An input layer is constructed, which is used to receive the ship's current state and the initial control input;
[0019] After the input layer, a hidden layer is constructed. The hidden layer is used to calculate the ship's next state based on the current state and the initial control input using a preset nonlinear activation function. The number of hidden layers is 2.
[0020] After the hidden layer, the output layer is constructed.
[0021] In some embodiments, calculating the adaptive law based on the controlled system control output vector and the reference model control output vector includes:
[0022] Calculate the state vector of the controlled system based on the control output vector of the controlled system;
[0023] Calculate the control law based on the state vector of the controlled system, the reference model control input, the initial feedforward controller, and the initial state feedback controller;
[0024] The control law is used as the control input of the controlled system;
[0025] Based on the state vector of the controlled system, the control input of the controlled system, the state matrix of the controlled system, and the input matrix of the controlled system, a set of state-space equations is constructed.
[0026] Calculate the reference model state vector based on the reference model control output vector;
[0027] A reference model is constructed based on the reference model state vector, the reference model control input, the reference model state matrix, and the reference model input matrix.
[0028] Calculate the error between the reference output and the actual output based on the state vector of the controlled system and the state vector of the reference model.
[0029] Calculate the system state error based on the error between the reference output and the actual output, the state-space equations, and the reference model;
[0030] The system state error is updated according to the system state convergence equation;
[0031] The adaptive law is calculated based on the system state error.
[0032] In some embodiments, updating the system state error according to the system state convergence equation includes:
[0033] Based on the initial feedforward controller, the system state convergence equation, and the error between the reference output and the actual output, a target feedforward controller is constructed.
[0034] Based on the initial state feedback controller, the system state convergence equation, and the error between the reference output and the actual output, a target state feedback controller is constructed.
[0035] Based on the target feedforward controller and the target state feedback controller, a set of matching equations is constructed to achieve a complete match between the reference model and the controlled system;
[0036] Calculate the feedforward controller difference based on the initial feedforward controller and the target feedforward controller;
[0037] Calculate the state feedback controller difference based on the initial state feedback controller and the target state feedback controller;
[0038] The system state error is updated based on the matching equation set, the feedforward controller difference, and the state feedback controller difference.
[0039] In some embodiments, calculating the adaptive law based on the system state error includes:
[0040] Based on the state matrix and positive definite matrix of the reference model, construct the Lyapunov function;
[0041] The Lyapunov function is solved to obtain its value;
[0042] A real number function is constructed based on the error between the reference output and the actual output, the Lyapunov function value, the feedforward controller difference, and the state feedback controller difference;
[0043] Differentiating the real function yields the derivative equation of the real function;
[0044] A system of negative definite equations is obtained by performing a global negative definite transformation on the derivative equations of the real functions.
[0045] The adaptive law is constructed based on the negative definite equations and the gain matrix.
[0046] In some embodiments, the step of calculating meta-parameters through meta-learning based on the ship trajectory model set and the adaptive law includes:
[0047] Based on the aforementioned set of ship trajectory models, multiple ship tasks are set;
[0048] Set the interference signal corresponding to each of the ship's missions;
[0049] The meta-parameters are constructed based on the adaptive law, the parameters related to the pi control input function, and the parameters related to the density control input function.
[0050] Calculate the target ship state information based on the initial ship state information and the adaptive input function;
[0051] Calculate the target adaptive mechanism correlation quantity based on the meta-parameters, the initial adaptive mechanism correlation quantity, the density control input function, and the interference signal;
[0052] Based on the meta-parameters, the reference trajectory, and the pi control input function, calculate the control input information;
[0053] Calculate the key information set based on the target ship status information, the target adaptive mechanism related quantities, and the control input information;
[0054] Calculate the average tracking error based on the reference trajectory and the interference signal;
[0055] Based on the set of key information, the average tracking error, and the control gain adjustment parameters, a loss function is constructed.
[0056] Based on the meta-parameters, the actual state of the ship, the reference trajectory, the control gain adjustment parameter, the initial control input information, the regularization parameter, the number of reference trajectories, and the number of interference signals, a meta-problem is constructed.
[0057] Based on the loss function, the meta-problem is solved using adaptive gradient descent, and the meta-parameters are updated.
[0058] In some embodiments, solving the meta-problem using adaptive gradient descent based on the loss function and updating the meta-parameters includes:
[0059] Initialize the diagonal matrix and the values of the meta-parameters;
[0060] Based on the ship's mission, calculate the gradient of the objective function with respect to the meta-parameters;
[0061] Update the diagonal matrix based on the gradient of the objective function with respect to the meta-parameters;
[0062] The adaptive learning rate is calculated based on the auxiliary positive number, the global learning rate, and the updated diagonal matrix.
[0063] The meta-parameters are updated based on the adaptive learning rate and the loss function until the change in the meta-parameters is less than a preset change threshold.
[0064] On the other hand, embodiments of the present invention provide an underactuated ship motion adaptive control device based on meta-learning, comprising:
[0065] The data acquisition module is used to acquire ship trajectory data, which includes ship status and initial control input;
[0066] The system dynamics feature learning module is used to construct a set of ship trajectory models based on the ship trajectory data;
[0067] The adaptive controller module is used to calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model.
[0068] A two-layer meta-learning optimization module is used to calculate meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law.
[0069] The control module is used to perform underactuated ship motion adaptive control based on the meta-parameters.
[0070] On the other hand, embodiments of the present invention provide a computer device, including:
[0071] At least one processor;
[0072] At least one memory for storing at least one program;
[0073] When the at least one program is executed by the at least one processor, the at least one processor implements the method.
[0074] The beneficial effects of this invention are as follows:
[0075] The embodiments of the present invention first acquire ship trajectory data, construct a set of ship trajectory models based on the ship trajectory data, then calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model, then calculate the meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law, and finally perform underactuated ship motion adaptive control based on the meta-parameters. Thus, ship motion control is realized through parameter calculation by meta-learning, thereby improving accuracy and stability.
[0076] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description and the drawings. Attached Figure Description
[0077] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 This is a flowchart of an underactuated ship motion adaptive control method based on meta-learning, according to an embodiment of the present invention.
[0079] Figure 2 This is a flowchart of a meta-learning training process according to an embodiment of the present invention;
[0080] Figure 3 This is a schematic diagram of a ship motion controller structure based on model reference adaptive control according to an embodiment of the present invention;
[0081] Figure 4 This is a schematic diagram of an architecture for ship motion control according to an embodiment of the present invention;
[0082] Figure 5 This is a schematic diagram of the structure of an underactuated ship motion adaptive control device based on meta-learning according to an embodiment of the present invention;
[0083] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0084] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0085] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0086] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0087] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0088] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0089] Metalearning refers to the learning mechanisms by which an individual acquires the skills necessary for learning. It concerns how an individual acquires the skills they rely on for learning.
[0090] In related technologies, classical control algorithms rely on accurate ship models. However, ships, as complex dynamic systems, are affected by various factors, making it difficult to construct accurate models. Furthermore, the actual operating environment is complex, with uncertainties such as currents, waves, wind direction, and wind speed, leading to uncertainties in model parameters and affecting the effectiveness of classical control algorithms. While adaptive control can address some model uncertainties, for underactuated nonlinear systems like ships, some nonlinear characteristics are difficult to determine a priori, limiting its application. Data-driven control methods, while not requiring accurate models, involve complex parameter adjustments in algorithm design, are prone to overfitting or underfitting, and struggle to fully consider the nonlinear and underactuated characteristics of ship systems. Meta-learning, using tasks as samples, learns feature representations to generalize to new tasks. It requires only a small number of samples and iterations to train a model with generalization capabilities, and the model's parameters can be fine-tuned to adapt to new tasks. In the field of ship control, meta-learning can learn the initial parameters of neural networks, enabling ships to "learn to learn." It is simple to model in new environments and offers flexible control, better addressing the challenges of ship motion control. While existing data-driven control methods offer the advantage of not requiring precise models, the algorithm design process involves numerous parameter adjustments, increasing the complexity of the control process. Excessive parameter adjustments not only increase computational burden but can also lead to overfitting or underfitting, thus affecting the model's performance and generalization ability in practical applications. Furthermore, when facing complex ship motion control scenarios, these methods struggle to fully consider the nonlinear and underactuated characteristics of the ship system, cannot effectively cope with model uncertainties caused by environmental disturbances, and fail to achieve precise control of ship motion, resulting in low accuracy and stability.
[0091] Therefore, this embodiment adopts adaptive control as its guiding principle, training the model on various learning tasks so that it can solve new learning tasks using only a small number of training samples. After training on various tasks, the model's parameters can better fit the nonlinear relationships of the ship system. When faced with different control tasks, the model can quickly adjust its parameters to adapt to the new task requirements. In addition, this method can effectively cope with model uncertainties caused by environmental disturbances, ensuring that the ship can move according to the expected trajectory in complex environments, thereby improving the accuracy and stability of ship motion control. It mainly includes a system dynamics feature learning module, an adaptive controller module, and a bi-level learning optimization module.
[0092] In the system dynamics feature learning module, dynamic characteristic information of ships under different environments is obtained through the analysis and processing of ship trajectory data. This module first preprocesses the collected trajectory data containing ship state and control input information. Under reasonable disturbance assumptions, a parameterized model is fitted to each trajectory, and the model parameters are trained using methods such as gradient descent. Finally, multiple trained models are integrated to construct a meta-problem and learn the meta-parameters related to system dynamics.
[0093] In the adaptive controller module, a suitable adaptive controller structure is designed based on the ship's dynamic characteristics and control objectives. This module considers the ship as a dynamic system and determines the specific form of the adaptive controller based on its nonlinear dynamic equations. When some information, such as external forces, is unknown, methods such as neural networks can be used for approximation.
[0094] In the two-layer meta-learning optimization module, it acts as a bridge and optimizes between the system dynamics feature learning module and the adaptive controller module. Guided by adaptive control, it establishes multiple loss functions, training datasets, and evaluation datasets corresponding to multiple tasks, and defines an adaptation mechanism to map meta-parameters and task-specific training data to task-specific parameters, thereby solving the two-layer problem and finding the optimal meta-parameters. In this process, meta-learning is performed from feedback and adaptation. Reference trajectories and disturbance signals are used as training data to learn the static parameters of the adaptive controller. The task loss is calculated through forward simulation of the closed-loop system, and the meta-problem is constructed and solved.
[0095] The underactuated ship motion adaptive control method based on meta-learning provided in this application relates to the field of ship control technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the underactuated ship motion adaptive control method based on meta-learning, but is not limited to the above forms.
[0096] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0097] The embodiments of this application will be explained in detail below with reference to the accompanying drawings:
[0098] Figure 1 This is an optional flowchart of the underactuated ship motion adaptive control method based on meta-learning provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S105.
[0099] Step S101: Obtain ship trajectory data, which includes ship status and initial control input;
[0100] Step S102: Construct a set of ship trajectory models based on ship trajectory data;
[0101] Step S103: Calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model;
[0102] Step S104: Calculate meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law;
[0103] Step S105: Perform underactuated ship motion adaptive control based on the meta-parameters.
[0104] Steps S101 to S105, as shown in the embodiments of this application, realize ship motion control and improve accuracy and stability.
[0105] In step S101 of some embodiments, ship trajectory data can be acquired through a simulator test platform. Ship trajectory data can also be acquired through other means, not limited to these. The ship trajectory data includes the ship's state and initial control input. For example, multiple sets of ship trajectory data can be collected in open water on the simulator test platform under undisturbed conditions, sea state 3 conditions, and sea state 5 conditions. Specifically, under undisturbed conditions, 100 sets of ship trajectory data are collected, each containing 500 sampling points; under sea state 3 conditions, 200 sets of ship trajectory data are collected, each containing 1000 sampling points; and under sea state 5 conditions, 300 sets of ship trajectory data are collected, each containing 1500 sampling points. It is understood that the number of samples can be set according to different operating conditions. Under undisturbed conditions, the ship's motion is stable, and this number of samples is sufficient for modeling requirements. Under sea state 3 conditions, the environment is relatively mild, and the ship's motion is relatively stable, but more data is still needed to reflect its motion characteristics. Under sea state 5, the sea conditions are more severe, and ship motion changes are more complex, requiring more data and longer sampling periods to comprehensively reflect the ship's motion characteristics under these conditions. Furthermore, during ship motion, the ship's state and control inputs are sampled at regular time intervals under the three operating conditions mentioned above. The ship's state information may include its position (longitude, latitude), speed, or heading, while the control input information may include rudder angle or propeller speed. By processing and preprocessing a large amount of raw sampled ship trajectory data, ship trajectory data for different time periods are obtained. Each trajectory Where M represents the total number of ship trajectory data sets, and j ranges from 1 to M. This represents the time value corresponding to the k-th sampling time within the j-th time period. This represents the ship's state information at the k-th sampling time within the j-th time period. This represents the control input at the k-th sampling time within the j-th time period, and N represents the number of samples in each group.
[0106] In some embodiments, in step S102, constructing a set of ship trajectory models based on ship trajectory data may include, but is not limited to, the following steps:
[0107] Based on the ship's state and initial control input, a preset neural network is used to fit the dynamic characteristics to obtain an initial ship trajectory model;
[0108] Calculate the predicted ship state value based on the ship state, initial control input, model parameters, and dynamic relationship functions;
[0109] Based on the predicted ship condition values, regularization coefficients, meta-parameters, and the number of sampling times, an objective function is constructed.
[0110] Based on the objective function, the model parameters of the initial ship trajectory model are trained using stochastic gradient descent to obtain the target ship trajectory model.
[0111] Multiple target ship trajectory models are combined to obtain a set of ship trajectory models.
[0112] In some embodiments, each trajectory τ can be calculated first based on the ship's state x and the initial control input u. j An initial ship trajectory model is obtained by fitting dynamic features using a pre-defined neural network. It can be understood that by fitting the data for each trajectory, the model is optimized. It can describe the ship dynamics characteristics corresponding to the trajectory as accurately as possible, among which These are the model parameters. The model parameters differ for different trajectories, reflecting the differences in ship dynamics under different tasks and environments. Then, based on the ship's state, initial control input, model parameters, and dynamic relationship functions, the predicted ship state value is calculated. The formula for calculating the predicted ship state value is: In the formula, This is the predicted ship state value of the model for the ship state at the (k+1)th sampling time within the j-th time period. This provides the actual state information of the ship at the k-th sampling time within the j-th time period, where x(t) represents the ship's state. As the initial control input, For the model parameters corresponding to the j-th trajectory, Let be the dynamic relationship function, i.e., the functional expression related to the fitted model corresponding to the j-th trajectory, which describes the dynamic relationship of the ship's state changing over time. Then, based on the predicted ship state value, regularization coefficient, meta-parameters, and number of sampling times, an objective function is constructed, where the expression of the objective function is: In the formula, N j This represents the number of sampling times in the j-th trajectory. This represents the actual state information of the ship at the (k+1)th sampling time within the j-th time period, where μ is the regularization coefficient and θ is the meta-parameter.
[0113] Finally, based on the objective function, the initial ship trajectory model is trained using stochastic gradient descent to obtain the target ship trajectory model. Multiple target ship trajectory models are then combined to form a ship trajectory model set. For example, during training, a variant of the stochastic gradient descent algorithm, Adagrad, can be used for optimization. All fitted target ship trajectory models are then grouped into a ship trajectory model set. It can be understood that the ship trajectory model set refers to a collection of multiple models used in subsequent meta-learning and control decision-making processes. To improve the accuracy and generalization ability of the model ensemble, different weights are assigned to each target ship trajectory model based on its performance on the validation dataset. Higher weights are given to better-performing models, and lower weights to poorer-performing models. This allows the ship trajectory model set to better reflect the dynamic characteristics of the ship as a whole, improving its adaptability to different tasks and environments.
[0114] In some embodiments, the process of constructing a preset neural network includes:
[0115] Construct an input layer, which is used to receive the ship's current status and initial control input;
[0116] After the input layer, a hidden layer is constructed. The hidden layer is used to calculate the ship's next state based on the current state and the initial control input using a preset nonlinear activation function. The number of hidden layers is 2.
[0117] After the hidden layer, the output layer is built.
[0118] In some embodiments, one input layer, two hidden layers, and one output layer can be constructed sequentially. The input layer is used to receive the current state of the ship and the initial control input. The hidden layers are used to calculate the next state of the ship based on the current state and the initial control input using a preset nonlinear activation function. The output layer outputs the predicted next state of the ship.
[0119] In some embodiments, step S103, calculating the adaptive law based on the controlled system control output vector and the reference model control output vector, may include, but is not limited to, the following steps:
[0120] Calculate the state vector of the controlled system based on the control output vector of the controlled system;
[0121] Calculate the control law based on the state vector of the controlled system, the reference model control input, the initial feedforward controller, and the initial state feedback controller;
[0122] Use the control law as the control input to the controlled system;
[0123] Based on the state vector of the controlled system, the control input of the controlled system, the state matrix of the controlled system, and the input matrix of the controlled system, construct a set of state-space equations;
[0124] Calculate the reference model state vector based on the reference model control output vector;
[0125] Construct a reference model based on the reference model state vector, reference model control input, reference model state matrix, and reference model input matrix;
[0126] Calculate the error between the reference output and the actual output based on the state vector of the controlled system and the state vector of the reference model;
[0127] Calculate the system state error based on the error between the reference output and the actual output, the state-space equations, and the reference model;
[0128] Update the system state error based on the system state convergence equation;
[0129] Calculate the adaptive law based on the system state error.
[0130] In some embodiments, the state vector of the controlled system can be calculated first based on the control output vector of the controlled system. The formula for calculating the state vector of the controlled system is: X s =Y s In the formula, X s Let Y be the state vector of the controlled system. s Let U be the control output vector of the controlled system. Then, based on the state vector of the controlled system, the control input of the reference model, the initial feedforward controller, and the initial state feedback controller, the control law is calculated. The formula for calculating the control law is: U s =FX s +KU m In the formula, U s Here, F is the control law, K is the initial state feedback controller, and U is the initial feedforward controller. m The control input is used as the reference model control input. The control law is used as the control input of the controlled system. Based on the controlled system state vector, the controlled system control input, the controlled system state matrix, and the controlled system input matrix, a state-space equation set is constructed, where the expression of the state-space equation set is: In the formula, Let A be the derivative of the state vector of the controlled system. s Let B be the state matrix of the controlled system. s The input matrix is the control system input matrix. Based on the reference model control output vector, the reference model state vector is calculated, where the formula for calculating the reference model state vector is: X m =Y m In the formula, X m Y is the reference model state vector. mThe reference model is defined as the control output vector. Based on the reference model state vector, reference model control input, reference model state matrix, and reference model input matrix, a reference model is constructed, where the expression for the reference model is: In the formula, A is the derivative of the state vector of the reference model. m For the reference model state matrix, B m As the input matrix for the reference model, U m The reference model is used as the control input. Based on the controlled system's state vector and the reference model's state vector, the error between the reference output and the actual output is calculated. The formula for calculating the error between the reference output and the actual output is: e x =X m -X s In the formula, e x Let $\frac{ ... Then, based on the system state convergence equation, update the system state error, and finally calculate the adaptive law based on the system state error.
[0131] In some embodiments, updating the system state error according to the system state convergence equation includes:
[0132] Based on the initial feedforward controller, the system state convergence equation, and the error between the reference output and the actual output, a target feedforward controller is constructed.
[0133] Based on the initial state feedback controller, the system state convergence equation, and the error between the reference output and the actual output, a target state feedback controller is constructed.
[0134] Based on the target feedforward controller and the target state feedback controller, a set of matching equations is constructed to achieve a perfect match between the reference model and the controlled system.
[0135] Calculate the feedforward controller difference based on the initial feedforward controller and the target feedforward controller;
[0136] Calculate the difference between the state feedback controllers based on the initial state feedback controller and the target state feedback controller;
[0137] The system state error is updated based on the matching equation set, the difference between the feedforward controller and the difference between the state feedback controller.
[0138] In some embodiments, a target feedforward controller can be constructed first based on the initial feedforward controller, the system state convergence equation, and the error between the reference output and the actual output. The expression for the target feedforward controller is: K(e x,t)=K0, where K is the target feedforward controller, K0 is the initial feedforward controller, and e x Let be the error between the reference output and the actual output, and t be time. Based on the initial state feedback controller, the system state convergence equation, and the error between the reference output and the actual output, a target state feedback controller is constructed, where the expression for the target state feedback controller is: F(e x ,t)=F0, where F is the target state feedback controller and F0 is the initial state feedback controller. Based on the target feedforward controller and the target state feedback controller, a set of matching equations is constructed to achieve a perfect match between the reference model and the controlled system. The expression of the matching equations is: In the formula, A s Let B be the state matrix of the controlled system. s Let A be the input matrix of the controlled system. m For the reference model state matrix, B m Input the reference model matrix. Calculate the feedforward controller difference based on the initial and target feedforward controllers. The formula for calculating the feedforward controller difference is: In the formula, This is the feedforward controller difference. Based on the initial state feedback controller and the target state feedback controller, the state feedback controller difference is calculated. The formula for calculating the state feedback controller difference is: In the formula, This is the difference between the state feedback controller and the input state feedback controller. Finally, based on the matching equations, the difference between the feedforward controller and the input state feedback controller, the system state error is updated, and A is eliminated. s and B s The updated expression for the system state error is: Understandably, in order to achieve system state convergence, it is possible to make Where t represents time, and e(t) represents the error as a function of time. When time approaches infinity, the error approaches 0, indicating that the system is stable.
[0139] In some embodiments, calculating the adaptive law based on the system state error includes:
[0140] Based on the state matrix and positive definite matrix of the reference model, construct the Lyapunov function;
[0141] Solve for the Lyapunov function to obtain its value;
[0142] Construct a real number function based on the error between the reference output and the actual output, the Lyapunov function value, the difference between the feedforward controller and the state feedback controller;
[0143] By differentiating the real function, we obtain the derivative equation of the real function;
[0144] By performing a global negative definite transformation on the derivative equations of real functions, we obtain a system of negative definite equations;
[0145] An adaptive law is constructed based on the negative definite equations and the gain matrix.
[0146] In some embodiments, a Lyapunov function can be constructed first based on the reference model's state matrix and positive definite matrix, wherein the expression of the Lyapunov function is: A m T +PA m +Q=0, where A m Let Q be the state matrix of the reference model, P be the positive definite matrix, and Q be the Lyapunov function value. Then, the Lyapunov function is solved to obtain the Lyapunov function value P. Based on the error between the reference output and the actual output, the Lyapunov function value, the difference between the feedforward controller and the state feedback controller, a real function is constructed, where the expression of the real function is: In the formula, e x The reference output represents the error between the actual output, and F represents the target state feedback controller. This is the difference in the feedforward controller value. P is the difference in the state feedback controller. F P is the Lyapunov function value of the state feedback controller. K Let Lyapunov be the value of the feedforward controller. Differentiating the real function yields the derivative equation of the real function, where the expression of the derivative equation is:
[0147] In the formula, B m As the input matrix for the reference model, U m As the reference model control input, tr represents the trace of the matrix. express The derivative of express The derivative, e x T e x transpose, e x The derivative of K0 -1 Let P be the inverse matrix of K0. K -1 P represents K The inverse matrix, express The transpose of .
[0148] Next, perform a global negative definite transformation on the derivative equations of real functions to obtain a system of negative definite equations, where the expression of the system of negative definite equations is: In the formula, Denotes the derivative of F. Let K0 be the derivative of K. -T B represents the negative transpose of K0. m T For B m transpose of X s T For X s transpose, U m T For U m The transpose of . Finally, based on the negative definite equations and the gain matrix, the adaptive law is constructed, where the expression of the adaptive law is: In the formula, γ1 and γ2 are both gain matrices. It can be understood that the adaptive law followed by parameters K and F provides the basic control logic for subsequent meta-learning optimization. The calculated adaptive law focuses on adjusting the controller parameters in real time based on information such as system state error within a single control cycle to ensure the system stably tracks the reference trajectory. The subsequent two-layer meta-learning optimization, from the perspective of multiple tasks and the overall meta-learning framework, utilizes training on a large number of different tasks to optimize the controller parameters (including the optimal settings of parameters such as K and F under different tasks). The two work synergistically.
[0149] In some embodiments, step S104, calculating meta-parameters through meta-learning based on the ship trajectory model set and the adaptive law, may include, but is not limited to, the following steps:
[0150] Based on the set of ship trajectory models, multiple ship tasks are set;
[0151] Set up the interference signal corresponding to each ship's mission;
[0152] Based on the adaptive law, the relevant parameters of the pi control input function, and the relevant parameters of the density control input function, meta-parameters are constructed.
[0153] Calculate the target ship state information based on the initial ship state information and the adaptive input function;
[0154] Calculate the target adaptive mechanism related quantities based on the meta-parameters, the initial adaptive mechanism related quantities, the density control input function, and the interference signal;
[0155] Calculate the control input information based on the elementary parameters, reference trajectory, and pi control input function;
[0156] Calculate the key information set based on the target vessel status information, relevant quantities of the target adaptive mechanism, and control input information;
[0157] Calculate the average tracking error based on the reference trajectory and interference signals;
[0158] Based on the key information set, average tracking error, and control gain adjustment parameters, a loss function is constructed.
[0159] Based on the meta-parameters, actual ship state, reference trajectory, control gain adjustment parameters, initial control input information, regularization parameters, number of reference trajectories, and number of interference signals, a meta-problem is constructed.
[0160] Based on the loss function, the meta-problem is solved using adaptive gradient descent, and the meta-parameters are updated.
[0161] In some embodiments, a meta-learning framework can be built, defining multiple ship tasks, each corresponding to a reference trajectory and a disturbance signal. A meta-problem is constructed by combining elements of all ship tasks, and the parameters of the adaptive controller are obtained by solving the meta-problem using gradient descent. The elements mainly include the reference trajectory, the disturbance signal, the ship's state information, control input information, and parameters related to the adaptive controller. Multiple ship tasks can be set up first based on a set of ship trajectory models, and a corresponding disturbance signal can be set for each ship task. For example, when collecting trajectory data T... j During the process, considering the complexity of the actual situation and in order to simplify the model learning process, it is assumed that the disturbance w(t) takes a fixed unknown value w. j Furthermore, the reference trajectory r can be... i (t) and interference signal w j (t) serves as the training set for ship missions (i,j) within the time range T. Here, ship task (i,j) represents the task set consisting of the i-th reference trajectory and the j-th interference signal. Then, based on the adaptive law, the parameters related to the pi control input function, and the parameters related to the density control input function, meta-parameters are constructed to achieve good tracking performance of the reference trajectory under given interference. The expressions for the meta-parameters are:
[0162] θ=(θ π ,θ ρ In the formula, θ is a variable parameter. π The parameters related to the control input function for pi are θ, which are related to the control input function π. ρThe parameters θ are related to the density control input function and are associated with the control input function ρ. It can be understood that parameter θ is a generalized set of adaptive controller parameters, used within a meta-learning framework to learn parameters that enable the controller to achieve good tracking of the reference trajectory under given disturbances. It represents an extension and optimization of the feedforward controller K and the state feedback controller F at the meta-learning level. The optimization in this embodiment allows the parameters in the adaptive law to obtain better initial values and to adaptively adjust according to more task scenarios, thereby improving the accuracy, generalization ability, and environmental adaptability of the entire ship motion control under different environments and tasks.
[0163] Then, based on the initial ship state information and the adaptive input function, the target ship state information is calculated. The formula for calculating the target ship state information is as follows: In the formula, x ij (t) represents the target ship's status information, x ij (0) represents the initial ship state information, f is the adaptive input function, and x ij (t) represents the ship's state information at time t under ship mission (i,j), w j (t) represents the interference signal. Based on the meta-parameters, the initial adaptive mechanism correlation quantity, the density control input function, and the interference signal, the target adaptive mechanism correlation quantity is calculated. The formula for calculating the target adaptive mechanism correlation quantity is: In the formula, a ij (t) represents the relevant quantity of the objective adaptive mechanism, a ij (0) represents the initial adaptive mechanism related quantity, and ρ is the density control input function. Based on the meta-parameters, reference trajectory, and pi control input function, the control input information is calculated, where the formula for calculating the control input information is: u ij (t)=π(x ij (t),r i (t),a ij (t); θ π In the formula, u ij (t) represents the control input information, r i (t) represents the reference trajectory, and π is the pi control input function. Based on the target ship's state information, relevant quantities of the target adaptive mechanism, and control input information, a key information set is calculated. The formula for calculating the key information set is: In the formula, Let T be the set of key information and T be the total number of times.
[0164] Then, based on the reference trajectory and interference signals, the average tracking error is calculated, where the expression for the average tracking error is: D ij ={r i (t),w j (t)}t∈[0,T] In the formula, D ij Let be the average tracking error. Based on the key information set, the average tracking error, and the control gain adjustment parameters, a loss function is constructed, where the expression for the loss function is: In the formula, L ij Let be the loss function, and α be the control gain adjustment parameter, where α ≥ 0. It can be understood that the loss function is calculated comprehensively based on the deviation between the ship's actual state and the reference trajectory, as well as the control input. A smaller value indicates better control performance, meaning the ship can better track the reference trajectory. Based on the meta-parameters, the ship's actual state, the reference trajectory, the control gain adjustment parameter, the initial control input information, the regularization parameter, the number of reference trajectories, and the number of interference signals, a meta-problem is constructed, where the expression for the meta-problem is: In the formula, μ meta Let be the regularization parameter, N be the number of reference trajectories, and M be the number of interfering signals. Based on the loss function, adaptive gradient descent is used to solve the meta-problem and update the meta-parameters. It can be understood that in the meta-problem, n reference trajectories are constructed. M interference signals were sampled.
[0165] In some embodiments, the meta-learning training flowchart is as follows: Figure 2 As shown, we can first train the data to learn the parameters of the adaptive controller, then perform the adaptation mechanism calculation and task loss calculation, then construct the meta-problem based on model ensemble, and use Adagrad gradient descent to solve the meta-parameters. Finally, we can determine whether it has converged. If it has converged, the meta-learning training is complete.
[0166] In some embodiments, the meta-problem is solved using adaptive gradient descent based on the loss function, and the meta-parameters are updated, including:
[0167] Initialize the values of the diagonal matrix and the primary parameters;
[0168] Based on the ship's mission, calculate the gradient of the objective function with respect to the elementary parameters;
[0169] Update the diagonal matrix based on the gradient of the objective function with respect to the meta-parameters;
[0170] Calculate the adaptive learning rate based on the auxiliary positive number, the global learning rate, and the updated diagonal matrix;
[0171] Based on the adaptive learning rate and loss function, update the meta-parameters until the change in the meta-parameters is less than a preset change threshold.
[0172] In some embodiments, the values of the diagonal matrix and the meta-parameters can be initialized first. For example, the meta-parameters θ can be initialized to random values or initial values set based on prior knowledge. Simultaneously, a diagonal matrix H = 0 is initialized, with the same dimensions as the meta-parameters θ, to record the historical sum of squared gradients for each parameter. Then, based on the ship mission, the gradient of the objective function with respect to the meta-parameters is calculated. For example, a ship mission (i,j) can be randomly selected, and the ship mission is determined by the reference trajectory r. i (t) and interference signal w j (t) is composed of the gradient h of the objective function with respect to the elementary parameter θ under the current task. ij (θ). Then, based on the gradient of the objective function with respect to the elementary parameters, update the diagonal matrix. For example, the diagonal matrix H = H + h can be updated. ij (θ) 2 The squared gradient of the current step is accumulated and added to the corresponding diagonal elements of H to record the historical gradient sum of each parameter. Based on the auxiliary positive number, the global learning rate, and the updated diagonal matrix, the adaptive learning rate is calculated. The formula for the adaptive learning rate is: In the formula, η ij The adaptive learning rate is defined as η, an initial global learning rate, H, the updated diagonal matrix, and ξ, an auxiliary positive number (a small positive number) to avoid zero denominators. Finally, the meta-parameters are updated based on the adaptive learning rate and the loss function until the change in the meta-parameters is less than a preset threshold. For example, when the objective function value of the meta-problem no longer decreases significantly, and the change in the meta-parameter θ is less than the preset threshold, i.e., for all meta-parameters θ... i After T consecutive iterations, all of them have The algorithm is then considered convergent. δ represents the value of the i-th meta-parameter in the k-th iteration. i The threshold value is the i-th meta-parameter. It's understandable that in solving the meta-problem, the series of operations using the Adagrad gradient descent algorithm—including initialization, gradient calculation, updating the correlation matrix, determining the learning rate, and updating meta-parameters—all revolve around the objective function of the meta-problem. The goal is to find the optimal meta-parameters by continuously iterating and optimizing to minimize the value of the objective function, thus solving the meta-problem.
[0173] In some embodiments, in step S105, underactuated adaptive ship motion control can be performed based on the meta-parameters. For example, the structure of a ship motion controller based on MRAC is as follows: Figure 3 As shown, during ship motion control, using the updated target state feedback controller F and target feedforward controller K parameters, the MRAC (Model Reference Adaptive Control) controller adjusts the current ship's actual state X according to the ship's current state X. sReference model control output U m Based on the current disturbance conditions, the control input U of the reference model is calculated. s Simultaneously, within each control cycle, the MRAC controller adjusts K and F in real time according to the system state error and the parameter adaptive law. This adjustment process is constrained and optimized by the meta-parameter θ, which guides F and K towards directions more conducive to trajectory tracking in complex environments, based on the training results of multiple tasks within the entire meta-learning framework. For example, when the ship encounters a new type of disturbance, the meta-parameter θ prompts the MRAC controller's F and K to quickly adapt to this change, thus improving the reference model control input U. s It can promptly correct the ship's course and speed, ensuring that the ship's actual trajectory closely follows the reference trajectory, thereby achieving underactuated ship motion adaptive control.
[0174] The beneficial effects of implementing the embodiments of the present invention include: the embodiments of the present invention first acquire ship trajectory data, construct a set of ship trajectory models based on the ship trajectory data, then calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model, then calculate the meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law, and finally perform underactuated ship motion adaptive control based on the meta-parameters. Thus, ship motion control is realized through parameter calculation by meta-learning, thereby improving accuracy and stability.
[0175] In some embodiments, the architecture for ship motion control is as follows: Figure 4 As shown, data can be collected first, then processed, model fitted and trained, and integrated through the system dynamics feature learning module. The adaptive controller module constructs a reference model, controller, and adaptive mechanism. The bi-level meta-learning optimization module trains task data, constructs and solves meta-problems, and performs meta-learning and parameter updates until parameters converge. Finally, the control module controls the controlled vessel. This embodiment uses the system dynamics feature learning module to analyze and integrate ship trajectory data, and trains and optimizes the model under the action of the bi-level meta-learning optimization module, thus improving the accuracy of ship motion control. The adaptive controller module in this embodiment is based on ship dynamics design, and the model parameters are reasonable values obtained by combining the system dynamics feature learning module and the bi-level meta-learning optimization module, resulting in higher interpretability. This embodiment uses a meta-learning method, requiring only a small number of samples and iterations to train a model with generalization ability. Parameters can be quickly adjusted to adapt to new requirements for different tasks, thereby improving the model's generalization ability and learning efficiency. This embodiment, through the collaboration of various modules, can quickly adjust model parameters to adapt to different control tasks and environmental changes, resulting in better environmental adaptability.
[0176] like Figure 5As shown, this embodiment of the invention also provides an underactuated ship motion adaptive control device based on meta-learning, comprising:
[0177] Data acquisition module 801 is used to acquire ship trajectory data, which includes ship status and initial control input;
[0178] The system dynamics feature learning module 802 is used to construct a set of ship trajectory models based on ship trajectory data;
[0179] The adaptive controller module 803 is used to calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model.
[0180] The two-layer meta-learning optimization module 804 is used to calculate meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law.
[0181] The control module 805 is used for underactuated ship motion adaptive control based on meta-parameters.
[0182] The content of the above method embodiments is applicable to the device embodiments. The specific functions implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0183] like Figure 6 As shown, embodiments of the present invention also provide a computer device, including:
[0184] At least one processor 901;
[0185] At least one memory 902 is used to store at least one program;
[0186] When at least one program is executed by at least one processor, such that at least one processor achieves Figure 1 The method shown.
[0187] The content of the above method embodiments is applicable to the device embodiments. The specific functions implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0188] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A meta-learning-based underactuated ship motion adaptive control method, characterized in that, Includes the following steps: Acquire ship trajectory data, which includes ship status and initial control input; Based on the ship trajectory data, a set of ship trajectory models is constructed; Calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model; Based on the set of ship trajectory models and the adaptive law, meta-parameters are calculated through meta-learning; Underactuated ship motion adaptive control is performed based on the aforementioned meta-parameters; Specifically, based on the set of ship trajectory models and the adaptive law, meta-parameters are calculated through meta-learning, including: Based on the aforementioned set of ship trajectory models, multiple ship tasks are set; Set the interference signal corresponding to each of the ship's missions; The meta-parameters are constructed based on the adaptive law, the parameters related to the pi control input function, and the parameters related to the density control input function. The target ship state information is calculated based on the initial ship state information and the adaptive input function; the formula for calculating the target ship state information is as follows: In the formula, For the target ship's status information, This is the initial ship status information. For adaptive input function, To control input information, This is an interference signal; Calculate the target adaptive mechanism correlation quantity based on the meta-parameters, the initial adaptive mechanism correlation quantity, the density control input function, and the interference signal; Based on the aforementioned meta-parameters, reference trajectory, and pi control input function, calculate the control input information; Based on the target vessel status information, the target adaptive mechanism related quantities, and the control input information, a key information set is calculated; the calculation formula for the target adaptive mechanism related quantities is: In the formula, For the target adaptive mechanism related quantities, For the initial adaptive mechanism related quantities, For density control input function, The parameters related to the density control input function are: The formula for calculating the control input information is: In the formula, To control input information, For reference trajectory, The input function is for controlling pi. The parameters related to the input function for controlling pi; Calculate the average tracking error based on the reference trajectory and the interference signal; Based on the key information set, the average tracking error, and the control gain adjustment parameters, a loss function is constructed; the expression of the loss function is: In the formula, For loss function, To control the gain adjustment parameters, , A collection of key information. For the total time, For the average tracking error, For reference trajectory; Based on the aforementioned meta-parameters, actual ship state, reference trajectory, control gain adjustment parameters, initial control input information, regularization parameters, number of reference trajectories, and number of interference signals, a meta-problem is constructed; the expression of the meta-problem is: In the formula, , For regularization parameters, For the number of reference trajectories, The number of interfering signals; Based on the loss function, the meta-problem is solved using adaptive gradient descent, and the meta-parameters are updated. The step of solving the meta-problem using adaptive gradient descent based on the loss function and updating the meta-parameters includes: Initialize the diagonal matrix and the values of the meta-parameters; Based on the ship's mission, calculate the gradient of the objective function with respect to the meta-parameters; Update the diagonal matrix based on the gradient of the objective function with respect to the meta-parameters; The adaptive learning rate is calculated based on the auxiliary positive number, the global learning rate, and the updated diagonal matrix; the formula for calculating the adaptive learning rate is: In the formula, For adaptive learning rate, For an initial global learning rate, This is the updated diagonal matrix. For auxiliary positive numbers; The meta-parameters are updated based on the adaptive learning rate and the loss function until the change in the meta-parameters is less than a preset change threshold.
2. The method according to claim 1, characterized in that, The step of constructing a set of ship trajectory models based on the ship trajectory data includes: Based on the ship's state and the initial control input, a preset neural network is used to fit the dynamic features to obtain an initial ship trajectory model; Based on the ship's state, the initial control input, model parameters, and dynamic relationship functions, calculate the predicted ship state value; Based on the predicted ship state values, regularization coefficients, meta-parameters, and number of sampling times, an objective function is constructed. Based on the objective function, the initial ship trajectory model is trained using stochastic gradient descent to obtain the target ship trajectory model. The multiple target ship trajectory models are combined to obtain the ship trajectory model set.
3. The method according to claim 2, characterized in that, The construction process of the preset neural network includes: An input layer is constructed, which is used to receive the ship's current state and the initial control input; After the input layer, a hidden layer is constructed. The hidden layer is used to calculate the ship's next state based on the current state and the initial control input using a preset nonlinear activation function. The number of hidden layers is 2. After the hidden layer, the output layer is constructed.
4. The method according to claim 1, characterized in that, The step of calculating the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model includes: Calculate the state vector of the controlled system based on the control output vector of the controlled system; Calculate the control law based on the state vector of the controlled system, the reference model control input, the initial feedforward controller, and the initial state feedback controller; The control law is used as the control input of the controlled system; Based on the state vector of the controlled system, the control input of the controlled system, the state matrix of the controlled system, and the input matrix of the controlled system, a set of state-space equations is constructed. Calculate the reference model state vector based on the reference model control output vector; A reference model is constructed based on the reference model state vector, the reference model control input, the reference model state matrix, and the reference model input matrix. Calculate the error between the reference output and the actual output based on the state vector of the controlled system and the state vector of the reference model. Calculate the system state error based on the error between the reference output and the actual output, the state-space equations, and the reference model; The system state error is updated according to the system state convergence equation; The adaptive law is calculated based on the system state error.
5. The method according to claim 4, characterized in that, The step of updating the system state error according to the system state convergence equation includes: Based on the initial feedforward controller, the system state convergence equation, and the error between the reference output and the actual output, a target feedforward controller is constructed. Based on the initial state feedback controller, the system state convergence equation, and the error between the reference output and the actual output, a target state feedback controller is constructed. Based on the target feedforward controller and the target state feedback controller, a set of matching equations is constructed to achieve a complete match between the reference model and the controlled system; Calculate the feedforward controller difference based on the initial feedforward controller and the target feedforward controller; Calculate the state feedback controller difference based on the initial state feedback controller and the target state feedback controller; The system state error is updated based on the matching equation set, the feedforward controller difference, and the state feedback controller difference.
6. The method according to claim 5, characterized in that, The step of calculating the adaptive law based on the system state error includes: Based on the state matrix and positive definite matrix of the reference model, construct the Lyapunov function; The Lyapunov function is solved to obtain its value; A real number function is constructed based on the error between the reference output and the actual output, the Lyapunov function value, the feedforward controller difference, and the state feedback controller difference; Differentiating the real function yields the derivative equation of the real function; A system of negative definite equations is obtained by performing a global negative definite transformation on the derivative equations of the real functions. The adaptive law is constructed based on the negative definite equations and the gain matrix.
7. An underactuated ship motion adaptive control device based on meta-learning, characterized in that, include: The data acquisition module is used to acquire ship trajectory data, which includes ship status and initial control input; The system dynamics feature learning module is used to construct a set of ship trajectory models based on the ship trajectory data; The adaptive controller module is used to calculate the adaptive law based on the control output vector of the controlled system and the control output vector of the reference model. A two-layer meta-learning optimization module is used to calculate meta-parameters through meta-learning based on the set of ship trajectory models and the adaptive law. The control module is used to perform underactuated ship motion adaptive control based on the aforementioned meta-parameters. Specifically, based on the set of ship trajectory models and the adaptive law, meta-parameters are calculated through meta-learning, including: Based on the aforementioned set of ship trajectory models, multiple ship tasks are set; Set the interference signal corresponding to each of the ship's missions; The meta-parameters are constructed based on the adaptive law, the parameters related to the pi control input function, and the parameters related to the density control input function. The target ship state information is calculated based on the initial ship state information and the adaptive input function; the formula for calculating the target ship state information is as follows: In the formula, For the target ship's status information, This is the initial ship status information. For adaptive input function, To control input information, This is an interference signal; Calculate the target adaptive mechanism correlation quantity based on the meta-parameters, the initial adaptive mechanism correlation quantity, the density control input function, and the interference signal; Based on the aforementioned meta-parameters, reference trajectory, and pi control input function, calculate the control input information; Based on the target vessel status information, the target adaptive mechanism related quantities, and the control input information, a key information set is calculated; the calculation formula for the target adaptive mechanism related quantities is: In the formula, For the target adaptive mechanism related quantities, For the initial adaptive mechanism related quantities, For density control input function, The parameters related to the density control input function are: The formula for calculating the control input information is: In the formula, To control input information, For reference trajectory, The input function is for controlling pi. The parameters related to the input function for controlling pi; Calculate the average tracking error based on the reference trajectory and the interference signal; Based on the key information set, the average tracking error, and the control gain adjustment parameters, a loss function is constructed; the expression of the loss function is: In the formula, For loss function, To control the gain adjustment parameters, , A collection of key information. For the total time, For the average tracking error, For reference trajectory; Based on the aforementioned meta-parameters, actual ship state, reference trajectory, control gain adjustment parameters, initial control input information, regularization parameters, number of reference trajectories, and number of interference signals, a meta-problem is constructed; the expression of the meta-problem is: In the formula, , For regularization parameters, For the number of reference trajectories, The number of interfering signals; Based on the loss function, the meta-problem is solved using adaptive gradient descent, and the meta-parameters are updated. The step of solving the meta-problem using adaptive gradient descent based on the loss function and updating the meta-parameters includes: Initialize the diagonal matrix and the values of the meta-parameters; Based on the ship's mission, calculate the gradient of the objective function with respect to the meta-parameters; Update the diagonal matrix based on the gradient of the objective function with respect to the meta-parameters; The adaptive learning rate is calculated based on the auxiliary positive number, the global learning rate, and the updated diagonal matrix; the formula for calculating the adaptive learning rate is: In the formula, For adaptive learning rate, For an initial global learning rate, This is the updated diagonal matrix. For auxiliary positive numbers; The meta-parameters are updated based on the adaptive learning rate and the loss function until the change in the meta-parameters is less than a preset change threshold.
8. A computer device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Generative model construction and generation method of unmanned ship control strategy and electronic equipment
CN119002478A
Robot path tracking method based on time delay compensation and input saturation control
CN119045321A