A self-calibration method and system for robot dynamic gait error based on MEMS inertial sensors
By using MEMS inertial sensors and nonlinear error models, combined with inverse kinematics mapping and PWM modulation, we have achieved full-scene self-calibration and high dynamic response of robot gait error, which solves the gait oscillation problem caused by response lag in existing technologies and improves the dynamic stability of the robot.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI LAMSHINE CO LTD
- Filing Date
- 2026-02-02
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies struggle to achieve efficient self-calibration of robot gait errors across all scenarios, especially in environments without base stations and during high-speed dynamic motion, where response lag issues exist, leading to gait oscillations or system instability.
Motion data is acquired intrinsically using MEMS inertial sensors. A nonlinear error model including attenuation factors is constructed. The characteristic of the attenuation factor decreasing over time is used to simulate the time-dependent correlation of sensor error. Combined with inverse kinematic mapping and PWM duty cycle modulation, a real-time gait correction matrix is generated and used to drive the joint motor, eliminating mechanical transmission hysteresis.
It achieves gait error self-calibration with full-scene applicability and high dynamic response, eliminates self-excited oscillation of the control system caused by spatiotemporal misalignment, and improves the dynamic stability of the robot.
Smart Images

Figure CN121612277B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of robot motion technology, and in particular to a method and system for self-calibrating robot dynamic gait error based on MEMS inertial sensors. Background Technology
[0002] During dynamic walking, robots inevitably experience gait errors due to mechanical gaps, ground slippage, or minor deformations in their internal structures. To ensure that the robot can accurately execute a predetermined trajectory and maintain posture balance, an effective dynamic error detection and self-calibration mechanism must be introduced to correct accumulated deviations during movement in real time.
[0003] To achieve the above objectives, two main implementation paths have been proposed: one is the RTK positioning and correction scheme relying on external auxiliary facilities; the other is a mechanical foot force / position feedback adjustment mechanism based on body contact perception. Specifically, the RTK scheme typically deploys fixed ground base stations within the work area. The robot achieves centimeter-level high-precision positioning by receiving differential data between the base station and satellite signals, and adjusts its position accordingly to eliminate errors. The mechanical feedback scheme, on the other hand, installs highly sensitive torque sensors or mechanical displacement gauges on the robot's foot or joint ends. By monitoring the force state or positional deformation of the foot at the moment of contact with the ground in real time, the physical deviation signal is fed back to the central controller, which then adjusts the output torque of the joint motors in reverse.
[0004] However, while RTK solutions offer extremely high accuracy in open environments, they suffer from drawbacks such as environmental dependence and high infrastructure costs. The need for additional base stations increases the overall system construction cost, and satellite signals are easily lost in indoor, tunnel, or densely built-up environments, causing robot calibration to fail. Mechanical feedback solutions, while eliminating external dependence, face the problem of response lag. Due to the propagation of mechanical waves, sensor filtering, and the computational overhead of the control loop, the overall adjustment delay of this solution often exceeds 100ms. During high-speed dynamic walking, this lag causes calibration commands to always lag behind actual posture changes, failing to eliminate errors and potentially causing gait oscillations or system instability due to phase lag. This makes it difficult for related technologies to simultaneously meet the requirements of universal applicability (no base station required) and high dynamic response (low latency). Summary of the Invention
[0005] This application provides a self-calibration method and system for robot dynamic gait error based on MEMS inertial sensors, which can meet the requirements of full-scene applicability and high dynamic response.
[0006] In a first aspect, this application provides a self-calibration method for robot dynamic gait error based on MEMS inertial sensors, comprising: calculating the robot's motion data based on a preset nonlinear error model to obtain the error state vector at the current moment; the motion data is obtained by collecting preset parts of the robot from MEMS inertial sensors; wherein, the error state vector at the current moment is equal to the sum of the predicted error states at different historical moments multiplied by the corresponding attenuation factors plus random interference noise, and the attenuation factor decreases as the interval between the current moment and the historical moment increases; performing inverse kinematic mapping calculation based on the error state vector at the current moment to generate a real-time gait correction matrix for correcting the target pose of the robot joints; using the real-time gait correction matrix to perform duty cycle modulation on the PWM pulse width modulation control signal of the robot joint controller to generate a corrected drive command and drive the joint motor.
[0007] By employing the aforementioned technical solution, motion data is intrinsically acquired using MEMS sensors, eliminating reliance on external base station facilities and achieving autonomous perception across all terrains and scenarios. Building upon this, a nonlinear error model incorporating an attenuation factor is constructed. Utilizing the characteristic that the attenuation factor decreases with increasing time intervals, the physical law of time-discorrelation of sensor errors is simulated, suppressing excessive accumulation of historical random noise. This ensures that the calculated error state vector accurately reflects the current true drift. Furthermore, combined with inverse kinematic mapping, the abstract mathematical error is transformed into a pose correction value in joint space, and finally, this correction value is applied to the motor through direct modulation of the PWM duty cycle. This eliminates mechanical transmission hysteresis while meeting the requirements of applicability to all scenarios and high dynamic response.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of using a real-time gait correction matrix to modulate the duty cycle of the PWM pulse width modulation control signal of the robot joint controller, generating a corrected drive command and driving the joint motor, the method further includes: calculating the time difference between the start time of motion data acquisition from the MEMS inertial sensor and the effective time of the corrected drive command to obtain the end-to-end processing delay; in the calibration process of the next stage, the end-to-end processing delay is sequentially added to the time interval between the current time and the historical time, and the attenuation factor is updated.
[0009] By adopting the above technical solution, after the calibration process, the end-to-end processing delay from data acquisition to drive activation is calculated. This delay quantifies the physical lag caused by system computation and transmission. Subsequently, in the next stage, this end-to-end processing delay is used to update the calculation logic of the attenuation factor, incorporating the physical delay into the evolution time parameter of the mathematical model. This allows the attenuation factor value to reflect errors including future time periods. The original error estimation for past moments is transformed into an error prediction for the future moment when the drive command actually takes effect. This can proactively offset the phase lag caused by computation time, thereby eliminating the self-excited oscillation of the control system caused by spatiotemporal misalignment at its source during high-speed motion, and improving dynamic stability.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of adding the end-to-end processing delay to the time interval between the current moment and the historical moment and updating the attenuation factor during the next stage of calibration, the method further includes: calculating the robot's motion data based on a preset nonlinear error model to obtain the error state vector at the future moment; analyzing the error state vector at the future moment to extract the future zero-bias prediction component and the future scaling factor prediction component; solving the future zero-bias prediction component and the future scaling factor prediction component according to inverse kinematics to obtain the joint angle advance compensation value; arranging the joint angle advance compensation value according to the robot's geometric configuration through homogeneous transformation to construct the future gait correction matrix; and using the future gait correction matrix to perform duty cycle modulation on the PWM pulse width modulation control signal of the robot joint controller to generate the corrected drive command and drive the joint motor.
[0011] By employing the aforementioned technical solution and relying on the updated attenuation factor, an error state vector precisely aligned to future moments can be derived, avoiding the bias associated with using lag data for correction. By analyzing this future moment vector and extracting the zero bias and scaling factor components, these components are substituted into the inverse kinematics solution to calculate the joint angle lead compensation value specifically for future moment drift. This not only achieves alignment in time but also spatially maps abstract sensor errors to concrete actuator movements.
[0012] In conjunction with some embodiments of the first aspect, before the step of arranging the joint angle advance compensation values according to the robot's geometric configuration in a homogeneous transformation to construct the future gait correction matrix, the method further includes: using the end-to-end processing delay as a time index key to access the instruction buffer queue to be executed; in the instruction buffer queue to be executed, retrieving instruction data whose timestamp matches the current system time superimposed with the end-to-end processing delay, and extracting the target joint configuration at the future moment; substituting the target joint configuration at the future moment into the robot's kinematic equations to parse and construct the reference Jacobian matrix at the future moment; and using the reference Jacobian matrix at the future moment as the basic transformation parameter for inverse kinematics.
[0013] By employing the above technical solution and using end-to-end processing latency as a time index, the system locates the instruction data to be executed in the buffer queue and extracts the target joint configuration for the future moment that is consistent with the moment the drive takes effect. This step ensures that the geometric reference for kinematic calculations is no longer the lagging current measured posture, but rather the actual posture that the robot is about to reach.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, the step of performing inverse kinematics mapping calculation based on the current error state vector to generate a real-time gait correction matrix for correcting the target pose of robot joints specifically includes: parsing the current error state vector and separating the current zero bias component and the current scale factor component; solving the current zero bias component and the current scale factor component according to inverse kinematics to obtain instantaneous joint angle compensation values; and arranging the instantaneous joint angle compensation values according to the robot's geometric configuration through homogeneous transformation to construct the real-time gait correction matrix.
[0015] By employing the aforementioned technical solution, the error state vector is analyzed to separate the zero-bias component and the scaling factor component, which can independently characterize the physical defects of the sensor, thus clarifying the physical source of the error. Subsequently, these components are solved using the inverse kinematics principle, converting the measurement deviation in the sensor coordinate system into instantaneous angle compensation values in the robot joint coordinate system. This ensures that any sensor drift can be corrected by a corresponding motor angle adjustment. Finally, by constructing a real-time gait correction matrix, the dispersed compensation values are encapsulated into a unified mathematical operator, facilitating direct use by the control system.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, the motion data includes triaxial acceleration and angular velocity data.
[0017] By employing the above technical solution, the accelerometer's ability to sense the gravity vector and the gyroscope's ability to capture instantaneous rotational states are fully utilized. Angular velocity data can quickly respond to extremely small attitude changes, providing high-frequency dynamic information; while acceleration data can provide an absolute tilt angle reference through the gravity component, suppressing long-term drift caused by the angular velocity integral. The fusion of these two types of data provides multi-dimensional observational inputs for the nonlinear error model, not only enriching the information content of state estimation but also improving the accuracy of error separation by utilizing complementary characteristics.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, the robot's motion data is calculated based on a preset nonlinear error model to obtain the error state vector at the current moment; before the step of obtaining the motion data from a preset part of the robot by a MEMS inertial sensor, the method further includes: calculating the convolution weight coefficient vector using the least squares regular equation based on a preset smoothing window length and a polynomial fitting order; adding the motion data to a data buffer queue in chronological order, the length of the data buffer queue being the same as the smoothing window length; multiplying each data point in the data buffer queue with the coefficient at the corresponding position in the convolution weight coefficient vector, and summing all the product results to update the motion data.
[0019] By adopting the above technical solution, before entering the nonlinear model calculation, the convolution weight coefficient vector is calculated offline using the least squares method, transforming the complex polynomial fitting process into an efficient linear weighted operation. In real-time operation, a data buffer queue maintains the latest time-series data window, and the convolution weight coefficients are used to perform convolution and summation on the data within the window. This processing method enables smooth updates of motion data in the time domain and, utilizing the fitting characteristics of polynomials, filters out high-frequency random noise in the original MEMS sensor signal without introducing phase delay.
[0020] Secondly, this application provides a self-calibration system for robot dynamic gait error based on MEMS inertial sensors. The self-calibration system for robot dynamic gait error based on MEMS inertial sensors includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, which includes computer instructions. The one or more processors call the computer instructions to cause the self-calibration system for robot dynamic gait error based on MEMS inertial sensors to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, this application provides a computer program product containing instructions that, when the computer program product is run on a self-calibration system for dynamic gait error of a robot based on a MEMS inertial sensor, causes the self-calibration system for dynamic gait error of a robot based on a MEMS inertial sensor to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, this application provides a computer-readable storage medium including instructions that, when executed on a MEMS inertial sensor-based robot dynamic gait error self-calibration system, cause the MEMS inertial sensor-based robot dynamic gait error self-calibration system to perform the method described in the first aspect and any possible implementation thereof.
[0023] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0024] 1. By utilizing MEMS sensors to intrinsically acquire motion data, dependence on external base station facilities is eliminated, enabling autonomous perception across all terrains and scenarios. Building upon this, a nonlinear error model incorporating an attenuation factor is constructed. Leveraging the characteristic that the attenuation factor decreases with increasing time intervals, the physical law of time-discorrelation of sensor errors is simulated, suppressing excessive accumulation of historical random noise. This ensures that the calculated error state vector accurately reflects the current true drift. Furthermore, combined with inverse kinematic mapping, the abstract mathematical error is transformed into a pose correction value in joint space, and finally, this correction value is applied to the motor through direct modulation of the PWM duty cycle. This eliminates mechanical transmission hysteresis while meeting the requirements of applicability to all scenarios and high dynamic response.
[0025] 2. Following the calibration process, the end-to-end processing latency from data acquisition to drive activation is calculated. This latency quantifies the physical lag caused by system computation and transmission. Subsequently, in the next stage, this end-to-end processing latency is used to update the calculation logic of the attenuation factor, integrating the physical latency into the evolution time parameters of the mathematical model. This ensures that the attenuation factor value reflects errors including future time periods. The original error estimation based on past moments is transformed into an error prediction for the future moment when the drive command actually takes effect. This can proactively offset the phase lag caused by computation time, thereby eliminating the self-excited oscillation of the control system caused by spatiotemporal misalignment at its source during high-speed motion, and improving dynamic stability.
[0026] 3. Based on the updated attenuation factor, the error state vector precisely aligned to future moments can be derived, avoiding the bias associated with using lag data for correction. By analyzing this future moment vector and extracting the zero bias and scaling factor components, these components are substituted into the inverse kinematics solution to calculate the joint angle advance compensation value specifically for future moment drift. This not only achieves alignment in time but also maps the abstract sensor error to concrete actuator movements in space. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating a self-calibration method for robot dynamic gait error based on MEMS inertial sensors in an embodiment of this application.
[0028] Figure 2 This is another flowchart illustrating the self-calibration method for robot dynamic gait error based on MEMS inertial sensors in this application embodiment;
[0029] Figure 3This is another flowchart illustrating the self-calibration method for robot dynamic gait error based on MEMS inertial sensors in this application embodiment;
[0030] Figure 4 This is an exemplary hardware structure diagram of a self-calibration system for robot dynamic gait error based on MEMS inertial sensors in this application embodiment. Detailed Implementation
[0031] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.
[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0033] Please see Figure 1 , Figure 1 This is a flowchart illustrating a self-calibration method for robot dynamic gait error based on MEMS inertial sensors in an embodiment of this application.
[0034] S101. Acquire motion data, including triaxial acceleration and angular velocity data;
[0035] Among them, motion data refers to the data of the robot during its movement. Specifically, it can be the acceleration and angular velocity data of preset parts of the robot, such as joints. Three-axis acceleration represents the vector including the gravitational component that the object experiences in the three-dimensional coordinate system; angular velocity represents the instantaneous rate of rotation of the object around the coordinate axis.
[0036] It is evident that the accelerometer's ability to sense the gravity vector and the gyroscope's ability to capture instantaneous rotational states are fully utilized. Angular velocity data can rapidly respond to extremely minute attitude changes, providing high-frequency dynamic information; while acceleration data can provide an absolute tilt angle reference through the gravity component, suppressing long-term drift caused by the angular velocity integral. The fusion of these two types of data provides multi-dimensional observational inputs for the nonlinear error model, not only enriching the information content of state estimation but also improving the accuracy of error separation by utilizing complementary properties.
[0037] S102. Based on the preset smooth window length and polynomial fitting order, the convolution weight coefficient vector is calculated using the least squares regular equation.
[0038] Among them, the smoothing window length refers to the number of consecutive sampling points involved in the calculation during the filtering process, which determines the time span of the filtering operation; the polynomial fitting order refers to the highest power of the basis function polynomial used to approximate the local trend of the data, which determines the ability to preserve the characteristics of the signal waveform; the least squares method is a mathematical optimization method that finds the best function match of the data by minimizing the sum of squares of the errors; the regular equation refers to the algebraic equation used to analytically solve the parameters of the linear equation system in the least squares problem; and the convolution weight coefficient vector refers to a set of fixed numerical coefficients derived from the fitting model for weighted summation of time series data.
[0039] Specifically, the system first determines the length of the smoothing window and the order of the polynomial fitting. Based on the Savitzky-Golay filtering principle, it is assumed that the discrete data points within the window conform to a polynomial variation pattern of a specific order. To obtain the optimal coefficients of this polynomial to achieve the best approximation of the window data, the system constructs a system of linear equations based on the Vandermonde matrix and establishes the corresponding regularization equations according to the least squares criterion. Since real-time filtering operations typically only output the fitted values at the center of the window, and this fitting calculation process is mathematically equivalent to a linear convolution of a set of fixed coefficients with the input data, the system analytically calculates a set of constant vectors that depend only on the window length and the fitting order by solving the regularization equations. This vector is the convolution weight coefficient vector required for subsequent filtering operations.
[0040] In some specific embodiments, the system first generates an integer sequence symmetrically extending in both positive and negative directions, centered at zero, based on the smoothed window length. For example, if the window length is 5, the generated sequence is: negative two, negative one, zero, positive one, positive two.
[0041] The system uses a predefined polynomial fitting order to perform exponential expansion on the aforementioned position index sequence. For each integer in the sequence, its zero power (i.e., 1), first power, second power, and so on, up to the highest order power. The system arranges all the power calculation results corresponding to each position into a row, and combines all the rows corresponding to all positions to form a two-dimensional numerical table (i.e., a matrix).
[0042] The system transposes the aforementioned two-dimensional numerical table, changing rows to columns and columns to rows, resulting in a transposed table. Then, the system performs matrix multiplication between the transposed table and the original two-dimensional numerical table to generate a square matrix. Next, the system performs matrix inversion on this square matrix to obtain the inverse square matrix.
[0043] The system performs matrix multiplication again with the previously transposed table to generate a final projection matrix. The system directly selects the first row of this projection matrix because it corresponds to the constant coefficients of the polynomial, which are the fitted values and weights of the window center point. The numerical sequence contained in this row is the final convolution weight coefficient vector.
[0044] S103. Add the motion data to the data buffer queue according to the time sequence. The length of the data buffer queue is the same as the length of the smoothing window.
[0045] Among them, motion data refers to the raw sampled values output by the sensor; according to time sequence means following the order in which the data was generated; and the data buffer queue refers to a linear storage structure with a fixed capacity that follows the first-in, first-out principle.
[0046] Specifically, this step constructs a sliding window structure to carry the real-time data stream. The system initializes a data structure in memory with a capacity strictly equal to the length of the sliding window. When the sensor reports new sampled data, the system performs an enqueue operation, storing the new data at the latest position in the queue. If the queue is full at this time, the system performs a dequeue operation before storing new data, removing the oldest data point from the queue, thus ensuring that the queue always retains only the most recent continuous sampled data. This process achieves time window truncation of the real-time data stream, providing the necessary local data support for subsequent convolution operations.
[0047] S104. Perform a multiplication operation between each data point in the data buffer queue and the corresponding coefficient in the convolution weight coefficient vector, and sum all the product results to update the motion data.
[0048] Here, each data point refers to all historical sampled values currently stored in the buffer queue; the corresponding position refers to the specific mapping relationship between the coefficient vector index and the buffer queue time index; the product result refers to the signal component after weighted processing; the summation refers to the algebraic addition of all components; and the update refers to replacing the original measurement value with the calculated smooth value.
[0049] Specifically, this step performs discrete-time convolution operations to achieve digital filtering. The system iterates through each element in the data buffer queue and multiplies it with the element at the corresponding index in the convolution weight coefficient vector. This operation applies a specific weight to each data point in the buffer queue; the magnitude and sign of the weight are determined by the multinomial fitting model. After completing all point-to-point multiplications, the system sums all the product results to obtain a scalar value. This value represents the best-fit value of the center point within the current window, which is physically equivalent to the signal estimate after removing high-frequency random noise. The system uses this value as preprocessed motion data and passes it to subsequent processing modules.
[0050] As can be seen, before entering the nonlinear model calculation, the convolution weight coefficient vector is calculated offline using the least squares method, transforming the complex polynomial fitting process into an efficient linear weighted operation. In real-time operation, the latest time-series data window is maintained through a data buffer queue, and the data within the window is convolved and summed using the convolution weight coefficients. This processing method enables smooth updates of motion data in the time domain and, leveraging the fitting characteristics of polynomials, filters out high-frequency random noise in the original MEMS sensor signal without introducing phase delay.
[0051] S105. The robot's motion data is calculated based on a preset nonlinear error model to obtain the error state vector at the current moment. The motion data is obtained by the MEMS inertial sensor from the preset part of the robot. The error state vector at the current moment is equal to the sum of the predicted error states at different historical moments multiplied by the corresponding attenuation factors plus random interference noise. The attenuation factor decreases as the interval between the current moment and the historical moment increases.
[0052] Among them, the nonlinear error model represents a set of mathematical equations describing the dynamic evolution of system error over time; the current error state vector represents the numerical set of the system estimated to include deviation values in each dimension; the prediction error state represents the estimated value extrapolated from the historical time to the present based on the model; the attenuation factor represents the coefficient used to quantify the weight of the influence of historical information on the current state; and the random disturbance noise represents the random variable simulating uncertainty.
[0053] Specifically, this step utilizes the Markov process principle to model the sensor drift characteristics. Based on the state-space equations, the system treats the current error state as an evolution of historical error states. During this evolution, a decay factor that varies with time intervals is introduced, exhibiting an exponential decreasing trend. This means that the more distant the historical state, the smaller its contribution to the current state; conversely, the most recent historical state has the largest weight. Simultaneously, random disturbance noise terms are superimposed on the model during the evolution process to simulate the thermal noise characteristics of the physical device. Through this nonlinear recursion incorporating a memory decay mechanism, and combining current measured motion data as observation correction, the system dynamically calculates and outputs the optimal error state vector that reflects the current physical deviation.
[0054] S106. Perform inverse kinematics mapping calculation based on the error state vector at the current moment to generate a real-time gait correction matrix for correcting the target pose of the robot joints;
[0055] Among them, the inverse kinematic mapping calculation represents the mathematical process of inversely calculating the joint angle adjustment amount from the end pose deviation; the real-time gait correction matrix represents the coordinate transformation matrix used to superimpose the target command.
[0056] Specifically, this step transforms abstract sensor mathematical errors into concrete mechanical control quantities. The system first constructs a Jacobian matrix describing the mapping relationship between the robot's joint velocity space and Cartesian velocity space. Then, it constructs the end-effector pose error using the error state vector and solves the inverse kinematic equations based on the Jacobian matrix to calculate the small corrections needed to compensate for this end-effector error at each joint angle. Finally, these dispersed joint corrections are converted into a unified homogeneous transformation matrix format, i.e., a real-time gait correction matrix, for direct application in the subsequent control loop.
[0057] In some specific embodiments, step S106 specifically includes:
[0058] S1061. Analyze the error state vector at the current moment and separate the current zero bias component and the current scale factor component;
[0059] Here, parsing represents the operation of extracting specific elements from the data structure; the current zero bias component represents the vector element corresponding to the sensor's zero offset; and the current scaling factor component represents the vector element corresponding to the sensor's sensitivity error.
[0060] Specifically, the error state vector output by S104 typically contains error information across multiple dimensions. This step aims to accurately extract specific components related to the sensor's physical characteristics from this mixed vector. Based on a predefined state vector index table or protocol format, the system extracts elements at specific locations through memory slicing operations and assigns them to the zero-bias variable and the scaling factor variable, respectively. These two components are considered the source errors causing system drift; the separation operation is for targeted source compensation in subsequent steps.
[0061] S1062. Solve the current zero bias component and the current scale factor component according to inverse kinematics to obtain the instantaneous joint angle compensation value.
[0062] The process of solving according to inverse kinematics represents the process of reverse-engineering the joint angle increment; the instantaneous joint angle compensation value represents the amount of joint angle change required to offset the current error.
[0063] Specifically, the system first reconstructs the current measurement error vector using the extracted zero bias and scaling factor components. Then, it establishes a linear relationship between the measurement error and the joint velocity error using the robot's differential kinematics Jacobian matrix. By solving this system of linear equations (which typically involves pseudo-inverse operations of the Jacobian matrix), the velocity error correction for each joint is calculated. Finally, the velocity correction is integrated into the angle correction, i.e., the instantaneous joint angle compensation value, by combining the sampling period.
[0064] S1063. The instantaneous joint angle compensation values are arranged in homogeneous order according to the robot's geometric configuration to construct the real-time gait correction matrix.
[0065] Among them, geometric configuration represents the robot's link parameters and topology; homogeneous transformation arrangement represents the operation of combining rotation and translation components into a standard matrix format; and construction represents the generation of data structures.
[0066] Specifically, this step encapsulates the discrete joint angle compensation values into standard mathematical operators. Based on the robot's kinematic chain model, the system calculates the end-effector coordinate system transformation caused by the minute angle compensations of each joint. A micro-transformation matrix is constructed based on the compensation values of each joint, and the final real-time gait correction matrix is generated through matrix multiplication or equivalent transformation. This matrix will be directly used for pose correction in the control loop.
[0067] As can be seen, analyzing the error state vector separates the zero-bias component and the scaling factor component, which can independently characterize the physical defects of the sensor, thus clarifying the physical source of the error. Subsequently, these components are solved using inverse kinematics principles, converting the measurement deviation in the sensor coordinate system into instantaneous angle compensation values in the robot joint coordinate system. This ensures that any sensor drift can be corrected by a corresponding motor angle adjustment. Finally, by constructing a real-time gait correction matrix, the dispersed compensation values are encapsulated into a unified mathematical operator, facilitating direct use by the control system.
[0068] S107. The PWM pulse width modulation control signal of the robot joint controller is modulated by the real-time gait correction matrix to generate the corrected drive command and drive the joint motor.
[0069] Among them, the robot joint controller represents the hardware unit responsible for the closed-loop control of the motor; PWM pulse width modulation represents the technology of controlling the output power by adjusting the square wave duty cycle; duty cycle modulation represents the operation of adjusting the duty cycle value; and the corrected drive command represents the final control signal sent to the power stage.
[0070] Specifically, this step translates kinematic corrections into electrical energy adjustments. The system inputs the joint angle correction amount corresponding to the real-time gait correction matrix into the controller's position or velocity loop. The controller then calculates the new control deviation and updates the current loop's setpoint. Subsequently, the corresponding duty cycle value is calculated using space vector pulse width modulation (SPWM) or a standard pulse width modulation (PWM) algorithm. If positive angle error compensation is required, the controller increases the duty cycle of the corresponding phase, causing the motor to output a larger torque to drive the joint to the corrected position. This process ensures that the drive signal can respond in real time and perform error compensation.
[0071] It is evident that by utilizing MEMS sensors to intrinsically acquire motion data, dependence on external base station facilities is eliminated, enabling autonomous perception across all terrains and scenarios. Building upon this, a nonlinear error model incorporating an attenuation factor is constructed. Leveraging the characteristic that the attenuation factor decreases with increasing time intervals, the physical law of time-discorrelation of sensor errors is simulated, suppressing excessive accumulation of historical random noise. This ensures that the calculated error state vector accurately reflects the current true drift. Furthermore, by combining inverse kinematic mapping, the abstract mathematical error is transformed into a pose correction value in joint space, and finally, this correction value is applied to the motor through direct modulation of the PWM duty cycle. This eliminates mechanical transmission hysteresis while meeting the requirements of applicability to all scenarios and high dynamic response.
[0072] The aforementioned technical solution addresses the challenge of simultaneously achieving applicability across all scenarios (no base station required) and high dynamic response (low latency). However, during use, the entire process of the robot control system—from acquiring sensor data, performing nonlinear error model calculations, generating a correction matrix, to finally driving the motor with PWM commands—inevitably involves physical time consumption. This means that the error state calculated based on data acquired at time t actually reflects the physical state at that moment, but by the time the correction command is applied to the motor, time has already passed to t + the physical time consumption. When the robot performs high-speed dynamic movements, this spatiotemporal misalignment of "correcting future actions based on past errors" leads to a mismatch between the correction torque and the actual posture deviation, thereby causing self-excited oscillations or gait instability in the control system.
[0073] Please see Figure 2 , Figure 2 This is another flowchart illustrating the self-calibration method for robot dynamic gait error based on MEMS inertial sensors in this application embodiment;
[0074] Therefore, in some embodiments, after step S107, the method further includes:
[0075] S201. Calculate the time difference between the start time of motion data acquisition from the MEMS inertial sensor and the effective time of the corrected drive command to obtain the end-to-end processing delay.
[0076] Among them, the starting moment of the MEMS inertial sensor acquiring motion data refers to the instant when the sensor completes the sampling of physical quantities and timestamps them; the effective moment of the corrected drive command refers to the instant when the current controller actually drives the motor to generate action or outputs a PWM signal to the power drive stage; the time difference refers to the scalar value obtained by subtracting two timestamps; the end-to-end processing delay refers to the physical time consumed by the entire control loop, which includes data acquisition, bus transmission, algorithm calculation, command generation, and signal modulation.
[0077] Specifically, this step aims to quantify the time lag characteristics of the control system. The system records the first trigger timestamp at the data acquisition source using a high-precision hardware counter or synchronous clock source. As the data flows through each processing stage (filtering, error estimation, kinematics calculation), the data packet or its processing result always carries this original timestamp. When the final control command is written to the motor controller's compare register or a direct memory access (DMA) transfer is triggered, the system reads the current hardware time, i.e., the second trigger timestamp. The difference between the two timestamps is the end-to-end processing delay. This value objectively reflects the degree of time phase lag between the control command and the robot's actual physical state. The system saves this delay value as a feedback correction parameter for the next control cycle.
[0078] S202. In the next stage of calibration, the end-to-end processing delay will be added to the time interval between the current moment and the historical moment to update the attenuation factor.
[0079] In this context, the next stage of calibration refers to the next control cycle or algorithm iteration step, such as re-executing S105 to S107; the time interval between the current moment and the historical moment refers to the time parameter used to calculate the decay degree of the Markov chain; adding refers to adding the time delay value to the original time interval in an arithmetic manner; the decay factor refers to the exponential coefficient that determines the memory strength of the error model; and updating refers to recalculating and replacing this coefficient.
[0080] Specifically, this step uses the measured physical delay to correct the time parameters of the mathematical model. In conventional algorithms, the attenuation factor depends only on the data sampling interval. However, in this step, the system recognizes that the calculated error correction amount has already passed the entire link processing delay by the time it takes for the physical correction to take effect. Therefore, the system artificially extends the time evolution span in the model. Specifically, when calculating the new attenuation factor, the input time variable is modified to "sampling interval + end-to-end processing delay". This makes the recalculated attenuation factor smaller (for exponential decay models), so that the error state predicted by the model is not just the value at the sampling moment, but the future value after the natural evolution of the delay duration. This operation mathematically achieves advance compensation for physical lag.
[0081] As can be seen, after the calibration process, the end-to-end processing delay from data acquisition to drive activation is calculated, quantifying the physical lag caused by system computation and transmission. Subsequently, in the next stage, this end-to-end processing delay is used to update the calculation logic of the attenuation factor, incorporating the physical delay into the evolution time parameter of the mathematical model. This allows the attenuation factor value to reflect errors including future time periods. The original error estimation of past moments is transformed into an error prediction of future moments when the drive command actually takes effect. This can proactively offset the phase lag caused by computation time, thereby eliminating the self-excited oscillation of the control system caused by spatiotemporal misalignment at its source during high-speed motion, and improving dynamic stability.
[0082] It should be noted that, since the attenuation factor has been changed, the error state vector at the current moment will also be adjusted accordingly. Therefore, after step S202, the following steps are also included:
[0083] S203. Calculate the robot's motion data based on a preset nonlinear error model to obtain the error state vector at future time steps.
[0084] S204. Analyze the error state vector at future time points and extract the future zero-bias prediction component and the future scaling factor prediction component.
[0085] S205. Solve the future zero bias prediction component and the future scale factor prediction component according to inverse kinematics to obtain the joint angle advance compensation value.
[0086] S206. Arrange the joint angle advance compensation values according to the robot's geometric configuration in a homogeneous transformation to construct the future gait correction matrix.
[0087] S207. The PWM pulse width modulation control signal of the robot joint controller is modulated by the future gait correction matrix to generate the corrected drive command and drive the joint motor.
[0088] As can be seen, by relying on the updated attenuation factor, the error state vector that is accurately aligned to the future moment can be derived, avoiding the bias caused by using lag data for correction. By analyzing this future moment vector and extracting the zero bias and scaling factor components, these components are substituted into the inverse kinematics solution to calculate the joint angle advance compensation value specifically for future moment drift. This not only achieves alignment in time but also maps the abstract sensor error to the specific actuator action in space.
[0089] The above embodiments, by introducing end-to-end processing delay, can achieve advance prediction of error states at future moments. However, in actual use, in the inverse kinematics calculation stage where this error prediction value is mapped to joint space control quantities, if the robot's geometric configuration parameters at the data acquisition moment (such as the current joint angles and Jacobian matrix) are still used, a significant model mismatch problem will be faced. This is because during the end-to-end delay, the high-speed moving robot joints have already undergone displacement, causing their actual geometric configuration to change compared to the acquisition moment, thus causing the Jacobian matrix describing the mapping relationship between joint velocity and end-effector velocity to become time-varying. At this time, the direction of the correction torque calculated based on the "past configuration" will not match the "future actual configuration," resulting in a distorted mapping relationship and introducing secondary spatial control errors in high-dynamic scenarios.
[0090] Please see Figure 3 , Figure 3 This is another flowchart illustrating the self-calibration method for robot dynamic gait error based on MEMS inertial sensors in this application embodiment;
[0091] Therefore, in some other embodiments, before S206, the following is also included:
[0092] S301. Use the end-to-end processing latency as the time index key to access the instruction buffer queue to be executed.
[0093] Among them, the time index key is an identifier used to find a specific data item in the queue; the pending instruction buffer queue is a buffer that stores the sequence of control instructions generated by the motion planning layer but not yet sent to the underlying motor.
[0094] Specifically, this step aims to obtain the robot's true future motion intentions. Since robot control systems typically possess look-ahead planning capabilities, the controller's memory stores a series of planning instructions with future timestamps. The system uses the calculated end-to-end processing delay, Deltat, to calculate the target time t. future =t now +Deltat. Then, use this target time as the lookup key to access the instruction buffer queue.
[0095] S302. In the instruction buffer queue to be executed, retrieve instruction data whose timestamp matches the current system time plus the end-to-end processing delay, and extract the target joint configuration at future time.
[0096] Among them, timestamp matching means that the timestamp of the data in the queue is consistent with or closest to the calculated target time; instruction data refers to data packets containing information such as joint angles and speeds; and the target joint configuration at future time refers to the combination of joint angles that the robot is expected to be in when the drive command takes effect.
[0097] Specifically, after the system finds the data corresponding to the given moment in the buffer, it reads and parses it. This extracted set of joint angle data represents the posture that the robot theoretically "should" maintain at the moment the correction command physically takes effect. This is the geometry of the "future" robot body.
[0098] S303. Substitute the target joint configuration at future time moments into the robot's kinematic equations, analyze and construct the reference Jacobian matrix at future time moments;
[0099] Among them, the kinematic equations of the robot are mathematical formulas that describe the mapping relationship between joint space and Cartesian space; the future reference Jacobian matrix is a partial derivative matrix calculated based on the predicted future configuration.
[0100] Specifically, conventional methods use the "current measured joint angles" to calculate the Jacobian matrix. However, during high-speed motion, the robot has already changed its orientation by the time the command takes effect, causing the Jacobian matrix to become invalid. This step utilizes the "future configuration" extracted by S402 and substitutes it into the kinematic equations. The calculated Jacobian matrix accurately describes the robot's sensitivity relationship at that "future" moment.
[0101] S304. Use the future time reference Jacobian matrix as the basic transformation parameter of inverse kinematics.
[0102] Among them, the fundamental transformation parameters of inverse kinematics refer to the core coefficient matrix on which the inverse kinematics equations are solved.
[0103] Specifically, this step formally passes the "future Jacobian matrix" calculated by S303 to the solution algorithm in S205. This means that when S205 calculates the compensation amount, it no longer calculates based on the "current body," but on the "future body." This ensures that the calculated correction torque direction perfectly matches the future fuselage attitude, eliminating the correction direction deviation caused by fuselage motion.
[0104] As can be seen, by using the end-to-end processing latency as a time index, the instruction data to be executed in the buffer queue is located, and the target joint configuration at the future moment consistent with the moment the drive takes effect is extracted. This step ensures that the geometric reference for kinematic calculations is no longer the lagging current measured posture, but the actual posture that the robot is about to reach.
[0105] The following describes an exemplary self-calibration system 400 for robot dynamic gait error based on MEMS inertial sensors, provided in an embodiment of this application. Figure 4 This is an exemplary hardware structure diagram of a self-calibration system 400 for robot dynamic gait error based on MEMS inertial sensors provided in this application embodiment.
[0106] In some embodiments, the self-calibration system 400 for robot dynamic gait error based on MEMS inertial sensors is a computer device or includes a computer device. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with other external terminals or servers via a network connection. In some embodiments, the network interface can be a wired network interface; in some embodiments, it can also be a wireless network interface. When the computer program is executed by the processor, it implements the methods described in the embodiments of this application.
[0107] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0108] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0109] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0110] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0111] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A self-calibration method for robot dynamic gait error based on MEMS inertial sensors, characterized in that, include: The robot's motion data is calculated based on a preset nonlinear error model to obtain the error state vector at the current moment; the motion data is obtained by MEMS inertial sensors collecting data from preset parts of the robot. Wherein, the error state vector at the current moment is equal to the sum of the prediction error states at different historical moments multiplied by the corresponding decay factors plus random interference noise, and the decay factor decreases as the interval between the current moment and the historical moment increases; Based on the error state vector at the current moment, perform inverse kinematic mapping calculation to generate a real-time gait correction matrix for correcting the target pose of the robot joints; The real-time gait correction matrix is used to modulate the duty cycle of the PWM pulse width modulation control signal of the robot joint controller, generating a corrected drive command and driving the joint motor.
2. The method according to claim 1, characterized in that, After the step of using the real-time gait correction matrix to modulate the duty cycle of the PWM pulse width modulation control signal of the robot joint controller, generating the corrected drive command, and driving the joint motor, the method further includes: The time difference between the start time of acquiring the motion data from the MEMS inertial sensor and the effective time of the corrected drive command is calculated to obtain the end-to-end processing delay. In the next stage of calibration, the end-to-end processing delay will be added sequentially to the time interval between the current moment and the historical moment to update the attenuation factor.
3. The method according to claim 2, characterized in that, Following the step of adding the end-to-end processing delay sequentially to the time interval between the current moment and the historical moment to update the attenuation factor during the next stage of calibration, the method further includes: The robot's motion data is calculated based on a pre-set nonlinear error model to obtain the error state vector at future time steps. The error state vector at the future time is analyzed, and the future zero-bias prediction component and the future scaling factor prediction component are extracted. The future zero-bias prediction component and the future scaling factor prediction component are solved by inverse kinematics to obtain the joint angle advance compensation value. The joint angle advance compensation values are arranged in homogeneous order according to the robot's geometric configuration to construct the future gait correction matrix; The duty cycle of the PWM pulse width modulation control signal of the robot joint controller is modulated using the future gait correction matrix to generate the corrected drive command and drive the joint motor.
4. The method according to claim 3, characterized in that, Before the step of arranging the joint angle advance compensation values according to the robot's geometric configuration in a homogeneous transformation to construct the future gait correction matrix, the method further includes: Use the end-to-end processing latency as the time index key to access the instruction buffer queue to be executed; In the pending instruction buffer queue, retrieve instruction data whose timestamp matches the current system time plus the end-to-end processing delay, and extract the target joint configuration for future time moments; Substitute the target joint configuration at the future moment into the robot's kinematic equations to analyze and construct the reference Jacobian matrix at the future moment; The future time reference Jacobian matrix is used as the fundamental transformation parameter for inverse kinematics.
5. The method according to claim 1, characterized in that, The step of performing inverse kinematic mapping calculation based on the current error state vector to generate a real-time gait correction matrix for correcting the robot joint target pose specifically includes: Analyze the error state vector at the current moment to separate the current zero bias component and the current scaling factor component; The instantaneous joint angle compensation value is obtained by solving the current zero bias component and the current scale factor component according to inverse kinematics. The instantaneous joint angle compensation values are arranged in a homogeneous manner according to the robot's geometric configuration to construct the real-time gait correction matrix.
6. The method according to claim 1, characterized in that, The motion data includes triaxial acceleration and angular velocity data.
7. The method according to claim 1, characterized in that, Before the step of calculating the error state vector at the current moment based on the robot's motion data using a preset nonlinear error model, and before the step of obtaining the motion data from a preset part of the robot using a MEMS inertial sensor, the method further includes: Based on the preset smooth window length and polynomial fitting order, the convolution weight coefficient vector is calculated using the least squares regular equation. The motion data is added to a data buffer queue in chronological order, and the length of the data buffer queue is the same as the length of the smoothing window. The motion data is updated by multiplying each data point in the data buffer queue with the corresponding coefficient in the convolution weight coefficient vector, summing all the product results.
8. A self-calibration system for robot dynamic gait error based on MEMS inertial sensors, characterized in that, The self-calibration system for robot dynamic gait error based on MEMS inertial sensors includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the self-calibration system for robot dynamic gait error based on MEMS inertial sensors to perform the method as described in any one of claims 1-7.
9. A computer program product containing instructions, characterized in that, When the computer program product is run on the self-calibration system for robot dynamic gait error based on MEMS inertial sensors, the self-calibration system for robot dynamic gait error based on MEMS inertial sensors performs the method as described in any one of claims 1-7.
10. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the self-calibration system for robot dynamic gait error based on MEMS inertial sensors, the self-calibration system for robot dynamic gait error based on MEMS inertial sensors performs the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Inertial sensor based human gait analyzing method and system
CN108836346A
Robot, control device and control method of robot, and control program of robot
JP2015139825A