**1. Introduction**

After middle-age, the possibility of knee weakness might increase as a result of knee fragility or weak muscles [1]. For this reason, devices that assist people in walking are essential to reduce the pressure on the knee. People with physical disabilities can significantly enhance their quality of life with assistive technologies such as knee prostheses. To make these technologies more effective, however, main scientific research requirements must be met. This study is motivated by the need to establish and validate an advanced controller for simulation-assisted prosthesis design, which covers typical assumptions about the appropriate form and functionality of knee disabilities. In more specific terms, this can be divided into two specific goals: (i) Design a control strategy that analyzes real knee dynamics and behavior and then translates the outcomes into an appropriate real

**Citation:** Jerbi, H.; Al-Darraji, I.; Tsaramirsis, G.; Ladhar, L.; Omri, M. Hamilton–Jacobi Inequality Adaptive Robust Learning Tracking Controller of Wearable Robotic Knee System. *Mathematics* **2023**, *11*, 1351. https:// doi.org/10.3390/math11061351

Academic Editor: Mauro Malvè

Received: 3 January 2023 Revised: 3 March 2023 Accepted: 7 March 2023 Published: 10 March 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

prosthesis. It is imperative that the control system be stable, flexible, and safe. (ii) Develop a set of analytical and smart tools that will enable the enhancement of design techniques by incorporating realistic testing constraints as a basis for validating simulated trends. Various control simulation scenarios based on a Lagrangian dynamics model will be investigated in this work to validate the overall design process. The scope of the present study is restricted to creating the framework necessary to enable this significant design process— fundamentally, the pipeline from theory to experimentation. The Wearable Robotic Knee (WRK) is an assist system that relieves the knee by offering support in performing various types of movements [2]. Generally, WRK interacts with the motion of the elderly or injured person during activity by actuated orthosis [3]. In [4], a WRK was designed using elastic actuators via a special technique that includes kinematic analysis, topology options, and optimization of structure. The developed WRK demonstrated low inertia on the person wearing the device, back-drive, and the ability to overcome the issues of misalignments. In [5], a WRK exoskeleton with variable stiffness actuators [6,7] was designed for lower limbs. Its structure was flexible, and it was equipped with six joints with variable stiffness actuators. By virtue of its structure, it showed the ability of assisting persons in walking by applying a simple torque. In [8], a functional and general gait assist robot was designed that could carry weight using a suggested mechanical design. The structure was dependent on the model of the human knee and the analysis of body movement. The designed gaitassisting robot could be worn without any restrictions on persons. Furthermore, it could achieve various movements for different human leg length and body weight. In [9], a prototype of a wearable robot was designed to assist people in walking by applying eight electric motors and inertial measurement unit sensors. A special controller was designed for this prototype to control the mechanical structure of the WRK. The designed prototype showed its ability to carry and move the person who wore it while keeping human body balance. In [10], the path planning of WRK was simplified by applying a Probabilistic Fam technique. This technique provides safe motion via an active knee orthosis. In [11], a WRK device was integrated within electromyogram sensors to assist the muscle of the person's knee. The human knee extension and flexion movements were controlled by manipulating the electromyogram sensor signals corresponding to rectus femoris and biceps femoris. The developed prototype showed functionality in practical application. A clinical control technique for an exoskeleton WRK is presented in [2]. The presented method applied the action of the human joint synergistically, using a gait help stick, to predict and supply the required assistance for injured limbs. The result of injured persons' walking with the proposed control technique achieves the aims that they can walk with the developed system. In [12], one of the major benefits of the proposed method is that it does not cancel the non-linear properties of the process, but compensates for these features by dampening them instead. The designed controller achieves the system's optimal performance in terms of robustness, rapidity and steady-state accuracy. However, a nonlinear observer reconstructs the unmeasurable signals to ensure that the process output trajectory closely follows the desired path. In the work of Belkhier et al. [13], the authors propose a passivity-based controller, designed to cope with nonlinear systems exhibiting ODEs with a high degree of coupling and a wide range of modelling uncertainties.

This study contributes to the development of an adaptive robust stable tracking controller using the Radial Basis Function (RBF) Neural Network (NN) and Hamilton– Jacobi Inequality (HJI) method. The following steps are implemented:


4. By using RBF NN, the control strategy is designed to overcome problems associated with random variations and uncertain operating conditions.

In Table 1, we provide the standard nomenclature used throughout this study in order to introduce the various symbols that appear in the equations presented.

**Table 1.** Standard nomenclature.



The rest of the paper is organized as follows: In Section 2, the related works and contributions of this study are presented. In Section 3, dynamics equations of the WRK system are derived. In Section 4, the design of the tracking error controller is outlined. In Section 5, the HJI-based *L*2 gain technique is introduced. In Section 6, the RBF NN–based Adaptive Robust Controller is detailed. In Section 7, the simulation study and results are presented and discussed. The conclusions of this study and future work suggestions are included in Section 8.

### **2. Related Works**

Developing a suitable tracking controller for a WRK is important to ensure the operation of the designed device in an independent and intelligent manner. This section presents the existing research on WRK control motion planning design. In [14], a WRK is designed using actuator-type elastomeric muscles and a body of soft fabric material. The knee movements are improved by the produced prototype. The process of producing this WRK was simple by virtue of the selected components. Moreover, producing the platform of the WRK from soft fabric material gives the prototype the essential property of light weight, making it a device that can be worn with ease. In [15], a control technique is proposed for an exoskeletal WRK in order to help with a specific motion, taking in consideration the weight and balance of the person. By equipping pressure sensors on the shoes of the person wear exoskeletal WRK, the center of the downward walking pressure by the person can be measured. Next, a suggested control algorithm is developed to provide balance. The required torque for improving the gait is supplied by actuators of the elastic type, which are installed at the wearer's hip and knee joints. In [16], a new WRK motion planning technique is introduced for helping humans to walk. The presented algorithm is based on the principles of the dynamic mechanism of a specifically developed lower limb wearable robot. The process of helping humans to walk is developed via applying a learning algorithm into the mechanism of the robot. Obtaining the path of the knee joint requires the value of the ankle joint. The uncertainties in joints are treated by a reinforcement learning algorithm. In [17], virtual force is used to obtain a technique for path control planning for both the hip joint and knee joint. The designed technique addresses the issue of uncertainty. In [18], an on-line learning algorithm is presented for a lower limb wearable robot to assist in walking. The objective of the suggested technique is to minimize the effort of the person who wears the exoskeleton robot and the consumed energy of the actuator. The results showed the functionality of the introduced on-line learning algorithm in reducing the effort of the person during walking and the consumed power by actuator. In [19], a control algorithm of the human–robot cooperation type is introduced to aid the wearer of the wearable robot in locomotion during stair climbing. The trajectory is divided into two control patterns. The first one is called the human control space, where the person does not need help from the wearable device. The second one is the robot control space, where the person needs help

from the wearable device. These two control spaces are managed through a new function. This new function constrains the motion of the person to achieve the required trajectory. An adaptive controller is designed to guarantee the smooth transmission between the human and robot motions. The main features of the controller algorithms of the mentioned works are listed in Table 2.


**Table 2.** Main motion control features of the related work.

In view of the literature review, in this paper we primarily address issues related to modeling uncertainties, robustness, and random external disturbances by satisfying the above criteria. Furthermore, since the WRK is a human medical prosthesis, it should be expected that operating conditions and model parameters will vary widely. Thus, maintaining WRK stability is a key performance factor. Equally significant, the controller running time must be reduced to allow online tuning and real-time update of the control input. As a means of overcoming the above-mentioned problems, this paper examines the combination of three conventional and advanced artificial intelligence techniques: the Hamilton–Jacobi Inequality method, the gain technique, and the Radial Basis Function Neural Network system. Generally, a WRK device is a nonlinear system of high uncertainty. The path planning of a WRK system should take in consideration path accuracy, consumed energy, and smooth functionality. Moreover, it is essential to consider the issues of external disturbances, modeling errors, unknown human weight, and other uncertainties. The other most important working condition that needs to be considered is changing of the control inputs during operation. For example, the person who wears the WRK may hold weight during movement or may feel tired and exert lower torque by the knee. All of these issues are treated in this recent research via the design an adaptive robust learned controller that aims to achieve the following contributions: (1) enhancing the control of the WRK system, (2) achieving better accuracy of knee joint trajectory tracking, (3) manipulating nonlinearities in WRK dynamics, (4) treating external disturbances, (5) achieving path tracking that does not depend on the weight of the user, and (6) most importantly, ensuring the designed controller can learn during operation to adapt to changing conditions.

