Robot layered control method, device and storage medium
Patent Information
- Application Number
- CN202611353765.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]本申请的主要目的在于提供一种机器人分层控制方法、设备和存储介质,旨在解决目前方法泛化能力差,影响系统整体的控制性能和稳定性的技术问题
本申请获取机器人的期望轨迹数据和当前轨迹数据,其中,所述期望轨迹数据包括期望关节数据,将所述期望关节数据输入到混合动力学模型中,得到由多个不同层级的力矩组成的综合控制力矩,其中,所述混合动力学模型包括物理解析模块和残差补偿模块,所述物理解析模块是基于预设的物理参数构建的,所述混合动力学模型是基于预设的辨识数据集,依次对所述物理解析模块和所述残差补偿模块循环交替训练得到的,基于所述期望轨迹数据、所述当前轨迹数据和所述综合控制力矩,对所述机器人进行控制。
Smart Images

Figure CN122876402A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot dynamics and control technology, and in particular to robot hierarchical control methods, devices and storage media. Background Technology
[0002] In the high-precision motion control of multi-joint robots, obtaining a high-fidelity dynamic model is the core foundation. Existing modeling methods are gradually shifting from traditional analytical dynamic models to hybrid dynamic models that integrate mechanistic equations and neural networks.
[0003] However, in the current joint training process of hybrid power dynamics models, the errors that should be explained by the rigid body analytical model are corrected by the neural network model. This makes the model prone to structural overfitting when facing high speed, strong coupling and complex unseen trajectories with frequent velocity reversals, resulting in a decrease in generalization ability and affecting the overall control performance and stability of the system. Summary of the Invention
[0004] The main objective of this application is to provide a robot hierarchical control method, device, and storage medium, aiming to solve the technical problem that current methods have poor generalization ability, which affects the overall control performance and stability of the system.
[0005] To achieve the above objectives, this application proposes a hierarchical control method for robots, the method comprising: Acquire the robot's desired trajectory data and current trajectory data, wherein the desired trajectory data includes desired joint data; The desired joint data is input into the hybrid power dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels. The hybrid power dynamics model includes a physical analysis module and a residual compensation module. The physical analysis module is constructed based on preset physical parameters. The hybrid power dynamics model is obtained by cyclically and alternately training the physical analysis module and the residual compensation module based on a preset identification dataset. The robot is controlled based on the desired trajectory data, the current trajectory data, and the combined control torque.
[0006] In one embodiment, before the step of inputting the desired joint data into the hybrid dynamics model to obtain the comprehensive control torque composed of multiple different levels of torque, the method further includes: The identification dataset and preset physical parameters are obtained, wherein the identification dataset includes joint data during robot operation and the actual joint torques corresponding to the joint data; Based on the physical parameters, the physical analysis module is constructed, and based on the physical analysis module, the residual compensation module is constructed. Based on the identification dataset, the physical analysis module and the residual compensation module are trained alternately. During the training of the physical analysis module, the weight parameters of the residual compensation module are frozen, and during the training of the residual compensation module, the physical parameters of the physical analysis module are frozen. Determine whether the physical analysis module and the residual compensation module have reached the preset training termination condition. If not, return to the step of alternating training of the physical analysis module and the residual compensation module based on the identification dataset until the physical analysis module and the residual compensation module have reached the training termination condition, and obtain the hybrid dynamics model.
[0007] In one embodiment, the step of alternately training the physical analysis module and the residual compensation module based on the identification dataset includes: The joint data is input into the residual compensation module to obtain the joint residual torque; Based on the joint data, the joint residual torque, and the actual joint torque, the physical parameters of the physical analysis module are updated to obtain the updated physical analysis module; The joint data is input into the physical analysis module to obtain the new joint basic torque corresponding to the updated physical analysis module; Based on the joint data, the basic joint torque, and the actual joint torque, the weight parameters of the residual compensation module are updated to obtain the updated residual compensation module.
[0008] In one embodiment, the step of updating the physical parameters of the physical analysis module based on the joint data, the joint residual torque, and the actual joint torque to obtain the updated physical analysis module includes: Freeze the weight parameters of the residual compensation module, input the joint data into the physical analysis module, and obtain the joint basic torque corresponding to the unupdated physical analysis module; The difference between the actual joint torque and the residual joint torque is calculated to obtain the target joint basic torque; Based on the joint base torque, the target joint base torque, and the preset physical analysis loss function, the physical analysis loss value of the physical analysis module is calculated; Based on the physical analysis loss value, the physical parameters of the physical analysis module are updated, and the weight parameters are unfrozen to obtain the updated physical analysis module.
[0009] In one embodiment, the step of updating the weight parameters of the residual compensation module based on the joint data, the basic joint torque, and the actual joint torque to obtain the updated residual compensation module includes: Freeze the physical parameters of the physical analysis module, calculate the difference between the actual joint torque and the new joint base torque, and obtain the target joint residual torque; Based on the joint residual torque, the target joint residual torque, and the preset residual compensation loss function, the residual compensation loss value of the residual compensation module is calculated; Based on the residual compensation loss value, the weight parameters of the residual compensation module are updated, and the freezing of the physical parameters is lifted to obtain the updated residual compensation module.
[0010] In one embodiment, the step of determining whether the physical parsing module and the residual compensation module have reached the preset training termination condition includes: Every preset training round, the average physical analysis loss value of the physical analysis module and the average residual compensation loss value of the residual compensation module are calculated. The average physical analysis loss value and the average residual compensation loss value are added together to obtain the average total prediction loss for this time. Obtain the average total predicted loss calculated in the previous calculation, and calculate the average loss decrease value between the average total predicted loss in the previous calculation and the average total predicted loss in the current calculation. Determine whether the average loss decrease value is lower than a preset loss decrease threshold. If it is lower, then determine that the physical parsing module and the residual compensation module have reached the training termination condition.
[0011] In one embodiment, the physical analysis module includes a rigid body dynamics layer and a friction compensation layer. The physical parameters include rigid body inertia parameters and friction coefficient parameters. The joint data includes joint position and joint velocity. The step of inputting the desired joint data into the hybrid dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels includes: The acceleration data in the desired trajectory is input into the rigid body dynamics layer, and the feedforward basic torque of the robot is determined based on the acceleration data and the rigid body inertial parameters. The joint velocity is input into the friction compensation layer, and the friction cancellation torque of the robot is determined based on the joint velocity and the friction coefficient parameter. The joint data is input into the residual compensation module to determine the residual compensation torque of the robot; The feedforward base torque, the friction cancellation torque, and the residual compensation torque are added together to obtain the comprehensive control torque.
[0012] In one embodiment, the desired trajectory data includes the robot's desired position data, and the step of controlling the robot based on the desired trajectory data, the current trajectory data, and the integrated control torque includes: Calculate the trajectory difference between the desired trajectory data and the current trajectory data; Based on the trajectory difference, the control feedback torque of the robot during control is calculated; The target control torque is obtained by adding the comprehensive control torque and the control feedback torque. The robot is controlled based on the target control torque.
[0013] In addition, to achieve the above objectives, this application also proposes a robot hierarchical control device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the robot hierarchical control method as described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the robot hierarchical control method described above.
[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application acquires the desired trajectory data and current trajectory data of a robot. The desired trajectory data includes desired joint data. The desired joint data is input into a hybrid dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels. The hybrid dynamics model includes a physical analysis module and a residual compensation module. The physical analysis module is constructed based on preset physical parameters. The hybrid dynamics model is obtained by cyclically and alternately training the physical analysis module and the residual compensation module based on a preset identification dataset. The robot is controlled based on the desired trajectory data, the current trajectory data, and the comprehensive control torque.
[0016] Compared to current methods where errors that should be explained by the rigid body analytical model are corrected by the neural network model during joint training of hybrid power dynamics models, leading to decreased generalization ability and impacting the overall control performance and stability of the system, this application obtains a hybrid power dynamics model by alternately training the physical analysis module and the residual compensation module. This improves the model's generalization ability and, consequently, the overall control performance and stability of the system. Specifically, the hybrid power dynamics model of this application includes a physical analysis module and a residual compensation module. Furthermore, this application decouples the training processes of the physical analysis module and the residual compensation module. By alternately training the physical analysis module and the residual compensation module, errors that should be explained by the rigid body analytical model are corrected by the neural network model during training, thus improving the generalization ability of the trained hybrid power dynamics model. The comprehensive control torque obtained through the hybrid power dynamics model is used to control the robot, thereby improving the overall control performance and stability of the system. Attached Figure Description
[0017] 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.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating an embodiment of the robot hierarchical control method of this application. Figure 2 This is a schematic diagram of the overall technical route provided for Embodiment 1 of the robot hierarchical control method of this application; Figure 3 A comparison diagram of Cartesian space circular arc trajectory tracking errors provided in Embodiment 1 of the robot hierarchical control method of this application; Figure 4 This is a flowchart illustrating Embodiment 2 of the robot hierarchical control method of this application; Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the robot hierarchical control method in the embodiments of this application; Figure 6 This is a schematic diagram illustrating the data acquisition consent process involved in the robot hierarchical control method in this application embodiment.
[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0023] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or robot hierarchical control device capable of performing the above functions. The following description uses a robot hierarchical control device as an example to illustrate this embodiment and the subsequent embodiments.
[0024] In high-precision motion control of multi-joint robots, obtaining a high-fidelity dynamic model is fundamental. Existing modeling methods are gradually shifting from traditional analytical dynamic models to hybrid dynamic models that integrate mechanistic equations and neural networks. However, current mainstream joint optimization methods face parameter coupling problems: during joint training, due to the strong fitting ability of neural networks, they indiscriminately absorb errors that should be explained by rigid body analytical models, forcing the identified physical parameters to deviate from their true physical meaning. This loss of physical consistency makes the model prone to structural overfitting when facing high speeds, strong coupling, and complex unseen trajectories with frequent velocity reversals, leading to a decrease in generalization ability. This, in turn, forces the underlying control to rely on high-gain feedback, affecting the overall control performance and stability of the system.
[0025] Based on this, embodiments of this application provide a robot hierarchical control method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the robot hierarchical control method of this application.
[0026] In this embodiment, the robot hierarchical control method includes steps S10 to S30: Step S10: Obtain the robot's desired trajectory data and current trajectory data, wherein the desired trajectory data includes desired joint data; It should be noted that the desired trajectory data is a pre-planned sequence of ideal motion states changing over time, including position, velocity, and acceleration information, used as a tracking reference for the control system. The current trajectory data is the motion state feedback value collected in real time by sensors during the robot's actual operation, including the actual joint position, velocity, and acceleration. The desired joint data is the component of the desired trajectory data in joint space, specifically referring to the desired angle, angular velocity, and angular acceleration of each joint.
[0027] Step S20: Input the desired joint data into the hybrid power dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels. The hybrid power dynamics model includes a physical analysis module and a residual compensation module. The physical analysis module is constructed based on preset physical parameters. The hybrid power dynamics model is obtained by cyclically training the physical analysis module and the residual compensation module on a preset identification dataset. It should be noted that the hybrid dynamics model is a joint computational framework integrating physical analytical equations and a temporal neural network module, used to characterize the complete dynamic mapping relationship between robot joint torques and motion states. The integrated control torque is the final feedforward torque command obtained by superimposing the dominant torque output by the physical analysis module and the compensating torque output by the residual compensation module. The physical analysis module is a deterministic computational unit built based on rigid body dynamics equations and friction mechanism equations, used to output rigid body torques and friction torques with clear physical meaning.
[0028] The residual compensation module is a learnable compensation unit constructed using a temporal convolutional network, used to fit unmodeled dynamic torques that the physical analysis module cannot accurately describe. Physical parameters are a set of identifiable calibration values describing the robot's link inertial characteristics and joint friction properties. The identification dataset is a set of paired samples of motion states and corresponding actual torques collected when the robot runs on a preset excitation trajectory.
[0029] It is understood that in this embodiment, the desired joint data is input into a hybrid dynamics model composed of a physical analysis module and a residual compensation module in parallel. This model is obtained through cyclical alternation training on an identification dataset. This ensures that the final output integrated control torque retains the physical deterministic components of the physical analysis module while incorporating the predictive compensation components from the residual compensation module for unmodeled dynamics. Therefore, without relying on high-gain feedback adjustment, the completeness of the feedforward torque's coverage of complex dynamics is improved. The overall technical approach of this embodiment can be referred to... Figure 2 .
[0030] In one feasible implementation, the physical analysis module includes a rigid body dynamics layer and a friction compensation layer; the physical parameters include rigid body inertia parameters and friction coefficient parameters; the joint data includes joint position and joint velocity; and the specific implementation of inputting the desired joint data into the hybrid dynamics model to obtain a comprehensive control torque composed of multiple different levels of torques can also be: The acceleration data in the desired trajectory is input into the rigid body dynamics layer, and the feedforward basic torque of the robot is determined based on the acceleration data and the rigid body inertial parameters. The joint velocity is input into the friction compensation layer, and the friction cancellation torque of the robot is determined based on the joint velocity and the friction coefficient parameter. The joint data is input into the residual compensation module to determine the residual compensation torque of the robot; The feedforward base torque, the friction cancellation torque, and the residual compensation torque are added together to obtain the comprehensive control torque.
[0031] It should be noted that the rigid body dynamics layer is a computational unit in the physics analysis module built upon the rigid body dynamics equations. It is used to calculate the feedforward base torque required to drive the robot's main body motion based on acceleration data and rigid body inertial parameters. The friction compensation layer is a computational unit in the physics analysis module built upon the friction mechanism equations. It is used to calculate the friction-compensating torque used to counteract nonlinear frictional resistance based on joint velocities and friction coefficient parameters. Rigid body inertial parameters are a set of physical quantities describing the mass, center of mass position, and inertia tensor of each link of the robot, used to characterize the quantitative relationship between rigid body motion inertia and external torque.
[0032] Friction coefficient parameters are a set of coefficients that describe nonlinear frictional characteristics such as Coulomb friction, viscous friction, and the Stribeck effect (a physical phenomenon in which frictional force changes nonlinearly with the relative velocity of motion) during joint motion.
[0033] Joint velocity is the first derivative of joint position with respect to time, reflecting the instantaneous speed and direction of joint movement. The feedforward base torque is a torque component calculated by the rigid body dynamics layer based on the desired acceleration, used to provide the dominant driving torque required for the robot's main motion. The friction compensation torque is a torque component calculated by the friction compensation layer based on real-time velocity, used to compensate for nonlinear frictional resistance during joint movement. The residual compensation torque is a torque component predicted by the residual compensation module based on the historical motion state time series, used to compensate for complex, unmodeled dynamics not covered by the physics analysis module.
[0034] It should also be noted that the formula for calculating torque in the physical analytical model of this embodiment is as follows:
[0035] in, It is the calculated physical torque. These represent the robot's joint position, velocity, and acceleration, respectively; RNEA represents the recursive Newton-Euler rigid body dynamics algorithm based on spatial vector algebra. The set of rigid body inertial parameters to be identified includes the link mass, center of mass, and inertia tensor. This represents a smooth friction model that incorporates Coulomb, viscosity, and Stribeck effects. Let be the set of friction coefficients to be identified.
[0036] The residual compensation model in this embodiment is designed for complex, unmodeled dynamics where the physical mechanisms are difficult to describe precisely, such as the viscoelastic deformation of joint links and the hysteresis effect of gear backlash. This embodiment introduces a temporal convolutional network as the residual compensation model. To capture historically dependent nonlinear features, the model uses an upward sliding time window. The time-series state matrix within As input, the specific formula is:
[0037] The network outputs the residual moment compensation value at the current moment through the temporal receptive field provided by its causal dilated convolution. The specific calculation formula is as follows:
[0038] in, The forward mapping function represents the residual network. This is the set of weight parameters for the deep network to be optimized.
[0039] Understandably, in this embodiment, the desired joint data is directed to the rigid body dynamics layer, friction compensation layer, and residual compensation module according to different physical properties. Each layer independently calculates the torque components of its corresponding level based on its own input variables and parameters, and then linearly superimposes them into a comprehensive control torque. This ensures that the rigid body inertial torque, friction torque, and residual compensation torque do not interfere with each other during the calculation process and have a clear division of labor. Each module only needs to focus on the specific dynamic subspace it is responsible for, thereby significantly reducing the coupling between modules and improving the computational efficiency and stability of the hybrid dynamics model.
[0040] Step S30: Control the robot based on the desired trajectory data, the current trajectory data, and the comprehensive control torque.
[0041] It is understood that in the process of generating control commands, this embodiment simultaneously adopts the comprehensive control torque calculated by the hybrid power dynamics model as a feedforward component, as well as the feedback adjustment component driven by the deviation between the desired trajectory and the current trajectory. This allows the feedforward part to undertake most of the deterministic dynamic compensation tasks, while the feedback part only needs to handle residual errors and external disturbances. This significantly reduces the dependence on high-gain feedback while ensuring system stability.
[0042] In one feasible implementation, the desired trajectory data includes the desired position data of the robot. The specific implementation of controlling the robot based on the desired trajectory data, the current trajectory data, and the comprehensive control torque may also be: Calculate the trajectory difference between the desired trajectory data and the current trajectory data; Based on the trajectory difference, the control feedback torque of the robot during control is calculated; The target control torque is obtained by adding the comprehensive control torque and the control feedback torque. The robot is controlled based on the target control torque.
[0043] It should be noted that the desired position data refers to the component of the desired trajectory data in the position dimension, specifically the desired angle of each joint or the desired pose of the end effector. The trajectory difference is the difference between the desired trajectory data and the current trajectory data at the corresponding state variables at the same moment, used to quantify the current tracking deviation of the control system. The control feedback torque is the torque adjustment amount calculated based on the trajectory difference using a preset feedback control law, used to suppress deviations and external disturbances. The target control torque is the final joint drive command obtained by superimposing the comprehensive control torque and the control feedback torque, directly acting on the robot servo system to drive its movement. This embodiment ultimately outputs the target control torque driving each joint of the robot. The calculation formula is:
[0044] in, To comprehensively control the torque, To control the feedback torque.
[0045] It is understood that this implementation independently calculates the control feedback torque after obtaining the trajectory difference, and superimposes this feedback quantity with the comprehensive control torque that already includes the hierarchical feedforward component to form the target control torque. This allows the comprehensive control torque to eliminate deterministic errors caused by known dynamic characteristics and identified but unmodeled dynamics, while the control feedback torque suppresses residual deviations and external random disturbances, effectively reducing steady-state tracking errors and enhancing the accuracy of the control system for model control.
[0046] Furthermore, the experimental results of the decoupling framework in this embodiment and the conventional joint optimization framework are compared in Table 1 below: Table 1 Comparison between decoupling frameworks and joint optimization frameworks
[0047] Here, the Frobenius norm is used to measure the error in physical parameter identification, that is, the degree of difference between the identified inertial parameter matrix and the true value. As shown in Table 1, compared with the physical parameter distortion caused by end-to-end joint optimization, the decoupling framework of this embodiment effectively reduces the relative error of link 1 to link 3, strictly constraining the error of physical parameters within ±3.5% of the true physical feasible region. Moreover, this embodiment also significantly reduces the Frobenius norm of link 1 to link 3, which proves that this application provides a high-fidelity dynamic model for the underlying hierarchical control while ensuring physical consistency.
[0048] Furthermore, when executing a Cartesian space end-effector circular trajectory involving strong multi-joint coupling and frequent velocity reversals, the traditional baseline controller exhibited significant contour distortion and a steady-state Z-axis sag of nearly 10 mm. However, the hierarchical feedforward controller deployed in this application, through pre-compensation for frictional hysteresis and unmodeled dynamics, maintained a reference height of 300 mm for the robot's end effector. Experiments demonstrate that this application avoids the dependence of the lower-level control on high-gain PD (Proportional-Derivative) feedback, achieving high-precision tracking. A comparison of Cartesian space circular trajectory tracking errors can be found in [reference needed]. Figure 3 .
[0049] In summary, this embodiment acquires the robot's desired trajectory data and current trajectory data. The desired trajectory data includes desired joint data. The desired joint data is input into a hybrid dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels. The hybrid dynamics model includes a physical analysis module and a residual compensation module. The physical analysis module is constructed based on preset physical parameters. The hybrid dynamics model is obtained by cyclically and alternately training the physical analysis module and the residual compensation module based on a preset identification dataset. The robot is controlled based on the desired trajectory data, the current trajectory data, and the comprehensive control torque.
[0050] Compared to current methods where errors that should be explained by the rigid body analytical model are corrected by the neural network model during joint training of hybrid dynamics models, leading to decreased generalization ability and impacting the overall control performance and stability of the system, this embodiment obtains a hybrid dynamics model by alternately training the physical analysis module and the residual compensation module. This improves the model's generalization ability and, consequently, the overall control performance and stability of the system. Specifically, the hybrid dynamics model in this embodiment includes a physical analysis module and a residual compensation module. Furthermore, this embodiment decouples the training processes of the physical analysis module and the residual compensation module. By alternately training the physical analysis module and the residual compensation module, errors that should be explained by the rigid body analytical model are corrected by the neural network model during training, thus improving the generalization ability of the trained hybrid dynamics model. The comprehensive control torque obtained from the hybrid dynamics model is used to control the robot, thereby improving the overall control performance and stability of the system.
[0051] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 4 Before step S20, the robot hierarchical control method further includes steps S01 to S04: Step S01: Obtain the identification dataset and preset physical parameters, wherein the identification dataset includes joint data during robot operation and the actual joint torques corresponding to the joint data; It should be noted that joint data is a sequence of measured values for the position, velocity, and other motion state variables of each joint during actual robot operation, used as input features for the model. Actual joint torque is the actual driving torque value of the robot joints under corresponding motion states, measured by torque sensors or calculated using a current loop, used as a benchmark label for supervised model training.
[0052] Step S02: Based on the physical parameters, construct the physical analysis module, and based on the physical analysis module, construct the residual compensation module; Understandably, this embodiment constructs a physical analysis module that includes rigid body dynamics equations and friction mechanism equations. Then, using the output dimension and input structure of this physical analysis module as a reference, a residual compensation module using a temporal convolutional network is constructed. The input of the residual compensation module is set to a historical state sequence within a time window, including joint positions and velocities. The output dimension is consistent with the torque output dimension of the physical analysis module. Thus, a complete hybrid dynamics model framework in parallel with the physical analysis module and the residual compensation module is established in the offline identification stage. The residual compensation module compensates for the residual dynamics that the physical analysis module fails to cover.
[0053] Furthermore, in an optional implementation, the residual compensation module can also take real-time motion state including joint position, velocity and acceleration as input, and compensate for residual dynamics that the physics analysis module fails to cover more accurately by using information from multiple parameters.
[0054] Step S03: Based on the identification dataset, the physical analysis module and the residual compensation module are trained alternately. During the training of the physical analysis module, the weight parameters of the residual compensation module are frozen, and during the training of the residual compensation module, the physical parameters of the physical analysis module are frozen. It should be noted that alternating training is an iterative training strategy that breaks down the overall optimization problem into two independent subproblems and executes them repeatedly. In each round, only the parameters of one module are updated while the parameters of the other module remain unchanged. Freezing is an operation that stops the gradient backpropagation of a certain module during training and keeps its current parameter values from being updated. The weight parameters are the set of all learnable connection weights and biases of the temporal convolutional network in the residual compensation module, and their values are iteratively optimized through the training process.
[0055] Understandably, freezing the weight parameters of the residual compensation module during the training of the physics analysis module and freezing the physical parameters of the physics analysis module during the training of the residual compensation module ensures that only the parameters of one module participate in the optimization in each iteration, while the other module maintains a fixed output. This avoids the problem of physical parameter distortion caused by the neural network absorbing the physical dominant dynamics due to its strong fitting ability during joint training. This ensures the physical consistency of the physics analysis module and the learning purity of the residual compensation module for the pure residual signal, effectively improving the generalization ability and parameter identification accuracy of the overall model.
[0056] In one feasible implementation, the specific implementation of alternating training of the physical analysis module and the residual compensation module based on the identification dataset can also be: The joint data is input into the residual compensation module to obtain the joint residual torque; Based on the joint data, the joint residual torque, and the actual joint torque, the physical parameters of the physical analysis module are updated to obtain the updated physical analysis module; The joint data is input into the physical analysis module to obtain the new joint basic torque corresponding to the updated physical analysis module; Based on the joint data, the basic joint torque, and the actual joint torque, the weight parameters of the residual compensation module are updated to obtain the updated residual compensation module.
[0057] It should be noted that the joint residual torque is the torque component predicted and output by the residual compensation module based on joint data, used to characterize complex unmodeled dynamic effects that the physics analysis module cannot accurately describe. The joint basic torque is the sum of rigid body torque and friction torque calculated and output by the physics analysis module based on acceleration data and joint velocity, used to characterize deterministic dynamic torques that the physical model can reasonably explain.
[0058] Understandably, in this implementation, when updating the physics analysis module, joint data is first input to the residual compensation module to obtain joint residual torques and deducted from the true joint torques. This removes the dynamics already explained by the residual compensation module from the update target of the physics analysis module, thus preventing the physics analysis module from absorbing signal components that should be fitted by the neural network. Simultaneously, when updating the residual compensation module later, joint data is first input to the updated physics analysis module to obtain new joint base torques and deducted from the true joint torques. This also removes the deterministic dynamics already explained by the physics analysis module from the update target of the residual compensation module. This ensures that both modules purify signals based on the other's current output during their respective update phases. Consequently, during the alternating iteration process, physical parameters gradually approach the true physical values, and the residual module only fits residual components that the physical model cannot explain. This effectively suppresses physical parameter distortion and improves the overall recognition accuracy and generalization ability of the model.
[0059] In one feasible implementation, the specific implementation of updating the physical parameters of the physical analysis module based on the joint data, the joint residual torque, and the actual joint torque to obtain the updated physical analysis module can also be: Freeze the weight parameters of the residual compensation module, input the joint data into the physical analysis module, and obtain the joint basic torque corresponding to the unupdated physical analysis module; The difference between the actual joint torque and the residual joint torque is calculated to obtain the target joint basic torque; Based on the joint base torque, the target joint base torque, and the preset physical analysis loss function, the physical analysis loss value of the physical analysis module is calculated; Based on the physical analysis loss value, the physical parameters of the physical analysis module are updated, and the weight parameters are unfrozen to obtain the updated physical analysis module.
[0060] It should be noted that the target joint base torque is the difference between the actual joint torque and the joint residual torque, used as the purified target signal that the physics analysis module expects to fit in this update round. The physics analysis loss value is a scalar that measures the degree of deviation between the joint base torque output by the physics analysis module and the target joint base torque. It is calculated using a preset physics analysis loss function and is used to guide the gradient update direction of the physical parameters.
[0061] Understandably, this implementation freezes the weight parameters of the residual compensation module when updating the physics analysis module, and uses the difference between the actual joint torque and the joint residual torque as the fitting target of the physics analysis module. This ensures that the gradient update of the physics analysis module is based entirely on the purified signal with the residual compensation component removed, thereby preventing the strong fitting ability of the residual compensation module from interfering with the update direction of the physical parameters during backpropagation. This ensures that the physical parameters of the physics analysis module always converge in a direction that conforms to the real physical laws, maintaining the physical consistency of parameter identification.
[0062] In one feasible implementation, the specific implementation of updating the weight parameters of the residual compensation module based on the joint data, the basic joint torque, and the actual joint torque to obtain the updated residual compensation module can also be: Freeze the physical parameters of the physical analysis module, calculate the difference between the actual joint torque and the new joint base torque, and obtain the target joint residual torque; Based on the joint residual torque, the target joint residual torque, and the preset residual compensation loss function, the residual compensation loss value of the residual compensation module is calculated; Based on the residual compensation loss value, the weight parameters of the residual compensation module are updated, and the freezing of the physical parameters is lifted to obtain the updated residual compensation module.
[0063] It should be noted that the target joint residual torque is the difference between the actual joint torque and the new joint base torque, which is used as the purified target signal that the residual compensation module expects to fit in this update round.
[0064] The residual compensation loss value is a scalar that measures the degree of deviation between the joint residual torque output by the residual compensation module and the target joint residual torque. It is calculated using a preset residual compensation loss function and is used to guide the gradient update direction of the weight parameters.
[0065] Understandably, this implementation freezes the physical parameters of the physical analysis module when updating the residual compensation module, and uses the difference between the real joint torque and the new joint base torque as the fitting target of the residual compensation module. This makes the gradient update of the residual compensation module entirely based on the purified residual signal stripped of physical deterministic components, thereby preventing the residual compensation module from back-penetrating into the direction of physical parameter update during the training process. At the same time, it forces it to only learn residual dynamics that the physical model cannot explain, thus achieving decoupling of the training processes of the two modules, effectively preventing the neural network from interfering with the physical dominant dynamics, and ultimately ensuring the physical consistency of physical parameters and the accurate fitting of the residual compensation module to unmodeled dynamics.
[0066] Step S04: Determine whether the physical analysis module and the residual compensation module have reached the preset training termination condition. If not, return to the step of alternating training of the physical analysis module and the residual compensation module based on the identification dataset until the physical analysis module and the residual compensation module have reached the training termination condition, and obtain the hybrid dynamics model.
[0067] It should be noted that the training termination condition is a pre-defined set of criteria used to determine whether the alternating training cycle should end. These criteria include specific conditions such as the total prediction error of the validation set being lower than a preset threshold, the number of iterations reaching the maximum limit, or the loss value no longer decreasing significantly in multiple consecutive training rounds.
[0068] It is understood that this embodiment performs a termination condition judgment after each round of alternating training, and only continues iteration when the condition is not met and terminates output when the condition is met. This ensures that the entire offline identification process will not lead to underfitting of the model due to insufficient iteration, nor will it lead to overfitting of the model due to overtraining. This ensures that the final output hybrid dynamics model achieves a balance between identification accuracy and generalization performance, while effectively controlling the computational cost of the training process.
[0069] In one feasible implementation, the specific implementation of determining whether the physical analysis module and the residual compensation module have reached the preset training termination condition may also be: Every preset training round, the average physical analysis loss value of the physical analysis module and the average residual compensation loss value of the residual compensation module are calculated. The average physical analysis loss value and the average residual compensation loss value are added together to obtain the average total prediction loss for this time. Obtain the average total predicted loss calculated in the previous calculation, and calculate the average loss decrease value between the average total predicted loss in the previous calculation and the average total predicted loss in the current calculation. Determine whether the average loss decrease value is lower than a preset loss decrease threshold. If it is lower, then determine that the physical parsing module and the residual compensation module have reached the training termination condition.
[0070] It should be noted that the preset training rounds are pre-defined fixed intervals for alternating training iterations, used to periodically trigger the calculation and judgment of termination conditions. The average physics analysis loss value is the arithmetic mean of the physics analysis module's loss values across all rounds on the identification dataset within the current monitoring period, used to characterize the overall fitting deviation of the physics analysis module within that period. The average residual compensation loss value is the arithmetic mean of the residual compensation loss values across all rounds on the identification dataset within the current monitoring period, used to characterize the overall fitting deviation of the residual compensation module within that period.
[0071] The average total predicted loss is the sum of the average physical analysis loss and the average residual compensation loss within the same monitoring period, used to characterize the overall average prediction error level of the hybrid power model. The previous average total predicted loss is the average total predicted loss calculated in the previous monitoring period, used as a benchmark for comparing the rate of decrease in total loss in the current period. The average loss decrease is the difference between the previous and current average total predicted loss, used to quantify the convergence progress of the hybrid power model between adjacent monitoring periods. The preset loss decrease threshold is a pre-defined lower limit for the average loss decrease; when the average loss decrease falls below this threshold, the model is considered to have entered the convergence saturation region, satisfying the training termination condition.
[0072] It is understandable that this implementation calculates the sum of the average losses of the two modules every preset training rounds, and uses whether the average loss decrease between adjacent monitoring periods is lower than a preset threshold as the termination criterion. This makes the termination condition no longer dependent on the accidental fluctuations of a single iteration or the illusion of a local optimum of a single module, but on the global convergence trend of the two modules in multiple rounds for comprehensive judgment. This effectively filters out random noise and oscillation interference during the training process, while ensuring that the model stops iterating only when the overall prediction accuracy reaches the saturation range. This avoids underfitting or overfitting problems caused by premature or late termination, and ultimately improves the accuracy of training termination judgment in the offline identification stage.
[0073] In one embodiment, the step of alternately training the physical analysis module and the residual compensation module based on the identification dataset further includes: Based on the joint data of the current batch, the joint data is input into the currently unupdated physical analysis module and the currently unupdated residual compensation module respectively, and the current joint basic torque output by the current physical analysis module and the current joint residual torque output by the current residual compensation module are obtained.
[0074] The difference between the actual joint torque and the current joint base torque is calculated as the current residual label. At the same time, the difference between the actual joint torque and the current joint residual torque is calculated as the current physical label. The first dynamic deviation between the output of the current residual compensation module and the current residual label, and the second dynamic deviation between the output of the current physical analysis module and the current physical label are calculated respectively.
[0075] Determine whether the first dynamic deviation is greater than the preset first deviation tolerance threshold, and determine whether the second dynamic deviation is greater than the preset second deviation tolerance threshold. When the first dynamic deviation is greater than the first deviation tolerance threshold, use the weighted moving average of the current residual label and the current joint residual torque to smooth the current joint residual torque, and use the corrected joint residual torque as the joint residual torque used by the physics analysis module in this update round. When the second dynamic deviation is greater than the second deviation tolerance threshold, the current joint base torque is smoothly corrected by the weighted moving average of the current physical label and the current joint base torque, and the corrected joint base torque is used as the joint base torque used by the residual compensation module in this update round. When neither of them exceeds the corresponding tolerance threshold, the current joint residual torque and the current joint basic torque are used directly for subsequent updates.
[0076] The physical parameters of the physical analysis module are updated based on the corrected or directly adopted joint residual torque, and the weight parameters of the residual compensation module are updated based on the corrected or directly adopted joint basic torque. After the end of this round of alternating training, the average loss value of the two modules is recorded as a reference benchmark for the next round of verification.
[0077] It should be noted that the current joint base torque is the sum of the rigid body torque and friction torque calculated and output by the currently unupdated physics analysis module based on the joint data. The current joint residual torque is the residual compensation torque calculated and output by the currently unupdated residual compensation module based on the joint data. The current residual label is the difference between the actual joint torque and the current joint base torque, used as a reference benchmark for evaluating the current output purity of the residual compensation module. The current physics label is the difference between the actual joint torque and the current joint residual torque, used as a reference benchmark for evaluating the current output purity of the physics analysis module.
[0078] The first dynamic bias is a measure of the difference between the current residual compensation module output and the current residual label, used to characterize the degree of deviation between the current predicted value of the residual compensation module and the explained components of the physical model.
[0079] The second dynamic bias is a measure of the difference between the current physical analysis module output and the current physical label, used to characterize the degree of deviation between the current predicted value of the physical analysis module and the compensated components of the residual model.
[0080] The preset first deviation tolerance threshold is a pre-set upper limit for dynamic deviation, used to determine whether the current output of the residual compensation module is reliable as a purification signal. The preset second deviation tolerance threshold is a pre-set upper limit for dynamic deviation, used to determine whether the current output of the physical analysis module is reliable as a purification signal.
[0081] Weighted moving average is a smoothing correction method that calculates a weighted average of the current output value and the current label value using preset weighting coefficients. It is used to suppress large fluctuations in the signal caused by the non-convergence of a single module. The corrected joint residual torque is the output value of the residual compensation module used by the physics analysis module when updating, after being smoothed by the weighted moving average. The corrected joint base torque is the output value of the physics analysis module used by the residual compensation module when updating, after being smoothed by the weighted moving average.
[0082] Understandably, in this embodiment, before each round of alternating training, the dynamic deviation between the outputs of the two modules and their respective purification labels is calculated and compared with the tolerance threshold. Weighted moving average is only used for smoothing correction when the deviation is too large. This ensures that if either module outputs an unreliable purification signal due to non-convergence or gradient oscillation in the early stages of training, the correction value can buffer its extreme deviation and prevent it from being directly introduced into the update target of the other module. This avoids mutual contamination of physical parameters and weight parameters caused by unreliable purification signals. Furthermore, this correction is triggered only as needed when the deviation exceeds the limit, without changing the independent optimization paths of the two modules under normal convergence. Therefore, while maintaining the physical consistency of the original decoupled identification architecture, it further enhances the robustness of the alternating training process in the early stages of non-convergence, enabling the overall identification process to converge stably even when facing different initial parameter qualities or different excitation trajectory conditions.
[0083] In one embodiment, the steps of smoothing the current joint residual moment by using a weighted moving average of the current residual label and the current joint residual moment, and using the corrected joint residual moment as the joint residual moment used by the physics parsing module in the current update round, and the steps of smoothing the current joint base moment by using a weighted moving average of the current physics label and the current joint base moment, and using the corrected joint base moment as the joint base moment used by the residual compensation module in the current update round, further include: Obtain the historical sequence of the first dynamic deviation and the historical sequence of the second dynamic deviation in the current batch, and calculate the deviation gradient of the first dynamic deviation relative to its historical mean at the current time, and the deviation gradient of the second dynamic deviation relative to its historical mean at the current time.
[0084] Based on the deviation gradient of the first dynamic deviation, the gradient change rate of the first dynamic deviation is calculated. When the first dynamic deviation is greater than the preset first deviation tolerance threshold and the gradient change rate of the first dynamic deviation shows a continuous increasing trend, it is determined that the current joint residual torque is in a divergent state. At this time, the smoothing weight coefficient in the weighted moving average is set to the first high smoothing weight value. When the first dynamic deviation is greater than the preset first deviation tolerance threshold but the gradient change rate shows a decreasing trend, it is determined that the current joint residual torque is in a convergent transition state. The smoothing weight coefficient is set to the first low smoothing weight value, which is lower than the first high smoothing weight value.
[0085] Based on the deviation gradient of the second dynamic deviation, the gradient change rate of the second dynamic deviation is calculated. When the second dynamic deviation is greater than the preset second deviation tolerance threshold and the gradient change rate of the second dynamic deviation shows a continuous increasing trend, it is determined that the current joint base torque is in a divergent state. At this time, the smoothing weight coefficient in the weighted moving average is set to the second high smoothing weight value. When the second dynamic deviation is greater than the preset second deviation tolerance threshold but the gradient change rate shows a decreasing trend, it is determined that the current joint base torque is in a convergent transition state. The smoothing weight coefficient is set to the second low smoothing weight value, which is lower than the second high smoothing weight value.
[0086] Based on the set smoothing weight coefficients, the weighted moving average of the current joint residual torque and the current residual label is calculated as the corrected joint residual torque, and the weighted moving average of the current joint base torque and the current physical label is calculated as the corrected joint base torque, and then the subsequent alternating update process is executed.
[0087] It should be noted that the historical sequence is a set of values for the same monitoring indicator from several rounds of alternating training prior to the current moment, used to provide the dynamic evolution background of the indicator. The deviation gradient is the instantaneous change direction and magnitude of the first or second dynamic deviation relative to its historical mean at the current moment, used to characterize the strength of the deviation signal's trend away from its historical average level. The gradient change rate is the rate of change of the deviation gradient at the current moment relative to the previous moment, used to determine whether the deviation signal is in an accelerating divergence, decelerating convergence, or steady-state fluctuation state.
[0088] The divergent state is the dynamic trend state of the deviation signal when the deviation gradient and the rate of change of gradient are in the same direction and both their absolute values continue to increase, indicating that the deviation between the current module output and its corresponding label is still worsening. The convergent transition state is the dynamic trend state of the deviation signal when the deviation gradient and the rate of change of gradient are in opposite directions or the absolute value of the rate of change of gradient is continuously decreasing, indicating that although the current module output still deviates from the label, the degree of deviation is improving. The smoothing weight coefficient is the weight ratio assigned to the current output value (joint residual torque or joint base torque) in the weighted moving average calculation. The larger the coefficient, the more the corrected value retains the original output characteristics; the smaller the coefficient, the closer the corrected value is to the label value.
[0089] The first high smoothing weight value is a larger smoothing weight coefficient used to suppress unreliable signal interference when the residual compensation module output is in a divergent state. The first low smoothing weight value is a smaller smoothing weight coefficient used to avoid overcorrection when the residual compensation module output is in a convergent transition state. The second high smoothing weight value is a larger smoothing weight coefficient used to suppress unreliable signal interference when the physical analysis module output is in a divergent state. The second low smoothing weight value is a smaller smoothing weight coefficient used to avoid overcorrection when the physical analysis module output is in a convergent transition state.
[0090] It is understandable that, in determining the smoothing weight coefficients of the weighted moving average, this embodiment not only relies on the static comparison between the absolute magnitude of the deviation at the current moment and the tolerance threshold, but also introduces the deviation gradient and gradient change rate to determine the dynamic evolution trend of the deviation. This allows for proactive high-intensity correction when the output deviation of the same module continues to increase in multiple consecutive rounds, while low-intensity correction is used when the deviation exceeds the standard but is already in the process of improvement to avoid excessive interference with the normal convergence process. This effectively avoids the problems of insufficient correction strength of fixed smoothing weights in the face of divergence, which leads to continuous pollution of the purified signal, and excessive correction strength in the face of convergence, which leads to slow convergence speed. This enhances the convergence stability and efficiency of the alternating training process at different convergence stages.
[0091] In summary, this embodiment acquires an identification dataset containing paired samples and preset physical parameters, constructs a physical analysis module based on these physical parameters, and a residual compensation module using these parameters as a reference. It employs a training strategy that alternately freezes the other module and uses the purified signal after deducting the other's output as its respective update target. This completely decouples the update processes of physical parameters and weight parameters, ensuring that physical parameters converge only in directions consistent with real physical laws, while the neural network can only fit residual components that the physical model cannot explain. Furthermore, this embodiment uses whether the average predicted total loss decrease over adjacent monitoring periods falls below a threshold as the termination criterion. This ensures that the training termination time is determined based on the overall convergence trend of the two modules, unaffected by single-round fluctuations. Therefore, it solves the problem of physical parameter distortion throughout the offline identification process, guarantees the physical consistency of the physical analysis module and the learning purity of the residual compensation module, and improves the stability of system control.
[0092] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the robot hierarchical control method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0093] This application provides a robot hierarchical control device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the robot hierarchical control method in the above embodiment 1.
[0094] The following is for reference. Figure 5 The diagram illustrates a structural schematic suitable for implementing the robot hierarchical control device in the embodiments of this application. The robot hierarchical control device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, tablets, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The illustrated robot hierarchical control device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0095] like Figure 5As shown, the robot hierarchical control device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the robot hierarchical control device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the robot hierarchical control device to communicate wirelessly or wiredly with other devices to exchange data. Although robot hierarchical control devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0096] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0097] The robot hierarchical control device provided in this application, employing the robot hierarchical control method described in the above embodiments, can solve the technical problem of poor generalization ability of current methods, which affects the overall control performance and stability of the system. Compared with the prior art, the beneficial effects of the robot hierarchical control device provided in this application are the same as those of the robot hierarchical control method provided in the above embodiments, and other technical features in this robot hierarchical control device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0098] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0099] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0100] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the robot hierarchical control method in the above embodiments.
[0101] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0102] The aforementioned computer-readable storage medium may be included in the robot hierarchical control device; or it may exist independently and not be assembled into the robot hierarchical control device.
[0103] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the robot hierarchical control device, cause the robot hierarchical control device to perform the aforementioned robot hierarchical control method.
[0104] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0106] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0107] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described robot hierarchical control method. This solves the technical problem of poor generalization ability in current methods, which affects the overall control performance and stability of the system. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the robot hierarchical control method provided in the above embodiments, and will not be repeated here.
[0108] All user-related data involved in this application was obtained with the user's permission or consent, as per [reference]. Figure 6 In other words, when this application is applied to a specific product or technology, user permission is required to acquire and process the relevant data, and the processing of the relevant data must comply with the relevant laws, regulations and regulatory standards of the relevant countries and regions.
[0109] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A hierarchical control method for a robot, characterized in that, The method includes: Acquire the robot's desired trajectory data and current trajectory data, wherein the desired trajectory data includes desired joint data; The desired joint data is input into the hybrid power dynamics model to obtain a comprehensive control torque composed of torques at multiple different levels. The hybrid power dynamics model includes a physical analysis module and a residual compensation module. The physical analysis module is constructed based on preset physical parameters. The hybrid power dynamics model is obtained by cyclically and alternately training the physical analysis module and the residual compensation module based on a preset identification dataset. The robot is controlled based on the desired trajectory data, the current trajectory data, and the combined control torque.
2. The method as described in claim 1, characterized in that, Before the step of inputting the desired joint data into the hybrid power dynamics model to obtain the comprehensive control torque composed of multiple different levels of torque, the method further includes: The identification dataset and preset physical parameters are obtained, wherein the identification dataset includes joint data during robot operation and the actual joint torques corresponding to the joint data; Based on the physical parameters, the physical analysis module is constructed, and based on the physical analysis module, the residual compensation module is constructed. Based on the identification dataset, the physical analysis module and the residual compensation module are trained alternately. During the training of the physical analysis module, the weight parameters of the residual compensation module are frozen, and during the training of the residual compensation module, the physical parameters of the physical analysis module are frozen. Determine whether the physical analysis module and the residual compensation module have reached the preset training termination condition. If not, return to the step of alternating training of the physical analysis module and the residual compensation module based on the identification dataset until the physical analysis module and the residual compensation module have reached the training termination condition, and obtain the hybrid dynamics model.
3. The method as described in claim 2, characterized in that, The step of alternately training the physical analysis module and the residual compensation module based on the identification dataset includes: The joint data is input into the residual compensation module to obtain the joint residual torque; Based on the joint data, the joint residual torque, and the actual joint torque, the physical parameters of the physical analysis module are updated to obtain the updated physical analysis module; The joint data is input into the physical analysis module to obtain the new joint basic torque corresponding to the updated physical analysis module; Based on the joint data, the basic joint torque, and the actual joint torque, the weight parameters of the residual compensation module are updated to obtain the updated residual compensation module.
4. The method as described in claim 3, characterized in that, The step of updating the physical parameters of the physical analysis module based on the joint data, the joint residual torque, and the actual joint torque to obtain the updated physical analysis module includes: Freeze the weight parameters of the residual compensation module, input the joint data into the physical analysis module, and obtain the joint basic torque corresponding to the unupdated physical analysis module; The difference between the actual joint torque and the residual joint torque is calculated to obtain the target joint basic torque; Based on the joint base torque, the target joint base torque, and the preset physical analysis loss function, the physical analysis loss value of the physical analysis module is calculated; Based on the physical analysis loss value, the physical parameters of the physical analysis module are updated, and the weight parameters are unfrozen to obtain the updated physical analysis module.
5. The method as described in claim 3, characterized in that, The step of updating the weight parameters of the residual compensation module based on the joint data, the basic joint torque, and the actual joint torque to obtain the updated residual compensation module includes: Freeze the physical parameters of the physical analysis module, calculate the difference between the actual joint torque and the new joint base torque, and obtain the target joint residual torque; Based on the joint residual torque, the target joint residual torque, and the preset residual compensation loss function, the residual compensation loss value of the residual compensation module is calculated; Based on the residual compensation loss value, the weight parameters of the residual compensation module are updated, and the freezing of the physical parameters is lifted to obtain the updated residual compensation module.
6. The method as described in claim 2, characterized in that, The step of determining whether the physical analysis module and the residual compensation module have reached the preset training termination condition includes: Every preset training round, the average physical analysis loss value of the physical analysis module and the average residual compensation loss value of the residual compensation module are calculated. The average physical analysis loss value and the average residual compensation loss value are added together to obtain the average total prediction loss for this time. Obtain the average total predicted loss calculated in the previous calculation, and calculate the average loss decrease value between the average total predicted loss in the previous calculation and the average total predicted loss in the current calculation. Determine whether the average loss decrease value is lower than a preset loss decrease threshold. If it is lower, then determine that the physical parsing module and the residual compensation module have reached the training termination condition.
7. The method as described in claim 1, characterized in that, The physical analysis module includes a rigid body dynamics layer and a friction compensation layer. The physical parameters include rigid body inertia parameters and friction coefficient parameters. The joint data includes joint position and joint velocity. The step of inputting the desired joint data into the hybrid dynamics model to obtain the comprehensive control torque composed of torques at multiple different levels includes: The acceleration data in the desired trajectory is input into the rigid body dynamics layer, and the feedforward basic torque of the robot is determined based on the acceleration data and the rigid body inertial parameters. The joint velocity is input into the friction compensation layer, and the friction cancellation torque of the robot is determined based on the joint velocity and the friction coefficient parameter. The joint data is input into the residual compensation module to determine the residual compensation torque of the robot; The feedforward base torque, the friction cancellation torque, and the residual compensation torque are added together to obtain the comprehensive control torque.
8. The method as described in claim 1, characterized in that, The desired trajectory data includes the robot's desired position data, and the step of controlling the robot based on the desired trajectory data, the current trajectory data, and the comprehensive control torque includes: Calculate the trajectory difference between the desired trajectory data and the current trajectory data; Based on the trajectory difference, the control feedback torque of the robot during control is calculated; The target control torque is obtained by adding the comprehensive control torque and the control feedback torque. The robot is controlled based on the target control torque.
9. A robot layered control device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the robot hierarchical control method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the robot hierarchical control method as described in any one of claims 1 to 8.