A method for modeling dynamics of a logistics robot arm

CN123013319APending Publication Date: 2026-10-30JIANGXI LONGEN INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611118292.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本发明的目的是提供一种物流机械臂的动力学建模方法,以解决现有技术中物流机械臂动力学模型在负载频繁突变工况下精度不足、泛化能力差的问题

Benefits of technology

[0059]本发明在物流场景建模精度取得突破性提升,通过实验发现,仅在数据采集时覆盖变负载工况或仅在模型中添加物理约束均无法有效提升负载切换暂态的精度,本发明的核心贡献在于发现了负载切换暂态数据采集策略与负载突变正则项之间、分拣动作阶段划分与阶段依赖的残差加权之间的协同增效作用,通过将它们系统性耦合,模型能够“理解”负载突变过渡动力学和各阶段主导物理效应。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013319A_ABST
    Figure CN123013319A_ABST
Patent Text Reader

Abstract

The application discloses a kind of logistics mechanical arm dynamics modeling method, it is related to robot dynamics modeling technical field, the method includes: acquisition logistics mechanical arm under typical sorting working condition Joint state and measured torque, focus on acquisition load switching transient data, construct logistics specialization dataset;With Lagrange dynamics as the physical prior of double-layer physical information neural network, the first layer is with joint position and load category coding as input, identifies inertia matrix and gravity term, the second layer fits friction force term containing friction;Design joint loss function, including data fitting loss and physical residual loss after stage perception weighted, and load mutation regular term and energy consistency constraint;Obtain dynamics model by joint training, and deploy for real-time torque prediction and compensation.The application solves the problem of insufficient accuracy of traditional model under frequent load mutation working condition, improves the dynamic modeling accuracy and generalization ability under variable load condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of dynamics modeling technology, and in particular to a dynamics modeling method for a logistics robotic arm. Background Technology

[0002] The robotic arm is the core execution unit of an automated warehousing system, and the accuracy of its dynamic model directly determines sorting efficiency, positioning accuracy, and operational stability. A high-fidelity dynamic model is a prerequisite for achieving high-performance trajectory tracking control and force-controlled compliant operation. However, logistics sorting scenarios have the following typical characteristics, posing a severe challenge to traditional dynamic modeling methods: the load changes abruptly from tens of grams to tens of kilograms within seconds, causing instantaneous mismatch in rigid body models with fixed parameters; unmodeled dynamics such as link flexibility and nonlinear joint friction triggered by high-speed start-stop are strongly coupled with load changes, which cannot be described by rigid body models; due to cost constraints, the only available motor current and position sensors lack joint torque sensing, resulting in nonlinear errors in the conversion from current to torque; in addition, the sorting action consists of a strongly periodic sequence of "lifting-carrying-placing," with significant differences in the dominant dynamic effects at each stage, but this specialized structure has not yet been effectively utilized by existing modeling methods.

[0003] Existing dynamic modeling methods each have their shortcomings: Mechanism modeling based on the Newton-Euler method or the Lagrange method relies on precise physical parameters and complex identification experiments, and it is difficult to accurately model dynamic characteristics with unclear or overly complex mechanisms such as friction and flexibility; Pure data-driven methods have strong nonlinear fitting capabilities, but as black-box models, they may violate physical laws such as energy conservation and have poor generalization ability in sparse data regions; Physical information neural network methods provide a solution to the above problems by incorporating the residuals of dynamic equations and energy constraints into the loss function, but existing research mostly focuses on general industrial robotic arms and has not yet effectively utilized the characteristics of load changes, high-speed start-stop, and strong periodicity in logistics sorting scenarios.

[0004] To address the above problems, this invention proposes a dynamic modeling method for logistics robotic arms. Summary of the Invention

[0005] The purpose of this invention is to provide a dynamic modeling method for logistics robotic arms, so as to solve the problems of insufficient accuracy and poor generalization ability of existing dynamic models of logistics robotic arms under conditions of frequent load changes.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] A dynamic modeling method for a logistics robotic arm, comprising:

[0008] Step S1: Collect routine sorting data of the logistics robotic arm under typical sorting conditions, focusing on collecting transient load switching data within the time window before and after the load switching instant. The routine sorting data and the transient load switching data together constitute a logistics-specific dataset.

[0009] Step S2: Construct a two-layer physical information neural network with Lagrange dynamics as the physical prior; the first layer of the physical information neural network takes the concatenated vector of joint position and load category encoding as input and outputs the inertia matrix and gravity term; for load weights not encountered during training, linear interpolation is performed on two adjacent known load category encodings, and the interpolated encoding vector is used as the input of the first layer of the physical information neural network, which outputs the corresponding inertia matrix and gravity term; the second layer of the physical information neural network takes joint position and velocity as input and outputs the friction term;

[0010] Step S3: Substitute the inertia term, Coriolis force term, gravity term, and friction term into the Lagrange dynamics equations to construct a complete dynamic prediction model for the robotic arm. The dynamic prediction model takes joint position, velocity, acceleration, and load category encoding as inputs and predictive torque as output. The inertia term is formed by multiplying the inertia matrix by the acceleration. The Coriolis force term is derived from the partial derivative of the inertia matrix with respect to position.

[0011] Step S4: Design a joint loss function that integrates logistics scenario constraints, including data fitting loss, physical residual loss after stage-aware weighting, load mutation regularization term, and energy consistency constraint; the stage-aware weighting is used to apply a stage-dependent weight vector to the residual vector of the entire Lagrange dynamics equation according to the stage of the sorting action, so as to differentiate the contribution ratio of each stage and each joint residual component in the total loss; the weight vector is based on each element being 1.0, and degenerates into standard physical residual loss when all weight elements are 1; the weight vector acts outside the residual vector, does not change the structure of the Lagrange dynamics equation itself, and is only used to guide the network to prioritize reducing the joint components with larger residuals in the current stage;

[0012] Step S5: Based on the logistics-specific dataset and the joint loss function, jointly train the two-layer physical information neural network. With minimizing the joint loss function as the optimization objective, update the parameters of the first and second layer physical information neural networks synchronously through backpropagation to obtain the trained dynamic model. The data fitting loss is used to make the predicted torque approximate the measured torque; the weighted physical residual loss is used to guide the model output to approximate the Lagrange dynamic equation in the sense of weighted least squares; the load mutation regularization term is used to constrain the rate of change of the predicted torque at load switching moments; and the energy consistency constraint is used to ensure the long-term energy stability of the system.

[0013] Step S6: Deploy the trained dynamic model to the robotic arm controller. Based on the real-time joint position, velocity, acceleration and current load category encoding, calculate the feedforward compensation torque through the trained dynamic prediction model. The feedforward compensation torque is superimposed with the feedback control torque of the controller to control the movement of the robotic arm.

[0014] Furthermore, in step S1, typical sorting conditions include package lifting actions, horizontal transport actions, drop and release actions, and their combination sequences; the data collection covers at least three different weight levels of package loads, including light load, medium load, and heavy load, corresponding to sequentially increasing package weight ranges.