### **3. Dynamics Analysis**

The exoskeleton WRK is a mechatronics device that integrates a person with a machine to form a human–machine approach. The WRK model within the human body is depicted in Figure 1. The thigh and calf are rotated by hip angle *<sup>θ</sup>hip* and knee angle *θknee*, respectively. The WRK orthosis actuators are link-1 and link-2, fixed at the wearer's knee, thigh, and calf. Note that link-1 is fixed to thigh and knee, and link-2 is fixed to calf and knee. Consider the height of the person is *T*, then, the lengths of the thigh and calf, WRK link-1, and WRK link-2 are obtained from Equations (1)–(4), respectively [20]:

$$l\_{\text{high}} = 0.245T \tag{1}$$

$$l\_{calf} = 0.246T \tag{2}$$

$$l\_1 = 0.12T \tag{3}$$

$$l\_2 = 0.12T \tag{4}$$

(**a**) (**b**)

**Figure 1.** WRK device model. (**a**) Front view of human body. (**b**) Side view of human leg.

The mass of the thigh and calf of a female and a male is calculated from total weight of the body *mbody* [21] as follows.

For a female:

$$m\_{thigh} = 0.118 m\_{body} \tag{5}$$

$$m\_{\rm call} = 0.0535 m\_{\rm body} \tag{6}$$

For a male:

$$m\_{thigh} = 0.105 m\_{buly} \tag{7}$$

$$m\_{calf} = 0.0475 m\_{hydy} \tag{8}$$

It is assumed that each part, including the thigh, the calf, the WRK link-1, and the WRK link-2, can be considered as a thin rod that rotates around an axis at its end. Hence, the moment of inertia of a part of mass *Mpart* and length *Lpart* is calculated according to Equation (9):

$$I\_{part} = \frac{1}{3} M\_{part} L^2\_{part} \tag{9}$$

where part refers to the thigh, calf, WRK link-1, or WRK link-2.

The WRK controller design is based on the dynamics of the WRK manipulator. There are various techniques that can be implemented to obtain the dynamics of manipulators [22]. In this study, the Lagrange approach is applied to obtain WRK equations of motion; the Lagrangian formula is as follows:

$$L\_{WRK} = K\_{WRK} - P\_{WRK} \tag{10}$$

where *KWRK* and *PWRK* denote the kinetic and potential energy, respectively. Human thigh and calf length are denoted as *lthigh* and *lcal f* , respectively. The position of center of thigh is obtained analytically from Figure 1b, as below:

$$
\omega\_{thigh} = 0.5 l\_{thig\,h} \sin \theta\_{hip} \tag{11}
$$

$$y\_{t\text{high}} = 0.5 l\_{t\text{high}} \cos\theta\_{hip} \tag{12}$$

According to Equations (11) and (12), the velocity is obtained as:

$$
\dot{\mathbf{x}}\_{thigh} = 0.5 l\_{thigh} \cos \theta\_{hip} \theta\_{hip} \tag{13}
$$

$$
\dot{y}\_{t\text{high}} = -0.5 l\_{t\text{high}} \sin \theta\_{hip} \theta\_{hip} \tag{14}
$$

$$
\upsilon\_{\text{thigh}}^2 = \dot{\upsilon}\_{\text{thigh}}^2 + \dot{y}\_{\text{thigh}}^2 = 0.25 l\_{\text{thigh}}^2 \dot{\theta}\_{\text{hip}}^2 \tag{15}
$$

.

.

In the same way, the position of center of calf is obtained as:

$$\propto\_{calf} = l\_{thigh} \sin \theta\_{hip} - 0.5 l\_{calf} \sin \left(\theta\_{knee} - \theta\_{hip}\right) \tag{16}$$

$$y\_{calf} = l\_{lhigh} \cos \theta\_{hip} + 0.5 l\_{calf} \cos \left(\theta\_{knee} - \theta\_{lipp} \right) \tag{17}$$

The velocity of calf is obtained from Equations (16) and (17) as:

$$\dot{\mathbf{x}}\_{\rm calf} = \left[ l\_{\rm high} \cos \theta\_{\rm hip} + 0.5 l\_{\rm calf} \cos \left( \theta\_{\rm kne} - \theta\_{\rm hip} \right) \right] \dot{\theta}\_{\rm lip} - 0.5 l\_{\rm calf} \cos \left( \theta\_{\rm kne} - \theta\_{\rm hip} \right) \dot{\theta}\_{\rm kne} \tag{18}$$

$$\dot{y}\_{calf} = \left[ -l\_{lhigh} \sin \theta\_{hip} + 0.5l\_{calf} \sin \left( \theta\_{knee} - \theta\_{hip} \right) \right] \dot{\theta}\_{lip} - 0.5l\_{calf} \sin \left( \theta\_{knee} - \theta\_{hip} \right) \dot{\theta}\_{knee} \tag{19}$$

$$v\_{calf}^2 = \dot{\mathbf{x}}\_{calf}^2 + \dot{y}\_{calf}^2$$

$$\boldsymbol{w}\_{\rm call}^{2} = l\_{\rm high}^{2} \dot{\boldsymbol{\theta}}\_{\rm hip}^{2} + 0.25 l\_{\rm call}^{2} \left( \dot{\theta}\_{\rm hip} - \dot{\theta}\_{\rm kne} \right)^{2} + l\_{\rm high} l\_{\rm call} \dot{\theta}\_{\rm lin} \left( \dot{\theta}\_{\rm hip} - \dot{\theta}\_{\rm kne} \right) \cos \theta\_{\rm kne} \tag{20}$$

The WRK system is represented by the following Lagrangian equation:

$$\pi\_{WRK,i} = \frac{d}{dt} \left( \frac{\partial L\_{WRK}}{\partial \dot{\theta}\_i} \right) - \frac{\partial L\_{WRK}}{\partial \theta\_i}, i = lip, knee \tag{21}$$

The input torque *<sup>τ</sup>WRK*,*hip* and *<sup>τ</sup>WRK*,*knee* represent the hip joint torque and knee joint torque, respectively. The total kinetic energy is:

> =

$$K\_{WRK} = K\_{thigh} + K\_{cdf}$$

$$\begin{array}{l} K\_{WRK} = \frac{1}{2} \left( m\_{thigh} + m\_1 \right) v\_{thigh}^2 + \frac{1}{2} \left( I\_{thigh} + I\_1 \right) \dot{\theta}\_{hp}^2 + \frac{1}{2} \left( m\_{cdf} + m\_2 \right) v\_{calf}^2\\ + \frac{1}{2} \left( I\_{cdf} + I\_2 \right) \dot{\theta}\_{hne}^2 \end{array} \tag{22}$$

+

where *m*1, *m*2, *Ithigh*, *I*1, *Ical f* , and *I*2 are the mass of WRK upper arm, mass of WRK lower arm, moment of inertia of thigh, moment of inertia of WRK upper arm, moment of inertia of calf, and moment of inertia of WRK lower arm, respectively. Assuming the center of mass

of the thigh and calf are at the geometrical center of the thigh and calf, then the potential energy is obtained as:

$$P\_{WRK} = P\_{thhigh} + P\_{Cal}$$

$$\begin{split} P\_{WRK} &= -0.5 \Big( m\_{thlight} + m\_1 \Big) g l\_{thigh} \cos \theta\_{hip} - \left( m\_{calf} + m\_2 \right) g l\_{thigh} \cos \theta\_{hip} \\ &- 0.5 \Big( m\_{calf} + m\_2 \Big) g l\_{calf} \cos \left( \theta\_{hip} - \theta\_{knee} \right) \end{split} \tag{23}$$

