single-rb.php

JRM Vol.38 No.4 pp. 1059-1072
(2026)

Paper:

Error Compensation Strategies for Lower-Limb Rehabilitation Robots: A Staged Approach with MLP and Transformer Models

Aihui Wang ORCID Icon, Rui Teng, Jinkang Dong, Xuebin Yue ORCID Icon, and Xiang Zhang

School of Automation and Electrical Engineering, Zhongyuan University of Technology
No.41 Zhongyuan Road, Zhengzhou, Henan 450007, China

Corresponding author

Received:
August 25, 2025
Accepted:
March 12, 2026
Published:
August 20, 2026
Keywords:
lower-limb rehabilitation robot, error compensation, MLP, Transformer, gait phase detection
Abstract

Lower-limb rehabilitation robots are valuable for gait training, but accurate joint motor angle tracking remains challenging due to various motion-related disturbances. This paper presents a staged joint-compensation strategy to improve control accuracy. The gait control process is partitioned into initiation, cyclic, and termination phases. A multilayer perceptron is employed during initiation and termination to predict and compensate for short-term aperiodic errors, while a Transformer-based sequence model combined with repetitive-control concepts is used in the cyclic phase to predict and correct periodic errors. Phase detection and safety-constraint mechanisms are integrated to ensure system stability and safety. Experiments are performed on a self-developed robotic platform with field-oriented control at the motor level, using a 165 cm, 60 kg dummy as the load. The proposed strategy substantially reduced joint-angle RMSE: left hip from 0.692° to 0.494° (28.6% reduction), right hip from 0.687° to 0.402° (41.5% reduction), left knee from 1.754° to 0.426° (75.7% reduction), and right knee from 1.667° to 0.461° (72.3% reduction). Ablation studies and repeated-trial statistical analyses further confirm the effectiveness of the approach. This study significantly reduces the gait trajectory tracking errors of joint actuators in a lower-limb rehabilitation robot, thereby providing a feasible and effective approach for the optimization of its control algorithm design.

Lower-limb rehabilitation robot

Lower-limb rehabilitation robot

Cite this article as:
A. Wang, R. Teng, J. Dong, X. Yue, and X. Zhang, “Error Compensation Strategies for Lower-Limb Rehabilitation Robots: A Staged Approach with MLP and Transformer Models,” J. Robot. Mechatron., Vol.38 No.4, pp. 1059-1072, 2026.
Data files:

1. Introduction

Lower-limb rehabilitation robots are important adjuncts for neurorehabilitation 1,2 (e.g., post-stroke and spinal cord injury) and postoperative recovery because they can provide high-intensity, repeatable, and quantitatively measurable training 3,4,5,6; consequently, they have become a key component of modern rehabilitation medicine. Clinical studies and systematic reviews indicate that rehabilitation robots hold substantial potential for promoting gait recovery 7,8, delivering objective assessment, and enabling personalized training, but challenges remain in long-term efficacy validation, individualized adaptation, and clinical accessibility—issues that place higher demands on the robustness and practicality of control strategies 9,10,11,12.

At the control level, lower-limb rehabilitation systems operating in real-world settings must contend with multi-source disturbances: actuator nonlinearities and saturation 13,14,15,16, backlash and friction, varying external loads, biomechanical coupling between user and device, and sensor noise. These effects typically superimpose multi-scale, time-varying 17,18, and mixed tracking errors that include both aperiodic transients at initiation/termination and steady-state periodic harmonic errors arising from the gait cycle. Classical PID, robust, and adaptive control approaches remain important for guaranteeing stability and engineering feasibility 19,20,21,22, but they often require extensive tuning and struggle to simultaneously satisfy real-time constraints and cross-cycle learning capabilities when faced with strong nonlinearities, multi-harmonic periodic errors, and operating-mode transitions (initiation \(\rightarrow\) cyclic gait \(\rightarrow\) termination).

Data-driven methods for control and error compensation in rehabilitation robotics have advanced rapidly. Key directions include data-driven phase/impedance adaptation to accommodate speed and slope variability, and repetitive/iterative-learning control for suppression of periodic errors—methods that can substantially reduce residual error in steady-state cyclic tasks 23,24. Meanwhile, Transformer-style self-attention temporal models excel at capturing long-range dependencies in time-series forecasting and thus offer new methodological support for cross-cycle error prediction 25. Nevertheless, several engineering challenges persist: high-capacity sequence models are sensitive to noise and small-sample regimes and impose latency and deployment challenges on embedded platforms; repetitive-control schemes may lack robustness to initiation/termination transients and abrupt disturbances, and seamless phase switching remains problematic. Moreover, relatively few studies integrate phase detection, cross-cycle priors, and lightweight real-time inference into a unified framework with systematic validation on a physical lower-limb rehabilitation platform 26,27,28,29.

To address these gaps, this paper proposes a staged joint-compensation framework tailored to lower-limb rehabilitation robot control. The framework explicitly partitions robot operation into three phases—initiation, cyclic gait, and termination—according to the statistical characteristics of joint-angle tracking errors, and adopts differentiated learning-based strategies for each phase. Lightweight multilayer perceptron (MLP)-based compensators are employed during the non-cyclic phases to provide low-latency suppression of short-term, aperiodic disturbances, while a Transformer-based sequence model, augmented with an explicit repetitive prior, is applied during cyclic gait to capture cross-cycle dependencies and suppress periodic and harmonic error components. Smooth transition and safety-retreat mechanisms are incorporated at phase boundaries to ensure stable and safe operation under real-time constraints. Although gait phase segmentation, repetitive control, and learning-based compensation have been explored in various robotic control contexts, their application to lower-limb rehabilitation robots remains fragmented, with most existing approaches relying on a single model across the entire gait cycle or on phase-aware switching among conventional controllers. By contrast, the proposed framework systematically integrates phase-aware model allocation, learning-based repetitive priors, and embedded real-time deployability, providing a practical and high-precision solution for gait-following control in lower-limb rehabilitation robots.

The main contributions are summarized as follows:

  1. We propose a phase-partitioned joint-compensation paradigm that systematically integrates the complementary strengths of MLPs, repetitive priors, and Transformer models to address the distinct disturbance characteristics across operating phases.

  2. We introduce, for the cyclic phase, a novel structuring of previous-cycle error information as a repetitive prior and fuse this prior with a self-attention sequence model, thereby improving cross-cycle error prediction accuracy under low-latency constraints.

  3. Considering engineering implementation and safety, we design phase detection, smooth switching, and safety-constraint mechanisms, and demonstrate online inference and real-time control integration on a self-developed lower-limb rehabilitation robot.

