A Data-Driven Modeling and Model Predictive Control Method for a Robotic Arm System
By constructing a Koopman linear model on the robotic arm and embedding a model predictive control framework, the problems of complexity in the robotic arm dynamics model and insufficient accuracy of traditional model predictive control are solved, achieving high-precision trajectory tracking control and safe data acquisition, which is suitable for real-time control of multi-degree-of-freedom robotic arms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2026-05-06
- Publication Date
- 2026-07-31
AI Technical Summary
The dynamic analytical model of robotic arms is complex and difficult to maintain high accuracy across the entire working range. Traditional linear model predictive control is difficult to accurately capture the dynamic characteristics of nonlinear robotic arms. The data-driven Koopman modeling method has limited engineering implementation solutions for real multi-degree-of-freedom robotic arms and lacks system integration with MPC.
By collecting experimental data under various working conditions, a Koopman linear model was constructed and embedded into a model predictive control framework to reduce the dependence on analytical dynamics models. A predictive controller was designed to achieve effective tracking control of the robotic arm trajectory.
It significantly reduces the complexity of dynamic modeling, improves the sampling security and data quality of physical systems, enhances prediction accuracy and generalization ability, facilitates integration with model predictive control, and is suitable for real-time control system applications.
Smart Images

Figure CN122125729B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of automatic control and robotics, specifically to a data-driven modeling and model predictive control method for a robotic arm system. Background Technology
[0002] Robotic arm systems are complex dynamic systems with significant nonlinearity, strong coupling, and multivariable characteristics. Traditional control methods typically rely on the accurate construction of a dynamic model of the robotic arm, designing control laws through inverse dynamics or feedback linearization to achieve high-precision tracking of joint trajectories. However, in practical engineering applications, the analytical modeling process is extremely complex, system parameters are difficult to calibrate precisely, and unmodeled dynamics such as friction, elastic deformation, and motor saturation can significantly degrade the performance of analytical model-based controllers.
[0003] Model Predictive Control (MPC), an advanced control method based on predictive models and performing rolling optimization, can achieve good control performance while considering both input and state constraints. For linear systems, MPC has been widely used in process control and servo systems. However, when the controlled object is a nonlinear robotic arm system, directly using a linearized model or a simple approximation model often only guarantees prediction accuracy within a small range around the operating point in a single implementation. Under large-scale motion conditions or highly dynamic conditions, the prediction error increases significantly, leading to poor constraint handling and performance optimization.
[0004] Significant differences typically exist between simulation environments and physical robotic arm systems: First, factors such as joint friction, gear backlash, and compliance often exhibit strong nonlinearity and change with operating conditions, making them difficult to accurately characterize using idealized models. Second, servo drives and actuators suffer from non-ideal constraints such as dead zones, saturation, current limiting, and discretization. Third, encoders and current / voltage measurements inevitably introduce noise, quantization errors, and time delays, leading to deviations between the real system's performance and the simulation model. Under the influence of these factors, controllers and predictive models obtained solely based on simulation or idealized models often exhibit problems such as increased prediction errors, control input jitter, or performance degradation in physical systems.
[0005] Compared to black-box data-driven modeling methods such as neural networks, the Koopman method maintains a linear discrete-time structure in the model obtained within the improvement space. This facilitates the direct integration of linear system theory and convex optimization frameworks, ensuring both predictive capability and real-time performance and interpretability in online solutions. In contrast, embedding neural network models into MPC often requires nonlinear optimization or backpropagation calculations, resulting in significant online computational costs and greater sensitivity to initial values and hyperparameters. These characteristics make the Koopman linear model more suitable for system integration with the MPC framework in servo control scenarios with real-time requirements.
[0006] Methods based on analytical dynamics models and model predictive control (e.g., CN120116215A) have been used to study the trajectory tracking problem of robotic arms, but these methods heavily rely on precise parameters, resulting in high computational costs for modeling and nonlinear control optimization. Control methods based on locally linearized models have been used to study trajectory tracking control of robotic arms (e.g., CN118288280A), but their prediction accuracy is only good within a small range of operating conditions. Methods based on neural networks have been used to study adaptive control of robotic arms (e.g., CN119159582A, CN120901976A), but these models are black-box structures, making online optimization complex and real-time performance unreliable. Simulation system modeling and control methods based on the Koopman operator (e.g., CN118906060A) are generally based on simulation results, and the commonly used open-loop data acquisition methods cannot be directly applied to physical robotic arms, lacking experimental verification with real multi-degree-of-freedom robotic arms.
[0007] In summary, the existing technology has the following shortcomings:
[0008] 1. The analytical model of robotic arm dynamics is complex and difficult to maintain high accuracy across the entire working area, which affects the model-based control and prediction performance;
[0009] 2. Traditional linear model predictive control struggles to accurately capture the dynamic characteristics of nonlinear robotic arms, and the prediction error increases significantly under a wide range of motion conditions;
[0010] 3. The data-driven Koopman modeling method has limited engineering implementation solutions for real multi-degree-of-freedom robotic arms and lacks system integration with MPC. Summary of the Invention
[0011] This invention addresses the problems of complex dynamic models and difficult-to-precise parameter calibration in multi-degree-of-freedom robotic arms, as well as the insufficient prediction accuracy of traditional linear model predictive control under a wide range of motion conditions. It proposes a data-driven modeling and model predictive control method for robotic arm systems. Using experimental data collected from real robotic arms under various working conditions, an approximately linear Koopman linear model in the lifting state space is constructed. This model is then embedded into the model predictive control framework, achieving effective tracking control of the robotic arm trajectory without relying on a precise analytical dynamic model.
[0012] This invention first proposes a data-driven modeling method for robotic arms based on Koopman operator theory. By utilizing experimental data collected from real robotic arms under various working conditions, a Koopman linear model with a linear discrete structure is constructed in the improved state space. This alleviates the problems of complexity in traditional analytical dynamics modeling and difficulty in accurately calibrating parameters across the entire working range, reducing the dependence of control design on precise analytical models. Then, the Koopman linear model is embedded into a model predictive control framework, and corresponding predictive controllers are designed for the joint motion of multi-degree-of-freedom robotic arms. Under the premise of uniformly considering input and state constraints, tracking control of the robotic arm joint trajectory is achieved, forming a set of integrated modeling and control methods based on data-driven linear models.
[0013] The present invention is achieved by at least one of the following technical solutions.
[0014] A data-driven modeling and model predictive control method for a robotic arm system includes the following steps:
[0015] Step 1: Dynamics Model and Discretized Representation of the Robotic Arm
[0016] In this invention, the continuous-time dynamics of the robotic arm are modeled using the Euler-Lagrange equations. The Euler-Lagrange dynamics model describing the N-DOF robotic arm system can be written as follows:
[0017] (1)
[0018] in, For the joint angle vectors of a multi-degree-of-freedom robotic arm, , These are the joint angular velocity and joint angular acceleration vectors, respectively. This is the joint driving torque vector. It is a symmetric positive definite inertia matrix used to describe the equivalent inertia of the link and the load. For the Coriolis force and centripetal force terms, This is the gravity term, used to describe the equivalent torque of gravity on each joint.
[0019] To facilitate integration with data-driven methods, the continuous-time model is divided according to the sampling period. Discretize, let the first... The corresponding state and control input at each time point are as follows:
[0020] , ;
[0021] in, , The first The joint angle and joint angular velocity vector at time t. For the first Input torque at any moment By mapping the relationship between indirect control signals such as actual control input current or voltage and joint input torque, the original robotic arm can be discretized into a nonlinear discrete-time system.
[0022] (2)
[0023] in For the continuous-time Eulerian-Lagrange dynamics model (1) described above, during the sampling period The mapping is obtained through numerical integration.
[0024] Step 2: Data Collection and Processing
[0025] On an N-DOF robotic arm platform, let the angles of each joint be as follows: , , , The corresponding angular velocities of each joint are as follows: , , , The control inputs for each joint are denoted as follows: , , , Unlike open-loop identification methods applicable only to simulation environments, this invention employs a data acquisition and identification approach under the closed-loop operation conditions of a physical robotic arm. First, an initial controller (e.g., a control law tuned based on simple proportional control or other empirical parameters) capable of ensuring basic stability and safety is used to drive the robotic arm in a closed loop. This initial controller does not require high control performance or very small steady-state error; it only needs to maintain system operation and provide sufficient excitation within safety constraints. Subsequently, under the premise of meeting safety constraints such as joint angles, angular velocities, and currents, the system is excited online, and the joint positions, joint velocities, and drive input time series of the physical robotic arm are recorded simultaneously. This method of data acquisition not only effectively avoids safety hazards caused by joint loss of control or physical collisions due to gravity or nonlinear abrupt changes during open-loop data acquisition, but also directly reflects the combined effects of actual servo drives, friction, clearance, and electrical interfaces, making it closer to real-world operating conditions.
[0026] In one implementation, the initial controller can be a low-precision position controller that comes pre-installed with the robotic arm, used as an example, to provide the necessary excitation and complete closed-loop data acquisition while ensuring safety and basic stability. Under closed-loop control conditions, training data is obtained through multiple sets of typical experimental conditions, including but not limited to: joint sinusoidal trajectory tracking experiments conducted near typical operating points, sinusoidal or combined trajectory tracking experiments with different amplitude and frequency combinations, and response experiments to random steps or random disturbances applied in joint space or task space.
[0027] The state vector and input vector were extracted from the time series data obtained from the above experiments.
[0028] , By applying clustering algorithms (e.g.) to the normalized state samples k -means clustering algorithm) to obtain
[0029] And construct sample pairs according to adjacent time points, such as the first... The sample pairs up to the (k+1)th sampling time can be denoted as Subsequently, the mean and standard deviation of the states and inputs for all samples were jointly calculated. Mean-variance standardization (Z-score) was then used to normalize both the states and inputs. The calculation formula is as follows:
[0030] , ;
[0031] in , and , These are the mean and standard deviation of the state and input, respectively, obtained statistically from the training data. This yields the normalized state samples. With normalized input samples Furthermore, samples from different experimental conditions are aggregated along the sample dimension to obtain a large-scale training dataset covering multiple conditions.
[0032] Step 3: Construction of lifting function and identification of Koopman linear model
[0033] Based on the normalized state sample set obtained in step 2, a set of lifting functions is first selected. Map the original normalized state to a higher-dimensional boosting space. Generally, the first... The definition of the elevated state at a given moment
[0034] (3)
[0035] in For the normalized state, Let be a vector composed of several nonlinear basis functions. The improved state vector, To increase the dimension of the post-state.
[0036] In this embodiment, We can choose a Gaussian radial basis function family, and denote the number of radial basis functions as . , No. The radial basis functions are denoted as follows: Then there is
[0037] , (4)
[0038] in For the first One center, For the corresponding width parameter, This represents the Euclidean norm. To ensure the lifting function adapts to the state-space density of the experimental data, enabling the model to perform refined feature extraction on highly nonlinear sensitive regions of the robotic arm's frequent operations, and thus significantly improve the modeling accuracy of strong joint coupling characteristics within a limited lifting dimension, each center... This can be obtained by applying a clustering algorithm (such as k-means clustering) to the normalized state samples. To ensure reproducibility, the width... The center-to-center distance can be selected using the empirical formula: Let... In order to be with the center The closest If there are several neighbor centers, then
[0039] ;
[0040] in For the number of neighbors, This is the scaling factor. For set Any neighboring center in the network. In one implementation, it is possible to choose... , This aims to achieve a compromise between feature locality and smoothness.
[0041] For all samples, construct the boosted state and normalized input for adjacent time steps, denoted as .
[0042] , ;
[0043] , ;
[0044] in The total number of samples.
[0045] The desired form for identifying a biased linear model fitted in the lifting space using the Koopman linear model is as follows. (5)
[0046] in For the first The boosted state vector at each sampling time point contains the normalized original state and its nonlinear boosting characteristics. To improve the system matrix in the state space, For the input matrix, Let c be the bias vector. The bias vector c is designed at the physical level to absorb and compensate for the constant gravitational torque deviation and sensor zero-position offset experienced by the robotic arm. Since the gravitational load on the jointed robotic arm changes drastically with its posture, the introduction of this term solves the problem of static error in trajectory tracking that is easily encountered in traditional unbiased linear models during vertical space motion. According to equation (5), the overall lift state vector satisfies the following form:
[0047] (6)
[0048] remember
[0049] , ;
[0050] To avoid pseudo-dynamic modeling caused by quantization noise during data acquisition of physical systems, and to prevent the model from overfitting to noisy signals under large-scale measured data conditions, a regularization term can be introduced to constrain the norm of the system matrix when fitting the system equations, ensuring the stability of matrix numerical operations. Koopman linear model identification can be expressed as a least-squares problem of ridge regression regularization terms.
[0051] (7)
[0052] in It is the Frobenius norm. Let be the regularization parameter, and its analytical solution is:
[0053] (8)
[0054] By dividing the above k into blocks according to the dimensional order, we can obtain the system matrix A, input matrix B and bias vector c in the boosted state space, thus obtaining the discrete-time Koopman linear model (5).
[0055] Step 4: Design of a Model Predictive Controller Based on the Koopman Linear Model
[0056] The Koopman linear model in the boosted state space constructed and identified in step 3 is as follows:
[0057] (9)
[0058] The matrix that transforms the lifted state vector into joint angle components is denoted as the recovery matrix. That is,
[0059] ;
[0060] in Let be the joint angle vector at the k-th sampling time.
[0061] Based on this Koopman linear model, the prediction time domain length is selected. and control time domain length Based on the current state of improvement As initial conditions, for the future Predict the state and output of each step. Denote the future control input as...
[0062] ;
[0063] in This represents the normalized input prediction value obtained at the k-th sampling time and used at the (k+i)-th sampling time. At that time, the control input remains at .
[0064] The predicted joint position output in the time domain is denoted as...
[0065] ,
[0066] ;
[0067] in To obtain the joint angle at the (k+i)th sampling time using the Koopman linear model at the kth sampling time, This corresponds to the reference trajectory. Given the system matrix A, input matrix B, bias vector c, and recovery matrix... Then, the prediction equation can be written in a compact form.
[0068] (10)
[0069] Where the matrix sum matrix Each satisfies
[0070] (11)
[0071] (12)
[0072] matrix The Koopman linear model is expanded in multiple steps and the bias vector is then used. After absorbing the state dimension into the linear model, the matrix is obtained. The inputs at each step are processed through the input matrix. This is obtained by superimposing the incremental effects on future outputs, reflecting the control input vector. The linear gain of each step of the input to the predicted output. The above form shows that the control input vector... The input components at earlier time points mainly influence the output at more recent time points through lower powers of the system matrix A, while the input components at later time points are influenced by the system matrix A. Higher powers of the equation gradually affect the output at more distant times.
[0073] Based on this, a quadratic performance index is constructed that includes penalties for position error and control input. In one implementation, the performance index can be written as...
[0074] (13)
[0075] in R is the weighted matrix for the position error in the prediction time domain, which is usually formed by the single-step error weight matrix along the diagonal, and R is the control input penalty weight matrix.
[0076] Substituting the compact prediction equation (10) into the above equation (13) and rearranging, and letting the Hessian (i.e., quadratic coefficient) matrix be H and the linear coefficient vector be f, satisfies
[0077] (14)
[0078] (15)
[0079] Then we can obtain information about the optimization variables. standard form of quadratic form
[0080] (16)
[0081] in With optimization variables This is irrelevant and can be ignored in numerical solutions. about We can obtain the gradient.
[0082] (17)
[0083] The optimization problem described above can be viewed as a standard convex quadratic programming (QP) problem. In the typical case without explicit inequality constraints, setting the gradient (17) to zero, its optimal solution satisfies
[0084] ;
[0085] Right now
[0086] (18)
[0087] First, from Extract the first normalized control quantity In order to obtain the actual physical instructions that the servo drive can execute. Based on the normalization relation satisfied by the data, the following inverse normalization calculation is performed.
[0088] (19)
[0089] in and These are the standard deviation and mean vector of the control inputs, calculated from the training data, respectively.
[0090] Step 5: Execution of control commands
[0091] The physical input calculated in step 4 The control command at the current sampling moment is sent to the servo driver to update the state of the controlled system. Then, at the next sampling moment, the updated state is used to reconstruct and solve the quadratic optimization problem described in step 4. Repeating the above process can realize the rolling optimization process of model predictive control.
[0092] A storage medium storing a computer program, which, when executed by a processor, implements the aforementioned data-driven modeling and model predictive control method for the robotic arm system.
[0093] Compared with existing technologies, the beneficial effects of the present invention are as follows:
[0094] 1. Reduced difficulty of dynamic modeling: This invention does not require precise analytical modeling of the inertia matrix, Coriolis force, centripetal force term, and gravity term in the Euler-Lagrange dynamic equations. Instead, it directly utilizes experimental data collected under various working conditions to obtain the Koopman linear model through improved function construction and linear regression identification. This significantly reduces the complexity and workload of robotic arm dynamic modeling. Furthermore, by introducing a bias vector, it solves the engineering pain point of achieving accurate gravity compensation without physical parameter calibration.
[0095] 2. Significantly improves sampling safety and data quality of physical systems: This invention constructs a closed-loop data acquisition environment through an initial controller, aiming to address the open-loop instability of multi-degree-of-freedom jointed robotic arms under non-uniform gravitational field coupling. The closed-loop sampling mechanism ensures the motion safety of the robotic arm during dynamic excitation throughout the entire workspace, effectively eliminating the risk of attitude loss of control or physical collisions caused by gravity. Furthermore, the data acquired in the closed-loop environment can accurately reproduce the dynamic characteristics of the servo drive system under feedback control logic, providing high-quality data support for constructing a physically consistent Koopman linear model.
[0096] 3. Improved Prediction Accuracy and Generalization Ability: This invention constructs boosted states using nonlinear boosting functions such as Gaussian radial basis functions in the normalized state space, and utilizes clustering algorithms such as k-means to achieve adaptive placement of boosting function centers in the state space. This enables the boosting functions to perform refined feature extraction for highly nonlinear sensitive regions of frequent robotic arm movements. Training with multi-condition experimental data covering different postures, velocities, and input amplitudes results in the obtained Koopman linear model exhibiting good approximation ability for actual robotic arm dynamics within a relatively large working range. Experimental results show that, compared to control methods based on a single linear approximation model, the method of this invention significantly reduces prediction and trajectory tracking errors under sinusoidal trajectories and combined trajectories.
[0097] 4. Easy to integrate with model predictive control: Since the Koopman linear model is a linear discrete-time form in the lifting state space, it can be directly embedded into the existing linear model predictive control framework to construct optimization problems based on the Koopman linear model with convex quadratic performance indices. It is easy to implement using numerical optimization methods, and the computational complexity and implementation difficulty are within a controllable range, making it suitable for application in real-time control systems.
[0098] 5. Facilitates performance index adjustment within existing control framework: This invention introduces a secondary penalty term dominated by joint position deviation into the model predictive control performance index, and allows for the selection of whether to add penalty terms such as velocity deviation, control input amplitude, and control input variation according to specific application needs, thereby enabling the trade-off and adjustment of trajectory tracking performance and control input behavior within the existing control framework.
[0099] 6. Supported by practical engineering tests: The method of this invention has been verified through physical experiments on a four-degree-of-freedom robotic arm platform. In tests under various typical trajectories and disturbance conditions, the joint position error of the closed-loop system showed a significant decreasing trend in the initial transition phase, and then fluctuated within a small range. The control input amplitude was within the rated operating range of the drive unit. No obvious instability or long-term saturation was observed during the experiment, indicating that the method of this invention can meet the corresponding control requirements under the tested conditions. Attached Figure Description
[0100] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0101] Figure 1 This is a schematic diagram of the QArm four-degree-of-freedom robotic arm structure used in this embodiment;
[0102] Figure 2 This is a block diagram of the robotic arm data-driven modeling method based on Koopman operator theory in this embodiment;
[0103] Figure 3 This is a block diagram of the robotic arm data-driven control method based on Koopman operator theory in this embodiment;
[0104] Figure 4(a) is a comparison of the predicted state of each joint and the actual state when the Koopman linear model is used to make real-time predictions for the physical QArm four-degree-of-freedom robotic arm in this embodiment. The solid line represents the actual measured value and the dashed line represents the predicted value of the Koopman linear model.
[0105] Figure 4(b) is a schematic diagram of the joint errors of the physical QArm four-degree-of-freedom robotic arm under the real-time prediction of the Koopman linear model in this embodiment.
[0106] Figure 5(a) is a comparison of the actual state of each joint and the reference signal under model predictive control of the physical QArm four-degree-of-freedom manipulator using the Koopman linear model in this embodiment. The solid line represents the reference trajectory and the dashed line represents the actual tracking trajectory.
[0107] Figure 5(b) is a schematic diagram of the joint errors of the physical QArm four-degree-of-freedom robotic arm under model predictive control using the Koopman linear model in this embodiment. Detailed Implementation
[0108] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0109] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0110] Robotic Arm Dynamics Model and Discretized Representation
[0111] In this invention, the continuous-time dynamics of the robotic arm are modeled using the Euler-Lagrange equations. The Euler-Lagrange dynamics model describing the N-DOF robotic arm system can be written as follows:
[0112] (1)
[0113] in, For the joint angle vectors of a multi-degree-of-freedom robotic arm, , These are the joint angular velocity and joint angular acceleration vectors, respectively. This is the joint driving torque vector. It is a symmetric positive definite inertia matrix used to describe the equivalent inertia of the link and the load. For the Coriolis force and centripetal force terms, This is the gravity term, used to describe the equivalent torque of gravity on each joint.
[0114] To facilitate integration with data-driven methods, the continuous-time model is divided according to the sampling period. Discretize, let the first... The corresponding state and control input at each time point are as follows:
[0115] , ;
[0116] in, , The first The joint angle and joint angular velocity vector at time t. For the first Input torque at any moment By mapping the relationship between indirect control signals such as actual control input current or voltage and joint input torque, the original robotic arm can be discretized into a nonlinear discrete-time system.
[0117] (2)
[0118] in For the continuous-time Eulerian-Lagrange dynamics model (1) described above, during the sampling period The mapping is obtained through numerical integration.
[0119] Data collection and processing
[0120] On an N-DOF robotic arm platform, let the angles of each joint be as follows: , , , The corresponding angular velocities of each joint are as follows: , , , The control inputs for each joint are denoted as follows: , , , Unlike open-loop identification methods applicable only to simulation environments, this invention employs a data acquisition and identification approach under the closed-loop operation conditions of a physical robotic arm. First, an initial controller (e.g., a control law tuned based on simple proportional control or other empirical parameters) capable of ensuring basic stability and safety is used to drive the robotic arm in a closed loop. This initial controller does not require high control performance or very small steady-state error; it only needs to maintain system operation and provide sufficient excitation within safety constraints. Subsequently, under the premise of meeting safety constraints such as joint angles, angular velocities, and currents, the system is excited online, and the joint positions, joint velocities, and drive input time series of the physical robotic arm are recorded simultaneously. This method of data acquisition not only effectively avoids safety hazards caused by joint loss of control or physical collisions due to gravity or nonlinear abrupt changes during open-loop data acquisition, but also directly reflects the combined effects of actual servo drives, friction, clearance, and electrical interfaces, making it closer to real-world operating conditions.
[0121] In one implementation, the initial controller can be a low-precision position controller that comes pre-installed with the robotic arm, as an example, to provide necessary excitation and complete closed-loop data acquisition while ensuring safety and basic stability. Under closed-loop control conditions, training data is obtained through multiple sets of typical experimental conditions, including but not limited to: joint sinusoidal trajectory tracking experiments conducted near typical operating points, sinusoidal or combined trajectory tracking experiments with different amplitude and frequency combinations, and response experiments to random step jumps or random disturbances applied in joint space or task space.
[0122] The state vector and input vector were extracted from the time series data obtained from the above experiments.
[0123] , ;
[0124] And construct sample pairs according to adjacent time points, such as the first... The sample pairs up to the (k+1)th sampling time can be denoted as Subsequently, the mean and standard deviation of the states and inputs for all samples were jointly calculated. Mean-variance standardization (Z-score) was then used to normalize both the states and inputs. The calculation formula is as follows:
[0125] , ;
[0126] in , and , These are the mean and standard deviation of the state and input, respectively, obtained statistically from the training data. This yields the normalized state samples. With normalized input samples Furthermore, samples from different experimental conditions are aggregated along the sample dimension to obtain a large-scale training dataset covering multiple conditions.
[0127] Construction of lifting functions and identification of Koopman linear models
[0128] Based on the obtained set of normalized state samples, a set of lifting functions is first selected. The original normalized state is mapped to a high-dimensional boosting space. Generally, the boosted state at time k can be defined as...
[0129] (3)
[0130] in For the normalized state, Let be a vector composed of several nonlinear basis functions. The improved state vector, To increase the dimension of the post-state.
[0131] In this embodiment, We can choose a Gaussian radial basis function family, denoted as V for the number of radial basis functions, and the j-th radial basis function denoted as . Then there is
[0132] , (4)
[0133] in For the first One center, For the corresponding width parameter, This represents the Euclidean norm. To ensure the lifting function adapts to the state-space density of the experimental data, enabling the model to perform refined feature extraction on highly nonlinear sensitive regions of the robotic arm's frequent operations, and thus significantly improve the modeling accuracy of strong joint coupling characteristics within a limited lifting dimension, each center... Clustering algorithms (e.g.) can be applied to normalized state samples. Obtained using the -means clustering algorithm. To ensure reproducibility, the width... The center-to-center distance can be selected using the empirical formula: Let... In order to be with the center The set of the p nearest neighbor centers, then
[0134] ;
[0135] Where p is the number of neighbors and m is the scaling factor. For set Any neighboring center in the network. In one implementation, it is possible to choose... , This aims to achieve a compromise between feature locality and smoothness.
[0136] For all samples, construct the boosted state and normalized input for adjacent time steps, denoted as .
[0137] , ;
[0138] , ;
[0139] in The total number of samples.
[0140] The desired form for identifying a biased linear model fitted in the lifting space using the Koopman linear model is as follows.
[0141] (5)
[0142] in Let be the boosted state vector at the k-th sampling time, containing the normalized original state and its nonlinear boosting characteristics. To improve the system matrix in the state space, For the input matrix, Let c be the bias vector. The bias vector c is designed at the physical level to absorb and compensate for the constant gravitational torque deviation and sensor zero-position offset experienced by the robotic arm. Since the gravitational load on the jointed robotic arm changes drastically with its posture, the introduction of this term solves the problem of static error in trajectory tracking that is easily encountered in traditional unbiased linear models during vertical space motion. According to equation (5), the overall lift state vector satisfies the following form:
[0143] (6)
[0144] remember
[0145] , ;
[0146] To avoid pseudo-dynamic modeling caused by quantization noise during data acquisition of physical systems, and to prevent the model from overfitting to noisy signals under large-scale measured data conditions, a regularization term can be introduced to constrain the norm of the system matrix when fitting the system equations, ensuring the stability of matrix numerical operations. Koopman linear model identification can be expressed as a least-squares problem of ridge regression regularization terms.
[0147] (7)
[0148] in It is the Frobenius norm. Let be the regularization parameter, and its analytical solution is:
[0149] (8)
[0150] The above By dividing the system into blocks according to the dimensional order, we can obtain the system matrix A, the input matrix B, and the bias vector c in the boosted state space, thus obtaining the discrete-time Koopman linear model (5).
[0151] Model Predictive Controller Design Based on Koopman Linear Model
[0152] The Koopman linear model within the constructed and identified boosted state space is:
[0153] (9)
[0154] The matrix that transforms the lifted state vector into joint angle components is denoted as the recovery matrix. That is,
[0155] ;
[0156] in Let be the joint angle vector at the k-th sampling time.
[0157] Based on this Koopman linear model, the prediction time domain length is selected. and control time domain length Based on the current state of improvement As initial conditions, for the future Predict the state and output of each step. Denote the future control input as...
[0158] ;
[0159] in This represents the normalized input prediction value obtained at the k-th sampling time and used at the (k+i)-th sampling time. At that time, the control input remains at .
[0160] The predicted joint position output in the time domain is denoted as...
[0161] ,
[0162] ;
[0163] in In the first The joint angle at the (k+i)th sampling time is predicted using the Koopman linear model at each sampling time. This corresponds to the reference trajectory. Given the system matrix A, input matrix B, bias vector c, and recovery matrix... Then, the prediction equation can be written in a compact form.
[0164] (10)
[0165] Where the matrix sum matrix Each satisfies
[0166] (11)
[0167] (12)
[0168] matrix The matrix is obtained by performing a multi-step expansion of the Koopman linear model and absorbing the bias vector c into the linear model through state dimension expansion. The inputs at each step are processed through the input matrix. This is obtained by superimposing the incremental effects on future outputs, reflecting the control input vector. The linear gain of each step of the input to the predicted output. The above form shows that the control input vector... The input components at earlier times are mainly processed through the system matrix. The lower powers of the inputs affect the output at more recent times, while the input components at later times are affected by the system matrix. Higher powers of the equation gradually affect the output at more distant times.
[0169] Based on this, a quadratic performance index is constructed that includes penalties for position error and control input. In one implementation, the performance index can be written as...
[0170] (13)
[0171] in R is the weighted matrix for the position error in the prediction time domain, which is usually formed by the single-step error weight matrix along the diagonal, and R is the control input penalty weight matrix.
[0172] Substituting the compact prediction equation (10) into the above equation (13) and rearranging, and denoting the Hessian (i.e., quadratic coefficient) matrix as H and the linear coefficient vector as f, satisfies
[0173] foot (14)
[0174] (15)
[0175] Then we can obtain information about the optimization variables. standard form of quadratic form
[0176] (16)
[0177] in With optimization variables This is irrelevant and can be ignored in numerical solutions. about We can obtain the gradient.
[0178] (17)
[0179] The optimization problem described above can be viewed as a standard convex quadratic programming (QP) problem. In the typical case without explicit inequality constraints, setting the gradient (17) to zero, its optimal solution satisfies
[0180] ;
[0181] Right now
[0182] (18)
[0183] First, from Extract the first normalized control quantity In order to obtain the actual physical instructions that the servo drive can execute. Based on the normalization relation satisfied by the data, the following inverse normalization calculation is performed.
[0184] (19)
[0185] in and These are the standard deviation and mean vector of the control inputs, calculated from the training data, respectively.
[0186] Control command execution
[0187] The calculated physical input The control command at the current sampling moment is sent to the servo driver to update the state of the controlled system. Then, at the next sampling moment, the updated state is used to reconstruct and solve the above quadratic optimization problem. Repeating the above process can realize the rolling optimization process of model predictive control.
[0188] Experimental verification on a multi-degree-of-freedom robotic arm
[0189] Taking a four-degree-of-freedom robotic arm as an example, this embodiment focuses on the following: Figure 1The QArm four-degree-of-freedom robotic arm physical platform shown was used for experimental verification. Since we adopted a data-driven modeling and control method, it was not necessary to know the specific parameters of the robotic arm system. A closed-loop control system, including closed-loop data acquisition, Koopman modeling, model predictive controller, and the robotic arm physical system, was built based on MATLAB / Simulink. The control input was sent to the actual servo driver through a real-time interface. The specific experimental process was divided into three stages: The first stage was closed-loop data acquisition under the initial controller, which was used to obtain the state and input time series covering various typical working conditions and to train the Koopman linear model accordingly; The second stage was real-time one-step prediction test based on the trained Koopman linear model. During the closed-loop operation of the physical robotic arm, the measured state and control input at the current sampling time were used to calculate the predicted value of the joint angle at the next sampling time online, and the value was compared with the actual measured value to evaluate the one-step prediction accuracy; The third stage was a closed-loop experiment of model predictive control (MPC) based on the Koopman linear model. Based on the verification of the prediction accuracy in the second stage, the Koopman linear model was embedded into the MPC framework to generate control commands and realize the trajectory tracking control of each joint angle of the robotic arm. All three stages are completed on a physical platform. Since the method we use is a data-driven method, we do not need to know the specific parameters of the robotic arm system.
[0190] During the first phase of data acquisition, reference trajectories for joint angles under various conditions are configured through a reference trajectory generation function. This enriches the system's excitation and improves the coverage of training samples. The reference trajectories may include: long-term static holding, slow single-joint trajectories focusing on the slow movement of the second / third joint, which is significantly affected by gravity, random step response trajectories, and dynamic trajectories such as low-frequency sinusoidal, Lissajous, and random reference trajectories. After completing the Koopman linear model training, both the second phase of real-time one-step prediction testing and the third phase of MPC closed-loop control performance verification uniformly use low-frequency sinusoidal joint angle reference trajectories as the online operating condition to evaluate prediction accuracy and control performance under the same type of continuous trajectory.
[0191] The results of the prediction experiment are shown in Figures 4(a) and 4(b), and the results of the control experiment are shown in Figures 5(a) and 5(b). The results show that the Koopman linear model modeled in this invention has high prediction accuracy, and the prediction model controller designed based on it can control the joint angle tracking error within a small range under continuous sinusoidal reference conditions, and exhibits relatively consistent response characteristics in multiple repeated motions.
[0192] The above is the content of this invention. Any changes made to the technical solution of this invention that do not exceed the scope of the technical solution of this invention shall fall within the protection scope of this invention.
Claims
1. A data-driven modeling and model predictive control method for a robotic arm system, the method comprising: Includes the following steps: Step 1: In the workspace of multiple joints of the robotic arm, closed-loop acquisition of experimental data including joint position, joint velocity and joint drive input is performed. The experimental data is normalized to obtain normalized state sequence and normalized input sequence. Step 2: Based on the normalized state sequence, select a set of lifting functions to describe the dynamic characteristics of the system, and map the normalized state to a high-dimensional lifted state to form a lifted state vector containing the original normalized state components and the enhanced feature components obtained by the nonlinear lifting function transformation. Step 3: Construct adjacent time sample pairs using the normalized state sequence and the normalized input sequence, and build a linear regression model with the current time boosted state vector and the current normalized input as independent variables and the next time boosted state as the dependent variable. Solve the model using the least squares method with regularization term to obtain the Koopman linear model describing the dynamics of the robotic arm. Step 4: Given the reference trajectory of the robotic arm joints, the normalized state at the current moment is mapped to the current lifting state through the lifting function. Based on the Koopman linear model, a quadratic performance index with joint position deviation as the main component is constructed in the finite prediction time domain. The optimal joint drive input at the current moment is solved by the rolling optimization method. Step 5: Send the optimal joint drive input to the robotic arm drive system for execution, obtain the updated state at the next sampling time, and repeat step 4 to realize data-driven modeling and model predictive control of the robotic arm system.
2. The data-driven modeling and model predictive control method for the robotic arm system according to claim 1, characterized in that, The experimental data collected in step 1 includes: using the initial controller to conduct experiments on the sinusoidal trajectory tracking of the robotic arm's joints, random step jumps or random perturbation excitation experiments, continuously recording the time series of joint position, joint velocity and joint drive input under different experimental conditions, and constructing sample pairs of adjacent time moments in the time dimension for training the Koopman linear model.
3. The data-driven modeling and model predictive control method for the robotic arm system according to claim 2, characterized in that, The lifting function in step 2 adopts the form of Gaussian radial basis function, and the normalized state samples are processed using... k -The mean clustering algorithm selects the centers of the radial basis functions as... k The width parameter of the radial basis function for the cluster centers obtained by the -means clustering algorithm is obtained by calculating the Euclidean distance from each cluster center to its nearest neighbor cluster center and scaling the Euclidean distance.
4. The data-driven modeling and model predictive control method for the robotic arm system according to claim 3, characterized in that, In step 3, the linear regression uses a batch accumulation method to construct the autocorrelation matrix and cross-correlation matrix of the improved state vector and normalized input. In each batch, local statistics are calculated based on the samples of the current batch and accumulated to the global statistics. After the accumulation of all batches is completed, a ridge regression regularization term is introduced to correct the autocorrelation matrix. The system matrix, input matrix and bias vector are obtained by matrix inversion or solving the linear equation system to improve the numerical stability of the regression solution under large-scale sample conditions and suppress overfitting.
5. The data-driven modeling and model predictive control method for the robotic arm system according to claim 4, characterized in that, The quadratic performance metric in step 4 includes one or more of the following penalty terms: (1) A weighted quadratic penalty term for joint position deviation is used to constrain the deviation of joint position from the reference trajectory and improve steady-state and dynamic tracking accuracy; (2) The weighted quadratic penalty term for joint velocity deviation is used to limit the joint velocity change too quickly and improve the smoothness of the trajectory and mechanical impact characteristics; (3) A weighted quadratic penalty term for controlling the input amplitude is used to limit the size of the drive input, avoid actuator saturation, and reduce energy consumption; (4) A weighted quadratic penalty term for the change in control input at adjacent sampling times is used to suppress high-frequency jitter of the control signal and reduce oscillation and mechanical shock in the servo drive; The weighting coefficients of the above penalty items are adjusted according to the importance of different joints and the capabilities of the actuators, so as to achieve a trade-off between error performance and control smoothness.
6. The data-driven modeling and model predictive control method for the robotic arm system according to claim 5, characterized in that, In the model predictive control solution process, the prediction time domain length may be the same as or different from the control time domain length. The optimization problem is a quadratic programming problem with linear dynamic constraints in the state space and a convex quadratic performance index. At each sampling time, the currently measured state is normalized and mapped to obtain the initial boost state. Based on the initial boost state and the reference trajectory, a finite-time optimization problem is constructed. By solving the problem, the optimal input sequence in the prediction time domain is obtained. Only the first step input in this sequence is used as the optimal joint drive input at the current time.
7. The data-driven modeling and model predictive control method for the robotic arm system according to claim 6, characterized in that, The Gaussian radial basis lifting function squares the Euclidean distance between any normalized state vector and any cluster center and substitutes it into the Gaussian function. This achieves the characteristic that the output value is close to 1 near the center and smoothly decays to close to 0 when it is far away from the center. Furthermore, the output of the radial basis function is normalized or scaled to avoid excessive differences in the numerical magnitude between different feature components, thereby improving the balance of the lifted state in different dimensions.
8. The data-driven modeling and model predictive control method for the robotic arm system according to claim 7, characterized in that, The Koopman linear model and model predictive control are implemented in a computing unit or digital processor. Specifically, this includes: loading the system matrix, input matrix, bias vector, and radial basis function center and width parameters into the control algorithm; constructing closed-loop control logic including a lift mapping module, a linear predictive model module, and an optimization solution module; initializing the reference trajectory and model predictive control parameters; and, in conjunction with the real-time communication interface between the robot arm and the actual drive system, converting the current control quantity in the optimized control input sequence into current or voltage commands compatible with the servo driver, thereby achieving online real-time control and data recording.
9. The data-driven modeling and model predictive control method for the robotic arm system according to claim 8, characterized in that, The robotic arm is a multi-degree-of-freedom robotic arm, with each joint driven by a servo motor. The normalized state includes the angles and angular velocities of multiple joints. The joint drive input is a control command signal that is proportional to the current or voltage of each joint's servo motor. During the data acquisition and control process, the joint position and joint velocity measurements are read and control commands are sent at a fixed sampling period based on the communication interface with the servo driver, thereby realizing trajectory tracking control and performance evaluation of the multi-degree-of-freedom robotic arm under multiple typical trajectories and disturbance conditions.
10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the data-driven modeling and model predictive control method for the robotic arm system according to any one of claims 1-9.