[0015] The conventional sorting data includes joint position, velocity, acceleration, and measured torque; the load switching transient data includes high-frequency sampled data of joint position, velocity, acceleration, and measured torque within the time window before and after the load switching instant; the logistics-specific dataset also includes load category codes and stage labels; the measured torque is obtained by converting motor current through a torque constant; since the motor torque constant is affected by factors such as temperature changes, magnetic circuit saturation, and low-speed operating conditions, the measured torque obtained by current conversion may have a certain nonlinear error with the actual torque.

[0016] It should be noted that the measured torque mentioned above is obtained by converting the motor current through a torque constant. This converted value may contain some nonlinear errors due to factors such as temperature changes, magnetic circuit saturation, and low-speed operation. This invention directly uses this converted value as a monitoring signal during training and does not introduce an additional independent torque sensor for calibration. To reduce the impact of the current-torque conversion error on the model training accuracy, this invention achieves robust learning through the following mechanism:

[0017] (1) The weighted physical residual loss imposes a physical consistency constraint on the model through the equation structure itself, thereby reducing the risk of overfitting the model to potential errors in the labels;

[0018] (2) The energy consistency constraint is based on the energy conservation relationship and provides additional physical regularization constraints to guide the model output to satisfy energy conservation, thereby further reducing the model's sensitivity to potential errors in the measured torque labels;

[0019] (3) The structured friction model of the second layer physical information neural network is equipped with a learnable low-speed compensation term to deal with torque fluctuations caused by current sampling noise near zero speed, and avoids misattributing them to inertial parameters or gravity parameters.

[0020] Unlike existing technologies that only collect steady-state or uniform sampling, this invention focuses on collecting transient high-density data within a 0.5 to 2-second time window before and after the load switching instant. The brief transient process at the moment of load switching contains rich dynamic information on parameter mutations, which is key to improving the model's generalization ability under varying load conditions. This strategy ensures that the dataset not only includes the static characteristics of different loads but also the dynamic transition characteristics of load switching.

[0021] Furthermore, in step S2, the first layer of the physical information neural network is a physical parameter identification network used to learn the habitual matrix M(q) and the gravity term G(q). The load category is encoded as a one-hot vector or a learnable embedding vector, representing the weight level of the current end load, and is concatenated with the joint position vector as the input to the first layer of the physical information neural network.

