Lyapunov-Redesign and Sliding Mode Controller for Microprocessor Based Transfemoral Prosthesis

Transfemoral prostheses have evolved from mechanical devices to microprocessor-based, electronically controlled knee joints, allowing amputees to regain control of their limbs. For improved amputee experience at varying ambulation rates, these devices provide controlled damping throughout the swing and stance phases of the gait cycle. Commercially available microprocessor-based prosthetic knee (MPK) joints use linear controllers, heuristic-based methods, and finite state machine based algorithms to track the refence gait cycle. However, since the amputee experiences a variety of non-linearities during ambulation, such as uneven terrains, walking backwards and climbing stairs, therefore, traditional controllers produces error, abnormal movements, unstable control system and require manual-tuning. As a result, novel controllers capable of replicating and tracking reference gait cycles for a range of reference signals are needed to reduce the burden on amputees and improve the rehabilitation process. Therefore, the current study proposes two non-linear control techniques, the Lyapunov-redesign controller and the sliding mode controller for real-time tracking of various signals, such as walking on level ground at a normal speed and ambulation on uneven terrains. State-space model of MPK was developed along with the mathematical modelling of non-linear controllers. Simulations and results are presented using MATLAB to verify the ability of proposed non-linear controllers for constantly and dynamically tracking and maintaining desired motion dynamics. Furthermore, for selected reference signals, a linear controller was applied to the same mathematical model of MPK. During tracking of reference angel in case of general gait cycle, an accuracy of 99.95% and 99.96% was achieved for sliding mode controller and Lyapunov-redesign controller respectively. Whereas, for the same case, linear controller had an accuracy of 95.5% only. Therefore, it can be concluded that the performance of non-linear controllers was better than their linear counterparts while tracking various reference signals for microprocessor based prosthetic knee. This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Intelligent Automation & Soft Computing DOI:10.32604/iasc.2022.020006 Article ech T Press Science


Introduction
Microprocessor-based prosthetic knee (MPK) joints provide relief to patients suffering from traumatic effects of amputation. MPK provides better and more promising results than mechanical counterparts, such as enhanced balance, less emphasis on walking mechanics, and less energy input from amputees in controlling these devices [1,2].

Motivation
With the rapid advancement of above-knee prosthesis, it is necessary to provide a cost-effective solution to reduce the high cost of MPKs [3,4]. Various control strategies, such as linear quadratic regulator (LQR) [5], PID and fuzzy logic control [6], have been endorsed in the literature for MPK joints spanning from C-leg [7] to rheo-knee [8], with each displaying some viable outcomes and a few limitations [3]. All commercial MPKs therefore employ a finite state machine-based approach to control MPKs, and state-of-the-art machine techniques. While these techniques increase the cognitive burden of the amputee according to the literature, they cause unnatural movements [9]. As a result, novel controllers capable of robustly replicating and tracking reference gait cycles are needed to reduce the burden of amputees, improve the rehabilitation process, and give them confidence.

Related Work
Alzaydi et al. [6] developed a fuzzy-based walking controller to track the behavior of healthy limbs during normal walking. Herr et al. [10] developed MPK based on magnetorheological damper (MRD) and designed an open-loop controller utilizing a finite state machine based technique to detect various phases of the gait cycle for controlling the resistance of the knee joint. The authors in [11] developed MRD based prosthetic knee and proposed a combination of computed control law and PD control law to track the angle of the knee joint in real time. In [12], the authors proposed a running controller for the actively powered prosthesis to enable amputees to run with a bio-mechanically appropriate gait. Lawson et al. [13] proposed a piece-wise controller for detecting various phases of the gait cycle to control the torque and damping of the knee joint. Park et al. [14] developed a knee prosthesis that can operate in active or semi-active modes controlled through polynomial prediction function. Jung et al. [15] proposed a semi-active type MRD based prosthetic knee joint controlled through a linear current controller. The authors in [16] discussed that for a continuous phase controller manual tuning is cumbersome, therefore, extremum seeking controller (ESC) capable of simultaneously tuning the feedback control gains of a powered knee prosthesis was developed. Various experiments were performed to verify the effectiveness of the proposed ESC across different walking speeds. Chang et al. [17] developed a data-driven model to track lower limb cadence trajectory and estimate the uncertainties by utilizing past input-output data. In [18] a model-free adaptive control method to estimate the angel of knee joint for applications such as exoskeleton and MPK was developed and simulated in MATLAB. The results indicated that the controller has an acceptable accuracy while tracking the trajectory of the knee joint. The authors in [19] developed a model-free robust adaptive controller capable of handling known non-linearities in robotic applications. Simulations suggested that tracking performances of the proposed autotuned adaptive gain is better than manually tuned constant gains.

