Multi-mode adaptive control strategy for a lower limb rehabilitation robot

Different patients have different rehabilitation requirements. It is essential to ensure the safety and comfort of patients at different recovery stages during rehabilitation training. This study proposes a multi-mode adaptive control method to achieve a safe and compliant rehabilitation training strategy. First, patients’ motion intention and motor ability are evaluated based on the average human–robot interaction force per task cycle. Second, three kinds of rehabilitation training modes—robot-dominant, patient-dominant, and safety-stop—are established, and the adaptive controller can dexterously switch between the three training modes. In the robot-dominant mode, based on the motion errors, the patient’s motor ability, and motion intention, the controller can adaptively adjust its assistance level and impedance parameters to help patients complete rehabilitation tasks and encourage them to actively participate. In the patient-dominant mode, the controller only adjusts the training speed. When the trajectory error is too large, the controller switches to the safety-stop mode to ensure patient safety. The stabilities of the adaptive controller under three training modes are then proven using Lyapunov theory. Finally, the effectiveness of the multi-mode adaptive controller is verified by simulation results.


Introduction
In recent years, the number of patients with movement disorders caused by stroke and spinal cord injury has increased rapidly, as has the corresponding rehabilitation demand.Traditional rehabilitation strategies rely on therapists to help patients participate in training, and there are some problems such as long rehabilitation cycle and low efficiency of rehabilitation which make it difficult to meet the growing recovery needs (Luo et al., 2019).As a new way of rehabilitation training, rehabilitation robots can effectively save medical resources and improve the efficiency of rehabilitation training.Therefore, this has received wide attention and recognition (Adhikari et al., 2023).
The control method plays a crucial role in the rehabilitation effect (Zhou et al., 2021) as the patient has been interacting with the robot during the training process.Traditional control methods may subject the patient to excessive torque, which increases the risk of secondary injury.In contrast, control methods based on human-robot interactive information can have good rehabilitation training effects (Guo et al., 2021).Such methods can not only effectively avoid potential injuries but also help improve recovery.Therefore, it is important to design a safe, natural, and compliant human-robot interaction control method for rehabilitation robot systems (Masengo et al., 2023;Bergmann et al., 2023;Li Z. et al., 2024;Lu et al., 2023).
For patients with weak motor ability, rehabilitation robots should provide enough assistive force to help complete training tasks.However, too much assistance may make patients slack off, and too little assistance will not help patients implement training tasks-both may reduce rehabilitation effects.In order to realize efficient rehabilitation training, human-robot interaction methods need to follow the assistedas-need (AAN) principle (Li N. et al., 2024).At present, impedance control is usually used to implement the AAN strategy (Han et al., 2023).Mao et al. (2015) established a force field controller which constructs a virtual tunnel with impedance characteristics around the desired trajectory to assist the patient's movement.Jamwal et al. (2016) built an impedance controller for an ankle robot to assist patient compliance.Due to individual differences, it is difficult to obtain optimal impedance parameters.In addition, the interaction force and motion speed change over time, and fixed impedance parameters usually cannot meet the practical needs.The dynamic relationship between motion and interaction force can be adjusted according to the actual task by using time-varying impedance control; thus, good dynamic interaction performance can be achieved (Liang et al., 2022).Asl et al. (2020) constructed an AAN impedance controller which utilizes velocity tracking errors to adjust impedance parameters online.However, only the damping parameter is adjusted in this study, and its adaptive adjustment ability is relatively limited.Han et al. (2023) proposed an AAN control strategy for rehabilitation robots based on patients' motor intention and task performance.The learning efficiency of impedance parameters and the auxiliary level were adaptively adjusted according to the assessment results of interaction force and patient performance.The experimental results show that this method can motivate patients to increase their engagement.
For patients with a partial recovery of motor function or strong motor ability, interference with their movement should be reduced to provide sufficient freedom of movement (Han et al., 2023;Zhang and Cheah, 2015).Higher freedom of movement does not mean that patients can move without restriction.When the position and speed of robots reach a certain level, patients may be exposed to the potential risk of secondary injury (Gao et al., 2023).To ensure patient safety, control methods should have safety features such as emergency stops or motion position limitations.
To meet the needs of patients at different recovery stages and ensure their safety, multi-mode control strategies have been proposed (Zhang and Cheah, 2015;Li et al., 2021;Yang et al., 2023;Xu et al., 2019;Li et al., 2017a,b).Zhang and Cheah (2015) proposed a multi-mode control method for upper limb rehabilitation robots.The training mode is chosen based on the position error to realize safety assistance.Li et al. (2021) and Yang et al. (2023) also designed multi-mode control strategies and switched control modes according to the tracking error.These methods switch control modes according to the position errors, which will partly limit the movement freedom of patients with strong motor ability.To solve this problem, a patient's bioelectrical or interactive force signals can be used as the basis for switching training modes.Xu et al. (2019) proposed a multi-mode adaptive control strategy for a sitting lower limb rehabilitation robot.The human-robot interaction torque is estimated by using an EMGdriven impedance model.Based on the estimated human-robot interaction torque, a smooth transition between the robot-dominant and human-dominant modes can be achieved.Compared with bioelectrical signals, interaction force signals are more reliable.Li et al. (2017a) proposed an adaptive control method to smoothly switch the training modes between robot-and human-dominant modes based on the human-robot interaction force to realize safe interaction between humans and robots.Since this method ignores trajectory errors, the trajectory errors in the human-dominant mode may be large, which will lead to a reduction in the training effect.In the multi-mode control strategy, relying on only a single signal cannot provide the most suitable rehabilitation training mode for patients.Li et al. (2017b) proposed a multi-mode control strategy in which the tracking error and human-robot interaction force are taken as the basis for mode switching.Based on the tracking error, the controller can switch flexibly between human-and robot-dominant modes.When the human-robot interaction force exceeds the safety threshold, the controller will switch to the safety-stop mode to ensure the patient's safety.This method still uses the tracking error as the basis for switching Multi-mode adaptive control block diagram.
Frontiers in Bioengineering and Biotechnology frontiersin.orgbetween human-and robot-dominated modes, which will also limit the movement freedom of patients with strong motor ability.In addition, the interaction force signals cannot fully indicate the patients' motor ability.
To solve such problems, a multi-mode adaptive control strategy for repetitive rehabilitation tasks is here proposed.The human-robot interaction force evaluation factor is introduced to assess a patient's motor ability and motor intention online (Han et al., 2023).Based on the evaluation result of the patient's motor ability and trajectory errors, the training mode can be freely switched between robot-dominant, patient-dominant, and safety-stop modes.In the robot-dominant mode, the robot's assistance level and the learning efficiency of impedance parameters are periodically adjusted according to the trajectory error, speed error, the assessed motor ability, and the motion intention, so as to provide appropriate assistance for patients with different motor abilities.In the patient-dominant mode, the controller allows the patient to modify the reference speed so that patients with higher motor ability have enough freedom of movement.When the trajectory error exceeds the safe range, it switches to safety-stop mode to ensure patient safety.The proposed method is not only suitable for patients at different stages of recovery and with different motor abilities but can also stimulate their enthusiasm to participate in rehabilitation training, further enhancing the rehabilitation effect.