[0022] Furthermore, in step 2, to strictly guarantee the physical positive definiteness of M(q,c), the network outputs the element values ​​of a lower triangular matrix L(q,c). To prevent L(q,c) from being singular or having zero diagonal elements, which would cause the constructed M(q,c) to be only semi-positive definite and lose its physical positive definiteness, this invention performs a positive definiteness transformation on the diagonal elements of L(q,c): Let the original network output be... Its diagonal element is The lower triangular matrix actually used for construction The diagonal element is taken as or (in For a preset minimum positive value, for example (Non-diagonal elements are taken directly) The corresponding element values. Through the above positive definite transformation, the diagonal elements of the lower triangular matrix L(q,c) are strictly greater than zero, ensuring that L(q,c) is full rank. The inertia matrix is ​​then constructed as follows:

[0023]

[0024] Where q is the joint position vector, and c is the load category code. Let L(q,c) be the lower triangular matrix output by the first layer of the physical information neural network, and M(q,c) be the constructed inertia matrix. Since L(q,c) is a lower triangular matrix with strictly greater than zero diagonal elements, it must be full rank. Therefore, the constructed M(q,c) satisfies symmetric positive definiteness, which meets the mathematical requirements of a physical inertia matrix. As an alternative, variants of Cholesky decomposition or other matrix decomposition methods that can guarantee positive definiteness can also be used, and this invention does not limit this to any particular method.

[0025] According to the standard derivation of Lagrange mechanics, the Coriolis force is automatically calculated using Christofel notation from the partial derivative of the inertia matrix M(q,c) with respect to the joint position q. This ensures the physical consistency between the various parts of the model.

[0026] The second-layer physical information neural network (friction fitting network) is used to fit the friction term, which includes Coulomb friction and viscous friction. Its model is represented as follows:

[0027]

[0028] Where q is the joint position vector, which is composed of the angle values ​​of each joint of the robotic arm, and its dimension is equal to the number of degrees of freedom of the robotic arm; The joint angular velocity vector is composed of the rotational angular velocities of each joint of the robotic arm and is the first derivative of the joint position vector with respect to time. The Coulomb friction coefficient vector represents the friction component that is related to the direction of velocity but independent of the magnitude of velocity, and its direction changes abruptly when the velocity crosses zero. This is the viscous friction coefficient vector, representing the friction component that is proportional to the speed; the higher the speed, the larger this term becomes. A preset positive coefficient is used to control the steepness of the approximation and adjust the slope of the tanh function. The larger the value of α, the closer the output of the tanh function is to the step shape of the sign function. It is a hyperbolic tangent function, with α times the joint angular velocity as input, and the output value smoothly transitions between -1 and 1. It is used to approximate a non-differentiable sign function in a differentiable way, ensuring the numerical stability of the neural network during training. The residual nonlinear friction term is output by a fully connected subnetwork with joint position q and joint angular velocity q̇ as inputs, and is used to capture nonlinear friction characteristics other than Coulomb friction and viscous friction.

[0029] Furthermore, in step 3, for The improved Lagrangian dynamics equations for the degree-of-freedom robotic arm are expressed as follows:

[0030]

[0031] in: This is a joint position vector, where each element corresponds to the angle value of each joint. The joint velocity vector is The first derivative with respect to time; The joint acceleration vector is The second derivative with respect to time; The load category encoding, used to identify the weight level of the current end load, is one of the core inputs of this invention, enabling the model to adaptively adjust dynamic parameters according to load changes; It is a symmetric positive definite inertia matrix, representing the inertia of each joint and their coupling relationships, and is encoded according to the load category. Variation, meaning that different loads result in different inertia characteristics; The Coriolis force term characterizes the nonlinear force generated by velocity coupling and is encoded according to the load type. change; The gravity term characterizes the gravitational torque acting on each joint and is coded according to the load category. The load increases with the magnitude of the change; the heavier the load, the greater the torque. This is the friction term, which characterizes the frictional resistance during joint movement; The predicted torque is the driving torque of each joint, which is the final output of the model.

[0032] Furthermore, in step 4, a joint loss function that integrates logistics scenario constraints is designed, including data fitting loss, physical residual loss after stage perception weighting, load mutation regularization term and energy consistency constraint.

[0033] (a) Data Fitting Loss

[0034] The data fitting loss is used to constrain the deviation between the predicted torque and the measured torque output by the dynamic prediction model, and is expressed as the mean square error between the predicted torque and the measured torque. Transient data near the load switching moment is assigned a higher weighting coefficient than steady-state data, specifically as follows:

[0035]

[0036] in, The total number of samples in the batch. For sample index, For the first The measured torque of each sample For the first The predictive moment for each sample, Let be the weight coefficient of the i-th sample; when the sampling time of the i-th sample is within a preset time window before or after the load switching time, Take a preset value greater than 1, otherwise =1.

[0037] (ii) Physical residual loss after stage perception weighting

[0038] The physical residual loss is used to embed the Lagrange dynamics equations as physical priors into the neural network training process. The inertia matrix output by the first layer of the physical information neural network is then used. and gravity term Coriolis force terms derived from the inertia matrix And the friction term output by the second-layer physical information neural network. Substituting all terms into the left side of the Lagrange dynamics equation, we can calculate the sum of the terms on the left side of the equation and the measured torque. The deviation between them. Based on this, according to the stage of the sample, the joint components of the residual vector of the complete Lagrange dynamic equation are weighted to adjust the contribution ratio of samples at different stages and different joint residuals to the physical residual loss, thus obtaining the weighted physical residual loss:

[0039]

[0040] in, The total number of samples in the batch. For sample index; For the first Stage labels for each sample; To correspond to the stage The weight vector, whose elements correspond to... Weighted average of the deviations of each joint; The first Model predictions for the inertial, Coriolis, gravity, and friction terms for each sample; For the first The measured torque of each sample; This represents element-wise multiplication. The weight vector... The base vector has all elements set to 1.0, with each element corresponding to a weighted coefficient of the residual components of each joint of the robotic arm. During the lifting phase, the primary task is to overcome gravity, and the gravity term significantly affects multiple joints; therefore, the overall value of each element in the weight vector is greater than in other phases. The transport phase primarily involves high-speed horizontal movement, mainly affecting the high-speed motion of joints such as the upper arm and forearm; therefore, the values ​​of elements corresponding to these major joints in the transport phase weight vector are further increased. The placement phase focuses on low-speed, precise alignment, mainly involving fine-tuning and overcoming friction at the wrist and other distal joints; therefore, the values ​​of elements corresponding to these distal joints in the placement phase weight vector are further increased. The specific values ​​of the weight vector for each phase are preset based on the importance of the dynamic effects of each joint in that phase.

[0041] (iii) Load mutation regularization term

[0042] A load change regularization term is used to constrain the rate of change of the predicted torque at load switching moments, forcing the model to learn smooth and physically reasonable transition dynamics. The set of load switching moments is automatically detected by monitoring the rate of change of motor current or end-effector force sensor signals. And within this time window, the first-order time difference of the model's predicted torque is applied. Norm penalty:

[0043]

[0044] in, The preset penalty coefficient, This is a set of load switching moments. The total number of switching moments in the set. For the dynamic prediction model in The moment vector predicted at any given time. One sampling period.

[0045] (iv) Energy Consistency Constraints

[0046] Energy consistency constraints are used to constrain the conservation relationship between the rate of change of system kinetic energy and the sum of the power done by external forces and the power dissipated, ensuring the energy stability of the model under long-term predictions. It should be noted that this constraint only holds true during the period when the load category remains constant and the end effector does not come into contact with the package. Within each preset time window before and after the load switching instant, the contact force between the package and the robotic arm will input or remove energy into the system. This energy cannot be fully explained by motor torque, frictional dissipation, and gravitational work; therefore, samples from this period are not included in the calculation of energy consistency constraints. Based on this, the energy consistency constraint is defined as:

[0047]

[0048] This loss is calculated only for samples where the load category code remains constant and the sampling time is not within a preset time window before or after any load switching event; The total kinetic energy of the system, The first derivative of the system's kinetic energy with respect to time is precisely calculated using automatic differentiation techniques. For joint velocity vectors, Transpose it; This refers to the joint driving torque; This is the friction term; This is the gravity term.

[0049] (v) Total Loss Function

[0050] Total loss function The weighted sum of the above items:

[0051]

[0052] in, For data fitting loss, For weighted physical residual loss, For load mutation regularization, For energy consistency constraints, , , , Each corresponds to its weighting coefficient.

[0053] Preferably, the weighting coefficient , , , A strategy based on task uncertainty is adopted to adaptively and dynamically adjust the network during training to balance the magnitude of each loss term and the convergence speed.

[0054] Through the above design, the "variable load" and "action specialization" characteristics of logistics scenarios are systematically embedded in the data layer, model layer, and optimization layer and work together to enhance efficiency.

[0055] By jointly optimizing the above data fitting loss, weighted physical residual loss, load mutation regularization term and energy consistency constraint, even under the condition that there is a certain nonlinear error in the measured torque (current-torque conversion value), this invention reduces the sensitivity of the model to current-torque conversion error by physical consistency guidance provided by physical residual and energy conservation, and achieves robust dynamic parameter learning under the condition of relying only on motor current signal, thus realizing robust identification of the dynamic parameters of the robotic arm.

[0056] In step S5, the logistics-specific dataset constructed in step S1 is used, and the joint loss function designed in step S4 is used as the optimization objective to perform end-to-end joint training on the two-layer physical information neural network constructed in step S2. During training, samples in the logistics-specific dataset are randomly sampled in batches and sequentially input into the first-layer physical information neural network and the second-layer physical information neural network for forward propagation: the first-layer physical information neural network takes the concatenated vector of joint position and load category encoding as input, outputs the inertia matrix and gravity term, and automatically derives the Coriolis force term from the inertia matrix; the second-layer physical information neural network takes the joint position and velocity as input and outputs the friction term. Substituting the above three terms into the left side of the Lagrange dynamics equation, the predicted torque is calculated, and then the joint loss function value is calculated. An adaptive moment estimation optimizer is adopted, combined with a cosine annealing learning rate scheduling strategy, with the goal of minimizing the joint loss function, and all trainable parameters of the first-layer physical information neural network and the second-layer physical information neural network are updated synchronously through the backpropagation algorithm. The above process is iteratively executed until the joint loss function converges, and the trained dynamic model is obtained. Preferably, the weight coefficients are adaptively and dynamically adjusted during network training using a strategy based on task uncertainty, in order to balance the magnitude of each loss term and the convergence speed.

[0057] In step 6, the converged dynamic model is exported and deployed to the real-time controller of the robotic arm. During online operation, the controller reads real-time joint positions, velocities, and accelerations through encoders, and generates corresponding load category codes based on package weight information input by the vision system or manually. These codes are then input into the trained dynamic model for forward inference. The dynamic model retrieves or interpolates the corresponding inertia matrix and gravity term from the parameter space based on the current load category code, calculates the friction term using the current joint position and velocity, substitutes it into the left side of the Lagrange equation, and outputs a predicted torque as a feedforward compensation torque. This feedforward compensation torque is superimposed with the feedback control torque calculated in real-time by the controller based on the deviation between the desired trajectory and the actual trajectory to generate the final execution torque, which is then sent to the robotic arm driver to achieve motion control of the robotic arm.

[0058] Compared with the prior art, the beneficial technical effects of the present invention are as follows:

[0059] This invention achieves a breakthrough improvement in the modeling accuracy of logistics scenarios. Through experiments, it was found that simply covering variable load conditions during data collection or simply adding physical constraints to the model cannot effectively improve the accuracy of load switching transients. The core contribution of this invention lies in discovering the synergistic effect between the load switching transient data collection strategy and the load mutation regularization term, and between the sorting action stage division and the stage-dependent residual weighting. By systematically coupling them, the model can "understand" the load mutation transition dynamics and the dominant physical effects of each stage.

[0060] This invention achieves high-precision torque prediction by relying solely on motor current and encoder signals, significantly reducing the torque prediction error of logistics robotic arms and providing a feasible technical path for a low-cost solution that does not require additional torque sensors.

[0061] This invention achieves a deep integration of physical consistency and data-driven capabilities, with extremely strong generalization ability. The structured network design ensures the physical positive definiteness of the inertia matrix, and the energy consistency constraint ensures the stability of long-term predictions. This enables the model to not only have a strong fitting ability for complex nonlinear friction, but also maintain physical rationality in the sparse regions of untrained load and workspace data, and exhibit excellent smooth generalization ability for unseen intermediate load weights.

[0062] This invention has the ability to adapt to different operating conditions with a single model. By introducing load category coding into the model and using load mutation regularization terms to learn smooth transition dynamics, a single model can continuously and smoothly adapt to the entire package weight range from light load to heavy load, avoiding the control discontinuity and complicated work caused by modeling different loads separately and switching models. Attached Figure Description

[0063] Figure 1 The overall flowchart of the dynamic modeling method for logistics robotic arms provided by this invention;

[0064] Figure 2 This is a schematic diagram of the dual-layer physical information neural network architecture and the integration method of logistics characteristics in this invention;

[0065] Figure 3 This diagram illustrates the phase division of a typical working condition for a logistics robotic arm in the "lifting-carrying-deployment" process, the dominant physical effects of each phase, and the key data collection points. Detailed Implementation

[0066] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0067] Example 1: A Precise Dynamics Modeling Method for Logistics Sorting Robotic Arms Based on a Two-Layer Physical Information Neural Network