Problem Statement
The efficacy of linear controllers and data-driven models has been successfully demonstrated in the literature. However, because the amputee encounters various non-linearities during ambulation, such as irregular terrains and changes in loading conditions, linear controllers may result in error and unstable control systems. This is due to the fact that linear controllers lack formal guarantees (when applied to non-linear systems) and require hand-tuning [20,21].

Contribution and Organization
The main objective of this study was to develop robust non-linear controllers for MPKs to address the limitations of linear controllers. The proposed non-linear controller will not only aid amputees in levelground walking but will also allow for self-selected ambulation on uneven terrains. Furthermore, the proposed controllers resulted in adapting amputee's walking pattern and gait cycle according to ideal gait cycle. The chosen MPK's physical model included intrinsic sensing capabilities for detecting the actual phase of the gait cycle [22]. A state-space model of MPK was developed, and non-linear controllers were used to track the reference gait cycle. MATLAB simulations and results are presented to validate the ability of proposed nonlinear controllers to track and maintain desired motion dynamics constantly. Furthermore, the results are compared with the linear controller for selected reference signals. Lyapunovredesign controller achieved an accuracy of 99.96% and 98.90% while tracking knee angle for a general gait cycle and partial gait cycle for uneven terrains, whereas, SMC had an accuracy of 99.95% and 98.70% while tracking the same reference signals. Contrarily, fine-tuned linear PID demonstrated an accuracy of 95.5% and 94% only, therefore, it can be concluded that non-linear controllers outperform linear PID while tracking reference signals for MPK.
The remainder of the article is organized as follow: Section 2 describes the state-space modelling of the system, which is followed by the design of nonlinear controllers in Section 3. Section 4 presents the findings and discussions, whereas Section 5 presents the conclusion and future considerations.

State-Space Model of the System
Schematic of MPK consisting of flexion/extension of knee joint is presented in Fig. 1. The angular displacement and angular velocity of knee joint are important control parameter in MPKs as tracking of gait cycle is dependent on these two variables. The state-space model for MPK presented in Fig. 1 is developed to apply and validate non-linear controller strategies. State-space representation is actually a mathematical model of a physical system as a set of input, output and state variables related by differential equations [23].
The proposed control strategy shown in Fig. 2 consists of a non-linear controller that takes the angular position and angular velocity of the knee joint as input, followed by a single-link manipulator based MPK as a dynamic model whose angular position and velocity are to be tracked according to the reference gait cycle. To demonstrate the efficacy and robustness of the proposed non-linear controller to external disturbances, noise is also introduced as an input to the control mechanism.
For developing a state-space model of the system, the following variables are assumed: h are the current angular position and angular velocity, whereas ref 1 and ref 2 are the desired angular position and angular velocity. Furthermore, e 1 and e 2 are errors between current and desired angular position and angular velocity, respectively. Hence, the dynamic model of the knee joint as discussed in [24] can be written as: The complete state-space model of the MPK after simplification can then be described as: where g, m, l, b, u, I, and φ(t) are gravitational acceleration, mass of the joint, length from the knee joint to foot, damping constant, input torque of the actuator, inertia of knee joint and external disturbances respectively.

Design and Stability Analysis of Non-Linear Controllers
Based on the state-space model discussed in Eq. (7), two different non-linear controllers, namely Lyapunov-redesign and SMC, were designed and their stability analyses were performed to ensure that MPK performed as designed because if the system deviates from the desired behavior, it may lead to gait instability and dissatisfaction of the amputee. The development of the Lyapunov-redesign controller for MPK is discussed in the following section.

Design of Lyapunov-Redesign Controller
Lyapunov-redesign Control is based on the energy function, and the stability of a given non-linear system is determined by the time rate of change of the energy function. According to the Lyapunov Figure 2: Control mechanism for microprocessor-based prosthetic knee stability criterion, if the rate of change of the energy function is zero or negative definite, the system is converging and stable [25].
From Eqs. (3) and (4), it could be written that As, from Lyapunov-redesign control theory when the controller is stable, the error converges as discussed in [26] and can be formulated as: where K 1 is the controller gain, and its value must be positive to keep the controller stable. By substituting the values of _ x 1 and _ x 2 in Eqs. (8) and (9), simplification yields: Now, by comparing Eq. (10) with (12) By rearranging Eq. (13) and solving for u where, u is the input torque (control input) that may be controlled with the help of Eq. (14), leading to track the concerned variable such as angular displacement and angular velocity to their desired reference signals.