Dynamic model of the human-robot hybrid system
During the rehabilitation training, the lower limb rehabilitation robot is in close contact with the patients' affected limb, forming a human-robot hybrid system.The hybrid system's dynamic model is shown as Eq. 1.
where q [q 1 /q i ] T represents the robot's joint angle, and i denotes the number of the robot's joints._ q and € q represent the angular speed and angular acceleration, respectively.M(q), C(q, _ q) and G(q) denote the inertia matrix, the Coriolis and centrifugal matrix, and the gravity vector, respectively.τ r and τ h respectively represent the actuation torque and interaction torque exerted by patient.In this paper, the interaction force F h is exerted on the robot end, give by Eq. 2.
where J(q) represents the Jacobian matrix.

Multi-mode control method
The functions and designs of the three control modes are briefly introduced in this section.For repetitive tasks, when the patient does not have enough motor ability to independently complete the training task, the robot-dominant mode runs.Adaptive assistance is then provided according to the patient's motor ability and motion intention.For patients with weak motor ability, the assistance level will be periodically increased.For patients with a certain motor ability but who cannot yet complete the task independently, the assistance intensity will reduce appropriately to encourage more active participation in the training task.When the patient has recovered part of the motor function and can complete the training task independently, the patient-dominant mode runs.In this case, only movement speed is adjusted to provide the patient with a high degree of freedom of movement.When the patient's movement is abnormal or the task is too difficult, the robot's trajectory may exceed the safe range.In this case, the safety-stop mode runs to ensure patient safety.