[0068] This embodiment uses a six-degree-of-freedom articulated logistics sorting robot arm as an example to describe in detail the implementation process of the present invention, such as... Figure 1 As shown:

[0069] Step S1: Install the following sensors on each joint of the robotic arm: ① 19-bit high-precision absolute position encoder, used to obtain joint position. Joint velocities obtained by sum and difference ② Hall current sensor, used to acquire motor phase current, through torque constant Converted to measured torque The torque constant is affected by factors such as temperature changes, magnetic circuit saturation, and low-speed operation. There may be some nonlinear error, leading to a deviation between the measured torque obtained from the current conversion and the true torque. This embodiment does not address this issue. Additional calibration compensation was performed to verify the ability of the physical constraint mechanism described in this invention to suppress current-torque conversion errors. Among these, joint acceleration... Through the The cutoff frequency is 50Hz, obtained by performing center differential and passing it through a second-order Butterworth low-pass filter.

[0070] The excitation trajectory was designed to cover typical actions in logistics sorting, including: lifting actions primarily driven by vertical Z-axis movement, handling actions primarily driven by horizontal X and Y-axis movement, and placement actions combining Z-axis micro-motion with hand gripping opening and closing, as well as complete combination sequences of the above three actions executed sequentially. Four standard loads of 0.2kg, 1kg, 5kg, and 15kg were sequentially installed at the end flange of the robotic arm to simulate the weight range from envelopes to small boxes, covering light, medium, and heavy loads. In this embodiment, the light load weight range is 0.2kg–1kg, the medium load weight range is 1kg–5kg, and the heavy load weight range is 5kg–15kg. Twenty-five complete action sequences were collected for each load. Each complete action sequence starts with a lifting action, proceeds through a handling action, and ends with a placement action, fully covering the entire action process of a single sorting cycle. The joint position, velocity, acceleration, and measured torque data collected under the above conditions constitute the conventional sorting data.

[0071] Load switching events are automatically detected by monitoring simple contact sensors on the end effector or by monitoring sudden changes in drive current. When a switching event is detected, high-frequency data within a 1-second time window before and after that moment is retained, with a sampling frequency of 2000Hz. The high-frequency sampling data of joint position, velocity, acceleration, and measured torque within this time window constitute the transient data of load switching.

[0072] Simultaneously, for each sampling moment in each acquired action sequence, its corresponding load category code and stage label are marked; the load category code is used to identify the weight level of the current load, and the stage label includes lifting stage, transporting stage, and delivery stage.

[0073] The routine sorting data, the transient data of load switching, the load category code, and the stage label together constitute the logistics-specific dataset. The total dataset contains approximately 500,000 valid time step samples, which are divided into training, validation, and test sets in a 7:2:1 ratio according to the action sequence, ensuring that the data for different loads and action stages are evenly distributed in each set.

[0074] Step S2: Construct a two-layer physical information neural network based on the PyTorch framework, using Lagrange dynamics as the physical prior, such as... Figure 2 As shown:

[0075] The first layer of the physical information neural network is a four-layer fully connected network with 256 neurons per layer. The hidden layer activation function uses Gaussian error linear units. The input is a 6-dimensional joint position vector. One-hot encoding with 4D load category A concatenated 10-dimensional vector. In this embodiment, the load category encoding adopts a one-hot encoding form, corresponding to four standard loads. As an alternative, the load category encoding can also adopt a learnable embedding vector form, obtaining a distributed representation of the load through end-to-end training. Its function is equivalent to one-hot encoding, and this invention does not limit it. The output layer is divided into two parts: one part outputs 21 values ​​(the number of elements in a 6×6 lower triangular matrix), denoted as the original lower triangular matrix. To ensure physical positive definiteness, for Apply a positive definite transformation to the diagonal elements and take the actual lower triangular matrix. The diagonal element is (in for The (one diagonal element), and take the non-diagonal elements directly. The corresponding element value, and then through Obtain the inertia matrix Since the diagonal elements of L(q,c) are always positive after exponential transformation, L(q,c) is guaranteed to be full rank. Therefore, M(q,c) must be a symmetric positive definite matrix. This construction method mathematically guarantees the physical positive definiteness of the inertia matrix; where q is the joint position vector and c is the load category code. For the raw output of the first layer of the physical information neural network The lower triangular matrix obtained by applying a positive definite transformation to the diagonal elements is M(q,c), which is the constructed inertia matrix.

[0076] The other part directly outputs the 6-dimensional gravity term. The first layer of the physical information neural network encodes the input load category c and outputs the corresponding inertia matrix and gravity term. For load weights not encountered during training, linear interpolation is performed on two adjacent known load category codes, and the interpolated code vector is used as input. Coriolis force term. Through PyTorch's automatic differentiation mechanism, by right The partial derivatives of each component were calculated precisely using Christofer's notation formula, ensuring the physical consistency between the various parts of the model; among them, This represents the joint velocity vector.

[0077] The second layer of the physical information neural network is a three-layer fully connected network, with 128 neurons in each layer. The input is... and The concatenated 12-dimensional vector outputs the friction term. Specifically, it is expressed as:

[0078]

[0079] in, Let Coulomb friction coefficient vector be . The vector of viscous friction coefficients. A preset positive coefficient (set to 50 in this embodiment) is used to control the degree of steepness of the approach. The residual nonlinear friction term is formed by a fully connected subnetwork. and The input is mapped to capture nonlinear frictional characteristics beyond Coulomb friction and viscous friction. The fully connected subnetwork contains at least one hidden layer, each employing a nonlinear activation function. Its output is connected to the torque output of the second-layer physical information neural network to compensate for unmodeled dynamics in the nominal dynamics model.

[0080] The mechanism of load category encoding: During the training phase, the neural network learns the mapping relationship between the encoding c and the inertia matrix M(q,c) and the gravity term G(q,c). For example, when c is [1,0,0,0] (representing a 0.2kg load), the network outputs the corresponding small inertia and small gravity term; when c switches to [0,0,0,1] (representing a 15kg load), the network outputs the corresponding large inertia and large gravity term. For load weights not present in the training set (such as 8kg), linear interpolation is performed on the category encodings of two adjacent known loads.

[0081]

[0082] in, These are the interpolation coefficients. and Class encoding for adjacent known loads; interpolating the encoding With joint position After being concatenated, the data is input into the first layer of the physical information neural network, and the network outputs the inertia matrix corresponding to the intermediate load. With gravity term This enables smooth generalization to unseen loads.

[0083] Step S3: The inertia matrix output by the first layer of the physical information neural network... and gravity term Coriolis force terms derived from the inertia matrix And the friction term output by the second-layer physical information neural network. Substituting all of them into the Lagrange dynamics equations:

[0084]

[0085] The model uses joint positions as a reference. Joint velocity Joint acceleration and load category coding As input, to predict torque This is the output.

[0086] Step S4: Design a joint loss function that incorporates constraints from the logistics scenario.

[0087] (a) Data Fitting Loss The mean square error between the network-predicted torque and the measured torque is used as the data fitting loss. Transient data near the load switching moment is assigned a higher weighting coefficient than steady-state data. The specific formula is as follows:

[0088]

[0089] in, The total number of samples in the batch. For sample index, For the first The measured torque of each sample For the first The predictive moment for each sample, Let be the weight coefficient of the i-th sample; when the sampling time of the i-th sample is within a preset time window before or after the load switching time, Take a preset value greater than 1, otherwise =1.

[0090] (ii) Physical residual loss after stage-perception weighting: the inertia matrix output by the first-layer physical information neural network. and gravity term Coriolis force terms derived from the inertia matrix And the friction term output by the second-layer physical information neural network. Substituting all terms into the left side of the Lagrange dynamics equation, we can calculate the sum of the terms on the left side of the equation and the measured torque. The deviation between them. Based on this, according to the stage of the sample, the joint components of the residual vector of the complete Lagrange dynamic equation are weighted to adjust the contribution ratio of samples at different stages and different joint residuals to the physical residual loss, thus obtaining the weighted physical residual loss:

[0091]

[0092] in, The total number of samples in the batch. For sample index, For the first Stage labels for each sample; To correspond to the stage The weight vector, whose elements correspond to the weighting coefficients of the deviation of each joint of the robotic arm; , , , The first Model predictions for the inertial, Coriolis, gravity, and friction terms for each sample; For the first The measured torque of each sample; This indicates element-wise multiplication.

[0093] The weight vector With each element being The weight vectors are the basic vectors. During the lifting phase, the overall values ​​of each element in the weight vector are greater than those during the transport and delivery phases, allowing the network to prioritize reducing the residual of the entire dynamic equation during the lifting phase. During the transport phase, the overall values ​​of the weight vector are next, with elements corresponding to major joints such as the upper arm and forearm having relatively higher values. During the delivery phase, the overall values ​​of the weight vector are third, with elements corresponding to distal joints such as the wrist having relatively higher values. The specific values ​​of the weight vectors for each phase are preset based on the importance of the dynamic effects of each joint in that phase.

[0094] like Figure 3 As shown, the lifting phase primarily involves overcoming the load's gravity, with a strong gravity effect and moderate friction effect; the transport phase primarily involves high-speed horizontal movement, with strong inertial and Coriolis force effects; the deployment phase primarily involves low-speed, precise alignment, with a strong friction effect and high positioning accuracy requirements. Based on these phase characteristics, this embodiment uses a phase-dependent weight vector to weight the residual of the entire dynamic equation, ensuring that the network prioritizes the accuracy of the entire dynamic equation during periods with stronger dominant physical effects in each phase. In this embodiment, the weight vector... The element values ​​are as follows: During the lifting phase, the weights of all joints are set to 3.0; during the transport phase, the weights of major joints such as the upper arm and forearm are set to 3.0, and the remaining joints are set to 2.0; during the drop phase, the weights of distal joints such as the wrist are set to 2.5, and the remaining joints are set to 1.5. It is important to clarify that the above weights adjust the contribution ratio of the residuals of the entire equation at each stage at the loss function level, guiding the network to prioritize reducing the residuals of the dynamic equations during the lifting phase, rather than scaling or modifying the corresponding physical terms in the Lagrange dynamic equations. When all elements of the weight vector are set to 1.0, the weighted physical residual loss degenerates into the standard physical residual loss.

[0095] (iii) Load mutation regularization term : For the transient dynamics during load switching, the set of automatically detected load switching moments. Within the time window, a penalty is imposed on the rate of change of the predicted torque, forcing the model to learn smooth and physically reasonable transition dynamics. This regularization term works synergistically with the strategy of focusing on collecting transient data in step S1: step S1 provides dense supervision signals for load switching, and this regularization term constrains the model's fitting method to these signals from the optimization objective. The specific formula is as follows:

[0096]

[0097] in, The default penalty coefficient is set to 5.0 in this embodiment. This is a set of load switching moments. The total number of switching moments in the set. For the dynamic prediction model in The moment vector predicted at any given time. One sampling period (0.5ms in this embodiment). Load switching time set. The automatic detection method is as follows: After performing median filtering (window size 11) on the motor drive current signal, its first-order backward differential absolute value is calculated. When the differential value exceeds a preset threshold (set to be 5 times the standard deviation of the steady-state current fluctuation range) for 5 consecutive sampling points, the center moment of this time window is marked as the load switching event, forming a set. .

[0098] (iv) Energy Consistency Constraints Using the conservation relationship between the rate of change of the system's kinetic energy and the sum of the power done and dissipated by external forces as a constraint, kinetic energy... The energy consistency constraint loss function is defined as:

[0099]

[0100] That is, the rate of change of kinetic energy should equal the sum of the power exerted by the non-conservative force (driving torque minus friction) and the conservative force (gravity), to ensure the energy stability of the model under long-term predictions. The total kinetic energy of the system, The first derivative of the system's kinetic energy with respect to time is precisely calculated using automatic differentiation techniques. For joint velocity vectors, Transpose it; This refers to the joint driving torque; This is the friction term; This is the gravity term.

[0101] It should be noted that the above energy consistency constraint is derived based on the closed system assumption (i.e., the system mass / inertia is constant, and no external object inputs or removes energy into or from the system through contact force). At the moment of load switching, the contact force between the package and the end effector will input or remove energy into the robotic arm system. At this time, the system does not satisfy the closed system assumption, and the above energy conservation relationship no longer holds. If the energy residual is calculated during this period, spurious residuals unrelated to the model prediction error will be generated, which will mislead the network training.

[0102] Therefore, in calculating the energy consistency loss, this embodiment selects only samples whose load category codes remain constant within a continuous time window and are not within the 1-second time window before or after any load switching event, based on the load category codes marked in step S1. The calculation is performed; samples within a 1-second time window before and after load switching are automatically excluded. During this window period, the accuracy of the system's dynamic modeling is jointly ensured by the data fitting loss described in step S4 (providing a strong supervision signal through high-density sampling of transient data) and the load mutation regularization term (constraining the smooth transition of the predicted torque change rate). Through this division of labor, the data fitting loss, the load mutation regularization term, and the energy consistency constraint each play their respective advantages in the transient and steady-state phases, forming effective coverage across the entire time period.

[0103] (v) Total Loss Function The weighted sum of the above items:

[0104]

[0105] in, , , , These are preset weighting coefficients used to balance the magnitude and contribution of each loss term in the total loss. In this embodiment, the initial values ​​are set to 1.0, 0.1, 0.1, and 0.05, respectively. Preferably, the weighting coefficients are adaptively and dynamically adjusted during network training using a strategy based on task uncertainty to balance the magnitude and convergence speed of each loss term.

[0106] By jointly optimizing the data fitting loss, weighted physical residual loss, load mutation regularization term, and energy consistency constraint, this invention guides the model to learn parameters consistent with the nominal dynamic structure under conditions relying solely on the motor current signal, thereby reducing the model's sensitivity to torque constant fluctuations. Specifically, the weighted physical residual loss imposes physical consistency constraints on the model through the Lagrange equation structure, while the energy consistency constraint provides additional regularization constraints through the energy conservation relationship. These two constraints complement the data fitting loss, jointly guiding the model to maintain a predictive output consistent with the dynamic equation structure even under conditions of fluctuations in the current-torque conversion.

[0107] Step S5: Using the logistics-specific dataset constructed in Step S1, and with the joint loss function designed in Step S4 as the optimization objective, perform end-to-end joint training on the two-layer physical information neural network constructed in Step S2. During training, samples in the dataset are randomly sampled in batches, with a batch size of 512. These samples are then sequentially input into the first and second layers of the physical information neural network for forward propagation. The first layer takes the concatenated vector of joint position and load category encoding as input and outputs the inertia matrix and gravity term, automatically deriving the Coriolis force term from the inertia matrix. The second layer takes the joint position and velocity as input and outputs the friction term. Substituting these three terms into the left-hand side of the Lagrange dynamics equation, the predicted torque is calculated, and then the joint loss function value is calculated.

[0108] An adaptive moment estimation optimizer is used, with an initial learning rate of 1×10⁻. 4 The weight decay is set to 1×10⁻ 5 Combining a cosine annealing learning rate scheduling strategy, and aiming to minimize the joint loss function, all trainable parameters of the first and second physical information neural networks are simultaneously updated via backpropagation. The total training epochs are 1500, with the learning rate decaying to 1×10⁻⁻⁻⁶. 6 Early stopping is triggered when the data fitting loss on the validation set fails to decrease for 100 consecutive rounds. The entire training process takes approximately 3.5 hours on a single NVIDIA RTX 3090 GPU to obtain the trained dynamic model.

[0109] Step S6: Compile the trained PyTorch model into an industrial-grade deployable serialized file using TorchScript and integrate it into a ROS2-based real-time control software framework. During online operation, the controller reads real-time joint positions, velocities, and accelerations via encoders, while the vision system identifies package dimensions and maps them to corresponding load category codes. The inertia matrix and gravity term are input into the trained dynamic model for forward inference. The model retrieves or interpolates the corresponding inertia matrix and gravity term from the parameter space based on the current load category code. For load category codes not found during training, the corresponding inertia matrix and gravity term are obtained by interpolating adjacent known load category codes and inputting them into the network. The friction term is then calculated based on the current joint position and velocity, substituted into the left side of the Lagrange dynamic equation, and the predicted torque is output as the feedforward compensation torque. This feedforward compensation torque is superimposed with the feedback control torque calculated in real-time by the controller based on the deviation between the desired trajectory and the actual trajectory, generating the final execution torque, which is then sent to the robotic arm actuator to achieve motion control of the robotic arm. Within a 1000Hz control cycle, the model's forward inference time is less than 150 microseconds, meeting real-time requirements.

[0110] Example 2: A modeling method with online adaptive fine-tuning capability

[0111] Based on Example 1, this embodiment adds an online adaptive update step to adapt to the drift in dynamic characteristics caused by joint wear, changes in lubrication status, or grasping special packages (such as irregularly shaped parts or liquid sloshing loads) not seen in the training set during long-term operation of the robotic arm.

[0112] Step S7: Online Error Monitoring and Adaptive Fine-Tuning Trigger. During the continuous operation of the robotic arm, the residual between the predicted torque from the dynamic model and the measured torque converted from the motor current is calculated in real time. The error evaluation index is defined as the normalized root mean square error (NRMSE) within a sliding window, with a window length of 100 control cycles, corresponding to 0.1 seconds. When this index exceeds the preset threshold of 0.08 for 10 consecutive control cycles, it is determined that a significant dynamic drift has occurred in the current operating condition, and the system automatically triggers the online fine-tuning process.

[0113] The preset threshold is set based on the following: Under normal operating conditions, the NRMSE of the model prediction error is stable between 0.03 and 0.05. The threshold of 0.08 is set as 1.6 times the upper limit of normal fluctuation, which can effectively avoid false triggering caused by noise.

[0114] Step S8: Freeze deep parameters and fine-tune surface parameters. After fine-tuning is triggered, the system performs the following operations:

[0115] (1) Freeze parameters: Immediately freeze all trainable parameters of the first-layer physical information neural network. The principle is that the first-layer physical information neural network learns basic physical properties such as the inertia matrix and gravity term. These properties are determined by the rigid structure of the robotic arm and the load weight level, and will not change significantly in the short term due to wear or changes in lubrication. Freezing these parameters can prevent the fine-tuning process from destroying the correct physical priors that have already been learned.

[0116] (2) Cached data: Extract the latest cached data samples of 512 consecutive time steps. Each sample contains joint position q, velocity q̇, acceleration q̈, load category code c, and corresponding measured torque τ. The data caching mechanism adopts a first-in-first-out (FIFO) queue to ensure that the data used for fine-tuning always reflects the latest operating conditions.

[0117] (3) Selective fine-tuning: Only the parameters of the last fully connected layer of the second physical information neural network are updated. The reason for choosing to fine-tune this layer is that the friction term is the part of the dynamic model most affected by wear, temperature and lubrication state, and the deep feature extraction part of the second physical information neural network has already learned the general characterization of friction. Only the output mapping layer needs to be fine-tuned to quickly adapt to the new friction characteristics without retraining the entire network.

[0118] Step S9: Quick online fine-tuning execution. The fine-tuning process uses mini-batch gradient descent, with a batch size of 64 and a learning rate of 1×10⁻. 6 The initial training learning rate is 1%, and the optimizer uses momentum-driven SGD with a momentum coefficient of 0.9 to prevent sudden changes in the predicted output caused by drastic parameter oscillations during fine-tuning.

[0119] The number of fine-tuning iterations after each trigger is fixed at 50, with the total time controlled within 0.8 seconds to ensure that the fine-tuning process does not block the main control loop. The control period is 1ms. The selection of 50 iterations is based on the following: experiments show that after more than 50 iterations, the decrease in validation set error tends to level off, with a decrease of less than 0.1%. Further increasing the number of iterations will only increase computational overhead and have limited effect on improving accuracy.

[0120] After fine-tuning, the new parameters take effect immediately, replacing the original parameters for subsequent feedforward torque prediction. If the error after fine-tuning does not fall below the threshold within 100 control cycles, the system issues a maintenance warning, prompting the operator to check the physical condition of the robotic arm joints.

[0121] Step S10: Protection Mechanism for Fine-Tuning. To prevent model degradation caused by online fine-tuning, the following protection measures are implemented:

[0122] (1) Parameter range constraint: The fine-tuned network parameters are constrained to within ±20% of the initial training parameters to prevent parameter divergence due to abnormal data.

[0123] (2) Rollback mechanism: If the error of the model on the validation cache data after fine-tuning increases by more than 5% compared with that before fine-tuning, the result of this fine-tuning is abandoned, the parameter state before fine-tuning is rolled back, and the abnormal event is recorded for subsequent analysis.

[0124] (3) Minimum trigger interval: There should be at least 500 control cycles between two fine-tuning triggers. That is, 0.5 seconds, to avoid frequent fine-tuning consuming computing resources.

[0125] Comparative Example

[0126] To further verify the synergistic effect of the components of this invention, under the same experimental conditions as in Example 1, including the same six-DOF articulated logistics sorting robot arm, the same excitation trajectory, the same four standard loads of 0.2kg, 1kg, 5kg, and 15kg, the same load switching transient data acquisition method, the same training set / validation set / test set partitioning ratio, and the same evaluation metric NRMSE, the following comparative example was set:

[0127] Comparative Example 1: Pure Data-Driven Benchmark Scheme

[0128] The network is trained using only data fitting loss, without introducing any physical or logistical constraints. This approach is essentially a pure black-box neural network, entirely driven by data and ignoring Lagrangian mechanics.

[0129] Comparative Example 2: Standard Physical Information Neural Network Benchmark Scheme

[0130] The method employs a joint training approach using data fitting loss and physical residual loss, without introducing load mutation regularization terms or stage-aware weighting terms. This scheme is a standard physical information neural network, containing only basic physical constraints.

[0131] Comparative Example 3: Validation Scheme for Load Mutation Regularization

[0132] Based on Comparative Example 2, a load mutation regularization term is added, excluding the stage-aware weighting term.

[0133] Comparative Example 4: Stage-Aware Weighted Verification Scheme

[0134] Based on Comparative Example 2, a stage-aware weighting term is added, which does not include a load mutation regularization term.

[0135] Comparative Example 5: Energy Consistency Constraint Verification Scheme

[0136] Based on Comparative Example 2, only energy consistency constraints are added, without load mutation regularization terms and stage-aware weighting terms.

[0137] The test results are shown in Table 1:

[0138] Table 1 Comparison of torque prediction accuracy of different technical solutions

[0139] Comparative Example 1 The network is trained using only data fitting loss, without introducing any physical or logistical constraints. 9.8% Comparative Example 2 The training employs a joint method combining data fitting loss and physical residual loss, without introducing load mutation regularization or stage-aware weighting terms. 7.1% Comparative Example 3 Based on Comparative Example 2, a load mutation regularization term is added, excluding the stage-aware weighting term and energy consistency constraint. 6.2% Comparative Example 4 Based on Comparative Example 2, a phase-aware weighting term is added, excluding load mutation regularization terms and energy consistency constraints. 5.8% Comparative Example 5 Based on Comparative Example 2, an energy consistency constraint is added, excluding load mutation regularization terms and stage-aware weighting terms. 6.8% Example 1 The training process employs a joint loss function comprising data fitting loss, weighted physical residual loss, load mutation regularization term, and energy consistency constraint, comprehensively encompassing all constraints across logistics scenarios. 4.0%

[0140] Note: NRMSE (Normalized Root Mean Square Error) is an evaluation index for the accuracy of torque prediction, and its calculation formula is as follows:

[0141]

[0142] in, The total number of test samples; For the first The measured torque of each sample; For the first Predictive torque for each sample; and These represent the maximum and minimum measured torque values ​​in the test set, respectively. A lower NRMSE value indicates higher model prediction accuracy.

[0143] Results Analysis: As shown in Table 1, the NRMSE values ​​of Comparative Examples 1 to 5 were 9.8%, 7.1%, 6.2%, 5.8%, and 6.8%, respectively, while the NRMSE of the embodiment of the present invention was 4.0%. Through the above comparative experiments, the effectiveness of the present invention can be demonstrated at the following levels.

[0144] Level 1: Effectiveness of the Physical Information Neural Network Structure. Comparing Comparative Example 1 and Comparative Example 2, it can be seen that the pure black-box network, entirely dependent on data-driven operation, has the lowest prediction accuracy under varying load conditions, with an NRMSE as high as 9.8%. After introducing the Lagrange dynamics equations as physical priors, the NRMSE of the standard physical information neural network drops to 7.1%, and the error decreases by 2.7 percentage points. This verifies that physical constraints can guide the model output to conform to dynamic laws.

[0145] The second level: the effectiveness of constraints in single logistics scenarios. Comparing Comparative Example 2 with Comparative Examples 3, 4, and 5, it can be seen that adding a load mutation regularization term (Comparative Example 3) reduces the NRMSE from 7.1% to 6.2%, and the error decreases by 0.9 percentage points; adding a stage-aware weighting term (Comparative Example 4) reduces the NRMSE from 7.1% to 5.8%, and the error decreases by 1.3 percentage points; adding an energy consistency constraint (Comparative Example 5) reduces the NRMSE from 7.1% to 6.8%, and the error decreases by 0.3 percentage points. Each of these three constraints, when introduced independently, effectively improves model accuracy, providing effective physical regularization constraints from three different dimensions: transient smoothness, stage-dominant physical effects, and energy conservation.

[0146] The third level: the synergistic effect among constraints in the logistics scenario. Comparing Comparative Examples 3, 4, and 5 with Example 1, it can be seen that the sum of the error reduction caused by the three constraints individually is 0.9 + 1.3 + 0.3 = 2.5 percentage points. After introducing the three constraints simultaneously, the NRMSE of Example 1 drops to 4.0%, and the error reduction reaches 7.1% - 4.0% = 3.1 percentage points, exceeding the sum of the individual effects of the three by 0.6 percentage points. This excess demonstrates the synergistic effect between the load mutation regularization term, the stage-aware weighting term, and the energy consistency constraint: the three act on the transient stage, the steady-state stage, and the long-term energy stability, respectively, forming a complementary enhancement in the joint optimization framework, making the combined effect better than the simple sum of the individual effects.

[0147] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A dynamic modeling method for a logistics robotic arm, characterized in that, Includes the following steps: Step S1: Collect routine sorting data of the logistics robotic arm under typical sorting conditions, focusing on collecting transient load switching data within the time window before and after the load switching instant. The routine sorting data and the transient load switching data together constitute a logistics-specific dataset. Step S2: Construct a two-layer physical information neural network with Lagrange dynamics as the physical prior; wherein, the first layer of the physical information neural network takes the concatenated vector of joint position and load category encoding as input and outputs the inertia matrix and gravity term; for load weights that have not appeared in the training, linear interpolation is performed on two adjacent known load category encodings, and the interpolated encoding vector is used as the input of the first layer of the physical information neural network, which outputs the corresponding inertia matrix and gravity term; the second layer of the physical information neural network takes joint position and velocity as input and outputs the friction term; Step S3: Substitute the inertia term, Coriolis force term, gravity term, and friction term into the Lagrange dynamics equations to construct a complete dynamic prediction model for the robotic arm. The dynamic prediction model takes joint position, velocity, acceleration, and load category encoding as inputs and predicted torque as output. The inertia term is composed of the product of the inertia matrix and acceleration. The Coriolis force term is derived from the partial derivative of the inertia matrix with respect to position. Step S4: Design a joint loss function that integrates logistics scenario constraints. The joint loss function includes data fitting loss, physical residual loss after stage-aware weighting, load mutation regularization term, and energy consistency constraint. The stage-aware weighting is used to apply a stage-dependent weight vector to the residual vector of the Lagrange dynamics equation according to the stage of the sorting action, so as to differentiate the contribution ratio of the residual components of each stage and each joint in the physical residual loss. Step S5: Based on the logistics-specific dataset and the joint loss function, jointly train the two-layer physical information neural network. With minimizing the joint loss function as the optimization objective, update the parameters of the first-layer physical information neural network and the second-layer physical information neural network synchronously through backpropagation to obtain the trained dynamic model. Step S6: Deploy the trained dynamic model to the robotic arm controller. Based on the real-time joint position, velocity, acceleration and current load category encoding, calculate the feedforward compensation torque through the trained dynamic prediction model. The feedforward compensation torque is superimposed with the feedback control torque of the controller to control the movement of the robotic arm.

2. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S1, typical sorting conditions include package lifting, horizontal transport, release and placement, and their combination sequences; the data collection covers at least three different weight levels of package load, including light load, medium load and heavy load, which correspond to the package weight range that increases sequentially. The conventional sorting data includes joint position, velocity, acceleration, and measured torque; the load switching transient data includes high-frequency sampling data of joint position, velocity, acceleration, and measured torque within the time window before and after the load switching instant; the measured torque is obtained by converting the motor current through a torque constant. The logistics-specific dataset also includes load category codes and stage labels.

3. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S2, the first-layer physical information neural network outputs all elements of the lower triangular matrix L(q,c). The diagonal elements of the lower triangular matrix L(q,c) are constrained to be strictly greater than zero after a positive definite transformation, and are then... Construct an inertia matrix, and the first layer of the physical information neural network simultaneously and directly outputs the gravity term G(q,c), where q is the joint position vector and c is the load category code. M(q,c) is the lower triangular matrix output by the first layer of the physical information neural network, and M(q,c) is the constructed inertia matrix. The Coriolis force is automatically calculated using Christofer's notation from the partial derivative of the inertia matrix M(q,c) with respect to the joint position q. .

4. The dynamic modeling method for a logistics robotic arm according to claim 3, characterized in that, In step S2, the load category code is concatenated with the joint position vector through one-hot encoding or a learnable embedding vector and used as the input of the first layer of the physical information neural network; for load weights that do not appear in the training, an interpolated encoding vector is generated by linear interpolation of its two adjacent known load category codes and used as the input.

5. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, The friction term fitted by the second-layer physical information neural network in step S2 is expressed as: Where q is the joint position vector, which is composed of the angle values ​​of each joint of the robotic arm, and its dimension is equal to the number of degrees of freedom of the robotic arm; The joint angular velocity vector is composed of the rotational angular velocities of each joint of the robotic arm and is the first derivative of the joint position vector with respect to time. The Coulomb friction coefficient vector represents the friction component that is related to the direction of velocity but independent of the magnitude of velocity, and its direction changes abruptly when the velocity crosses zero. This is the viscous friction coefficient vector, representing the friction component that is proportional to the speed; the higher the speed, the larger this term becomes. A preset positive coefficient, used to control the steepness of the approximation, is employed to adjust the slope of the tanh function. The larger the value, the closer the output of the tanh function is to the step shape of the sign function; It is a hyperbolic tangent function, with α times the joint angular velocity as input, and the output value smoothly transitions between -1 and 1. It is used to approximate a non-differentiable sign function in a differentiable way, ensuring the numerical stability of the neural network during training. The residual nonlinear friction term is output by a fully connected subnet with joint position q and joint angular velocity q̇ as input, and is used to capture nonlinear friction characteristics other than Coulomb friction and viscous friction. The fully connected subnetwork contains at least one hidden layer, each of which employs a nonlinear activation function. This subnetwork is used to fit the residual friction characteristics other than the Coulomb friction and viscous friction. Its output is connected to the torque output of the second physical information neural network in step S2 to compensate for the unmodeled dynamics in the nominal dynamics model.

6. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S4 The data fitting loss is represented as the mean square error between the predicted torque output by the dynamic prediction model and the measured torque. Transient data near the load switching moment is assigned a higher weighting coefficient than steady-state data. The weighted physical residual loss is obtained in the following way: the deviation vector between the combined vector of the inertia term, Coriolis force term, gravity term and friction term and the measured torque is multiplied element-wise with the stage-specific weight vector, and then the L2 norm squared is calculated. That is, first calculate the deviation vector between the sum of the inertia term, Coriolis force term, gravity term and friction term predicted by the model and the measured torque, then multiply the deviation vector element-wise with the stage-specific weight vector, and then calculate the L2 norm squared of the product vector. The load mutation regularization term is used to constrain the rate of change of the predicted torque at the moment of load switching. The energy consistency constraint is derived based on the closed system assumption and is applied only to samples where the load category code remains constant and the end effector does not come into contact with the package. Samples within each preset time window before and after the load switching moment are automatically excluded from the calculation range of the energy consistency constraint. The dynamic accuracy of the system within this window period is jointly guaranteed by the data fitting loss and the load mutation regularization term.

7. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S4, the load change regularization term is implemented by automatically detecting the set of load switching moments by monitoring the rate of change of motor current or the signal from the end force sensor. And within this time window, an L2 norm penalty is applied to the first-order time difference of the model's predicted torque, with the constraint formula as follows: in, For load mutation regularization, The preset penalty coefficient, This is a set of load switching moments. The total number of switching moments in the set. For the dynamic model in The moment vector predicted at any given time. One sampling period.

8. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S4, the stage-aware weighting term is implemented in the following way: the sorting reference trajectory is dynamically time-normalized in advance, and each sampling moment is labeled with a stage label, which includes the lifting stage, the handling stage, and the placement stage; when calculating the weighted physical residual loss, the entire Lagrange dynamic equation residual vector is multiplied element-wise with the stage-dependent weight vector according to the stage label of the sample; the weight vector is based on the fact that each element is 1.0, and the overall value of each element of the lifting stage weight vector is greater than that of the handling stage and the placement stage, so that the network prioritizes reducing the dynamic equation residual of the lifting stage.

9. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, In step S5, the data fitting loss is used to make the predicted torque approximate the measured torque, and the weighted physical residual loss is used to guide the model output to approximate the Lagrange dynamic equation in the sense of weighted least squares. When all elements of the weight vector are 1, the weighted physical residual loss degenerates into the standard physical residual loss. The load mutation regularization term is used to constrain the rate of change of the predicted torque at the moment of load switching, and the energy consistency constraint is used to ensure the long-term energy stability of the system.

10. The dynamic modeling method for a logistics robotic arm according to claim 1, characterized in that, It also includes an online adaptive update step: when the error between the model-predicted torque and the measured torque continuously exceeds a preset threshold, all training parameters of the first-layer physical information neural network are frozen, and the latest cached data is used to quickly fine-tune only some parameters of the second-layer physical information neural network to adapt to mechanical wear or unseen working conditions.