Stability of Lyapunov-Redesign Controller
Even if the system is efficiently controlled, unstable Lyapunov-redesign control can result in unbounded system output that does not provide the desired ouputs. As a result, controller stability is as important as controller design [26]. The following steps can be used to test the Lyapunov-redesign controller's stability: Supposing a semi-positive definite energy function Computing time derivative of the energy function If the rate of change of energy function is negative or equal to zero, then the controller is stable, whereas if the rate of change of energy function is positive, then the system is deemed to be unstable [26].
To select an optimal candidate for the Lyapunov-redesign energy function in order to test the stability of the controller, a semi-positive definite energy function having mass (m) and length (l) of MPK as key parameters are assumed.
By taking time-derivative of Eq. (15), V 1 can be simplified as: Substituting Eq. (10) in (16) and simplification yields: In Eq. (17), m, l and K 1 are always positive with the added fact that the square of e 2 also results in a positive value. Thus, _ V 1 0 concludes that, since, the rate of change of the energy function is either zero or negative, then according to the Lyapunov function stability analysis, the proposed controller is stable.

Design of Sliding Mode Controller
The Sliding Mode Controller (SMC) is a nonlinear control method that modifies the dynamics of a nonlinear system by applying a discontinuous control signal (or, more precisely, a set-valued control signal) that causes the system to slide along a cross-section (sliding surface) of the system's normal behavior [27]. SMC is well suited to nonlinear systems containing disturbances and uncertainties, such as MPK. SMC is a technique in which the control inputs are alternating between two limits [27]. The desired performance of closed-loop dynamics is expressed at s = 0, which happens through a proper design of a controller. Let us assume a sliding surface: where a, s and e 2 are the coefficient of the controller, sliding surface and error of angular velocity, respectively. By taking the time derivative of Eq. (18), it can be written as: s is the rate of change of the sliding surface. By substituting the value of _ e 2 from Eq. (10) in Eq. (19), it may be written as: where as from the theory of SMC, it could be analyzed that when the system attains stability, the error converges and system slides on the supposed sliding surface. Thus from the theory of the SMC [27], the rate of change of sliding surface could also be formulated as: where α and γ are the controller coefficients used to control the rate of convergence and chattering (disturbance) [27] and K 2 is the controller gain which must be positive to ensure the controller is stable. Furthermore, sgn is the signum function used to ensure an ideal switching. By comparing Eq. (20) with Eq. (21), it could be written as: By solving for u Eq. (21) yields:

Stability of Sliding Mode Controller
Similar to the Lyapunov redesign controller it is essential to exercise stability of SMC. Let us assume a semi-positive definite energy function that includes the sliding surface parameter: By taking the time derivative of Eq. (24), it can be written as: Substituting Eq. (21) in Eq. (25) yields: By simplifying Eq. (26) _ V 2 can be written as whereas jγj = γ as γ > 0. Therefore, Eq. (27) can be simplified as As K 2 > 0, so Eq. (28) will result in a negative value which concludes that the developed SMC for MPK is stable.

Results and Discussion
Simulations in MATLAB have validated the developed Lyapunov-redesign and sliding mode controller is capable of successfully tracking various reference signals in MPK. Tab. 1 summarises key parameters of MPK such as the mass of knee joint (m) and length of joint (l) [28]. Results for a sinusoidal signal, normal walking gait cycle, and specific partial gait cycles have been plotted and compared with linear controller to acquire a realistic view of the developed controllers.

Sinusoidal Reference Signal
The reference signal to be tracked for an MPK varies frequently with time. Therefore, to test the adaptability and robustness of the proposed controllers, the authors have implemented them on a sinusoidal signal which modifies its behavior at every instant. The hit and trial approach was used to finetune the parameters of the linear controller (PID), Lyapunov-redesign, and SMC as described in Tab. 2 to follow the reference sinusoidal signals, and the obtained results are plotted in Fig. 3.  Fig. 3a, it may be observed that linear and the non-linear controllers produced comparable results while following angular position as fine-tuning of the controller parameters were performed. Similarly, Fig. 3b presents that the linear controller produced slightly poor results as compared to SMC and Lyapunov-redesign controller for an angular velocity reference signal due to the inherited system nonlinearities. A comparison of three controllers in terms of error plot for angular position and angular velocity is presented in Figs. 3c and 3d respectively from where it can be analyzed that both non-linear controllers produced comparatively better results than PID controller.