Design of human-robot interaction force evaluation factor and mode shift factor
According to the functional requirements of the three control modes, a unified control law is established that includes the Training modes.
reference term, impedance learning term, sliding term, and compensation term, as shown below.
impedance learning term where M, C, and G are abbreviations of M(q), C(q, _ q), and G(q), respectively.K(t) and D(t) denote variable stiffness and damping, respectively.L(t) denotes the sliding control gain, while e = q d − q represents the trajectory error between the desired q d and actual trajectory q. s _ q ref − _ q denotes the sliding vector._ ) denotes the reference speed, where A is a symmetric positive definite matrix, _ q h is the modified speed determined by the interaction torque, α is the robot-patient mode shift factor determined by the patients' motor ability, and β is the stop-mode shift factor, determined by the trajectory error.Before analyzing the change pattern of these two mode shift factors, the human-robot interaction force evaluation factors r par j and r ort j are introduced to assess the patients' motor ability and motion intention (Han et al., 2023) as shown in Eqs 4, 5.
where F par h represents the human-robot interaction force parallel to the desired trajectory.F ort h represents the human-robot interaction force perpendicular to the desired trajectory.( _ x d , _ y d ) represents the desired speed at the robot end.F h can be obtained by the interaction force estimation methods (Lu et al., 2023;Liang et al., 2023).j denotes the jth training task, T denotes the task period.t j , and t j−1 represent the initial moments of the jth and (j − 1)th task, respectively.
When r par j is positive, the patient's movement speed is greater than the desired speed, and the robot is driven by the patient along the desired trajectory.On the other hand, when r par j is negative, the patient is driven by the robot along the desired trajectory.|r ort j | > 0 means that the patient intends to deviate from the desired trajectory.The greater the r par j , the stronger the patient's motor ability.The larger |r ort j | is, the stronger the patient's intention to move away from the desired trajectory.
The change pattern of α and β is designed as follows: Schematic diagram of the compensation principle.When abnormal, which will lead to excessive trajectory errors or even secondary injury to the patient.The controller will then switch to safety-stop mode to ensure patient safety.If e ≤ a, then the patient is able to complete training task either with the robot's assistance or independently.The controller will then switch to either robotdominant or patient-dominant mode based on the value of α.If r par j > c, then the patient can complete the task independently, and it will switch to patient-dominant mode.If r par j ≤ c, the patient's motor ability is insufficient to complete the training task, and it will switch to the robot-dominant mode.In practice, c can be set to a constant close to 0. If the patient has good control over the affected limb, c can be slightly reduced, allowing the controller to easily enter and maintain the patient-dominant mode.If the patient has poor control over the affected limb, c can be slightly increased so that the controller is always in robot-dominant mode so that the robot can help the patient complete the training task and correct their wrong movements.
The control diagram is shown in Figure 1.To ensure patient safety, the safety-stop mode has the highest priority among the three modes, which is reasonable in practical applications.To ensure the smoothness of the mode switching process, transition intervals are added to Eqs 6, 7, and then the change pattern of α and β is modified as Eqs 8, 9. and e change.According to the patient's motor ability and trajectory error, the controller switches freely between the three modes (Figure 2).However, r par j is periodically adjusted, and it will cause α to be discontinuous in time.When α changes at t 1 , the changed α is expressed as α 1 = α(t 1 ), and we have where α s = α(t 1 − t s ), t s is the sampling time, and T smo is the smoothing time.Thus, α is smooth in time.
Although Eq. 10 can ensure the continuity of α, T smo may also cause a lag in mode switching.Therefore, the value of T smo should not be too large in practical applications.

The Robot-dominant mode
When α = 1, β = 0, the controller is in the robot-dominant mode.In this mode, the human-robot interaction torque is described as Eq.11 (Han et al., 2023;Yang et al., 2011): where the stiffness parameters K h (t), damping parameters D h (t), and compensating torque τ 0 (t) are assumed to vary with time.The minimum quantities of stiffness, damping, and compensating torque are assumed to be K m (t), D m (t), and τ m (t), respectively, and In this mode, Eq. 3 can be written as Eq. 13.
where the update rules of K(t), D(t), L(t), and τ c (t) adhere to the following principles.1) When r par j is negative and its absolute value Simplified structure of a lower limb rehabilitation robot.  is large, the patient's motor ability is insufficient to complete the desired training task.In this case, the robot should increase its assistance level to help the patient complete training task.When r par j is negative and its absolute value is small, then, although the patient does not have the ability to complete the training task independently, the degree of active participation in the training is relatively high.In this case, the robot should reduce its assistance level to encourage the patient to further improve training enthusiasm.
2) The impedance parameters and torque compensation terms are adjusted adaptively by iterative learning.
When the absolute value of r ort j is large, the learning speed increases to quickly correct the patient's movement.When the absolute value of r ort j is small, the learning speed slows down.The update law for L(t) is designed as follows: where where η 0 = 0. L 0 is a positive definite matrix.In this mode, L(t) is periodically adjusted according to the value of r par j as shown in Eqs 14, 15. r par min and r par max are given constants, and their values are smaller than c and d.In practice, these two parameters can be adjusted according to the patient's motor ability.If their motor ability is weak, r par min and r par max can be set to smaller values so that the controller can more easily detect the patient's effort and reduce the robot's assistance level.
The update law for K(t), D(t), and τ c (t) are given as follows: where γ j is updated as shown in Eq. 17.
where γ j ∈ (−1, 1) denotes the iterative learning factor, and ζ denotes the update rate.γ 0 = 0. Q K , Q D , and Q τc are symmetric positive definite matrices.During the first task cycle, K(t) = 0 i×i , D(t) = 0 i×i , and τ c (t) 0 i×1 .In this mode, based on the assessment of motor ability and motor intention, L(t) and γ j are periodically adjusted to provide adaptive assistance for patients at different recovery stages.