After substituting the values of *vthigh*<sup>2</sup> and *vcal f* 2 from Equations (15) and (20), respectively, into Equation (22), then Equations (22) and (23) are inserted into Equation (10) to obtain the Lagrangian formula *LWRK*, shown in Equation (24):

$$\begin{array}{ll} L\_{WRK} &= 0.125 \Big( m\_{high+} + m\_1 \Big) l\_{high}^2 \theta\_{hip}^2 + 0.5 \Big( l\_{high} + l\_1 \Big) \dot{\theta}\_{hip}^2 \\ &+ 0.5 \Big( l\_{calf} + l\_2 \Big) \dot{\theta}\_{kmc}^2 + 0.5 \Big( m\_{calf} + m\_2 \Big) l\_{high}^2 \dot{\theta}\_{hip}^2 \\ &+ 0.125 \Big( m\_{calf} + m\_2 \Big) l\_{calf}^2 \Big( \dot{\theta}\_{hip} - \dot{\theta}\_{kmc} \Big)^2 \\ &+ 0.5 \Big( m\_{calf} + m\_2 \Big) l\_{high} l\_{calf} \dot{\theta}\_{hip} \Big( \dot{\theta}\_{hip} - \dot{\theta}\_{kmc} \Big) \cos \theta\_{kmc} \\ &+ 0.5 \Big( m\_{high+} + m\_1 \Big) gl\_{high} \cos \theta\_{hip} \\ &+ \Big( m\_{calf} + m\_2 \Big) gl\_{high} \cos \theta\_{hip} \\ &+ 0.5 \Big( m\_{calf} + m\_2 \Big) gl\_{calf} \cos \Big( \theta\_{hip} - \theta\_{kmc} \Big) \end{array} \tag{24}$$

Considering Equation (21), the torque at hip and knee are obtained according to Equations (25) and (26), respectively:

$$\begin{aligned} \tau\_{\text{VKE,kip}} &= \left[ \left( m\_{\text{high}} + m\_1 \right) \left( \frac{l\_{\text{low}}}{2} \right)^2 + \left( m\_{\text{cal}f} + m\_2 \right) \boldsymbol{1}^2 \boldsymbol{h}\_{\text{high}}^2 + \left( m\_{\text{cal}f} + m\_2 \right) \left( \frac{l\_{\text{low}}}{2} \right)^2 \right. \\ &\left. + \left( m\_{\text{cal}f} + m\_2 \right) \left( l\_{\text{high}} \right) \cos \theta\_{\text{knee}} + \left( l\_{\text{cal}f} + l\_2 \right) \left| \hat{\theta}\_{\text{kip}} \right| \\ &- \left( m\_{\text{cal}f} + m\_2 \right) \left( \frac{l\_{\text{high}}}{2} \right)^2 \\ &+ 0.5 \left( m\_{\text{cal}f} + m\_2 \right) l\_{\text{high}} l\_{\text{cal}f} \cos \theta\_{\text{knee}} \Bigg] \theta\_{\text{knee}} \\ &- \left( m\_{\text{cal}f} + m\_2 \right) l\_{\text{high}} l\_{\text{cal}f} \sin \theta\_{\text{knee}} \dot{\theta}\_{\text{knee}} \\ &+ 0.5 \left( m\_{\text{cal}f} + m\_2 \right) l\_{\text{high}} l\_{\text{solid}} \sin \theta\_{\text{knee}} \dot{\theta}\_{\text{knee}} \\ &+ \left[ \left( m\_{\text{light}f} + m\_1 \right) g^{\frac{l\_{\text{solid}}}{\text{sup}}} + \left( m\_{\text{cal}f} + m\_2 \right) g l\_{\text{high}} \right] \sin \theta\_{\text{knee}} \\ &+ \left( m\_{\text{cal}f} + m\_2 \right) \frac{l\_{\text{solid}}}{2} \sin \left( \theta\_{\text{hips}}$$

By rearranging the resulting above two equations into matrix forms, the WRK dynamics Equation (27) is obtained, as below:

$$\begin{aligned} \left[\boldsymbol{\pi}\_{\text{WRK},\text{hip}}\boldsymbol{\pi}\_{\text{WRK},\text{knee}}\right]^T &= \boldsymbol{M}\_{\text{WRK}}\left(\boldsymbol{\theta}\_{\text{hip}},\boldsymbol{\theta}\_{\text{knee}}\right)\left[\ddot{\boldsymbol{\theta}}\_{\text{hip}}\ddot{\boldsymbol{\theta}}\_{\text{knee}}\right]^T + \\ \boldsymbol{\mathsf{C}}\_{\text{WRK}}\left(\boldsymbol{\theta}\_{\text{hip}},\boldsymbol{\theta}\_{\text{knee}},\dot{\boldsymbol{\theta}}\_{\text{hip}},\dot{\boldsymbol{\theta}}\_{\text{knee}}\right)\left[\dot{\boldsymbol{\theta}}\_{\text{hip}}\dot{\boldsymbol{\theta}}\_{\text{knee}}\right]^T &+ \boldsymbol{\mathsf{C}}\_{\text{WRK}}\left(\boldsymbol{\theta}\_{\text{hip}},\boldsymbol{\theta}\_{\text{knee}}\right) \end{aligned} \tag{27}$$

⎧⎪⎪⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎪⎪⎩

where *MWRK<sup>θ</sup>hip*, *<sup>θ</sup>knee*, *CWRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*, .*<sup>θ</sup>knee*, and *GWRK<sup>θ</sup>hip*, *<sup>θ</sup>knee*are the matrix of WRK system inertia, Coriolis centrifugal forces, and gravity, which are obtained as follows: 

$$M\_{WRK} \left( \theta\_{hip\prime} \theta\_{knec} \right) = \begin{bmatrix} M\_{WRK,11} & M\_{WRK,12} \\ M\_{WRK,21} & M\_{WRK,22} \end{bmatrix}$$

where

$$\begin{aligned} M\_{\mathrm{WKB,11}} &= \left(l\_{\mathrm{high}} + l\_1\right) + \left(m\_{\mathrm{high}} + m\_1\right)\left(\frac{l\_{\mathrm{high}}}{2}\right)^2 + \left(m\_{\mathrm{calf}} + m\_2\right)l\_{\mathrm{high}}^2 + \left(m\_{\mathrm{allf}} + m\_2\right)\left(\frac{l\_{\mathrm{allf}}}{2}\right)^2 + \left(m\_{\mathrm{allf}} + m\_2\right)l\_{\mathrm{high}}l\_{\mathrm{allf}}\cos\theta\_{\mathrm{backf}} \\\ M\_{\mathrm{WKB,12}} &= \left(m\_{\mathrm{allf}} + m\_2\right)\left(\frac{l\_{\mathrm{allf}}}{2}\right)^2 + 0.5\left(m\_{\mathrm{calf}} + m\_2\right)l\_{\mathrm{high}}l\_{\mathrm{allf}}\cos\theta\_{\mathrm{back}} \\\ M\_{\mathrm{WKB,21}} &= \left(m\_{\mathrm{allf}} + m\_2\right)\left(\frac{l\_{\mathrm{allf}}}{2}\right)^2 + \left(m\_{\mathrm{allf}} + m\_2\right)l\_{\mathrm{high}}l\_{\mathrm{allf}}\cos\theta\_{\mathrm{back}} \\\ M\_{\mathrm{WKB,22}} &= \left(l\_{\mathrm{allf}} + l\_2\right) + \left(m\_{\mathrm{calf}} + m\_2\right)\left(\frac{l\_{\mathrm{allf}}}{2}\right)^2 \end{aligned}$$

*CWRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*, .*<sup>θ</sup>knee* =

where

$$\begin{cases} \mathsf{C}\_{WRK,11} = -\left(m\_{\mathrm{cal}f} + m\_2\right)l\_{\mathrm{thig}h}l\_{\mathrm{cal}f}\sin\theta\_{\mathrm{knee}}\dot{\theta}\_{\mathrm{knee}}\\ \mathsf{C}\_{WRK,12} = 0.5\left(m\_{\mathrm{cal}f} + m\_2\right)l\_{\mathrm{thig}h}l\_{\mathrm{cal}f}\sin\theta\_{\mathrm{knee}}\dot{\theta}\_{\mathrm{knee}}\\ \mathsf{C}\_{WRK,21} = 0.5\left(m\_{\mathrm{cal}f} + m\_2\right)l\_{\mathrm{thig}h}l\_{\mathrm{cal}f}\sin\theta\_{\mathrm{knee}}\dot{\theta}\_{\mathrm{kips}}\\ \mathsf{C}\_{WRK,22} = 0 \end{cases}$$

*CWRK*,<sup>11</sup>

*CWRK*,<sup>21</sup> *CWRK*,<sup>12</sup>

*CWRK*,<sup>22</sup>

and

$$G\_{WRK} \left( \theta\_{hip\prime} \theta\_{kncc} \right) = \begin{bmatrix} G\_{WRK,1} \\ G\_{WRK,2} \end{bmatrix}$$

where

$$\begin{cases} \begin{aligned} \text{G}\_{\text{WRK},1} &= \left[ \left( m\_{\text{high}} + m\_1 \right) g \frac{l\_{\text{high}}}{2} + \left( m\_{\text{cal}f} + m\_2 \right) g l\_{\text{high}} \right] \sin \theta\_{\text{kip}} + \left( m\_{\text{cal}f} + m\_2 \right) \frac{l\_{\text{cal}f}}{2} \sin \left( \theta\_{\text{kip}} - \theta\_{\text{knee}} \right) \cos \theta\_{\text{knee}} \\\ \text{G}\_{\text{WRK},2} &= - \left( m\_{\text{cal}f} + m\_2 \right) g \frac{l\_{\text{cal}f}}{2} \sin \left( \theta\_{\text{hips}} - \theta\_{\text{knee}} \right) \end{aligned} \end{cases}$$

The dynamics equation of motion, Equation (27), of WRK system with uncertainties *<sup>δ</sup>WRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*,*r*, .*<sup>θ</sup>knee*,*<sup>r</sup>* can be written as:

$$\begin{aligned} \left[ \,^{\mathsf{T}WRK}\_{\mathsf{V}RR} \dot{\mathsf{T}}\_{\mathsf{V}RR,\mathsf{knee}} \right]^{T} &= \,^{\mathsf{T}}M\_{\mathsf{V}RK} \left( \theta\_{\mathrm{hip}}, \theta\_{\mathrm{knee}} \right) \left[ \ddot{\theta}\_{\mathrm{hip}} \ddot{\theta}\_{\mathrm{knee}} \right]^{T} \\ &+ \,^{\mathsf{C}WRK}\_{\mathsf{V}RR} \left( \theta\_{\mathrm{hip}}, \theta\_{\mathrm{knee}}, \dot{\theta}\_{\mathrm{hip}}, \dot{\theta}\_{\mathrm{knee}} \right) \left[ \ddot{\theta}\_{\mathrm{hip}} \dot{\theta}\_{\mathrm{knee}} \right]^{T} \\ &+ \,^{\mathsf{C}WRK}\_{\mathsf{V}RR} \left( \theta\_{\mathrm{hip}}, \theta\_{\mathrm{knee}} \right) + \,^{\mathsf{S}WRK}\_{\mathsf{V}RR} \left( \theta\_{\mathrm{hip}}, \theta\_{\mathrm{knee}}, \dot{\theta}\_{\mathrm{hip},r}, \dot{\theta}\_{\mathrm{knee},r} \right) \end{aligned} \tag{28}$$

In term of model errors *<sup>ε</sup>WRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*,*r*, .*<sup>θ</sup>knee*,*<sup>r</sup>*and external disturbances *DWRK*, the uncertainty value is obtained as: *<sup>δ</sup>WRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*,*r*, .*<sup>θ</sup>knee*,*<sup>r</sup>* = *DWRK* + *<sup>ε</sup>WRK<sup>θ</sup>hip*, *θknee*, .*<sup>θ</sup>hip*,*r*, .*<sup>θ</sup>knee*,*<sup>r</sup>*.

### **4. Tracking Error**

In this section, the control input and the trajectory of a hip and knee joint are presented to address the tracking error of the WRK system. The control input is based on the difference between the current and the desired value, of the hip and knee joints, in the feedback section. When there are no uncertainties and no errors in the initial values of states, the laws of control will move the WRK system on a desired path in the feedforward control scheme. The unknown weight of the person is included in the outer disturbances, while all the uncertainties are involved in the error of the dynamics model. The uncertainties, including model errors and disturbance errors, are applied to train the RBF NN. This will be necessary to continue the WRK device on the required track, i.e., to achieve robustness. On the other hand, hip and knee reference trajectories for a healthy person are derived to simulate the values of hip and knee joints during the gait cycle.

### *4.1. Control Input*

The control input *ui*/*p* affecting the WRK is developed from feedback action that is applied to provide the difference between the current value of the hip angle *<sup>θ</sup>hip* and knee angle *θknee* and the required value of hip angle *<sup>θ</sup>hip*,*<sup>r</sup>* and knee angle *<sup>θ</sup>knee*,*r*, respectively. Hence, the error vector of tracking will be *EWRK* = *<sup>θ</sup>hip* − *<sup>θ</sup>hip*,*<sup>r</sup> θknee* − *<sup>θ</sup>knee*,*<sup>r</sup> T*. On the other hand, the feedforward control design is applied to the WRK system. The laws of control will move the WRK system on a desired path when there are no uncertainties and no errors in the initial values of states. Consequently, Equation (29) is used to determine the feedforward control loop:

$$\begin{aligned} \left[ \begin{aligned} ^{\mathsf{T}}\_{\mathsf{V}\mathsf{V}\mathsf{R}\mathsf{X},\mathsf{hi}\mathsf{p}\mathsf{T}\mathsf{V}\mathsf{R}\mathsf{X},\mathsf{knee} \end{aligned} \right]^{\mathsf{T}} &= \begin{aligned} ^{\mathsf{T}}\_{\mathsf{i}\mathsf{i}'/p} + ^{\mathsf{H}}\_{\mathsf{i}\mathsf{V}\mathsf{R}\mathsf{X}} \left( \theta\_{\mathrm{hi}p}, \theta\_{\mathrm{knee}} \right) \left[ \ddot{\theta}\_{\mathrm{hip},r} \ddot{\theta}\_{\mathrm{knee},r} \right]^{\mathsf{T}} \\ + \mathsf{C}\_{\mathsf{W}\mathsf{R}\mathsf{K}} \left( \theta\_{\mathrm{hip},r} \theta\_{\mathrm{knee}}, \dot{\theta}\_{\mathrm{hip},r} \dot{\theta}\_{\mathrm{knee}} \right) \left[ \dot{\theta}\_{\mathrm{hip},r} \dot{\theta}\_{\mathrm{knee},r} \right]^{\mathsf{T}} \\ + \mathsf{G}\_{\mathsf{W}\mathsf{R}\mathsf{K}} \left( \theta\_{\mathrm{hip},\theta} \theta\_{\mathrm{knee}} \right) \end{aligned} \end{aligned} \tag{29}$$

By considering the uncertainties, the WRK robust closed loop system is obtained by inserting Equation (29) in the WRK dynamics Equation (28), as below:

$$\begin{split} u\_{i/p} = M\_{\text{WRK}} \Big( \theta\_{\text{hip}\prime} \theta\_{\text{knee}} \Big) \ddot{E}\_{\text{WRK}} + \mathbb{C}\_{\text{WRK}} \Big( \theta\_{\text{hip}\prime} \theta\_{\text{knee}} \dot{\theta}\_{\text{hip}\prime} \dot{\theta}\_{\text{knee}} \Big) \dot{E}\_{\text{WRK}} \\ + \delta\_{\text{WRK}} \Big( \theta\_{\text{hip}\prime} \theta\_{\text{knee}} \dot{\theta}\_{\text{hip}\prime} \dot{\theta}\_{\text{knee},r} \Big) \end{split} \tag{30}$$

The unknown weight of the person is included in the outer disturbances *DWRK*, while all the uncertainties involving the error of the dynamics model are represented as *εWRK <sup>θ</sup>hip*, *θknee*, . *<sup>θ</sup>hip*,*r*, . *<sup>θ</sup>knee*,*<sup>r</sup>* . In the model-based control system, the tracking error of the WRK device moves toward a linear trajectory when the model errors and disturbances errors are close to zero. Thus, a lack of congruence between the tracking error of the WRK control-based model and the actual WRK device causes unacceptable control. This issue will result in the inability to support appropriate actuator torque by the WRK device to reach the required trajectory. Thus, the WRK system will be unrobust. To solve this issue, the uncertainties, including model errors and disturbance errors, are applied to train the RBF NN. This will be necessary for the WRK device to continue on the required track, i.e., to achieve robustness. The applied RBF NN structure includes the following:


$$d\_{\vec{j}} = \frac{1}{\left[1 + e^{-c\_{\vec{j}}^2}\right]}, \vec{j} = 1, 2, \dots, k.$$

where *k* is the number of neurons in the hidden layer, which is supposed to be equal to the number of the inputs of the RBF NN.

(3) Output, as calculated from the following equation:

$$\left(\varepsilon\_{\text{WRK}}\left(\theta\_{\text{hip}}, \theta\_{\text{knee}}, \dot{\theta}\_{\text{hip},r}, \dot{\theta}\_{\text{knee},r}\right) = \sum\_{j=1}^{k} w\_{\text{WRK}, \text{bj}} d\_{j}, h = 1, 2, \dots, m \tag{31}$$

where *m* and *wWRK*,*hj* denote the number of outputs and the RBF NN weight, respectively. Hence,

$$\delta\_{\rm WKB} \left( \theta\_{\rm hip\,\gamma}, \theta\_{\rm knc\,\gamma}, \dot{\theta}\_{\rm hip\,\gamma\,\gamma}, \dot{\theta}\_{\rm knc\,\gamma\,\Gamma} \right) = \sum\_{j=1}^{k} w\_{\rm WKB,hj} d\_j + D\_{\rm WKB} \tag{32}$$

Inserting Equation (32) into (30) yields

$$\begin{split} \mathcal{U}\_{i/p} = & M\_{\rm WKB} \Big( \theta\_{\rm hi\rho}, \theta\_{\rm kne} \Big) \ddot{\mathcal{E}}\_{\rm WKB} + \mathcal{C}\_{\rm WKB} \Big( \theta\_{\rm hi\rho}, \theta\_{\rm kne}, \dot{\theta}\_{\rm li\rho}, \dot{\theta}\_{\rm kne} \Big) \dot{\mathcal{E}}\_{\rm WKB} \\ & + \sum\_{j=1}^{k} w\_{\rm WKB,j} d\_j + D\_{\rm WKB} \end{split} \tag{33}$$

The training algorithm for RBF NN weight *wWRK*,*hj* dominates the associated computation for the suggested technique. In what follows, an examination of the adaptive computational complexity involved is provided [23]. Suppose that the input data *x*(*t*) and output data *y*(*t*) of the WRK system are sampled in the following interval {*t* = 1, ··· , *<sup>N</sup>*}, where *N* denotes the number of samples. To evaluate how the RBF NN performs, a metric known as the normalized prediction error (*NPEWRK*) is implemented, which is defined as

$$NPE\_{WRK} = \sqrt{\frac{\sum\_{t=1}^{N} \left(\mathcal{Y}(t) - \mathcal{Y}(t)\right)^2}{\sum\_{t=1}^{N} \mathcal{Y}^2(t)}} \times 100\% \tag{34}$$

where *y*<sup>ˇ</sup>(*t*) represents the calculated values of the WRK output system.

### *4.2. Hip and Knee Joint Trajectory*

The categorization of walking features allows us to separate a movement cycle into a stance period and a swing period. As shown in Figure 2, the percentage of gait cycle can be separated into 60% and 40% for the stance period and swing period, respectively. The leg, considering the right leg in this analysis, normally moves according to the following stages: heel strike, foot flat, midstance, heel off, toe off, midswing, heel strike [24]. During typical walking on level ground, a person's knee bends at an approximate extension angle of 2◦ to 15◦ during the standing phase and bends at an approximately extension angle of 2◦ to 60◦ during the swing phase. To be considered healthy, a hip joint must be able to bend and extend across an approximate angle of −15◦ to 22◦. For a gait cycle, hip and knee reference swing trajectories are fitted for typical walking on level ground, as presented in Equations (35) and (36) and detailed in [25]:

$$\theta\_{\text{hip}} = \sum\_{j=1}^{6} f\_{1j} \sin \left( f\_{2j} \omega t + f\_{3j} \right) \tag{35}$$

$$\theta\_{kn\alpha} = \sum\_{j=1}^{6} g\_{1j} \sin \left( g\_{2j} \omega t + g\_{3j} \right) \tag{36}$$

where

> *ω* denotes the frequency of motion;

*f*1*j* denotes the amplitude of sin *f*2*j<sup>ω</sup><sup>t</sup>* + *f*3*j* component of *<sup>θ</sup>hip*; *g*1*j* denotes the amplitude

 of sin *<sup>g</sup>*2*j<sup>ω</sup><sup>t</sup>* + *<sup>g</sup>*3*j* 

**Figure 2.** Hip and knee joints in a complete gait cycle of walking, with the right leg moving in the following stages: 1—heel strike, 2—foot flat, 3—midstance, 4—heel off, 5—toe off, 6—midswing, 7—heel strike.

component

 of *θknee*;

The sum of sines model in the curve fitting toolbox of MATLAB is implemented to fit the periodic functions in Equations (35) and (36) to obtain the fitting parameters presented in Table 3.


**Table 3.** Fitting parameters of hip and knee reference trajectories.

### **5. Separation System and** *L*2 **Gain**

This study is only a first step towards developing a comprehensive theory of nonlinearstate feedback *H*∞ control; and important issue is the more complex dynamics measurement feedback problem, particularly involving disturbances that corrupt the process states' variables measurements. In fact, the assumption that only affected measurements are available for feedback was an essential part of the main purpose behind linear *H*∞ analysis design (see, e.g., [26,27] and the references cited therein). As a matter of terminology, the *H*∞ norm is defined as a norm for transfer matrices and therefore cannot be directly generalized to nonlinear systems. The *H*∞ norm, however, is nothing more than the *L*2 induced norm converted into the time domain. The application of *L*2 gain in the adaptive robust dynamics RBF NN is developed in this section in order to facilitate the control motion solutions and provide the feature of intelligent WRK control techniques. In the control algorithm, the characteristics of separation and style *L*2 gain for the WRK system

are crucial due to the status of relations between the input and output. The separation of system is implemented to establish the WRK dynamic system, as follows:

$$
\dot{\mathbf{x}} = f\_{WRK}(\mathbf{x}) + v\_{WRK}(\mathbf{x})\\D\_{WRK}y = q\_{WRK}(\mathbf{x})\tag{37}
$$

where *fWRK* is a smooth function; *y* represents the output of the WRK system implemented to monitor the error; *vWRK*(*x*) is an *n* × *m* matrix, where *n* represents the number of local coordinates, *x* = (*<sup>x</sup>*1,..., *xn*) of the smooth function *fWRK*, and *m* is the number of disturbances *DWRK* = (*d*1,..., *dm*); *qWRK*(*x*) is the output that results from *DWRK* corresponding to initial states [28,29]. However, the WRK system will be dissipative in the case that all of its accumulated energy will be consumed during operation to the moment of reaching the equilibrium position. Consequently, we obtained:

$$Q(\mathbf{x}(t\_n)) - Q(\mathbf{x}(t\_0)) \le \int\_{t\_0}^{t\_n} \mathbb{E}(D\_{WRK}, \mathbf{y}(t))dt\tag{38}$$

where *Q* is a function that should have a value greater than or equal to zero, and *<sup>E</sup>*(*dWRK*, *y*(*t*)) denotes the input energy. On the other hand, the dynamic WRK system is stable when:

$$\|y(t)\|\_{L\_2} \le \beta \|D\_{WRK}(t)\|\_{L\_2} \tag{39}$$

where *L*2 gain is less than or equal to *β* and *β* ≥ 0. The inequality of Equation (38) is solved next based on the optimization technique to establish that function *Q*(*x*) has a minimum value, as follows:

$$\frac{\partial \underline{Q}}{\partial \mathbf{x}} \left( f\_{WRK}(\mathbf{x}) + v\_{WRK}(\mathbf{x}) D\_{WRK} \right) \le 0.5 \left( \beta^2 \| D\_{WRK} \| ^2 - \| \mathbf{y} \| ^2 \right) \tag{40}$$

The achievement of this equation is the solution of *Q* as greater than or equal to zero for all disturbances *DWRK* and *y*(*t*) = *qWRK*(*x*). The WRK system *L*2 gain is developed by the following equation to determine the robustness of the WRK system against disturbance:

$$I\_{WRK} = \sup\_{D\_{WRK}} \begin{array}{l} \text{sup} \\ \hline \|D\_{WRK}\|\_{L\_2} \end{array} \tag{41}$$

The operation of the WRK device is more robust against disturbance for a lower *IWRK* value. When the inequality presented in Equation (40) is fulfilled, the following inequality is obtained as: 

$$\dot{V} \le 0.5 \left( \beta^2 ||D\_{WRK}||^2 - ||y||^2 \right) \tag{42}$$

where *IWRK* ≤ *β*. The inequality mentioned in Equation (42) will be used in the next section to find the solution of WRK motion for the adaptive RBF NN.

### **6. RBF NN–Based Adaptive Robust Controller**

RBF NNs are reported to be efficient in designing control techniques for complex uncertain nonlinear systems in a significant number of theoretical studies and practical applications [30,31]. Although there have been notable achievements in the field of NN, due to their capabilities in analyzing nonlinear system dynamics, the current research on adaptive RBF NN controllers remains primarily focused on investigating fundamental approaches. Assuming that discontinuous RBF NN functions are defined properly, it is possible to simulate models with nonlinear dynamics. Thus, adaptive RBF NNs are most effective in practical applications where system dynamics are inherently nonlinear, vary significantly, and are not fully analyzed (see, e.g., Ref. [32] and the references cited therein). In this section, a robust design technique is discussed for stable adaptive-control WRK systems using RBF NN approximation-based methods.

Adaptive robust controllers involve a tracking error control algorithm that can be applied to enhance the performance of manipulators in trajectory planning [33–35]. First, the control input *ui*/*p* in Equation (29) is used to compensate the WRK system in Equation (28). Then, the closed loop of the WRK system is developed as explained in Equation (33). By assuming the external disturbances *DWRK* and presenting a new signal *SWRK*, the index signal of Equation (41) can be rewritten as follows:

$$I\_{WRK} = \sup\_{\|D\_{WRK}\|\_{\mathcal{Y}} \neq 0} \|S\_{WRK}\|\_2 / \|D\_{WRK}\|\_2 \tag{43}$$

The aim of the RBF NN-based robust controller is to obtain control signal *ui*/*p* and RBF NN learning . *WWRK*, where *IWRK* < . The variable represents a predefined level. As explained in Section 2, the proposed WRK model is derived using the Lagrange approach. Hence, the obtained WRK dynamics model shown in Equation (27) generally contains the acceleration that is essential to be measured for the design of the WRK controller. However, measuring the acceleration signal is not an easy process due to its noise. In turn, assuming *ε* > 0, the following two variables are defined to avoid using the acceleration signal:

$$\begin{aligned} z\_1 &= E\_{WRK} \\ &= \dot{E}\_{WRK} + \varepsilon E\_{WRK} \end{aligned}$$

*z*2

.

.

Hence, Equation (33) is rewritten as

$$
\dot{z}\_1 = z\_2 - \varepsilon z\_1 \tag{44}
$$

$$\begin{array}{rcl} \mathcal{M}\_{\text{WRK}} \Big( \theta\_{\text{hip}}, \theta\_{\text{knee}} \Big) \dot{z}\_2 &=& \mathcal{M}\_{\text{WRK}} \Big( \theta\_{\text{hip}}, \theta\_{\text{knee}} \Big) \varepsilon \dot{E}\_{\text{WRK}} \\ &+& \mathcal{C}\_{\text{WRK}} \Big( \theta\_{\text{hip}}, \theta\_{\text{knee}}, \dot{\theta}\_{\text{hip}}, \dot{\theta}\_{\text{knee}} \Big) \varepsilon E\_{\text{WRK}} \\ &-& \mathcal{C}\_{\text{WRK}} \Big( \theta\_{\text{hip}}, \theta\_{\text{knee}}, \dot{\theta}\_{\text{hip}}, \dot{\theta}\_{\text{knee}} \Big) z\_2 - D\_{\text{WRK}} \\ &-& \sum\_{j=1}^{k} w\_{\text{WRK}, \text{bj}} d\_j + u\_{i/p} \end{array} \tag{45}$$

To track the position and speed of the WRK system, an adaptive law is designed based on RBF NN, as follows:

$$
\mathcal{W}\_{WRK} = -\gamma \varepsilon\_2 d\_{WRK}^T \tag{46}
$$

where the constant *γ* > 0. On the other hand, *W*ˆ *WRK* and *dTWRK* denote the derivative of estimated weight and Gaussian function vector of RBF NN, respectively.

.

$$w\_{WRK} = \begin{bmatrix} w\_{WRK,11} & w\_{WRK,12} & \dots & w\_{WRK,1k} \\ w\_{WRK,21} & w\_{WRK,22} & \dots & w\_{WRK,2k} \\ \vdots & \vdots & \vdots & \vdots \\ w\_{WRK,n1} & w\_{WRK,n2} & \dots & w\_{WRK,nk} \end{bmatrix}, \\ d\_{WRK}^{T} = \begin{bmatrix} d\_1 & d\_2 & \dots & d\_k \end{bmatrix}.$$

The control law is now designed with feedback based on Equations (44) and (45), as below: 

$$\begin{array}{rcl}\mu\_{\frac{i}{p}} &=& -M\_{WRK} \Big(\theta\_{hip\prime}, \theta\_{kne\varepsilon}\Big) \varepsilon \dot{E}\_{WRK} \\ &-\mathbb{C}\_{WRK} \Big(\theta\_{hip\prime}, \theta\_{kne\prime}, \dot{\theta}\_{hip\prime}, \dot{\theta}\_{kne\varepsilon}\Big) \varepsilon E\_{WRK} - \frac{1}{\Xi^2} z\_2 \\ &+ \hat{\mathsf{W}}\_{WRK} d\_{WRK} - \frac{1}{2} z\_2. \end{array} \tag{47}$$

where the index signal of Equation (43) is such that *IWRK* < -. System stability can be described by two major concepts: system stability, which indicates its trajectories depend on initial conditions at a nearby equilibrium point, or asymptotical stability. A system's asymptotic stability refers to its ability to achieve equilibrium under relatively minor variations for a reasonable period of time. Robustly asymptotically stable systems may still be stable despite being subjected to random disturbances and modeling uncertainties [36]. Considering the WRK closed system, the stability is ensured by introducing the following Lyapunov function:

$$L\_{WRK} = \frac{1}{2} z\_2^T M\_{WRK} \left(\theta\_{hip}, \theta\_{knc}\right) z\_2 + \frac{1}{2\gamma} \left(\stackrel{\sim}{W}\_{WRK}^T \tilde{W}\_{WRK}\right) \tag{48}$$
 
$$\sim \qquad .$$

*WWRK* = *W* ˆ *WRK* − *WWRK*

Now, considering Equations (44), (45) and (47) and assuming the WRK dynamics of Equation (27), we obtain:

$$\begin{split} \dot{L}\_{WRK} = z\_2^T M\_{WRK} \left( \theta\_{hip}, \theta\_{kncc} \right) \dot{z}\_2 + \frac{1}{2} z\_2^T \dot{M}\_{WRK} \left( \theta\_{hip}, \theta\_{kncc} \right) \dot{z}\_2 \\ + \frac{1}{\gamma} tr \left( \stackrel{\cdot}{\dot{W}}\_{WRK} \stackrel{\cdot}{W}\_{WRK} \right) \end{split} \tag{49}$$

Inserting *MWRK<sup>θ</sup>hip*, *<sup>θ</sup>knee*.*z*2 from Equation (45) into above equation yields:

$$\begin{aligned} \dot{L}\_{WRK} &= z\_2^T \Big[M\_{WRK} \left(\theta\_{\mathrm{hipr}}, \theta\_{\mathrm{kvec}}\right) \varepsilon \dot{E}\_{WRK} \\ &+ \mathcal{C}\_{WRK} \left(\theta\_{\mathrm{hipr}}, \theta\_{\mathrm{kvec}}, \theta\_{\mathrm{hipr}}, \theta\_{\mathrm{kvec}}\right) \varepsilon \dot{E}\_{WRK} \\ &- \mathcal{C}\_{WRK} \left(\theta\_{\mathrm{hipr}}, \theta\_{\mathrm{kvec}}, \theta\_{\mathrm{hipr}}, \dot{\theta}\_{\mathrm{kvec}}\right) z\_2 - \mathcal{D}\_{WRK} \\ &- \sum\_{j=1}^k \mathcal{w}\_{WRK, \mathrm{pj}} d\_j + i\_{1/p} \bigg] + \frac{1}{2} z\_2^T \dot{M}\_{WRK} \left(\theta\_{\mathrm{hipr}}, \theta\_{\mathrm{kvec}}\right) \dot{z}\_2 \\ &+ \frac{1}{\gamma} \left(\overset{\sim}{\dot{W}}\_{WRK}^T \overset{\sim}{\dot{W}}\_{WRK}\right) \\ \dot{L}\_{WRK} &= -z\_2^T D\_{WRK} - \frac{1}{\gamma^2} z\_2^T z\_2 + z\_2^T \overset{\sim}{\dot{W}}\_{WRK} d\_{WRK}^T - \frac{1}{2} z\_2^T z\_2 \\ &+ \frac{1}{\gamma} tr\left(\overset{\sim}{\dot{W}}\_{WRK} \overset{\sim}{\dot{W}}\_{WRK}\right) \end{aligned} \tag{50}$$

Considering the external disturbance *DWRK*, assume:

$$H\_{WRK} = \dot{L}\_{WRK} - \frac{1}{2}\Delta^2 \|D\_{WRK}\|^2 + \frac{1}{2} \|S\_{WRK}\|^2 \tag{51}$$

Inserting Equation (44) into above equation gives

$$\begin{array}{lcl} H\_{\rm WKB} & = -z\_2^T D\_{\rm WKB} - \frac{1}{2\Sigma^2} z\_2^T z\_2 - \frac{1}{2} \mathfrak{D}^2 \left\| D\_{\rm WKB} \right\|^2 \\ & + z\_2^T \widetilde{W}\_{\rm WKB} d\_{\rm WKB}^T \\ & + \frac{1}{\gamma} tr \left( \widetilde{W}\_{\rm WKB} \widetilde{W}\_{\rm WKB} \right) \\ & + \frac{1}{2} \left\| S\_{\rm WKB} \right\|^2 \end{array} \tag{52}$$

The components of Equation (52) are considered as follows:

1. The first three components involve the following:

$$-z\_2^T D\_{WRK} - \frac{1}{2\Delta^2} z\_2^T z\_2 - \frac{1}{2} \mathfrak{D}^2 \|D\_{WRK}\|^2 = -\frac{1}{2} \left\| \frac{1}{\Delta} z\_2 + \Delta D\_{WRK} \right\|^2 \le 0$$

2. Regarding the second two components, since *zT*2 ∼ *WWRKdTWRK* = *tr*∼*WWRKdTWRKzT*2 andusingtheadaptivelaw,i.e.,. *W*ˆ =−*γ<sup>z</sup>*2*<sup>d</sup>TWRK*",introducedinEquation(46),

 *WRK* we obtain .

$$\operatorname{tr}\left(\widetilde{\boldsymbol{W}}\_{\boldsymbol{W}\boldsymbol{R}\boldsymbol{K}}\boldsymbol{d}\_{\boldsymbol{W}\boldsymbol{R}\boldsymbol{K}}^{\boldsymbol{T}}\boldsymbol{z}\_{2}^{\boldsymbol{T}}\right) = -\frac{1}{\gamma}\operatorname{tr}\left(\dot{\widetilde{\boldsymbol{W}}}\_{\boldsymbol{W}\boldsymbol{R}\boldsymbol{K}}^{\boldsymbol{T}}\widetilde{\boldsymbol{W}}\_{\boldsymbol{W}\boldsymbol{R}\boldsymbol{K}}\right)$$

Hence,

$$z\_2^T \widehat{\boldsymbol{W}}\_{WRK} \boldsymbol{d}\_{WRK}^T + \frac{1}{\gamma} tr \left( \dot{\widehat{\boldsymbol{W}}}\_{WRK}^T \widehat{\boldsymbol{W}}\_{WRK} \right) = 0$$

3. For the last two components, considering the approximation error as the disturbance *DWRK* and defining *SWRK* = *z*2 = . *EWRK* + *<sup>ε</sup>EWRK*, we obtain:

$$-\frac{1}{2}z\_2^T z\_2 + \frac{1}{2}||z\_2||^2 = 0$$

Hence, *HWRK* ≤ 0. According to Equation (45), we obtain:

$$\dot{L}\_{WRK} \le \frac{1}{2} \mathfrak{D}^2 \|D\_{WRK}\|^2 - \frac{1}{2} \|S\_{WRK}\|^2 \tag{53}$$

Equation (53) represents the derived HJI in Equation (42). Consequently, based on Section 5, it can be concluded that the system is stable for *IWRK* < -. This finalizes the proof of the following theorem:

**Theorem 1.** *Considering the implemented nonlinear system of a wearable robotic knee, as defined in Equation (37), and the Hamiltonian–Jacobi Inequality. which is defined in (42), the RBF NN–based adaptive control law given by (47) ensures the asymptotic convergence to 0 for the trajectory tracking error if, and only if:*

*IWRK* < -

*where* - *is a positive constant number. The designed control algorithm of this system is depicted in Figure 3*.

**Figure 3.** Block diagram of the WRK tracking control system.

### **7. Numerical Simulation Validation**

The designed control algorithm of this study is tested in this section on the tracking motion of a WRK system by simulation experiments. Five tests were performed as part of the numerical simulation analysis for validating the controller developed for this study. Test 1 was designed as a means of assessing the overall performance of the controller without taking into account the weight and the height of the user. Tests 2 and 3 were conducted using real users' [19,20] (one male and one female) data in order to evaluate the performance of the designed controller in terms of position and speed tracking errors. Tests 4 and 5 evaluated the torques at each joint of the hip and knee using data from two real human users [19,20] (one male and one female), allowing the torque applied to the calf and thigh to be measured in a realistic context. All tests, except Test 1, used authentic human parameters to test the controller during realistic human walking, based on the hip and knee joint trajectories derived from Section 4.2 and reference [24]. Four additional tests were implemented based on different combinations of human characteristics (such as male, female, height, weight) as presented in Table 4, widening the potential user base for the device. Table 4 contains the parameters for the simulation experiments of the four persons. The parameters of person 1, person 2, person 3, and person 4 are used in Test 2, Test 3, Test 4, and Test 5, respectively. In this table, the tests are considered for four persons of four different heights *T* and weights *mbody*. The length of thigh, calf, WRK link-1, and WRK link-2 are obtained according to Equations (1)–(4), respectively. The weights of the thigh and calf are calculated as a percentage of total weight of the body according to Equations (5)–(8). The inertia of the thigh, calf, WRK link-1, and WRK link-2 are calculated referring to Equation (9). The weights of each of the WRK link are selected as 0.25 kg. The main features of the simulation study methodology are presented in Figure 4.

**Table 4.** Parameters of the simulation tests.


**Figure 4.** Features of the simulation study methodology.

### *7.1. Simulation Results*

The computing simulation analysis is conducted using MATLAB programming software on a computer characterized by the following configurations: (i) Windows 10 Enterprise for 64 bits; (ii) 16 Gigabytes of RAM; and (iii) Intel(R) Core(TM) i7-4790T CPU @ 2.70 GHz. The uncertainty due to model errors is considered as:

$$\varepsilon\_{\rm WKB} = \begin{bmatrix} 0.7 \text{sgn}(\dot{\theta}\_{\rm hip} - \dot{\theta}\_{\rm hip}) + 0.7 \text{sgn}(\dot{\theta}\_{\rm hip,r} - \dot{\theta}\_{\rm hip}) \exp\left(-\left|\dot{\theta}\_{\rm imp,r} - \dot{\theta}\_{\rm hip}\right|\right) \\ 0.6 \text{sgn}\left(\dot{\theta}\_{\rm kne,r} - \dot{\theta}\_{\rm kne}\right) + 0.3 \text{sgn}\left(\dot{\theta}\_{\rm kne,r} - \dot{\theta}\_{\rm kne}\right) \exp\left(-\left|\dot{\theta}\_{\rm kne,r} - \dot{\theta}\_{\rm kne}\right|\right) \end{bmatrix} \text{N.m} \tag{54}$$

The second part of the uncertainty due to external disturbances is assumed as

$$D\_{WRK} = \begin{bmatrix} \text{7random}() \\ \text{6random}() \end{bmatrix} + D\_{\text{weight}} \tag{55}$$

$$D\_{\text{weight}} = \begin{bmatrix} 8\text{sg}\,\text{tr}\left(\dot{\theta}\_{\text{hip},r} - \dot{\theta}\_{\text{hip}}\right)\exp\left(-\left|\dot{\theta}\_{\text{hip},r} - \dot{\theta}\_{\text{hip}}\right|\right) \\ 7\text{sg}\,\text{tr}\left(\dot{\theta}\_{\text{knee},r} - \dot{\theta}\_{\text{knee}}\right)\exp\left(-\left|\dot{\theta}\_{\text{knee},r} - \dot{\theta}\_{\text{knee}}\right|\right) \end{bmatrix}$$

where *Dweight* represents the disturbances due to the extra weight that the person may hold during walking, and "random()" represents a random number between 0 and 1. The disturbances that are represented by Equation (55) are selected to be changed in a random way to simulate the unknown external disturbances. Hence, for each test, the disturbance signal is not the same. In addition, the exponential function is included in the disturbance signal of Equation (55) to simulate the nonlinearity. The sign of the difference between the current and the required value of tracking are taken into consideration in the "*sgn*" function. The number of inputs, hidden layers, and outputs of the NN are set as 4, 7, and 1, respectively. By applying the adaptive control law of Equation (46) and the feedback control law in Equations (29) and (47) for all the five tests, the tracking controller is designed with the following constant values: *γ* = 1000, *ε* = 15, - = 0.06.

In the first test, the parameters of the WRK system are set as *m*1 = 0.25 kg, *m*2 = 0.25 kg, *I*1 = 0.012 kgm2, *I*2 = 0.012 kgm2. The free load test is conducted under the assumption that WRK has not been worn by any individual (i.e., *mthigh* = *<sup>m</sup>*calf = 0). The initial states are *<sup>θ</sup>hip* = 0.2 rad, *θknee* = 0.2 rad, . *<sup>θ</sup>hip* = 0 rad/s, and . *θknee* = 0 rad/s. It is assumed that the length of the WRK-thigh-link and the WRK-calf-link will be 25 cm so as to be suitable

for adults, who usually have thigh and calf lengths that exceed 35 cm [20,37]. The ideal trajectory of the hip and knee joint is assumed as a sinusoid function of *<sup>θ</sup>hip*,*<sup>r</sup>* = sin 4*πt* and *<sup>θ</sup>knee*,*<sup>r</sup>* = sin 4*πt*, respectively. The tracking errors results are shown in Figures 5 and 6. As can been seen from these figures, there are no steady errors, since the actual trajectory matches the desired trajectory.

**Figure 5.** Position tracking of WRK thigh and calf links.

**Figure 6.** *Cont.*

**Figure 6.** Speed tracking of WRK thigh and calf links.

As seen in Figure 7, the ideal trajectory for each hip joint (*θhip*,*<sup>r</sup>*) and knee joint (*θknee*,*<sup>r</sup>*) during a swing period simulates a realistic human path during walking (Tests 2 and 3). Specifically, such a trajectory is based on the hip and knee joint trajectories derived from Section 4.2 and reference [24]. As explained in Equations (35) and (36), this is normal movement for a normal individual. The initial states here are assumed to be *<sup>θ</sup>hip* = −0.158 degree, *θknee*= −23.6degree, . *<sup>θ</sup>hip*= 0rad/s,and . *θknee*= 0rad/s.

**Figure 7.** Swing angle of hip and knee joints.

Considering the trajectories of hip and knee joints of Figure 7 and the parameters of the simulation tests of Table 4 corresponding to person 1 female and person 2 male, the required positions of the end of thigh and calf are calculated according to Equations (1) and (2), respectively, as depicted in Figure 8. The end of the thigh and calf is located at knee and ankle joint, respectively. These positions, as specified in Figure 8, will be implemented in the simulation of Test 2 and Test 3 as the required position of the controller of person 1 female and person 2 male, respectively.

**Figure 8.** Position of the end of the thigh and calf of person 1 female and person 2 male.

The number of inputs, hidden layers, and outputs of the NN, *γ*, *ε*, and -, are set as the values of the first test. Again, by applying the adaptive control law of Equation (46) and the feedback control law in Equations (29) and (47), the tracking error results for person 1 female and person 2 male are shown in Figures 9–12.

**Figure 9.** *Cont.*

**Figure 9.** Position tracking of WRK thigh and calf links for person 1 female.

**Figure 10.** Speed tracking of WRK thigh and calf links for person 1 female.

**Figure 11.** Position tracking of WRK thigh and calf links for person 2 male.

**Figure 12.** *Cont.*

**Figure 12.** Speed tracking of WRK thigh and calf links for person 2 male.

Based on the results shown in Figures 9–12, the controller was able to track the desired position and speed of the thigh and calf. There was, however, a small delay between the actual position and the required position in position tracking. It was expected that this would occur since the delay was been taken into account in the current study; it will be examined in a future study. As a result of the calf link, the controller was able to track the required speed with acceptable results. The tracking speed of the thigh link was slightly inaccurate due to the fact that in this study we exclusively focused on the robustness and adaptiveness of the system to random external disturbances, as shown by Equations (54) and (55). Hence the controller responded with the same plot when the experiment was repeated, which was predictable.

The fourth and fifth tests were implemented to depict the control input torque on thigh and calf. The parameters of person 3 and person 4 presented in Table 4 were used in Test 4 and Test 5, respectively. Considering the values of hip and knee joints of Figure 7 and the parameters of person 3 and person 4, the required position of the end of thigh and calf were calculated according to Equations (1) and (2), respectively, as depicted in Figure 13.

**Figure 13.** Position of the end of thigh and calf of person 3 female and person 4 male.

The tracking error results for person 3 in Test 4 are shown in Figures 14 and 15, while the torque of the thigh and calf are shown in Figure 16. Regarding person 4, the tracking error results from Test 5 are shown in Figures 17 and 18, while the torque of the thigh and calf are shown in Figure 19.

**Figure 14.** Position tracking of WRK thigh and calf links for person 3 female.

**Figure 15.** Speed tracking of WRK thigh and calf links for person 3 female.

**Figure 16.** *Cont.*

**Figure 16.** Torque input of thigh and calf of person 3 female.

**Figure 17.** Position tracking of WRK thigh and calf links for person 4 male.

**Figure 18.** Speed tracking of WRK thigh and calf links for person 4 male.

**Figure 19.** *Cont.*

**Figure 19.** Torque input of thigh and calf of person 4 male.

Furthermore, as previously discussed, the controller's adaptivity and robustness to a combination of user parameters in Tests 4 and 5 resulted in the same performance as in Tests 2 and 3. It was observed that there is a delay in response when tracking the positions of calf and thigh links (Figures 14 and 17), as well as errors in terms in tracking thigh link speed (Figures 15 and 18) as a result of these tests. As shown in Figures 16 and 19, the thigh and calf input torques for persons 3 and 4, respectively, are depicted.