General Gait Cycle
The Lyapunov redesign and SMC were then implemented on the actual normal walking gait cycle, after their validation on the sinusoidal signal. The reference angular position of the knee during normal walking presented in Fig. 4 is adopted from [29], whereas, reference angular velocity can be obtained by taking the time derivative of reference angular position. The parameters tuned for individual controllers in the previous section were used, as in real-life it is not possible to recalibrate controller parameters for individual reference signals.
From Fig. 4a, it can be concluded that both nonlinear controllers achieved steady state in a shorter time and produced comparable, while the linear controller had relatively poor results because of ripples and a long transitional period. Additionally, control input (torque) and error difference between the desired (reference) and actual outputs have also been plotted in Figs. 4b and 4c respectively. This helps to analyze that both nonlinear controllers produce comparatively better results than linear controller. Lyapunov-redesign controller tracked knee angel with an accuracy 99.96%, whereas, SMC had a comparable accuracy of 99.95%. However, linear controller was the least accurate with only 95.50% accuracy.

Partial Gait Cycles for Knee Extension/Flexion at Normal Walking Speed
This subsection validates non-linear controllers for the knee extension and flexion phase for a normal speed walking, whereby the reference signals for angular position and angular velocity has been adopted from [30,31]. In Figs. 5a-5c it can be analyzed that the linear controller produced poor results while tracking the referral signal, since it had significant steady-state error, undershoot and overshoot. SMC and Lyapunov redesign controllers were, by contrast, relatively fast in their stability and had no large ripples over the simulation cycle, making it more suitable both for partial and complete gait cycles. Furthermore, in Fig. 5d, error difference between reference and actual outputs is shown, indicating the comparatively better results for both non-linear controllers. While tracking angular position Lyapunov-redesign and sliding mode controller achieved an accuracy of 99.20% and 98.80% respectively, whereas, linear controller was only 92.20% accurate.

Partial Gait Cycle for Knee Extension/Flexion at Uneven Terrains
Lyapunov-redesign and SMC have been validated for both knee flexion and knee extension for uneven terrain. The reference angular position and velocity were obtained from [30,31], Fig. 6 shows and compares  the results for uneven terrain. Nonlinear controllers gave good results over uneven terrains, as illustrated in Figs. 6a and 6b. When compared to both SMC and Lyapunov-redesign controllers, PID failed to precisely track the reference, resulting in a large steady-state error. The developed non-linear controllers reached steady-state values more quickly, whereas PID lagged at first exhibited wobbles and large ripples, proving PID is inappropriate for uneven terrains, as discussed in the literature [28,29]. In addition, in Figs. 6c and 6d the control input (torque) and the error difference between the reference and actual output have been shown for easy comparison between non-linear controllers and the PID controller. An accuracy of 98.90% was observed for Lyapunov-redesign controller, whereas, SMC was 98.70% accurate. However, PID only achieved 94% accuracy proving that it is inappropriate for non-linear systems.

Conclusion
Due to advancements in the field of bio-mechatronics, lower-limb implants, particularly transfemoral prostheses, are quickly progressing. Microprocessor-based knee prostheses perform better and are more viable than mechanical knee prosthesis, which provide little assistance to amputees. Several control techniques have been reported in the literature, including finite-state controllers, optimal controllers, and PID controllers. However, there are certain key shortcomings that need to be addressed. This study presents non-linear controllers for a single-link manipulator based MPK, such as the Lyapunov-redesign controller and the Sliding Mode Controller, to address the limitations of linear controllers. The suggested non-linear control techniques have been validated for a variety of reference signals, including the general gait cycle, sinusoidal reference signal, and partial gait cycle for natural speed in both knee-flexion and extension phase. The results are plotted in MATLAB and compared to a linear PID controller, confirming that non-linear controllers outperform PID controls for all reference signals. Eventually, for microprocessor-based prosthetic knee joints, nonlinear controllers are the way of the future. In addition, the present study provides a platform for implementation of non-linear controllers through hardware-inloop technique. Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.