The patient-dominant mode
When α = 0, β = 0, the controller is in the patient-dominant mode.In this mode, Eq. 3 can be written as Eq.18.
where L(t) is given in Eq. 19.
where L last denotes the last updated value of L(t) before entering this mode.λ L last denotes the smallest eigenvalue of L last , and λ L0 denotes the smallest eigenvalue of L 0 .From the definition of _ q ref and s, we Evaluation results of the human-robot interaction force under different task cycles.
derive s _ In this mode, _ q h can be obtained by using the following impedance equation: where M im and B im denote the inertia and damping parameters, respectively.
To ensure the stability of human-robot interactions and encourage active patient participation, τ c was utilized to appropriately compensate τ h (Zhang and Cheah, 2015).When the absolute value of the angle θ h,s between τ h and s is smaller than θ ς and θ ς ∈ (0, π 2 ), then the patient exerts an interactive force to drive the robot close to the reference speed-that is, the patient's motion intention can be seen as correct.In this case, τ h is retained.When θ ς ≤ |θ h,s | ≤ π 2 , then the patient's motion intention cannot be seen as quite correct.In this case, τ h is compensated to its nearest unit vector s ς1 or s ς2 to ensure that the angle between the compensated torque and s is equal to θ ς .When |θ h,s | > π 2 , the patient's motion intention cannot be seen as correct.In this case, τ c is utilized to neutralize τ h -that is, τ c + τ h = 0.The schematic diagram of the compensation principle is shown in Figure 3.In this mode, τ c + τ h can be expressed as Eqs 21−23 where Entire simulation results of hip and knee joints.Frontiers in Bioengineering and Biotechnology frontiersin.orgμ s ( ) and where s min is a small positive number.μ(s) ensures the smoothness of τ c + τ h at s = 0. s ς equals s ς1 or s ς2 .In this mode, the impedance learning term is removed, and the sliding mode control term is converted to a speed control term.In addition, the patient can modify the reference speed, improving compliance with and the flexibility of rehabilitation training.τ c is used to compensate τ h appropriately.Compared with the robotdominant mode, the patient-dominant mode further improves the patient's freedom of movement.

The safety-stop mode
When α = 0, β = 1, the controller is in the safety-stop mode.In this mode, Eq. 3 can be written as Eq.24.
where L(t) is given as Eq.25.
L t ( ) τ c is utilized to neutralize τ h -that is, τ c + τ h = 0. From the definition of _ q ref and s, we derive s _ q ref − _ q − _ q.

