Multi-body system control method, equipment and medium
By combining physical information neural networks and variational integrators, the problems of model uncertainty and disturbance in multibody systems by traditional variational integrators are solved, and high-precision and stable multibody system simulation and control are achieved.
Patent Information
- Application Number
- CN202511665762.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-24
AI Technical Summary
Traditional variational integrators (VIs) cannot maintain stability and accuracy in multibody systems due to uncertainties in the dynamic model and the influence of external disturbances, making them difficult to apply to the simulation and control of complex multibody systems.
A pre-trained Physical Information Neural Network (PINN) is used to estimate the generalized force model. Combined with a variational integrator (VI), the model compensates for and corrects unmodeled dynamics by adaptively adjusting the integration step size and model invocation, thus ensuring the stability and accuracy of the simulation process.
It improves the stability and accuracy of the simulation process in multibody system dynamics analysis scenarios, and enhances the stability and accuracy of multibody system control.
Smart Images

Figure CN121559859A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of simulation control, and in particular to a control method, device and medium for a multibody system. Background Technology
[0002] Multibody dynamics is the study of the motion laws of complex systems composed of multiple rigid or flexible bodies connected by joints, force elements, etc. Its core problem is to solve for the system's trajectory given external forces and initial conditions. This problem is a fundamental common problem in fields such as robot control, vehicle simulation, spacecraft attitude control, and biomechanical analysis.
[0003] Currently, variational integrators (VI), as a representative of geometric integration methods, are based on discrete variational principles and Hamiltonian systems. They can inherently preserve the symplectic structure of dynamics and the law of conservation of momentum, exhibiting excellent long-term stability and energy behavior, making them very suitable for long-term simulation of multibody systems.
[0004] The performance of VI (Variable Intensity Component) heavily depends on the accuracy of the Lagrangian function or generalized force model. However, the dynamics of real systems (such as complex nonlinear friction, air resistance, hydraulic transmission characteristics, flexible body deformation, assembly gaps, etc.) and external disturbances are usually not modeled, affecting the accuracy of the Lagrangian function or generalized force model on which VI depends. This makes it impossible to realize or even fail the advantages of traditional VI, making it difficult to apply in multibody system processes. Summary of the Invention
[0005] This application provides a control method, device, and medium for multibody systems, which aims to improve the stability of the simulation process and the accuracy of the simulation results in complex multibody system dynamics analysis scenarios, thereby improving the stability and accuracy of the control of multibody systems.
[0006] In a first aspect, embodiments of this application provide a control method for a multibody system, including:
[0007] The pre-trained generalized force estimation model is invoked to obtain the predicted generalized force of the multibody system based on the current system state. The generalized force estimation model is a model that predicts the generalized force on the system based on the system state and is pre-trained on a physical information neural network.
[0008] Using a variational integrator, the system state at the next moment is calculated based on the system state and the predicted generalized force.
[0009] The system state at the next moment is output to the actuator of the multibody system.
[0010] In one possible implementation, the generalized force estimation model is based on a loss function and is trained on a pre-constructed initial physical information neural network using a historical dataset; the historical dataset includes multiple system states and the actual generalized force of the multibody system corresponding to each system state.
[0011] The loss function includes a first loss function constrained by the actual generalized force and a second loss function constrained by the Lagrange function.
[0012] In one possible implementation, the method further includes:
[0013] The integration step size of the variational integrator is adjusted according to the state changes of the multibody system.
[0014] The state change is used to characterize the stability of the motion of the multibody system.
[0015] In one possible implementation, adjusting the integration step size of the variational integrator based on the state changes of the multibody system includes:
[0016] If the rate of change of energy of the multibody system within a preset time is greater than or equal to a first preset threshold, then the integration step size of the variational integrator is reduced according to the first preset rule.
[0017] If the energy change rate of the multibody system within a preset time is less than the second preset threshold, then the integration step size of the variational integrator is increased according to the second preset rule, wherein the first preset threshold is greater than or equal to the second preset threshold.
[0018] or,
[0019] If the rate of change of generalized momentum of the multibody system within a preset time is greater than or equal to a third preset threshold, then the integration step size of the variational integrator is reduced according to the third preset rule.
[0020] If the rate of change of generalized momentum of the multibody system within a preset time is less than the fourth preset threshold, then the integration step size of the variational integrator is increased according to the fourth preset rule, and the third preset threshold is greater than or equal to the fourth preset threshold.
[0021] In one possible implementation, before invoking the pre-trained generalized force estimation model to obtain the predicted generalized force of the multi-body system based on the current system state, the method further includes:
[0022] Determine whether the generalized force estimation model needs to be invoked;
[0023] Accordingly, the step of calling a pre-trained generalized force estimation model based on the current system state of the multi-body system to obtain the predicted generalized force of the multi-body system includes:
[0024] When it is determined that the generalized force estimation model needs to be invoked, the pre-trained generalized force estimation model is invoked, and the predicted generalized force of the multi-body system is obtained based on the current system state of the multi-body system.
[0025] In one possible implementation, the method further includes:
[0026] If it is determined that the generalized force estimation model does not need to be invoked, then the variational integrator is used to calculate the system state at the next moment based on the system state and the predicted generalized force at the previous moment.
[0027] In one possible implementation, determining whether to invoke the generalized force estimation model includes:
[0028] Based on the random number pre-configured for each integration step, if the random number corresponding to the current time step is greater than or equal to the preset value, it is determined that the generalized force estimation model needs to be invoked.
[0029] If the random number corresponding to the current time step is less than the preset value, then it is determined that the generalized force estimation model does not need to be called.
[0030] In one possible implementation, the method further includes:
[0031] Obtain the current actual generalized force of the multibody system;
[0032] When the error between the actual generalized force and the predicted generalized force is greater than a preset error and the duration is greater than a preset time threshold, the model parameters of the generalized force estimation model are optimized.
[0033] Secondly, embodiments of this application provide a control device for a multi-body system, comprising:
[0034] The calling module is used to call a pre-trained generalized force estimation model to obtain the predicted generalized force of the multi-body system based on the current system state. The generalized force estimation model is a model that predicts the generalized force on the system based on the system state and is pre-trained on a physical information neural network.
[0035] The first calculation module is used to calculate the system state at the next moment using a variational integrator based on the system state and the predicted generalized force.
[0036] The output module is used to output the system state at the next moment to the actuator of the multibody system.
[0037] In one possible implementation, the generalized force estimation model of the calling module is based on a loss function and is trained on a pre-constructed initial physical information neural network using a historical dataset; the historical dataset includes multiple system states and the actual generalized force of the multibody system corresponding to each system state;
[0038] The loss function includes a first loss function constrained by the actual generalized force and a second loss function constrained by the Lagrange function.
[0039] In one possible implementation, the device further includes:
[0040] An adjustment module is used to adjust the integration step size of the variational integrator according to the state changes of the multibody system.
[0041] The state change is used to characterize the stability of the motion of the multibody system.
[0042] In one possible implementation, the adjustment module is specifically used for:
[0043] If the rate of change of energy of the multibody system within a preset time is greater than or equal to a first preset threshold, then the integration step size of the variational integrator is reduced according to the first preset rule.
[0044] If the energy change rate of the multibody system within a preset time is less than the second preset threshold, then the integration step size of the variational integrator is increased according to the second preset rule, wherein the first preset threshold is greater than or equal to the second preset threshold.
[0045] or,
[0046] If the rate of change of generalized momentum of the multibody system within a preset time is greater than or equal to a third preset threshold, then the integration step size of the variational integrator is reduced according to the third preset rule.
[0047] If the rate of change of generalized momentum of the multibody system within a preset time is less than the fourth preset threshold, then the integration step size of the variational integrator is increased according to the fourth preset rule, and the third preset threshold is greater than or equal to the fourth preset threshold.
[0048] In one possible implementation, the device further includes:
[0049] The decision module is used to determine whether the generalized force estimation model needs to be invoked.
[0050] Accordingly, the calling module is specifically used for:
[0051] When it is determined that the generalized force estimation model needs to be invoked, the pre-trained generalized force estimation model is invoked, and the predicted generalized force of the multi-body system is obtained based on the current system state of the multi-body system.
[0052] In one possible implementation, the device further includes:
[0053] The second calculation module is used to calculate the system state at the next moment by using the variational integrator based on the system state and the predicted generalized force at the previous moment if it is determined that the generalized force estimation model does not need to be called.
[0054] In one possible implementation, the determining module is specifically used for:
[0055] Based on the random number pre-configured for each integration step, if the random number corresponding to the current time step is greater than or equal to the preset value, it is determined that the generalized force estimation model needs to be invoked.
[0056] If the random number corresponding to the current time step is less than the preset value, then it is determined that the generalized force estimation model does not need to be called.
[0057] In one possible implementation, the device further includes:
[0058] An optimization module is used to obtain the current actual generalized force of the multibody system;
[0059] When the error between the actual generalized force and the predicted generalized force is greater than a preset error and the duration is greater than a preset time threshold, the model parameters of the generalized force estimation model are optimized.
[0060] Thirdly, embodiments of this application provide a computing device, including: a memory and a processor;
[0061] The memory stores computer-executed instructions;
[0062] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0063] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0064] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0065] The control method, device, and medium for multibody systems provided in this application first obtain the predicted generalized force of the multibody system based on the current system state by calling a generalized force estimation model pre-trained on a Physics-Informed Neural Network (PINN). Then, a variable induction valve (VI) is used to calculate the system state at the next moment based on the system state and the predicted generalized force. Finally, the system state at the next moment is output to the actuator of the multibody system. On the one hand, the generalized force estimation model trained on PINN can learn and compensate for unmodeled dynamics, making the simulation algorithm highly robust to model uncertainties, parameter changes, and external disturbances. On the other hand, the use of VI to perform structure-preserving and highly stable numerical integration in multibody system dynamics analysis scenarios ensures the stability of the integration process. In summary, this scheme improves the stability of the simulation process and the accuracy of the simulation results in complex multibody system dynamics analysis scenarios through the combined use of VI and PINN, thereby improving the stability and accuracy of multibody system control. Attached Figure Description
[0066] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0067] Figure 1 A flowchart illustrating a control method for a multibody system provided in Embodiment 1 of this application;
[0068] Figure 2 This application provides an overall architecture for a specific control method for a multibody system.
[0069] Figure 3 This is a schematic diagram of the structure of a control device for a multibody system provided in Embodiment 3 of this application;
[0070] Figure 4 This is a schematic diagram of the structure of a control device for a multibody system provided in Embodiment 4 of this application;
[0071] Figure 5 A schematic diagram of the computing device provided in this application.
[0072] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0073] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0074] To facilitate understanding of the technical content of this solution, the background technology is described in detail below:
[0075] Numerical integration methods are the core approach for solving the differential-algebraic equations of multibody system dynamics. However, traditional methods have significant limitations when facing high real-time requirements, strong nonlinearity, model uncertainty, and long-term simulation needs.
[0076] Explicit integration methods (such as the explicit Euler method and the Runge-Kutta method) are computationally simple, but have poor conditional stability. To ensure numerical stability, the integration step size must be smaller than a fraction of the system's minimum natural period. For systems with rigid characteristics (such as those with flexible components or contact dynamics), the required step size is extremely small, resulting in low computational efficiency and difficulty in meeting real-time requirements.
[0077] Implicit integration methods (such as implicit Euler methods and backward difference formula (BDF) methods) offer good stability and allow for larger step sizes. However, each step requires solving a system of nonlinear equations, typically involving iteration (such as Newton's iteration), which is computationally expensive and may not converge. The numerical damping introduced distorts the long-term energy behavior of the system, leading to physical distortion.
[0078] Unlike traditional numerical integration methods, variational integrators (VIs), while possessing superior numerical stability and structure-preserving properties, rely heavily on accurate, analytical system dynamics models for performance. Real-world multibody systems (such as biomimetic robots and on-orbit spacecraft) exhibit numerous unmodeled dynamics (e.g., complex friction, flexible deformation, assembly gaps) and unknown time-varying disturbances (e.g., wind force, external impacts), making accurate models unavailable and rendering traditional VIs ineffective or even obsolete. Therefore, a solution is urgently needed to resolve the contradiction between the "high-precision model dependency" and the "uncertainty of real-world models" in VIs, enabling traditional VIs to move from theoretical applications to complex engineering applications.
[0079] Based on the above background information, the inventors discovered during their research that a physical-informed neural network (Physics-Informed Neural Network) could be used. The model trained by PINN (Physical Networks) replaces the Lagrangian function or generalized force model relied upon by traditional VI (Virtual Integration). PINN can embed the learning ability of artificial intelligence into a rigorous physical and mathematical framework to ensure that the trained model strictly follows basic physical laws, while also adaptively learning and compensating for unmodeled dynamic characteristics. This successfully bridges the gap between accurate models and complex reality, thereby accurately predicting generalized forces, including unmodeled dynamics (such as nonlinear friction, air resistance, and flexible deformation), ultimately achieving intelligent simulation with both physical consistency and environmental generalization. Furthermore, the inventors also considered that when using VI to perform integration calculations based on the generalized forces output by the model trained by PINN, even if there are small errors in PINN's predictions, the variational integrator will sense and utilize the possible errors or uncertainties in the PINN output. By automatically maintaining the symplectic structure and conservation laws, it will "correct" errors at each time step. This ensures that the errors of PINN do not propagate, and the entire integration process can maintain numerical stability without energy explosions or divergences.
[0080] In view of this, the present invention is proposed to provide an efficient simulation algorithm that can both strictly follow physical laws and maintain numerical stability like VI, and adaptively learn and compensate for model uncertainties and disturbances like artificial intelligence (AI), thereby fundamentally solving the contradiction between numerical stability, physical consistency and model uncertainty.
[0081] It should be noted that the simulation and control method based on PINN and VI for multibody system design provided in this application can be applied to scenarios that require multibody system dynamics analysis, such as robot control, spacecraft adjustment, vehicle dynamics simulation, and biomechanical analysis. This application does not impose specific limitations on the specific application scenarios of the solution.
[0082] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0083] Figure 1 This is a flowchart illustrating a control method for a multibody system provided in Embodiment 1 of this application, as shown below. Figure 1 As shown, the method includes:
[0084] S101. Call the pre-trained generalized force estimation model to obtain the predicted generalized force of the multibody system based on the current system state. The generalized force estimation model is a model that is pre-trained based on a physical information neural network to predict the generalized force on the system based on the system state.
[0085] In this step, a pre-trained generalized force estimation model is called. The current system state of the multibody system is used as the input of the model, and the output is the predicted generalized force of the multibody system corresponding to the current moment, which is used to predict the system state at the next moment.
[0086] The system state includes the generalized coordinates and generalized velocity (or generalized momentum) of the multibody system.
[0087] Furthermore, a multibody system refers to a system composed of two or more rigid or flexible bodies, with the components connected by constraints, such as industrial robots, automobiles, and spacecraft. Dynamic simulation of complex multibody systems allows for in-depth analysis of the motion laws within the system that are not directly observable.
[0088] Generalized force refers to the equivalent force acting on a multibody system in generalized coordinates.
[0089] The generalized force estimation model is a model that uses the current state of the system as input to predict the generalized forces acting on a multibody system at the current moment. It is used to replace the order-accurate modeling of the Lagrangian function and generalized force model that traditional VI relies on.
[0090] This generalized force estimation model is trained based on PINN. PINN can be constructed using a Multi-Layer Perceptron (MLP).
[0091] PINN is a deep learning model that integrates physical laws with data-driven approaches. Its training loss function for the neural network includes not only data terms matching the observed data but also physical constraint terms derived from physical equations. In this way, physical laws are injected into the neural network as soft constraints, ensuring that its learning results both conform to the data and roughly follow physical laws.
[0092] In this scheme, the physical constraints of PINN are designed around the core constraints of the multibody system motion, so that the prediction results of the generalized force estimation model satisfy the physical laws of multibody motion, such as the law of conservation of energy and the Lagrange equation.
[0093] It should be understood that the generalized force estimation model based on PINN training in this scheme bridges the gap between traditional models (Lagrangian function and generalized force model) and complex realities, and can accurately predict generalized forces including unmodeled dynamics (such as nonlinear friction, air resistance, and flexible deformation).
[0094] Optionally, the generalized force in this application can also be replaced by the acceleration of a multibody system, with the same implementation principle, which will not be elaborated here.
[0095] S102. Using a variational integrator, the system state at the next moment is calculated based on the system state and the predicted generalized force.
[0096] In this step, the variational integrator receives the generalized force predicted by the aforementioned generalized force estimation model, uses its internal Lagrange equation or Hamiltonian equation to solve the discrete algebraic equation, and calculates the system state at the next moment based on the current system state of the multibody system and the predicted generalized force.
[0097] It should be understood that, due to the structure-preserving properties of VI, even if there are small errors in the prediction of the generalized force estimation model, the entire integration process can maintain numerical stability and will not result in energy explosion or divergence.
[0098] The following example illustrates this step:
[0099] The core of VI is its update using the Discrete Euler-Lagrange Equation (DEL). The DEL equation for traditional VI is as follows:
[0100]
[0101] Where, q k-1 ,q k ,q k+1 Let represent the generalized coordinates of the multibody system at times k-1, k, and k+1, respectively; This represents the discrete generalized force acting at the starting point at time k. The discrete generalized force acting at the end of time k is determined by the Lagrangian function or the generalized force model. This represents the partial derivative of the discrete Lagrange function with respect to the first variable; This represents the partial derivative of the discrete Lagrange function with respect to the second variable.
[0102] Based on the aforementioned traditional VI DEL equation, this scheme incorporates the generalized forces in the above equation. Replace with the predicted generalized force output by the generalized force estimation model. Therefore, the update equation becomes:
[0103]
[0104]
[0105] in, and Let represent the generalized momentum at times k and k+1, respectively. This represents the discrete generalized force acting at the starting point at time k. The discrete generalized force acting at the end point of time k is obtained by decomposing the predicted generalized force output by the generalized force estimation model trained based on PINN.
[0106] PI will use the obtained integration step size of this iteration to solve for this... as well as The system state at the next moment can be obtained by solving the equation (for example, by using Newton's iteration method). , ).
[0107] S103. Output the system state at the next moment to the actuator of the multibody system.
[0108] In this step, in some scenarios where control is required based on the aforementioned simulation results, it is necessary to output the system state at the next moment to the actuator so that the actuator can actively adjust its actions according to the acquired system state, thereby making the state of the multibody system conform to expectations.
[0109] For example, in a vehicle simulation and control scenario, actuators could be motors and / or servo valves in a vehicle.
[0110] The control method for multibody systems provided in this embodiment first obtains the predicted generalized force of the multibody system based on the current system state by calling a generalized force estimation model pre-trained on a physical information neural network. Then, it uses a variable identity (VI) to calculate the system state at the next moment based on the system state and the predicted generalized force. By using VI in conjunction with PINN, the stability of the simulation process and the accuracy of the simulation results in complex multibody system dynamics analysis scenarios are improved. Furthermore, by outputting the accurate and stable system state at the next moment to the actuator of the multibody system, the stability and accuracy of the control of the multibody system are improved.
[0111] Furthermore, in one possible implementation, the generalized force estimation model in the control method for multibody systems provided in the above embodiments can be obtained by training a pre-constructed neural network of initial physical information using a historical dataset based on a loss function.
[0112] The historical dataset includes multiple system states and the actual generalized forces of the multibody system corresponding to each system state.
[0113] In practical applications, historical datasets can be obtained by acquiring real dynamic data from sensors installed in a multibody system. For example, sensors include torque sensors and vision system sensors. Vision system sensors (such as cameras and LiDAR) are used to acquire the actual position and velocity of the multibody system to obtain the system state, while torque sensors are used to acquire the actual torque values of the multibody system to obtain the actual generalized force corresponding to the system state. Alternatively, an inertial measurement unit (IMU) can be used to acquire generalized velocity, and an encoder can be used to acquire generalized coordinates.
[0114] In addition, the loss function includes a first loss function constrained by the actual generalized force and a second loss function constrained by the Lagrange function.
[0115] The first loss function is determined based on the error (e.g., mean squared error or mean absolute error) between the actual generalized force and the predicted generalized force. It uses data-driven fitting loss to make the model's predicted values closer to the actual values.
[0116] It should be understood that the first loss function calculates the error between the generalized force predicted by the model based on the system state and the actual generalized force measured by the sensor, allowing the model to learn the mapping relationship between the generalized forces of the system state, thus avoiding the disconnect between the model output and the actual data.
[0117] For example, the first loss function is calculated using the following formula:
[0118]
[0119] Where N represents the total number of training samples (obtained from historical datasets); This represents the actual generalized force corresponding to the i-th sample; This represents the predicted generalized force corresponding to the i-th sample. The second loss function is determined based on the Lagrange function. It uses physics-driven constraint loss to force the network output to comply with the physical laws of the Euler-Lagrange equations, ensuring that the model does not violate the dynamic essence, and that the output is physically reliable even if the data is noisy.
[0120] For example, the second loss function It can be expressed using the following formula:
[0121]
[0122] Where L=TV is the known part of the Lagrangian function (T represents the kinetic energy of the system, V represents the potential energy of the system, and L represents the Lagrangian function). Generalized coordinates representing the system state; It represents the generalized velocity in the system state.
[0123] Accordingly, in practical applications, a loss function can be set for training PINN. for:
[0124]
[0125] in, This represents the weighting coefficient.
[0126] The method provided in this implementation employs two types of loss functions for training PINN, enabling the model to simultaneously consider both the fit to real data and compliance with physical laws, achieving the effect that the model output data not only fits the data but also conforms to physical laws.
[0127] Furthermore, Embodiment 2 of this application provides a control method for a multibody system. Based on the above embodiments, this embodiment employs an adaptive control strategy to comprehensively optimize overall efficiency and accuracy.
[0128] The adaptive control strategy specifically includes the following:
[0129] 1) Adjust the integration step size of the variational integrator according to the state changes of the multibody system.
[0130] Among them, the state change situation is used to characterize the stability of the motion of the multibody system.
[0131] For example, it can be determined whether the multibody system is in a high-speed collision state or a stage of severe deformation. If it is determined to be so, it indicates that the motion of the multibody system is unstable, and the integration step size of VI can be reduced to ensure accuracy. If it is determined not to be so, it indicates that the motion of the multibody system is relatively stable, and the integration step size of VI can be increased to improve computational efficiency.
[0132] Optionally, the rate of change of energy and the rate of change of generalized momentum of a multibody system can be used to represent the state changes of the multibody system.
[0133] The specific implementation is as follows:
[0134] The process of adjusting the integration step size based on the rate of energy change is as follows:
[0135] If the energy change rate of the multibody system within a preset time is greater than or equal to a first preset threshold, the integration step size of the variational integrator is reduced according to the first preset rule; if the energy change rate of the multibody system within a preset time is less than a second preset threshold, the integration step size of the variational integrator is increased according to the second preset rule.
[0136] Wherein, the first preset threshold is greater than or equal to the second preset threshold, and the first preset threshold and the second preset threshold can be determined according to the actual application situation, and this application does not impose any restrictions on them.
[0137] Furthermore, the preset time refers to a fixed time interval set in advance. For example, the energy change within the preset time can be the energy change of a multi-body system between two adjacent moments. The rate of energy change can be determined based on the system state at the start and end of the preset time.
[0138] The first preset rule refers to the rule for reducing the integral step size of VI when the energy change rate is greater than or equal to the first preset threshold. For example, it may include the step size reduction ratio corresponding to different energy change rates. Similarly, the second preset rule refers to the rule for increasing the integral step size of VI when the energy change rate is less than the second preset threshold. For example, it may include the step size increase ratio corresponding to different energy change rates.
[0139] The process of adjusting the integration step size based on the rate of energy change is as follows:
[0140] If the rate of change of generalized momentum of the multibody system within a preset time is greater than or equal to the third preset threshold, the integration step size of the variational integrator is reduced according to the third preset rule; if the rate of change of generalized momentum of the multibody system within a preset time is less than the fourth preset threshold, the integration step size of the variational integrator is increased according to the fourth preset rule.
[0141] The third preset threshold is greater than or equal to the fourth preset threshold. The third and fourth preset thresholds can be determined according to the actual application, and this application does not impose any restrictions on them.
[0142] Furthermore, the rate of change of momentum within a preset time period is, for example, the change of momentum of a multibody system between two adjacent time points. The rate of change of momentum can be determined based on the system state at the start and end of the preset time period.
[0143] The third preset rule refers to the rule for reducing the integral step size of VI when the momentum change rate is greater than or equal to the third preset threshold. For example, it may include the step size reduction ratio corresponding to different momentum change rates. Similarly, the fourth preset rule refers to the rule for increasing the integral step size of VI when the momentum change rate is less than the fourth preset threshold. For example, it may include the step size increase ratio corresponding to different energy-momentum change rates.
[0144] It should be noted that in practical applications, either the adjustment method based on the rate of change of energy or the rate of change of momentum can be used.
[0145] In this implementation, the scheme adjusts the integration step size of the variational integrator based on the stability of the multibody system's motion. This achieves the effect of further reducing unnecessary calculations without sacrificing the stability of the multibody system, thus meeting the real-time control requirements of the multibody system.
[0146] 2) Determine whether the generalized force estimation model needs to be called. If it is determined that the generalized force estimation model needs to be called, the pre-trained generalized force estimation model is called, and the predicted generalized force of the multi-body system is obtained based on the current system state of the multi-body system. If it is determined that the generalized force estimation model does not need to be called, a variational integrator is used to calculate the system state at the next moment based on the system state and the predicted generalized force at the previous moment.
[0147] Optionally, the following method can be used to determine whether to invoke the generalized force estimation model:
[0148] Based on the random number pre-configured for each integration step, if the random number corresponding to the current time step is greater than or equal to the preset value, it is determined that the generalized force estimation model needs to be called; if the random number corresponding to the current time step is less than the preset value, it is determined that the generalized force estimation model does not need to be called.
[0149] In other words, a preset value γ is introduced, and a random number is generated in advance for each integration step. If the random number at the current moment is less than γ, the model is invoked; otherwise, the value from the previous moment is reused. Optionally, γ can be dynamically adjusted according to the system state. For example, when the system dynamics change slowly, γ can be increased, and vice versa.
[0150] Optionally, the generalized force estimation model can be invoked at the current time based on a preset number of integration invocations. For example, if the number of integration invocations is 3, the generalized force estimation model will be invoked once every three time intervals.
[0151] In this implementation, the generalized force estimation model is not called at every step. The model is only called when it is determined that it needs to be called. When it is determined that it does not need to be called, the previous prediction result of the model is directly used, which greatly reduces the computational overhead.
[0152] 3) Obtain the current actual generalized force of the multibody system; when the error between the actual generalized force and the predicted generalized force is greater than the preset error and the duration is greater than the preset time threshold, optimize the model parameters of the generalized force estimation model.
[0153] In this step, the error e between the actual generalized force and the predicted generalized force will be monitored. If e exceeds the preset error and persists for a period of time (greater than the preset time threshold), it indicates that the current model can no longer accurately describe the environment. In this case, the online fine-tuning process of the generalized force estimation model will be triggered to update the network weights using the latest batch of real-time data.
[0154] In this implementation, by monitoring the deviation between the generalized force predicted by the model and the actual value, an online fine-tuning mechanism for the generalized force estimation model is triggered to update the network weights in PINN, thereby improving the model's environmental adaptability.
[0155] It should be noted that during the simulation process, all three methods mentioned above can be used simultaneously to optimize the global system, or any one or two of the three methods can be used to optimize the global system. This application does not impose any specific restrictions on this.
[0156] In one specific implementation, the above optimization process can be performed by an independently configured agent, such as a lightweight reinforcement learning algorithm or a Bayesian optimization strategy.
[0157] The control method for multibody systems provided in this embodiment, through adaptive step size adjustment, model call judgment, and online update mechanism, ensures the overall environmental adaptability and efficiency of the overall control while guaranteeing computational accuracy and stability.
[0158] Figure 2 The overall architecture of a specific control method for a multibody system provided in this application is as follows: Figure 2 As shown, the whole system includes a perception layer 201, an intelligent decision-making and computing layer 202, and an execution layer 203.
[0159] The perception layer 201 includes sensors, which are used to collect the actual system state and actual generalized force of the multi-body system through the sensor system and send them to the intelligent decision and computing layer 202.
[0160] The intelligent decision-making and computing layer 202 includes an adaptive policy controller, a generalized force estimation model, and VI:
[0161] The adaptive policy controller is used to send control instructions to the generalized force estimation model based on the system state, actual system state, and actual generalized force fed back by VI. This control is used to adjust the integral step size and model activation frequency, and to send weight update instructions to the generalized force estimation model for online model updates.
[0162] The generalized force estimation model is used to receive weight update instructions and update its network parameters according to the weight update instructions. It is also used to predict the generalized force based on the system state output at the current moment.
[0163] VI is used to receive control commands, adjust its basic step size according to the control commands, determine the acquisition method of generalized force, calculate the system state at the next moment based on the predicted generalized force and the system state at the current moment, and output the system state at the next moment to the execution layer 203.
[0164] The execution layer uses 203 to adjust actions based on the acquired system status.
[0165] visible, Figure 2 On the one hand, it demonstrates the flow of information throughout the system, starting from sensor acquisition and ultimately forming control commands to drive the actuators for high-speed, stable physical integral calculations, thus achieving real-time control. On the other hand, it demonstrates the intelligent scheduling and optimization of the entire system's computing resources by the adaptive strategy controller, dynamically adjusting the inner loop's computing strategy and model parameters at a lower frequency to achieve intelligent optimization.
[0166] The following is a specific control method flow for a multibody system:
[0167] Specifically, after system startup, a data buffer is allocated, a pre-trained generalized force estimation model is loaded, initial control parameters (such as the step size for each integration step) are set, and the system state in the VI is initialized. Then, the main control loop is entered until the periodic clock is interrupted. During the main control loop, sensors are used to collect actual generalized forces and actual states, which are stored in the data buffer for online updates of the generalized force estimation model and to provide generalized force data for estimation when the VI does not call the generalized force estimation model. Additionally, the model performance is evaluated based on the actual and predicted generalized forces to generate optimization strategies. These optimization strategies include updating the model network weights output to the generalized force estimation model, adjusting the integration step size output to the VI, and a model invocation strategy. Simultaneously, when the VI determines that a model needs to be invoked based on the model invocation strategy, it invokes the generalized force estimation model to obtain the predicted generalized forces, and calculates the system state for the next time step based on the predicted generalized forces and the integration step size adjustment strategy, then outputs this information to the actuator.
[0168] Figure 3 This is a schematic diagram of the structure of a control device for a multibody system provided in Embodiment 3 of this application, as shown below. Figure 3 As shown, the control device 30 for the multi-body system provided in this embodiment includes:
[0169] The calling module 301 is used to call the pre-trained generalized force estimation model to obtain the predicted generalized force of the multi-body system based on the current system state of the multi-body system. The generalized force estimation model is a model that predicts the generalized force on the system based on the system state and is pre-trained based on a physical information neural network.
[0170] The first calculation module 302 is used to calculate the system state at the next moment using a variational integrator based on the system state and the predicted generalized force.
[0171] The output module 303 is used to output the system state at the next moment to the actuator of the multibody system.
[0172] The control device 30 for the multibody system provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0173] Figure 4 This is a schematic diagram of the structure of a control device for a multibody system provided in Embodiment 4 of this application, as shown below. Figure 4 As shown, based on the above embodiments, the control device 30 for the multi-body system provided in this embodiment further includes:
[0174] The adjustment module 304 is used to adjust the integration step size of the variational integrator according to the state changes of the multibody system.
[0175] The state change is used to characterize the stability of the motion of the multibody system.
[0176] The judgment module 305 is used to determine whether the generalized force estimation model needs to be invoked.
[0177] The second calculation module 306 is used to calculate the system state at the next moment by using the variational integrator based on the system state and the predicted generalized force at the previous moment if it is determined that the generalized force estimation model does not need to be called.
[0178] Optimization module 307 is used to obtain the current actual generalized force of the multibody system;
[0179] When the error between the actual generalized force and the predicted generalized force is greater than a preset error and the duration is greater than a preset time threshold, the model parameters of the generalized force estimation model are optimized.
[0180] In one possible implementation, the generalized force estimation model of the calling module 301 is based on a loss function and is obtained by training a pre-constructed initial physical information neural network using a historical dataset; the historical dataset includes multiple system states and the actual generalized force of the multibody system corresponding to each system state;
[0181] The loss function includes a first loss function constrained by the actual generalized force and a second loss function constrained by the Lagrange function.
[0182] In one possible implementation, the adjustment module is specifically used for:
[0183] If the rate of change of energy of the multibody system within a preset time is greater than or equal to a first preset threshold, then the integration step size of the variational integrator is reduced according to the first preset rule.
[0184] If the energy change rate of the multibody system within a preset time is less than the second preset threshold, then the integration step size of the variational integrator is increased according to the second preset rule, wherein the first preset threshold is greater than or equal to the second preset threshold.
[0185] or,
[0186] If the rate of change of generalized momentum of the multibody system within a preset time is greater than or equal to a third preset threshold, then the integration step size of the variational integrator is reduced according to the third preset rule.
[0187] If the rate of change of generalized momentum of the multibody system within a preset time is less than the fourth preset threshold, then the integration step size of the variational integrator is increased according to the fourth preset rule, and the third preset threshold is greater than or equal to the fourth preset threshold.
[0188] In one possible implementation, the calling module is specifically used for:
[0189] When it is determined that the generalized force estimation model needs to be invoked, the pre-trained generalized force estimation model is invoked, and the predicted generalized force of the multi-body system is obtained based on the current system state of the multi-body system.
[0190] In one possible implementation, the determining module is specifically used for:
[0191] Based on the random number pre-configured for each integration step, if the random number corresponding to the current time step is greater than or equal to the preset value, it is determined that the generalized force estimation model needs to be invoked.
[0192] If the random number corresponding to the current time step is less than the preset value, then it is determined that the generalized force estimation model does not need to be called.
[0193] The control device 30 for the multibody system provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0194] Figure 5 A schematic diagram of the computing device provided in this application. Figure 5As shown, the computing device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus 404.
[0195] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to perform the above-described method.
[0196] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0197] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0198] The memory may include read-only memory and random access memory. The memory may be volatile or non-volatile, or may include both. Non-volatile memory may include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which serves as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0199] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0200] This application also provides a computer program product, including a computer program that, when executed, implements the above-described method.
[0201] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0202] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as SRAM, EEPROM, EPROM, PROM, ROM, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0203] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0206] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0207] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A control method for a multibody system, characterized in that, include: The pre-trained generalized force estimation model is invoked to obtain the predicted generalized force of the multibody system based on the current system state. The generalized force estimation model is a model that predicts the generalized force on the system based on the system state and is pre-trained on a physical information neural network. Using a variational integrator, the system state at the next moment is calculated based on the system state and the predicted generalized force. The system state at the next moment is output to the actuator of the multibody system.
2. The method according to claim 1, characterized in that, The generalized force estimation model is based on a loss function and is trained on a pre-constructed neural network using historical datasets; the historical datasets include multiple system states and the actual generalized force of the multibody system corresponding to each system state. The loss function includes a first loss function constrained by the actual generalized force and a second loss function constrained by the Lagrange function.
3. The method according to claim 1 or 2, characterized in that, The method further includes: The integration step size of the variational integrator is adjusted according to the state changes of the multibody system. The state change is used to characterize the stability of the motion of the multibody system.
4. The method according to claim 3, characterized in that, Adjusting the integration step size of the variational integrator based on the state changes of the multibody system includes: If the rate of change of energy of the multibody system within a preset time is greater than or equal to a first preset threshold, then the integration step size of the variational integrator is reduced according to the first preset rule. If the energy change rate of the multibody system within a preset time is less than the second preset threshold, then the integration step size of the variational integrator is increased according to the second preset rule, wherein the first preset threshold is greater than or equal to the second preset threshold. or, If the rate of change of generalized momentum of the multibody system within a preset time is greater than or equal to a third preset threshold, then the integration step size of the variational integrator is reduced according to the third preset rule. If the rate of change of generalized momentum of the multibody system within a preset time is less than the fourth preset threshold, then the integration step size of the variational integrator is increased according to the fourth preset rule, and the third preset threshold is greater than or equal to the fourth preset threshold.
5. The method according to claim 1 or 2, characterized in that, Before invoking the pre-trained generalized force estimation model and obtaining the predicted generalized force of the multi-body system based on the current system state, the method further includes: Determine whether the generalized force estimation model needs to be invoked; Accordingly, the step of calling a pre-trained generalized force estimation model based on the current system state of the multi-body system to obtain the predicted generalized force of the multi-body system includes: When it is determined that the generalized force estimation model needs to be invoked, the pre-trained generalized force estimation model is invoked, and the predicted generalized force of the multi-body system is obtained based on the current system state of the multi-body system.
6. The method according to claim 5, characterized in that, The method further includes: If it is determined that the generalized force estimation model does not need to be invoked, then the variational integrator is used to calculate the system state at the next moment based on the system state and the predicted generalized force at the previous moment.
7. The method according to claim 5, characterized in that, The determination of whether to invoke the generalized force estimation model includes: Based on the random number pre-configured for each integration step, if the random number corresponding to the current time step is greater than or equal to the preset value, it is determined that the generalized force estimation model needs to be invoked. If the random number corresponding to the current time step is less than the preset value, then it is determined that the generalized force estimation model does not need to be called.
8. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the current actual generalized force of the multibody system; When the error between the actual generalized force and the predicted generalized force is greater than a preset error and the duration is greater than a preset time threshold, the model parameters of the generalized force estimation model are optimized.
9. A computing device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8.