2. System and Problem Description

The objective of this study is to reduce joint-angle tracking errors in a lower-limb rehabilitation robot operating under phase-varying gait conditions, while maintaining real-time feasibility. Although learning-based compensation methods have demonstrated effectiveness in improving tracking accuracy, their performance characteristics differ across gait phases due to variations in signal periodicity and temporal dependency. This motivates the formulation of explicit research questions and testable hypotheses to guide the experimental design and analysis.

The first research question concerns whether explicitly incorporating gait-phase information into the compensation strategy provides measurable benefits over a continuous, phase-agnostic approach. Accordingly, the first hypothesis is defined as:

  1. H1:

    Phase-aware error compensation yields lower overall joint-angle tracking root mean square error (RMSE) than continuous compensation without phase segmentation.

The second research question addresses the suitability of different learning models for error characteristics observed in distinct gait phases. In particular, the gait initiation and termination phases are dominated by short-term, aperiodic tracking errors, whereas the cyclic gait phase exhibits strong periodicity and long-term temporal correlations. Based on this observation, the second hypothesis is formulated as:

  1. H2:

    MLP-based compensation is more effective in reducing aperiodic tracking errors during non-cyclic gait phases, while Transformer-based sequence modeling provides superior error suppression during the cyclic gait phase.

The third research question focuses on the practical trade-off between tracking accuracy and real-time feasibility in embedded control systems. While sequence-based models can improve prediction accuracy, their computational cost may limit applicability in real-time control. This leads to the third hypothesis:

  1. H3:

    A staged compensation strategy combining lightweight MLP models and a Transformer model achieves a better accuracy—real-time performance trade-off than single-model compensation approaches.

To quantitatively evaluate these hypotheses, joint-angle tracking performance is assessed using RMSE and peak error metrics across four actuated joints under different compensation strategies. The experimental design and result analysis presented in Section 4 are explicitly structured to validate the above hypotheses.

2.1. Controlled System and Hardware Architecture

The experimental platform is a lower-limb rehabilitation robot developed by the authors’ research team. The control task covers four actuated joints: left hip, right hip, left knee, and right knee. Each joint is driven by a brushless DC motor; low-level motor control is implemented via field-oriented control (FOC) to realize angle/velocity closed-loop regulation, thereby providing a stable actuator response to the higher-level controller. The main controller is an NVIDIA Jetson platform (running Ubuntu with real-time patches), and the control and communication framework is implemented on ROS 2. The upper-level controller is primarily responsible for trajectory generation, learned-model inference (compensator), and the computation and dispatch of compensation signals.

Define the joint angle vectors for the subsequent symbolic description:

\begin{equation*} \begin{array}{c@{\hspace{1cm}}c} \theta _{\mathit{ref}}( t ) = \begin{bmatrix} \theta ^{LH} _{\mathit{ref}} ( t ) \\[3pt] \theta ^{RH} _{\mathit{ref}} ( t ) \\[3pt] \theta ^{LK} _{\mathit{ref}} ( t ) \\[3pt] \theta ^{RK} _{\mathit{ref}} ( t ) \end{bmatrix}, & \theta _{act}( t ) = \begin{bmatrix} \theta ^{LH} _{act} ( t ) \\[3pt] \theta ^{RH} _{act} ( t ) \\[3pt] \theta ^{LK} _{act} ( t ) \\[3pt] \theta ^{RK} _{act} ( t ) \end{bmatrix}, \end{array} \end{equation*}
\(\theta _\mathit{ref}\) is the reference angle of the joint motor and \(\theta _{act}\) is the actual angle of the joint motor.

Real-time performance measurements indicate that, when the upper-level controller does not load any neural network models, the minimum operating cycle (one closed-loop control cycle, including data acquisition, computation, and command dispatch) is 3.6 ms; when a lightweight MLP is loaded the minimum cycle is 4.0 ms; and when a Transformer-based sequence predictor is loaded the minimum cycle is 7.4 ms. These values constitute the engineering constraints for the subsequent real-time and scheduling analysis.

2.2. Problem Definition and Performance Metrics

Define the tracking-error vector as:

\begin{equation} e( t ) =\theta_{\mathit{ref}} ( t )-\theta _{act}( t ), \quad e\in \mathbb{R}^{4}. \end{equation}

The design objective is to construct an upper-level compensator \(u_{c}( t ) \in \mathbb{R}^{4}\) (produced by a learned model) such that the compensated reference:

\begin{equation} \theta {'} ( t ) =\theta_{\mathit{ref}} ( t )+u_{c} ( t ), \end{equation}
yields a compensated system output \(\theta {'} _{act} ( t )\) and substantially reduces the closed-loop residual tracking error:
\begin{equation} \tilde{e} ( t ) =\theta_{\mathit{ref}} ( t )-\theta{'} _{act}( t ), \quad \tilde{e} \in \mathbb{R}^{4}. \end{equation}

From a biomechanical and rehabilitation perspective, joint-angle tracking accuracy is not solely a numerical control objective but is closely related to kinematic consistency and assisted-motion quality. Previous biomechanical and clinical observations suggest that joint-angle tracking errors within approximately 1°–2° are generally required to maintain consistency with normative gait patterns and to avoid perceptible disturbances during assisted rehabilitation. Larger deviations may alter inter-joint coordination and affect the smoothness of human-robot interaction. Therefore, maintaining tracking errors within this range is commonly regarded as an important requirement in lower-limb rehabilitation control systems.

To quantitatively evaluate tracking performance, the RMSE of joint angles is adopted as the primary metric, computed over the full gait as well as over individual gait phases. Peak error values are additionally considered to characterize transient deviations. These metrics enable systematic comparison of different compensation strategies under consistent operating conditions.

To ensure that the system can operate stably and safely, a set of security constraints must also be satisfied.

Real-time constraint: The compensator computation (including model inference) must complete within each control period. If inference exceeds the allotted cycle time, a graceful degradation strategy must be applied (reverting to the uncompensated reference) to ensure uninterrupted operation of the low-level FOC controllers.

Safety constraints: Joint angles, angular velocities, and motor torques are limited to engineering-specified bounds; the compensator output \(u_{c}( t )\) must be subject to saturation and rate-of-change limits to prevent injection of transients that exceed actuator capabilities; on detection of abnormal gait patterns or communication loss, the system must enter a safe stop or fallback control mode.

When designing and evaluating the compensator, measurement noise, sensor latency, and phase shifts introduced by predictive models must be taken into account because they can affect closed-loop stability and safety.

2.3. Gait-Phase Segmentation and Data Preprocessing

To fully exploit the temporal structure of gait, the experimental data are partitioned into three phases—initiation, cyclic, and termination—each reflecting distinct dynamic characteristics and error statistics.

Initiation phase: a short transient during transition from rest or low-speed motion to a stable cyclic gait. Movements in this phase contain pronounced aperiodic components and strong transient dynamics, and are therefore suitable for short-horizon, aperiodic error-prediction compensation models; cyclic phase: a long-duration, repeatable steady-state gait in which errors include recurring periodic components; this phase is amenable to sequence-prediction and repetitive-control strategies for periodic error suppression; termination phase: the short transition from a stable cyclic gait back to rest; similar to the initiation phase, it exhibits aperiodic transient behavior and requires short-horizon aperiodic compensation.

figure

Fig. 1. Nokov 3D infrared optical motion-capture system.

Gait data are collected using a high-precision NOKOV 3D infrared optical motion-capture system (Fig. 1), comprising eight 3D infrared cameras, a plantar force platform, and upper-level data-acquisition software 30,31. Reflective markers are affixed to anatomical landmarks at the hip, knee, and ankle to record three-dimensional marker coordinates throughout the motion trials; these coordinates are then used to derive instantaneous hip and knee joint angles. Data are acquired from multiple gait trials involving 65 participants. The raw signals underwent standard preprocessing for noise reduction and synchronization, including zero-phase band-pass filtering, computation of joint angles from marker coordinates (with finite-difference methods applied to obtain derived quantities where appropriate), and temporal alignment of joint timestamps, thereby ensuring data quality and temporal consistency for subsequent analysis and model development.

Each processed gait record is then segmented into three phases-initiation, cyclic, and termination. For closed-loop control, the upper-level controller concatenates these segments in the form of \(\mathrm{initiation} + \mathrm{cyclic} \times N + \mathrm{termination}\) to generate the control gait; the number of cyclic repetitions \(N\) is set according to the rehabilitation protocol (in the experiments reported here \(N = 5\)).

It should be clarified that the collected healthy gait database is not used to train or validate the learning-based compensation models in an offline, data-driven manner. Instead, the database provides physiologically reasonable reference gait trajectories, from which an appropriate control gait is selected for each patient based on anthropometric characteristics such as height, weight, thigh length, and shank length. The learning-based compensation models operate at the joint-control level during robot execution and are trained online using the selected reference trajectory together with the corresponding historical joint-angle tracking errors observed during the gait-following process. Consequently, the learning process aims at compensating for execution-induced tracking errors under a given reference gait, rather than learning human gait patterns directly from the gait database.

3. Methods

The MLP, as a lightweight feedforward neural network, is characterized by a simple architecture, low inference latency, and stable training. Owing to these engineering advantages, it is well suited for rapid prediction and compensation of short-term, non-periodic disturbances. In this study, the MLP is applied during short non-periodic phases such as initiation and termination. Its inputs typically include the recent historical window of reference and actual joint angles as well as a phase index, while its output is the instantaneous compensation value used to refine the reference trajectory. Compared with recurrent neural networks or large-scale sequence models, the MLP enables low-latency inference on embedded platforms, thereby ensuring that the compensation does not violate the strict constraints of real-time control cycles.

For the gait execution stage, where significant periodic error components are present, this study employs a Transformer model with self-attention mechanisms to capture and predict periodic disturbances. By leveraging multi-head self-attention, the Transformer is capable of modeling long-range dependencies within sequences, thus effectively identifying repetitive errors across gait cycles and phase-related features 32,33. To enhance its ability to perceive periodicity, complete information on gait phase is explicitly included in the model input, enabling phase-specific compensation outputs. The Transformer demonstrates clear advantages in parallel training, long-range dependency modeling, and capturing complex phase relationships, making it an appropriate choice for suppressing periodic errors 34,35. Furthermore, the Transformer can be extended to realize learning-based repetitive control. The core idea is to learn the temporal structure of periodic disturbances from observed errors over several past cycles and to predict future compensation sequences, thereby improving prediction stability and convergence speed. By adopting the Transformer for prediction and compensation of strong periodic components, the proposed framework maximizes error suppression while maintaining closed-loop stability 36,37. In addition, to adapt to varying operating conditions, the Transformer supports periodic and controlled online updates, enabling robust long-term operation.

3.1. Overall Framework

The proposed error compensator comprises two classes of learned models that operate in different running phases: an MLP for short-horizon, aperiodic error prediction during the initiation and termination phases, and a Transformer-based sequence predictor for periodic error prediction during the cyclic phase. The upper-level control workflow consists of data acquisition and offline database construction, model training and selection, real-time phase detection, invoking the phase-appropriate model to predict errors, applying smoothing and safety-limited filtering to the predicted corrections, and feedforwarding the resulting compensation to the low-level controller. Runtime data are streamed back for subsequent retraining or online fine-tuning. To ensure deployability, both training and inference are executed on the upper-level host (NVIDIA Jetson).

3.2. Data Acquisition and Preprocessing

figure

Fig. 2. MLP network topology.

Experimental data are stored as CSV files, with each record containing the reference (target) and measured angles for four joints. Supervised learning samples are extracted on a frame-by-frame basis from multiple trial files.

For MLP training, the input-output pairing is defined as follows. The input vector concatenates the current reference vector \(\theta _\mathit{ref}( t )\), the previous-frame actual angles \(\theta _{act}( t-1 )\), and the previous-frame tracking error \(e( t-1 )\):

\begin{equation} x( t )=\left[ \theta _\mathit{ref}( t ); \theta _{act}( t-1 );e( t-1 )\right] , \quad x( t ) \in \mathbb{R}^{12}, \end{equation}
where each component is a 4-dimensional vector. The output target is the current reference deviation (actual minus reference), i.e.,
\begin{equation} y( t )=\theta _{act}( t )-\theta_\mathit{ref} ( t ), \quad y( t )\in \mathbb{R}^{4}, \end{equation}
and \(y( t )\) is used as the supervisory signal for the MLP-generated compensator \(u_{c} ( t )\). Because the input construction depends on the previous frame, the first row of each raw record is discarded during sample construction. Samples from all files are concatenated along the temporal dimension to form the aggregate dataset used for training and validation.

For Transformer training, the dataset is constructed and organized as time-series samples of fixed-length frame sequences. Each sample consists of \(L\) consecutive frames (in this study one full gait cycle with \(L=330\) frames is used as the sample unit). Each frame is represented by the four-joint tracking error features, computed consistently with the prior definition \(e( t ) =\theta_\mathit{ref} ( t )-\theta _{act}( t )\); thus each sample is an \(L\times4\) time-series vector. Using this representation, the learning target may be formulated as either a sequence-to-sequence or a sequence-to-one predictor to capture cross-cycle error patterns for periodic compensation. To ensure comparability and to assess generalization, the constructed dataset is randomly split into training and validation subsets; both the MLP and Transformer models use an 80%/20% training/validation split.

3.3. MLP Error Predictor Architecture and Training

The MLP is employed for short-horizon error regression. The network is a fully connected to feedforward architecture with two hidden layers. The output layer employs a linear mapping to directly regress the predicted disturbance values of the four joints; the specific topology is shown in Fig. 2. The mean squared error (MSE) is adopted as the loss function to minimize the discrepancy between predicted and ground truth values.

To achieve a more robust model configuration, a grid search is conducted over the combined space of training epochs, batch sizes, and learning rates. Specifically, the epochs are set to \(\{ 30, 50, 100 \}\), the batch sizes to \(\{ 16, 32, 64 \}\), and the learning rates to \(\{ 1\times 10^{-3}, 5\times 10^{-4}, 1\times 10^{-4} \}\). Each hyperparameter combination is trained for the specified number of epochs on the training set, and the validation error is computed on the validation set. The model weights corresponding to the minimum validation error are retained as the optimal configuration.

figure

Fig. 3. Block diagram of the Transformer model. Model details; input: 330-step \(\times\) 4-dim features, six encoder layers (residual connections), output: 4D gait error prediction, loss: MSE.

3.4. Structure and Training of the Transformer Sequence Predictor

The Transformer model is employed to predict errors during the gait cycle phase, and the model architecture is illustrated in Fig. 3. The input consists of a joint angle sequence of length \(L\) (set to \(L=330\) in this study, corresponding to one complete gait cycle). The model is constructed on a standard self-attention encoder architecture. Raw joint features are first linearly mapped (embedding) and positionally encoded before being processed by the encoder. The model produces outputs with the same dimensionality as the labels, thereby generating predictions for each input sample. MSE is adopted as the training loss function.

To identify the optimal training configuration, a systematic grid search is performed over the hyperparameter space: the sequence length is fixed at 330 (one full gait cycle) and the number of training epochs is fixed at 100, while batch size is varied over \(\{ 2, 4 \}\) and learning rate over \(\{ 1\times 10^{-4}, 5\times 10^{-4} \}\). Each hyperparameter combination is trained on the training set and evaluated on the validation set; the model weights corresponding to the lowest validation error are selected as the final model to ensure comparability and robustness of performance.

3.5. Deployment, Compensation Strategy, and Safety Constraints

Compensation application: The model output provides an estimate of the current deviation \(u_{c} ( t )=\theta_{\mathit{act}}( t )-\theta_{\mathit{ref}} ( t )\). A feedforward compensation is applied as:

\begin{equation} \theta {'} ( t ) =\theta_{\mathit{ref}} ( t )+\mathrm{clip} \left( u_{c} ( t )\in \left[-u_{\max},u_{\max} \right] \right). \end{equation}

Here, clip (.) denotes a per-joint amplitude-saturation operator that constrains the compensatory command within bounds \(\pm u_{\max}\) determined by actuator capabilities and clinical safety requirements; the specific value of \(\pm u_{\max}\) is set according to gait data matched to the patient’s anthropometric characteristics.

Phase switching and smooth transition: To prevent abrupt changes in compensation that could induce oscillation at phase boundaries, a weighted smoothing strategy is employed within a switching window \(T_{\mathit{switch}}\). The compensator output is linearly interpolated as:

\begin{equation} u_{c} ( t ) =( 1-w( t ) ) u_{\mathit{old}}( t ) + w( t )u_{\mathit{new}}( t ), \end{equation}
where the weight \(w(t)\) linearly increases from 0 to 1 over the switching window \(T_{\mathit{switch}}\). If phase detection is uncertain or predicted compensation exceeds safety thresholds, the system invokes a retreat strategy (disabling compensation) to ensure uninterrupted low-level FOC operation and closed-loop stability.

3.6. Gait-Phase Identification and Model Switching

Gait-phase segmentation (initiation, cyclic, termination) is performed based on kinematic features extracted from continuous time-series data during preprocessing; each phase corresponds to a specific frame count (the gait cycle length in this work is \(L=330\) frames). At runtime, an online phase-detection module identifies the current phase and triggers the corresponding model invocation and the aforementioned smooth-switching logic, thereby enabling phase-aware compensation and maintaining safety.

4. Experiments and Results Analysis

This section presents experimental validation of the proposed staged compensation approach (staged MLP + Transformer) for joint tracking on a lower-limb rehabilitation robot, focusing on effectiveness, real-time capability, and robustness. To ensure the credibility and engineering relevance of the findings, the experimental protocol adhered to the following principles: targeted validation—independently assessing short-horizon aperiodic-error compensation (MLP), periodic-error suppression (Transformer), and their combined effect; statistical significance—evaluating inter-method differences via repeated trials and paired statistical tests (e.g., paired \(t\)-test or Wilcoxon signed-rank test, depending on data normality); deployability under engineering constraints—measuring inference latency and resource utilization on the target hardware (NVIDIA Jetson and low-level FOC) within real control-cycle deadlines; and robustness—examining algorithm stability under additional loading and disturbance conditions.

4.1. Experimental Design

To evaluate the proposed method, three comparative experiments are conducted: baseline with low-level FOC only (no upper-level compensation); continuous MLP compensation (no phase switching); and the staged switching compensation scheme based on gait-phase segmentation, in which MLP is applied during initiation/termination and Transformer during the cyclic phase. All experiments are performed on the authors’ self-developed lower-limb rehabilitation robot (Fig. 4), using a 165 cm, 60 kg dummy as the load; repeated trials are collected to provide sufficient samples for statistical analysis.

When the lower-limb rehabilitation robot operates at a lower control frequency (30 Hz), the overall tracking error is relatively small. However, as rehabilitation intensity and walking speed increase, the control frequency must be raised accordingly (for example to 60 Hz), which is associated with a marked increase in tracking error. To reflect the more demanding conditions of advanced training and to ensure engineering relevance, all comparative and validation experiments in this study are performed at a control frequency of 60 Hz.

Baseline experiment: low-level FOC only, with no upper-level compensation. The reference and measured joint-angle trajectories for each actuator are presented in Fig. 5, where the reference trajectory is shown as a red dashed line and the measured trajectory as a black solid line. The traces reveal pronounced transient deviations and short-duration oscillations occurring at motor commutation instants, which produce concentrated increases in tracking error at those events. This baseline visualization characterizes the intrinsic response and error spectrum of the uncompensated system and serves as a reference for subsequent evaluation of compensation strategies.

figure

Fig. 4. Lower limb rehabilitation robot experimental platform.

figure

Fig. 5. Joint motor tracking data: baseline (FOC only).

figure

Fig. 6. Joint motor tracking data: continuous MLP compensation.

figure

Fig. 7. Joint motor tracking data: staged compensation.

In this experimental condition, an upper-level MLP model is employed continuously throughout the gait to predict errors and provide feedforward compensation. The reference and measured joint trajectories for each actuator are presented in Fig. 6. As shown, MLP-based compensation produced a positive effect on overall gait tracking performance; it noticeably suppressed transient deviations during initiation and termination, attenuated short-duration oscillations at commutation events, and reduced residual error during the cyclic phase, resulting in measured trajectories that more closely match the reference in both amplitude and phase. These findings indicate that a lightweight frame-by-frame predictor can deliver effective short-horizon error correction while meeting real-time constraints.

In this experimental condition, the control gait is partitioned into phases; a lightweight MLP is employed for error prediction and feedforward compensation during the short-term, aperiodic initiation and termination phases, while a Transformer-based sequence predictor is used during the dominant cyclic phase to model and compensate for cross-cycle errors. This staged switching compensation exploits the complementary strengths of the two model classes—low-latency transient correction by the MLP and long-range dependency captured by the Transformer. The reference and measured joint-angle trajectories under the staged scheme are presented in Fig. 7. As illustrated, the phase-aware compensation effectively suppresses transient deviations during initiation and termination and substantially reduces periodic residual error during the cyclic phase, yielding a systematic improvement in tracking performance for all joints.

4.2. Experimental Results Analysis

To enhance the generality and statistical reliability of the findings, each experimental condition is independently repeated \(n=10\) times. For each trial, joint-angle tracking errors are computed at corresponding time instants and aggregated across the 10 repeats; at each time point the sample mean and standard deviation of the error are then calculated. Time-series plots of the error means with their associated standard-deviation bands are produced to quantitatively and visually characterize the temporal behavior of joint tracking errors under each experimental condition. The resulting error-statistic curves are presented in Figs. 810 for comparative analysis. The mean error’s corresponding upper and lower bounds for each experimental condition are summarized in Table 1.

figure

Fig. 8. Joint motor angle error: baseline (FOC only).

figure

Fig. 9. Joint motor angle error: continuous MLP compensation.

figure

Fig. 10. Joint motor angle error: staged compensation.

To facilitate a direct comparison of compensation performance, RMSEs of joint-angle tracking are computed for the entire gait and separately for the initiation, cyclic, and termination phases. The RMSE results for each phase are summarized in Tables 24 (units: °), enabling quantitative evaluation of method-specific differences in overall and phase-wise tracking performance.

The experimental results indicate that both the MLP and Transformer models effectively reduce the tracking error of joint motors in the lower limb rehabilitation robotic system after gait compensation. Data analysis further reveals that, compared to the hip joint motor, the knee joint motor, with a larger range of motion, demonstrates a more significant reduction in error. Additionally, since cyclic gait accounts for 81.8% of the entire gait cycle (with \(N = 5\), the proportion of cyclic gait is 81.8%, and this increases as \(N\) grows), the Transformer model excels in predicting periodic errors. Therefore, the implementation of a stepwise prediction and compensation strategy across different gait phases leads to a more substantial reduction in the overall error.

The reduction in joint-angle tracking errors results from the complementary characteristics of the two learning-based compensation models. During gait initiation and termination, tracking errors are mainly aperiodic and transient, caused by actuator dynamics, friction variation, and abrupt reference changes. The MLP-based compensator, operating on instantaneous joint states and recent error information, is therefore effective in suppressing high-frequency and non-repetitive error components, leading to reduced peak deviations in these phases. In contrast, during cyclic gait execution, tracking errors exhibit strong periodicity and repeatability, including low-frequency bias and harmonic components synchronized with the gait cycle. The Transformer-based model exploits this temporal structure by processing full-cycle error sequences and capturing long-range dependencies via self-attention, enabling effective prediction and compensation of repetitive error patterns. Consequently, the staged combination of MLP-based and Transformer-based compensation achieves targeted suppression of distinct error components, explaining the observed reductions in both RMSE and peak errors across all joints.

To contextualize the tracking performance achieved in this study, the obtained error metrics are compared with representative results reported in the lower-limb rehabilitation and exoskeleton control literature. Although direct experimental replication on a common hardware platform is infeasible due to differences in mechanical structure and actuation, literature-based benchmarks provide a reasonable reference for performance positioning. Guo et al. 38 proposed a reinforcement-learning-based control strategy using a twin-delayed deep deterministic policy gradient (TD3) algorithm, reporting hip and knee joint tracking errors generally within \(\pm5°\) during gait-related tasks, which demonstrates adaptability but remains relatively coarse for high-frequency gait-following control. In contrast, Abdallah et al. 39 employed an adaptive fuzzy-PID control strategy for a lower-limb active prosthesis and reported joint-angle tracking RMSE values ranging from approximately 0.61° to 1.99° under external perturbations. By comparison, the proposed staged error-compensation framework consistently reduces joint-angle tracking RMSE to below 0.5° in the cyclic gait phase for all four actuated joints at a 60 Hz control frequency, with effective suppression of peak errors. This places the proposed method at the lower end of the tracking error range reported in existing studies, highlighting the benefit of phase-aware compensation combined with sequence-based learning for high-precision gait-following control.

Table 1. Joint motor angle error.

figure

Table 2. RMSE at each phase: baseline (FOC only).

figure

Table 3. RMSE at each phase: continuous MLP compensation.

figure

Table 4. RMSE at each phase: staged compensation.

figure

4.3. Discussion and Future Work

The experimental results demonstrate that the proposed staged joint-compensation framework effectively reduces joint-angle tracking errors across different gait phases in lower-limb rehabilitation robots. By exploiting the complementary characteristics of the MLP and Transformer models, the framework addresses both short-term aperiodic errors and long-term cyclic errors. Specifically, the MLP-based compensator provides rapid suppression of transient disturbances during gait initiation and termination, while the Transformer-based model captures repetitive error patterns during steady-state cyclic gait. This phase-dependent allocation of learning models explains the observed reductions in both RMSE and peak tracking errors and highlights the importance of explicitly considering phase-dependent error characteristics in gait-following control.

It should be emphasized that the present study is not intended as a clinical validation of rehabilitation effectiveness, but rather as a foundational investigation of control and compensation mechanisms at the joint and actuator level. All experiments were conducted using a standardized dummy load instead of human subjects to ensure repeatability and to isolate controller-level behavior under controlled conditions. This design choice eliminates variability arising from voluntary motion, inter-subject differences, and behavioral adaptation, allowing a clear and fair comparison of different compensation strategies. Consequently, the results should be interpreted as system-level and controller-level validation, providing a necessary basis for subsequent human-in-the-loop studies.

In real rehabilitation scenarios involving human users, tracking error characteristics are further influenced by complex human-robot interaction factors, including biological torque generation, muscle stiffness modulation, and reflexive responses. These effects introduce time-varying impedance and nonlinearity, which can alter both the magnitude and temporal structure of tracking errors across different gait phases. In particular, transient neuromuscular responses are more pronounced during gait initiation and termination, whereas cyclic phases tend to exhibit repeatable interaction patterns. This observation further supports the relevance of phase-aware compensation, as tailoring control strategies to phase-dependent error characteristics is expected to be especially beneficial under such dynamic and interactive conditions.

While gait phase segmentation, repetitive control, and learning-based compensation have each been explored in prior studies on rehabilitation and exoskeleton robots, these elements are typically applied in isolation or uniformly across the entire gait cycle. Existing phase-aware approaches often switch among conventional controllers with fixed structures, whereas learning-based methods are commonly implemented as single-model solutions operating continuously. In contrast, the proposed framework explicitly segments the gait process into initiation, cyclic, and termination phases and assigns heterogeneous learning-based models according to dominant error characteristics. To the best of our knowledge, such phase-dependent allocation of lightweight MLP and Transformer models for joint-level error compensation has not been previously reported for lower-limb rehabilitation robot control.

Despite the demonstrated improvements in tracking accuracy, challenges related to real-time deployment and robustness remain. In particular, the increased inference latency of the Transformer model may pose limitations in systems with more stringent real-time constraints. Future work will focus on optimizing model architectures through techniques such as pruning, quantization, or lightweight attention mechanisms to further reduce computational overhead. Additionally, enhancing phase detection by incorporating multimodal sensory information, such as force or pressure sensing, may improve robustness in dynamic environments. Ultimately, integrating the proposed framework into human-in-the-loop experiments will enable systematic evaluation under realistic interaction conditions and facilitate the development of more personalized and effective rehabilitation strategies.

5. Conclusion

This paper presents a staged joint-compensation framework for lower-limb rehabilitation robots to improve joint-angle tracking accuracy during gait execution. By explicitly partitioning the gait cycle into initiation, cyclic, and termination phases, the proposed strategy assigns phase-appropriate compensation models to address distinct error characteristics; lightweight MLP-based compensators suppress short-term, aperiodic disturbances during non-cyclic phases, while a Transformer-based sequence model predicts and compensates for repetitive periodic errors during cyclic gait. Experimental results demonstrate consistent and substantial reductions in joint-angle tracking RMSE across all actuated joints, including the left and right hip and knee, with effective performance improvements in both transient and steady-state phases. The results confirm the advantage of combining phase-aware model allocation with learning-based repetitive prediction for high-precision gait-following control. Overall, this work provides a systematic and practically deployable solution for joint-level error compensation in lower-limb rehabilitation robots and establishes a robust foundation for further optimization in real-time efficiency, adaptability, and integration with advanced control architectures.

Ethics Approval and Consent to Participate

The study was conducted in accordance with the Declaration of Helsinki and was approved by the Institutional Review Board of Zhongyuan University of Technology (Protocol code: ZUTSEI202305; approved on May 12, 2023). Healthy volunteers were recruited for gait data collection, and written informed consent was obtained from all participants prior to participation. All collected data were anonymized before analysis. Personal identifying information was removed, and the dataset was stored on secure institutional servers with access restricted to authorized research personnel.

Acknowledgments

This work was supported in part by the Henan Province Key Research and Development Project under Grant 241111312000; in part by the Henan Province Key Technologies Research and Development Program under Grants 252102211106, 252102320281, and 262102110343; in part by the Henan Province Key International Science and Technology Cooperation Project under Grant 251111520400; in part by the Henan Provincial Science and Technology Research and Development Program Joint Fund under Grants 252103810260 and 252103810251; and in part by the Major Science and Technology Special Project of Henan Province under Grant 251100310300.

References
  1. [1] N. Alam, S. Hasan, G. A. Mashud, and S. Bhujel, “Neural Network for Enhancing Robot-Assisted Rehabilitation: A Systematic Review,” Actuators, Vol.14, Issue 1, Article No.16, 2025. https://doi.org/10.3390/act14010016
  2. [2] V. Firouzi, A. Seyfarth, S. Song, O. von Stryk, and M. A. Sharbafi, “Biomechanical models in the lower-limb exoskeletons development: A review,” J. of NeuroEngineering and Rehabilitation, Vol.22, No.1, Article No.12, 2025.
  3. [3] K. Aqabakee, F. Abdollahi, A. Taghvaeipour, and M.-R. Akbarzadeh-T, “Recursive generalized type-2 fuzzy radial basis function neural networks for joint position estimation and adaptive EMG-based impedance control of lower limb exoskeletons,” Biomedical Signal Processing and Control, Vol.100, Part C, Article No.106791, 2025. https://doi.org/10.1016/j.bspc.2024.106791
  4. [4] H. Xia, Y. Zhang, N. Rajabi, F. Taleb, Q. Yang, D. Kragic, and Z. Li, “Shaping high-performance wearable robots for human motor and sensory reconstruction and enhancement,” Nature Communications, Vol.15, No.1, Article No.1760, 2024. https://doi.org/10.1038/s41467-024-46249-0
  5. [5] S. Ha, J. Lee, M. van de Panne, Z. Xie, W. Yu, and M. Khadiv, “Learning-based legged locomotion: State of the art and future perspectives,” The Int. J. of Robotics Research, Vol.44, Issue 8, pp. 1396-1427, 2025. https://doi.org/10.1177/02783649241312698
  6. [6] O. Flor-Unda, R. Arcos-Reina, C. Toapanta, F. Villao, A. Bustos-Estrella, C. Suntaxi, and H. Palacios-Cabrera, “Challenges in the Development of Exoskeletons for People with Disabilities,” Technologies, Vol.13, Issue 7, Article No.291, 2025. https://doi.org/10.3390/technologies13070291
  7. [7] G.-R. Duan, “Fully Actuated System Approach for Control: An Overview,” IEEE Trans. on Cybernetics, Vol.54, Issue 12, pp. 7285-7306, 2024. https://doi.org/10.1109/TCYB.2024.3457584
  8. [8] X. Lu, X. Chen, Y. Bai, and R. Liu, “Explicit model based fuzzy control method for lower limb exoskeleton robot,” Expert Systems with Applications, Vol.270, Article No.126601, 2025. https://doi.org/10.1016/j.eswa.2025.126601
  9. [9] A. D. Banyai and C. Brișan, “Robotics in Physical Rehabilitation: Systematic Review,” Healthcare, Vol.12, Issue 17, Article No.1720, 2024. https://doi.org/10.3390/healthcare12171720
  10. [10] M. S. Amiri and R. Ramli, “Fuzzy Adaptive Controller of a Wearable Assistive Upper Limb Exoskeleton Using a Disturbance Observer,” IEEE Trans. on Human-Machine Systems, Vol.55, Issue 2, pp. 197-206, 2025. https://doi.org/10.1109/THMS.2025.3529759
  11. [11] Y. Wang, Y. Tian, Y. Guo, and H. Wang, “Active torque-based gait adjustment multi-level control strategy for lower limb patient – Exoskeleton coupling system in rehabilitation training,” Mathematics and Computers in Simulation, Vol.215, pp. 357-381, 2024. https://doi.org/10.1016/j.matcom.2023.08.020
  12. [12] R. L. McGrath and F. Sergi, “Repetitive Control of Knee Interaction Torque via a Lower Extremity Exoskeleton for Improved Transparency During Walking,” IEEE Trans. on Medical Robotics and Bionics, Vol.6, Issue 4, pp. 1581-1590, 2024. https://doi.org/10.1109/TMRB.2024.3464119
  13. [13] B. Chen, L. Zhou, B. Zi, E. Li, and D. Zhang, “Adaptive Admittance Control Strategy for a Robotic Knee Exoskeleton with a Nonlinear Variable Stiffness Actuator,” IEEE/ASME Trans. on Mechatronics, Vol.30, Issue 3, pp. 1888-1899, 2024. https://doi.org/10.1109/TMECH.2024.3422478
  14. [14] J. Luo, C. Zhang, W. Si, Y. Jiang, C. Yang, and C. Zeng, “A Physical Human–Robot Interaction Framework for Trajectory Adaptation Based on Human Motion Prediction and Adaptive Impedance Control,” IEEE Trans. on Automation Science and Engineering, Vol.22, pp. 5072-5083, 2024. https://doi.org/10.1109/TASE.2024.3415650
  15. [15] L. Pezeshki, H. Sadeghian, A. Mohebbi, M. Keshmiri, and S. Haddadin, “Personalized Assistance in Robotic Rehabilitation: Real-Time Adaptation via Energy-Based Performance Monitoring,” IEEE Trans. on Automation Science and Engineering, Vol.22, pp. 13298-13309, 2025. https://doi.org/10.1109/TASE.2025.3552446
  16. [16] H. Liu, C. Zhu, Z. Zhou, Y. Dong, W. Meng, and Q. Liu, “Synergetic gait prediction and compliant control of SEA-driven knee exoskeleton for gait rehabilitation,” Frontiers in Bioengineering and Biotechnology, Vol.12, Article No.1358022, 2024. https://doi.org/10.3389/fbioe.2024.1358022
  17. [17] H. van der Kooij, E. H. F. van Asseldonk, M. Sartori, C. Basla, A. Esser, and R. Riener, “AI in therapeutic and assistive exoskeletons and exosuits: Influences on performance and autonomy,” Science Robotics, Vol.10, No.104, Article No.eadt7329, 2025. https://doi.org/10.1126/scirobotics.adt7329
  18. [18] D. Astolfi, S. Marx, and N. van de Wouw, “Repetitive control design based on forwarding for nonlinear minimum-phase systems,” Automatica, Vol.129, Article No.109671, 2021. https://doi.org/10.1016/j.automatica.2021.109671
  19. [19] K. Umeda, Y. Jiang, H. Yokoi, and S. Togo, “Repetitive Control of Robotic Joint with Variable Impedance Utilizing Agonist-Antagonist Muscle Pair Structure Based on Virtual Trajectories,” IEEE Access, Vol.13, pp. 16866-16878, 2025. https://doi.org/10.1109/ACCESS.2025.3532633
  20. [20] Z. Sun, F. Li, X. Duan, L. Jin, Y. Lian, S. Liu, and K. Liu, “A novel adaptive iterative learning control approach and human-in-the-loop control pattern for lower limb rehabilitation robot in disturbances environment,” Autonomous Robots, Vol.45, No.4, pp. 595-610, 2021. https://doi.org/10.1007/s10514-021-09988-3
  21. [21] J. Yang, T. Sun, L. Cheng, and Z.-G. Hou, “Spatial Repetitive Impedance Learning Control for Robot-Assisted Rehabilitation,” IEEE/ASME Trans. on Mechatronics, Vol.28, Issue 3, pp. 1280-1290, 2022. https://doi.org/10.1109/TMECH.2022.3221931
  22. [22] X. Wang, R. Zhang, Y. Miao, M. An, S. Wang, and Y. Zhang, “PI^{mathrm{2}}-Based Adaptive Impedance Control for Gait Adaption of Lower Limb Exoskeleton,” IEEE/ASME Trans. on Mechatronics, Vol.29, Issue 6, pp. 4251-4261, 2024. https://doi.org/10.1109/TMECH.2024.3370954
  23. [23] T. K. Best, C. G. Welker, E. J. Rouse, and R. D. Gregg, “Data-Driven Variable Impedance Control of a Powered Knee-Ankle Prosthesis for Adaptive Speed and Incline Walking,” IEEE Trans. on Robotics, Vol.39, Issue 3, pp. 2151-2169, 2023. https://doi.org/10.1109/TRO.2022.3226887
  24. [24] X. Li, Y.-H. Liu, and H. Yu, “Iterative learning impedance control for rehabilitation robots driven by series elastic actuators,” Automatica, Vol.90, pp. 1-7, 2018. https://doi.org/10.1016/j.automatica.2017.12.031
  25. [25] Q. Wen, T. Zhou, C. Zhang, W. Chen, Z. Ma, J. Yan, and L. Sun, “Transformers in Time Series: A Survey,” arXiv preprint, arXiv:2202.07125, 2023. https://doi.org/10.48550/arXiv.2202.07125
  26. [26] J. Zhao, S. Gao, Z. Pan, L. Wang, and Z. Yu, “Cross-Coupled Synchronous Control of Dual Linear Motor Servo System Based on Disturbance-Assignment Observer and Iterative Learning Control,” IEEE Trans. on Transportation Electrification, Vol.11, Issue 1, pp. 2908-2917, 2024. https://doi.org/10.1109/TTE.2024.3430062
  27. [27] H. Chen, X. Wang, Y. Xiao, B. Wu, Z. Wang, Y. Liu, P. Wang, C. Chen, and X. Wu, “iP3T: An interpretable multimodal time-series model for enhanced gait phase prediction in wearable exoskeletons,” Frontiers in Neuroscience, Vol.18, Article No.1457623, 2024. https://doi.org/10.3389/fnins.2024.1457623
  28. [28] Z. Guo, H. Zheng, H. Wu, J. Zhang, G. Zhou, and J. Long, “Transferable multi-modal fusion in knee angles and gait phases for their continuous prediction,” J. of Neural Engineering, Vol.20, No.3, Article No.036019, 2023. https://doi.org/10.1088/1741-2552/accd22
  29. [29] I. Kang, D. D. Molinaro, S. Duggal, Y. Chen, P. Kunapuli, and A. J. Young, “Real-Time Gait Phase Estimation for Robotic Hip Exoskeleton Control During Multimodal Locomotion,” IEEE Robotics and Automation Letters, Vol.6, Issue 2, pp. 3491-3497, 2021. https://doi.org/10.1109/LRA.2021.3062562
  30. [30] J. Ren, A. Wang, H. Li, X. Yue, and L. Meng, “A Transformer-Based Neural Network for Gait Prediction in Lower Limb Exoskeleton Robots Using Plantar Force,” Sensors, Vol.23, Issue 14, Article No.6547, 2023. https://doi.org/10.3390/s23146547
  31. [31] A. Wang, J. Dong, R. Teng, P. Liu, X. Yue, and X. Zhang, “A Hierarchical Distributed Control System Design for Lower Limb Rehabilitation Robot,” Technologies, Vol.13, Issue 10, Article No.462, 2025. https://doi.org/10.3390/technologies13100462
  32. [32] Y. Zheng, Z. Cao, Z. Man, A. Kumar, and S. Wang, “Phase-lead Repetitive Control of a PMSM with Field-oriented Feedback Linearization and a Disturbance Observer,” 47th Annual Conf. of the IEEE Industrial Electronics Society (IECON 2021), 2021. https://doi.org/10.1109/IECON48115.2021.9589815
  33. [33] S. Hu, L. Shen, Y. Zhang, Y. Chen, and D. Tao, “On Transforming Reinforcement Learning With Transformers: The Development Trajectory,” IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol.46, Issue 12, pp. 8580-8599, 2024. https://doi.org/10.1109/TPAMI.2024.3408271
  34. [34] H. Kang and P. Kang, “Transformer-based multivariate time series anomaly detection using inter-variable attention mechanism,” Knowledge-Based Systems, Vol.290, Article No.111507, 2024. https://doi.org/10.1016/j.knosys.2024.111507
  35. [35] A. Y. Yıldız, E. Koç, and A. Koç, “Multivariate Time Series Imputation with Transformers,” IEEE Signal Processing Letters, Vol.29, pp. 2517-2521, 2022. https://doi.org/10.1109/LSP.2022.3224880
  36. [36] E. Kurniawan, H. Wang, J. A. Prakosa, P. Purwowibowo, and E. B. Pratiwi, “An improved repetitive controller with fractional time-delay for discrete-time linear systems: Synthesis and comparison study,” ISA Trans., Vol.146, pp. 511-527, 2024. https://doi.org/10.1016/j.isatra.2023.12.035
  37. [37] W. Duan, W. Chen, J. Wang, J. Liu, Z. Pei, and J. Chen, “Gait-Generation Strategy for Lower Limb Exoskeleton Based on Central Pattern Generator,” IEEE/ASME Trans. on Mechatronics, Vol.29, Issue 6, pp. 4191-4202, 2024. https://doi.org/10.1109/TMECH.2024.3367348
  38. [38] Y. Guo, M. He, X. Tong, M. Zhang, and L. Huang, “Research on the Motion Control Strategy of a Lower-Limb Exoskeleton Rehabilitation Robot Using the Twin Delayed Deep Deterministic Policy Gradient Algorithm,” Sensors, Vol.24, Issue 18, Article No.6014, 2024. https://doi.org/10.3390/s24186014
  39. [39] W. Abdallah, R. Boucetta, and S. B. H. Ali, “An adaptive fuzzy-PID control of a lower limb active prosthesis under external perturbations,” 2019 16th Int. Multi-Conf. on Systems, Signals & Devices (SSD), pp. 96-101, 2019. https://doi.org/10.1109/SSD.2019.8893227

*This site is desgined based on HTML5 and CSS3 for modern browsers, e.g. Chrome, Firefox, Safari, Edge, Opera.

Last updated on Aug. 19, 2026