FIGURE 9
The controller is in the robot-dominant mode, and the robot assisted the patient to complete the rehabilitation task.Frontiers in Bioengineering and Biotechnology frontiersin.org10 Liang et al. 10.3389/fbioe.2024.1392599 5 Simulations A two-degree-of-freedom lower limb rehabilitation robot is used to verify the effectiveness of the proposed method.As shown in Figure 5, m 1 and m 2 represent the mass of the thigh and calf, respectively.l 1 and l 2 represent the length of the thigh and calf, respectively.l c1 denotes the distance from the hip joint to the center of mass of the thigh.l c2 denotes the distance from knee joint to the center of mass of the calf.The dynamic model of this hybrid system is described as Eq.55 where M 11 I 1 + I 2 + m 2 l 2 1 + 2m 2 l 1 l c2 cos(q 2 ).I 1 m 1 l 2 c1 and I 2 m 2 l 2 c2 represent the inertia of the thigh and calf, respectively.
The initial angle of the robot is set to q 0 [7π/36, −13π/36] T .The initial parameters of the proposed method and lower limb rehabilitation robot are listed in Table 1.The values of η and ζ are given as Eqs 57, 58 The simulation process consists of 28 task cycles, each lasting 10 s.The results of the human-robot interaction force evaluation for each task cycle are given in Figure 6, which shows the patients' motor ability and motion intention under different task cycles.The simulation results are shown in Figure 7.
At the beginning, the controller is in safety-stop mode due to e > a.In this mode, τ h is neutralized by τ c .At approximately 4.44 s, e < a.Meanwhile, due to r par 1 −1, the controller leaves the safetystop mode and gradually transitions to the robot-dominant mode (Figure 8).
In the robot-dominant mode, according to r par j and r ort j , the robot's assistance level is adaptively adjusted to help the patient complete the desired task.The change trends of η j and γ j are shown in Figure 9A.When r par j < r par min , L(t) increases periodically with η j .Although there are fluctuations in the changes of r par j and r ort j , the trajectory error decreases periodically (Figure 9B).The increase of the eigenvalue of L(t) improves motion accuracy.When r par min < r par j < r par max , η j remains unchanged.When r par j > r par max , L(t) decreases periodically with η j .It can be observed that |r ort j | is greater than r ort max in the second to seventh task cycle, which means that the patient intends to move away from the desired trajectory.γ j will then reduce to a lower value to increase the learning rate of the impedance parameters, thus correcting the patient's motion trajectory (Figure 9A).However, with the gradual reduction of γ j , the impedance parameters present a tendency to decrease periodically (Figures 9C, D).According to Eq. 16, this phenomenon is attributed to the improvement of motion accuracy.
When d < r par j ≤ c, the controller breaks away from the robotdominant mode and transitions to the patient-dominant mode.When r par j > c, the controller is in patient-dominant mode.As the controller switches from robot-dominant to patient-dominant mode, greater trajectory errors are allowed, which provides greater freedom of movement (Figures 10A, B).In addition, the robot's speed gradually converges to _ q d + _ q h (Figure 10C).This phenomenon is consistent with theory.
As r par j decreases, the controller switches again to the robotdominant mode.Compared to the patient-dominant mode, the trajectory error is significantly reduced at this point (Figure 11A).From 190 to 230 s, η j does not change.Affected by the vertical interaction force, γ j decreases periodically (Figure 11B).From Figures 11C-E, the impedance parameter and torque compensation term increase periodically to correct patient motion, and the trajectory error is gradually reduced (Figure 11A).
When r par j > c, the controller switches to the patient-dominant mode again, where the patient's freedom of movement increases and the robot's speed converges to _ q d + _ q h (Figure 12).To test the safety stop function of the controller during rehabilitation training, the excessive F par h and F ort h are applied, which will cause e to increase sharply and e > a (Figure 13A).In this case, the controller switches to the safety-stop mode to ensure patient safety (Figure 13B), and the actual speed of the robot decreases rapidly to zero (Figure 13C).
The effectiveness of the proposed method is demonstrated by the trajectory errors, adaptive change of controller parameters, and joint angular speed during human-robot interaction in three modes.In addition, the simulation includes the transition process between each mode, and the system can still run stably during this transition process.

Conclusion
This study proposes a multi-mode adaptive control method, including robot-dominant, patient-dominant, and safety-stop modes.The patient's motor ability and the system's trajectory error are taken as the basis for mode switching.Based on the patients' motor ability, the controller can switch between robotdominant and patient-dominant modes.Trajectory errors are used to determine whether to switch to the safety-stop mode.The proposed control strategy is not only suitable for patients with different motor abilities and rehabilitation stages but also guarantees safety during rehabilitation training.Since the transition between robot-dominant and patient-dominant modes does not depend on the trajectory errors, the patient-dominant mode allows for greater trajectory errors than the robot-dominated mode, and the reference speed can be modified by the patient, improving their freedom of movement.The stability of the proposed method under three control modes is analyzed using Lyapunov theory.Numerical simulations are carried out on a two-degree-of-freedom lower limb rehabilitation robot to verify the effectiveness of the proposed method.Our future work will focus on clinical applications.Liang et al. 10.3389/fbioe.2024.1392599

FIGURE 2
FIGURE 2 FIGURE 3 9) where b and d are given values.The modified α and β change smoothly as r par j

FIGURE 6
FIGURE 6 (A) Desired and actual trajectories.(B) Absolute values of trajectory errors.

FIGURE 8
FIGURE 8The controller leaves the safety-stop mode at approximately 4.44 s. (A) Desired and actual trajectories.(B) At approximately 4.44 s, e < a.

FIGURE 11
FIGURE 11 Controller switches from patient-dominant to robot-dominant mode and remains in the robot-dominant mode.(A) Absolute values of trajectory errors.(B) η j and γ j .(C) K(t).(D) D(t).(E) τ c (t).

TABLE 1
Initialization parameters in simulation.