Learning-Based Repetitive Control of a Bowden-Cable-Actuated Exoskeleton with Frictional Hysteresis

Bowden-cable-actuated soft exoskeleton robots are known for their light weight and flexibility of power transmission during rehabilitation training or movement assistance for humans. However, friction-induced nonlinearity of the Bowden transmission cable and gearbox backlash pose great challenges forprecise tracking control of the exoskeleton robot. In this paper, we proposed the design of a learning-based repetitive controller which could compensate for the non-linearcable friction and gearbox backlash in an iterative manner. Unlike most of the previous control schemes, the presented controller does not require apriori knowledge or intensive modeling of the friction and backlash inside the exoskeleton transmission system. Instead, it uses the iterative learning control (ILC)to adaptively update the reference trajectory so that the output hysteresis caused by friction and backlashis minimized. In particular, a digital phase-lead compensator was designed and integrated with the ILC to address the issue of backlash delay and improve the stability and tracking performance. Experimental results showed an average of seven iterations for the convergence of learning and a 91.1% reduction in the RMS tracking error (~1.37 deg) compared with the conventional PD control. The proposed controller design offers promising options for the realization of lightweight, wearable exoskeletons with high tracking accuracies.


Introduction
Exoskeleton robots are wearable supporting structures designed for human strength enhancement, movement assistance, or rehabilitation training [1]. The structures of early exoskeletons are usually rigid and bulky, which are installed parallel to the human limbs [2]. The well-known Berkeley lower extremity exoskeleton (BLEEX) and Cyberdyne hybrid assistive limb (HAL) are of this type [3,4]. There have been various studies on the dynamical modeling and control of these rigid exoskeletons [5]. However, the rigidity and bulkiness of these exoskeletons severely limit the natural movements and wearing comfort of human body, which could even cause injuries to the human limbs during operation [6].
In light of the drawbacks of traditional rigid exoskeleton designs, soft exoskeletons have been developed recently for enhanced user comfort and wearing safety [7]. Tsagarakis et al. used linear pneumatic muscle actuators (PMA) as power sources for aseven-degree-ofmotion prototype upper-arm training/rehabilitation exoskeleton system. With the excellent power-to-weight ratio, this type of actuator offers safety, simplicity, and lightness to the overall design [8]. Zhang   As shown in Figure 1, the outer Bowden cable sheath was constrained by the adjustable stop, which could be tightened to create pretension of the inner cable. The inner cable was connected to the grooved pulleys which were mounted on output shaft of the actuator and the knee joint, respectively. The thigh and shank brackets made of light-weight ABS plastics were connected together by the rotational knee joint of the exoskeleton for the swing motion in the saggital plane. Flexible Velcro straps were used for the fixation of the associated brackets to the lower limbs of the user. To provide feedback of the angular displacement of the user's knee joint movement, a knee-angular sensor was installed on the knee axle of the exoskeleton.
Approximate weights and sizes of the major exoskeleton components are listed in Table 1 below. Here, the weight of waist bracket assembly (including the actuator module, the battery pack and controller box) was around 2160 g, while the weights of the exoskeleton thigh and shank brackets were 485 g and 418 g, respectively. With the proposed design, most of the weight is carried by the back straps and the pelvis of the human user, where only less than 1/3 of the weight is carried by the lower limbs of user. Furthermore, the lengths of both the thigh and shank brackets as well as back straps are adjustable for users with different body sizes. The optimized weight distribution and adjustable design provide good user comfort and portability of the soft exoskeleton.  As shown in Figure 1, the outer Bowden cable sheath was constrained by the adjustable stop, which could be tightened to create pretension of the inner cable. The inner cable was connected to the grooved pulleys which were mounted on output shaft of the actuator and the knee joint, respectively. The thigh and shank brackets made of light-weight ABS plastics were connected together by the rotational knee joint of the exoskeleton for the swing motion in the saggital plane. Flexible Velcro straps were used for the fixation of the associated brackets to the lower limbs of the user. To provide feedback of the angular displacement of the user's knee joint movement, a knee-angular sensor was installed on the knee axle of the exoskeleton.
Approximate weights and sizes of the major exoskeleton components are listed in Table 1 below. Here, the weight of waist bracket assembly (including the actuator module, the battery pack and controller box) was around 2160 g, while the weights of the exoskeleton thigh and shank brackets were 485 g and 418 g, respectively. With the proposed design, most of the weight is carried by the back straps and the pelvis of the human user, where only less than 1/3 of the weight is carried by the lower limbs of user. Furthermore, the lengths of both the thigh and shank brackets as well as back straps are adjustable for users with different body sizes. The optimized weight distribution and adjustable design provide good user comfort and portability of the soft exoskeleton.

Actuator Design
The Bowden transmission cables are driven by a custom-designed actuator module, which consists of a DC motor with a gear reducer (XD-42GA775-24V-25W, 50 round × min −1 , gear ratio: 100:1, maximum torque: 0.917 N × m), a grooved pulley, cable tie points, and amounting bracket, as shown in Figure 2 below. This DC motor is a low-cost and relatively light-weight (540 g) motor without built-in encoders, as opposed to the expensive servo motors. It is useful for the portable design of the soft knee exoskeleton, as the motor can be mounted directly on the waist brace of the user.

Actuator Design
The Bowden transmission cables are driven by a custom-designed actuator module which consists of a DC motor with a gear reducer (XD-42GA775-24V-25W, 50 round min −1 , gear ratio: 100:1, maximum torque: 0.917 N × m), a grooved pulley, cable ti points, and amounting bracket, as shown in Figure 2 below. This DC motor is a low-cos and relatively light-weight (540 g) motor without built-in encoders, as opposed to th expensive servo motors. It is useful for the portable design of the soft knee exoskeleton as the motor can be mounted directly on the waist brace of the user.  When the DC motor rotates, the grooved pulley pulls the inner Bowden cables in two directions to actuate the knee extension and flexion, respectively. Adjustable stop are integrated for the pretension of inner cables, which could reduce the amount o backlash in the Bowden cables to a certain extent. For instance, the backlash could b reduced to around ±3 mm after adjustment, when a 1 m-long Bowden cable is used with a 90° bending angle and a 2.5 mm inner diameter. The amount of backlash of th gear reducer, however, cannot be reduced by the adjustable stops. Appropriate preten sion is required, as very large pretension will induce high friction between the inner ca ble and outer sheath, causing a significant amount of power loss during the Bowden ca ble transmission. While this custom-designed actuator is of a compact structure, due t limited output power (25 W), it is unable to fully reject the frictional disturbances in th Bowden transmission cable during operation, using conventional control methods. Thi issue is analyzed in detail in the following sections.

Nonlinear Friction in the Bowden Cable
The Bowden cable transmission system for the soft knee exoskeleton is illustrated in Figure 3. The gear reducer lowers the rotational speed of DC motor and amplifies it output torque, which drives the gear-reducer pulley. As the inner cables are pulled b the gear-reducer pulley and slide inside the outer sheath, nonlinear friction is produced between the contacting interfaces. The friction results in the difference between the out put and the input forces of the Bowden transmission cable. When the DC motor rotates, the grooved pulley pulls the inner Bowden cables in two directions to actuate the knee extension and flexion, respectively. Adjustable stops are integrated for the pretension of inner cables, which could reduce the amount of backlash in the Bowden cables to a certain extent. For instance, the backlash could be reduced to around ±3 mm after adjustment, when a 1 m-long Bowden cable is used with a 90 • bending angle and a 2.5 mm inner diameter. The amount of backlash of the gear reducer, however, cannot be reduced by the adjustable stops. Appropriate pretension is required, as very large pretension will induce high friction between the inner cable and outer sheath, causing a significant amount of power loss during the Bowden cable transmission. While this custom-designed actuator is of a compact structure, due to limited output power (25 W), it is unable to fully reject the frictional disturbances in the Bowden transmission cable during operation, using conventional control methods. This issue is analyzed in detail in the following sections.

Nonlinear Friction in the Bowden Cable
The Bowden cable transmission system for the soft knee exoskeleton is illustrated in Figure 3. The gear reducer lowers the rotational speed of DC motor and amplifies its output torque, which drives the gear-reducer pulley. As the inner cables are pulled by the gear-reducer pulley and slide inside the outer sheath, nonlinear friction is produced between the contacting interfaces. The friction results in the difference between the output and the input forces of the Bowden transmission cable.
To illustrate the nonlinear frictional effect quantitatively, a frictional model is needed. In this paper, the Coulomb friction between the inner cable and outer sheath was assumed, and the inertia of the inner cable was neglected. The input-output relationship of the inner cable's tension can be described by the following equations [35,36] where T in and T out are the tensions of the inner cable at the input and output ends, respectively, T 0 is the inherent cable friction when the bending angle φ(L) is zero, µ is the s is the pulling direction of the inner cord, L is the length of the cable, κ(λ) is the curvature, and φ(L) is the total bending angle of the Bowden cable.  To illustrate the nonlinear frictional effect quantitatively, a frictional model is needed. In this paper, the Coulomb friction between the inner cable and outer sheath was assumed, and the inertia of the inner cable was neglected. The input-output relationship of the inner cable's tension can be described by the following equations [35,36] where and are the tensions of the inner cable at the input and output ends, respectively, 0 is the inherent cable friction when the bending angle ( ) is zero, is the frictional coefficient between the inner cord and the outer sheath, ()isthe pulling direction of the inner cord, is the length of the cable, ( ) is the curvature,and ( ) is the total bending angle of the Bowden cable.
Moreover, the input-output relationship of the tendon displacement (i.e., the variation of the tendon length) can be modeled as where and are the displacements of the input and output ends of the inner cable, respectively, ( ) is the elongation of the inner cord, is the backlash of the Bowden cable, is the Young's modulus of the tendon, and is its cross-sectional area. Moreover, the input-output relationship of the tendon displacement (i.e., the variation of the tendon length) can be modeled as where S in and S out are the displacements of the input and output ends of the inner cable, respectively, δ(s) is the elongation of the inner cord, B c is the backlash of the Bowden cable, E is the Young's modulus of the tendon, and A is its cross-sectional area. The simulated input-output relationship for cable tensions and displacements can be obtained based on Equations (1)-(4), as shown in Figure 4 below. Figure 4a shows the loading and unloading characteristics of the cable tensions when the friction coefficient is µ = 0.5 and the bending angles are φ = 30 o , 60 o , 90 o , respectively. The plot shows the difference between loading and unloading process, and there is a region where the output tension is unchanged. Such characteristics will lead to frictional hysteresis, creating larger tracking errors when controlling the soft exoskeleton. Figure 4b plots the loading and unloading profile when a backlash of the Bowden cable B c = 6 mm exists. The backlash of the Bowden cable and gear reducer together with the cable friction contribute to the complex nonlinear hysteresis of the knee joint motion. put tension is unchanged. Such characteristics will lead to frictional hysteresis, creating larger tracking errors when controlling the soft exoskeleton. Figure 4b plots the loading and unloading profile when a backlash of the Bowden cable = 6 mm exists. The backlash of the Bowden cable and gear reducer together with the cable friction contribute to the complex nonlinear hysteresis of the knee joint motion.

Dynamics of the Soft Knee Exoskeleton System
The dynamics of the soft knee exoskeleton system involve the motions of the exoskeleton knee joint, the gear-reducer pulley, and the DC motor, all which contribute to the degrees of freedom of the system. The most important degree of freedom is the knee joint rotation, which was the focus of control in this study. The rotation of the gear-reducer pulley and motor spindle are additional degrees of freedom but are of less concern in the controller design. Moreover, the bending angles of the flexion and extension Bowden cables as well as the human body motion also affect the dynamical performance, but they are not controllable and are treated as disturbances.
The following analysis formulates the mathematical equations for these motions. Here, certain approximations and simplifications were made, which include the assumption of Coulomb friction in the Bowden transmission cable and linear viscous friction in the rotational axles (e.g., motor spindles, knee joint bearing, etc.). The goal was to derive the dynamical relationship between the output torque of the DC motor and the angular response of the knee joint.
The equation of motion for the soft exoskeleton knee joint can be written as where is the equivalent moment of inertia of the knee pulley (including both the exoskeleton and human), is the viscous friction coefficient of the exoskeleton knee joint bearing, ℎ( , ) is the disturbance torque by the human body, ( , ) is the gravitational torque, and is the total actuation torque applied by the Bowden cables on the knee pulley.
The actuation torque on the exoskeleton knee pulley and on the gear-reducer pulley are formulated below, which are related to the Bowden cable tensions and radii of pulleys

Dynamics of the Soft Knee Exoskeleton System
The dynamics of the soft knee exoskeleton system involve the motions of the exoskeleton knee joint, the gear-reducer pulley, and the DC motor, all which contribute to the degrees of freedom of the system. The most important degree of freedom is the knee joint rotation, which was the focus of control in this study. The rotation of the gear-reducer pulley and motor spindle are additional degrees of freedom but are of less concern in the controller design. Moreover, the bending angles of the flexion and extension Bowden cables as well as the human body motion also affect the dynamical performance, but they are not controllable and are treated as disturbances.
The following analysis formulates the mathematical equations for these motions. Here, certain approximations and simplifications were made, which include the assumption of Coulomb friction in the Bowden transmission cable and linear viscous friction in the rotational axles (e.g., motor spindles, knee joint bearing, etc.). The goal was to derive the dynamical relationship between the output torque of the DC motor and the angular response of the knee joint.
The equation of motion for the soft exoskeleton knee joint can be written as where J kp is the equivalent moment of inertia of the knee pulley (including both the exoskeleton and human),c kp is the viscous friction coefficient of the exoskeleton knee joint bearing, h(θ, t) is the disturbance torque by the human body, g(θ, t) is the gravitational torque, and τ kp is the total actuation torque applied by the Bowden cables on the knee pulley. The actuation torque τ kp on the exoskeleton knee pulley and τ gp on the gear-reducer pulley are formulated below, which are related to the Bowden cable tensions and radii of pulleys where T ek (t) and T f k (t) are the extensor and flexor cable tensions on the knee pulley respectively, T eg (t) and T f g (t) are the extensor and flexor cable tensions on the gear-reducer pulley respectively, and R kp and R gp are radii of the knee and gear-reducer pulleys respectively. Due to friction, the tensions on each side of the Bowden cable are different for both the extension and flexion cables. The detailed relationship can be derived based on Equation (1), namely where f e (φ e (t), (11) here, φ e (t) and φ f (t) are the total bending angles of the extension and flexion Bowden cables respectively, . θ gp (t) and . θ kp (t) are the angular velocity of the gear-reducer pulley and knee joint pulley respectively and their sum is used to determine the direction of the average cable velocity, f e (φ e (t)) and f f φ f (t) are friction caused by the bending angles in the extension and flexor cables respectively [37], and f e0 and f f 0 are inherent cable friction when bending angles are zero in the extension and flexor cables respectively.
The dynamical model of the DC motor can be formulated as where u(t) is the motor control voltage, K e is the motor back-EMF constant, L a and R a are the armature inductance and resistance respectively, i m (t) is the armature current, τ m (t) is the motor torque, θ m (t) is the motor angle, K T is the motor torque constant, and J m and c m are the moment of inertia and viscous friction coefficient of the motor spindle respectively. The gear reducer lowers the output velocity of the DC motor and amplifies the motor's torque, which can be described by where τ g (t) and τ m (t) are the output torques of the gear reducer and DC motor respectively, θ g (t) and θ m (t) are the output angles of the gear reducer and DC motor respectively, α is the gear ratio, η( . θ m ) is the efficiency of the gear reducer, τ f g is the equivalent frictional torque in the gear reducer, B g is the gear reducer's backlash, and c gp is the viscous friction coefficient of the gear reducer.
For the dynamical motion of the gear reducer pulley, the following holds θ gp (t) = θ g (t) (18) where J gp is the equivalent moment of inertia of the gear-reducer pulley. Combining Equations (5)- (18) and assuming zero pretentions of the extension and flexion cables, the relationship between the output torque of the DC motor and the angular displacement of exoskeleton knee joint can be written as where here, J gp and c gp are the equivalent overall moment of inertia and viscous friction coefficient on the knee joint respectively, τ f (φ(t), . θ kp ) is the overall frictional torque caused by the bending angle of the Bowden transmission cable (in quasi-static condition), and τ f 0 ( . θ kp ) is the overall inherent frictional torque when bending angle is zero.
As Equation (19) shows, the human-exoskeleton system can be modeled as a secondorder system with viscous damping, nonlinear cable frictional disturbances, human motion disturbance, and gravitational disturbance. The nonlinear cable friction causes a significant amount of backlash hysteresis in the angular displacement output of the soft knee exoskeleton when conventional control methods are used without appropriate compensation. The following section focuses on the controller design for this particular system, which aims to address the issue of frictional backlash.

Controller Design
For successful and precise operation of the soft knee exoskeleton, a good design of the controller is crucial, which includes low tracking error and robust stability to model uncertainties. In particular, a fast response with low overshoot is required for the Bowdencable-actuated system, which has a considerable amount of delay and hysteresis due to cable friction and gear-reducer backlash. Moreover, monotonic decay (convergence) of tracking error is required to prevent injuries to the user during use. The overall design of the control system for the soft knee exoskeleton is presented in Figure 5 below, which consists of an inner-loop feedback controller and an outer-loop iterative learning controller.
The inner loop is a lower-level servo control with a high sampling rate at 1 kHz (∆T S = 0.001 s). The angular displacement sensor reads the angular position θ O (t) of the knee joint as a feedback signal which is compared with the ILCreference input knee angle signal θ L (t) for the inner-loop servo controller to process. Here, the angular velocity is obtained by a basic differentiation of the angular displacement θ O (t). The differentiator works well in this study with proper shielding of the wirings and sufficient allocation of A/D conversion time. More advanced methods (such as Kalman Filtering [38]) offer better estimate of velocity in the presence of noise. However, they have not been implemented due to the finite computation power of the microprocessor and limited knowledge of the model [39]. The control parameters of the inner-loop servo controller were tuned to ensure closed-loop stability of the position control for the exoskeleton knee angle. The motor driver amplifies the output signal of the servo controller and drives the DC motor. Additionally, Bowden cables transmit the rotational motion of the DC motor to the exoskeleton knee joint. The mission of the inner-loop control is to make the output knee angle θ O (t) as close as possible to the reference input knee angle θ L (t) of the inner loop. However, due to Bowden cable friction and disturbances such as human motion h(t) and gravitational forces g(θ, t), the position-tracking performance of the inner-loop controller alone is poor. The inner loop is a lower-level servo control with a high sampling rate at 1 kHz (Δ = 0.001 s). The angular displacement sensor reads the angular position ( ) of the knee joint as a feedback signal which is compared with the ILCreference input knee angle signal ( ) for the inner-loop servo controller to process. Here, the angular velocity ̇( ) is obtained by a basic differentiation of the angular displacement ( ). The differentiator works well in this study with proper shielding of the wirings and sufficient allocation of A/D conversion time. More advanced methods (such as Kalman Filtering [38]) offer better estimate of velocity in the presence of noise. However, they have not been implemented due to the finite computation power of the microprocessor and limited knowledge of the model [39]. The control parameters of the inner-loop servo controller were tuned to ensure closed-loop stability of the position control for the exoskeleton knee angle. The motor driver amplifies the output signal of the servo controller and drives the DC motor. Additionally, Bowden cables transmit the rotational motion of the DC motor to the exoskeleton knee joint. The mission of the inner-loop control is to make the output knee angle ( ) as close as possible to the reference input knee angle ( ) of the inner loop. However, due to Bowden cable friction and disturbances such as human motion ℎ( ) and gravitational forces ( , ), the position-tracking performance of the inner-loop controller alone is poor.
For this problem, an outer learning control loop was introduced to compensate for the frictional disturbances of the Bowden transmission cable. In typical exoskeleton applications such as rehabilitation training and walking assistance, repetitive movements of the human body and exoskeleton are involved, which inspires a learning-based approach. The proposed learning-based repetitive control belongs to the more general internal model principle (IMP). It is a particular case of the IMP for tracking periodic references or attenuating periodic disturbances in closed-loop control [40,41]. Basically, the outer loop creates a process that simulates the response of the system in order to estimate the outcome of a system disturbance. Intuitively, the model of the dynamic structure of the environment is created in the closed loop system using the proposed approach [42,43]. For the particular exoskeleton system, the outer learning control loop For this problem, an outer learning control loop was introduced to compensate for the frictional disturbances of the Bowden transmission cable. In typical exoskeleton applications such as rehabilitation training and walking assistance, repetitive movements of the human body and exoskeleton are involved, which inspires a learning-based approach. The proposed learning-based repetitive control belongs to the more general internal model principle (IMP). It is a particular case of the IMP for tracking periodic references or attenuating periodic disturbances in closed-loop control [40,41]. Basically, the outer loop creates a process that simulates the response of the system in order to estimate the outcome of a system disturbance. Intuitively, the model of the dynamic structure of the environment is created in the closed loop system using the proposed approach [42,43]. For the particular exoskeleton system, the outer learning control loop learns the history of output knee joint angle θ O,j−1 (t) and input reference θ L,j−1 (t) for the inner loop in the previous repetition j − 1.Some learning laws and filtering are then applied, which update the input reference θ L,j (t) for the inner loop in the current repetition j. The refresh rate of the outer learning loop is at 40 Hz (∆T L = 0.025 s). When properly designed, the iterative adjustment of the input reference θ L,j−1 (t) for the inner loop could make the tracking error (θ d (t) − θ O (t)) converge to zero (or a very small level) as the number of iterations increases.

Design of Inner Loop Digital Servo Controller
The block diagram of the inner-loop digital servo control system is illustrated in Figure 6 below, where Θ L (z) is the reference input knee angle and Θ O (z) is the output knee angle. The goal of the inner-loop digital servo controller is to stabilize the angular output of the soft knee exoskeleton G E (s), by proper design of the controller C(z).To ensure a fast response and dynamical stability, a high sampling rate of 1 kHz (∆T S = 0.001 s) wasused for the inner-loop digital servo controller.

Design of Inner Loop Digital Servo Controller
The block diagram of the inner-loop digital servo control system is illustrated in Figure 6 below, where ( ) is the reference input knee angle and ( ) is the output knee angle. The goal of the inner-loop digital servo controller is to stabilize the angular output of the soft knee exoskeleton ( ), by proper design of the controller ( ).To ensure a fast response and dynamical stability, a high sampling rate of 1 kHz (Δ = 0.001 s)wasused for the inner-loop digital servo controller. The soft knee exoskeleton model can be obtained from Equation (19), and its continuous time transfer function ( ) can be written as where is the Laplace operator, and ̃ and ̃ are the equivalent moment of inertia and viscous friction coefficient on the knee joint, respectively. Based on the digital sampling of the A/D converter (quantizer) and zero-order hold of the D/A converter (motor amplifier),the discrete-time model of the soft knee exoskeleton ( ) can be written in the following form where the parameters 1 , 0 , 1 , 0 , depend on the exoskeleton parameters,digital sampling time Δ , and zero-order hold being used, and is the z-transform operator.
The Bowden cable friction ( ), human motions ( ),and gravitational forces ( ) are all treated as disturbances, represented by the term ( ) in the discrete-time domain, namely In this study, a digital servo controller ( ) of a proportional-derivative (PD) type wasused, and its discrete-time transfer function can be expressed as The soft knee exoskeleton model can be obtained from Equation (19), and its continuous time transfer function G E (s) can be written as where s is the Laplace operator, and J kp and c kp are the equivalent moment of inertia and viscous friction coefficient on the knee joint, respectively. Based on the digital sampling of the A/D converter (quantizer) and zero-order hold of the D/A converter (motor amplifier),the discrete-time model of the soft knee exoskeleton G E (z) can be written in the following form where the parameters a 1 , a 0 , b 1 , b 0 , ξ depend on the exoskeleton parameters, digital sampling time ∆T S , and zero-order hold being used, and z is the z-transform operator. The Bowden cable friction F(z), human motions H(z),and gravitational forces G(z) are all treated as disturbances, represented by the term V(z) in the discrete-time domain, namely In this study, a digital servo controller C(z) of a proportional-derivative (PD) type wasused, and its discrete-time transfer function can be expressed as where k p and k d are the proportional and derivative gains. By mathematical manipulation of the block diagram in Figure 6 above, the following equations hold where K a and K g are the motor amplifier gain and gear ratio respectively, Θ m (z) is the measured knee angle, N(z) is the measurement noise and unity sensor gain, and K S is assumed.
Therefore, the transfer functions from the reference input Θ L (z), disturbance V(z) and measurement noise N(z) to the output knee angle Θ O (z) can be obtained from Equations (29) and (30) as follows Combining Equations (25), (28), and (31)yields the equivalent closed-loop transfer function G IL (z) of the inner loop The servo error of the inner digital feedback loop is defined as And the characteristic equation of the servo error E S (z) can be obtained based on the numerator of Equation (34) The dynamic performance and stability of the inner loop can be changed by adjusting k p and k d . Assuming the desired closed-loop poles of the servo error's characteristic equation are p 1 , p 2 , and p 3 , the following holds By equating the corresponding coefficients in Equations (36) and (37), the relationship between the control gains and desired closed-loop poles can be established as For the discrete-time stability of the inner loop servo control, k p and k d can be selected such that the eigenvalues of Equation (36) are all within the circle with radius ρ, that is where ρ = 1 for basic stability and ρ < 1 for faster settling time. To avoid overshoot, the closed-loop poles p 1 , p 2 , and p 3 should all be real numbers. Based on the inner-loop digital controller design above, a Matlab Simulink simulation was conducted to study the sinusoidal response of the soft knee exoskeleton system. The simulated results are shown in Figure 7 below, where the PD controller gains are k p = 4, k d = 0.5, the amplifier gain (with motor torque constant) is K a K g = 0.225 Nm, the equivalent moment of inertia on knee pulley is J kp = 0.01 kgm 2 , and the viscous coefficientis c kp = 0.7 Nms/rad. Moreover, to match the experimental results, frictional coefficient µ = 0.5 and bending angle φ = 90 o were used for the Bowden cable, and gear-reducer backlash was B g = ±2 o based on hardware measurement. tion was conducted to study the sinusoidal response of the soft knee exoskeleton system. The simulated results are shown in Figure 7 below, where the PD controller gains are = 4 , = 0.5, the amplifier gain (with motor torque constant) is = 0.225 Nm, the equivalent moment of inertia on knee pulley is ̃= 0.01 kgm 2 , and the viscous coefficientis ̃= 0.7 Nms/rad. Moreover, to match the experimental results, frictional coefficient = 0.5 and bending angle = 90 were used for the Bowden cable, and gear-reducer backlash was = ±2 o based on hardware measurement. The upper plot in Figure 7a shows the position tracking performance of the inner-loop digital servo controller, and the lower plot in Figure 7a shows the time history of the gear-reducer output torque − and equivalent frictional torque − . As seen from Figure 7a, there was a significant amount of backlash and phase delay for the output knee angle − ( ) compared with the reference input − ( ). Figure 7b shows the input-output relationship by an X-Y plot, which further illustrates the issue of frictional hysteresis and backlash. At point A, the output torque of gear reducer started to fall below the maximum frictional torque and the exoskeleton system slowed down and stop edits rotation. From point A to point B, the Bowden cable provides a static friction which cancels the output torque of the gear reducer. From point B to point C, the output torque of gear reducer switched sign, and the static Bowden cable friction also switched sign. From point C to point D, the output torque of the gear reducer surpassed the maximum frictional torque and the motor spindle started to rotate. However, due to the gear-reducer backlash, the output knee angle of the exoskeleton still remained unchanged, until point D was reached. Therefore, the exoskeleton system kept stationary from point A to point C, and static friction was applied against the output torque of the gear reducer. From point D to point E, the knee exoskeleton started rotating again, and dynamic friction was applied against the output torque of gear reducer.
The introduction of an integral term with anti-windup (AW) could help improve the tracking performance to some extent, as seen from the gray curve, Figure 7b. However, the tracking error of PID +AW control is still not small enough (RMSE ~3.254 deg). The upper plot in Figure 7a shows the position tracking performance of the innerloop digital servo controller, and the lower plot in Figure 7a shows the time history of the gear-reducer output torque τ g−sim and equivalent frictional torque τ f −sim . As seen from Figure 7a, there was a significant amount of backlash and phase delay for the output knee angle θ O−sim (t) compared with the reference input θ L−sim (t). Figure 7b shows the input-output relationship by an X-Y plot, which further illustrates the issue of frictional hysteresis and backlash. At point A, the output torque of gear reducer started to fall below the maximum frictional torque and the exoskeleton system slowed down and stop edits rotation. From point A to point B, the Bowden cable provides a static friction which cancels the output torque of the gear reducer. From point B to point C, the output torque of gear reducer switched sign, and the static Bowden cable friction also switched sign. From point C to point D, the output torque of the gear reducer surpassed the maximum frictional torque and the motor spindle started to rotate. However, due to the gear-reducer backlash, the output knee angle of the exoskeleton still remained unchanged, until point D was reached. Therefore, the exoskeleton system kept stationary from point A to point C, and static friction was applied against the output torque of the gear reducer. From point D to point E, the knee exoskeleton started rotating again, and dynamic friction was applied against the output torque of gear reducer.
The introduction of an integral term with anti-windup (AW) could help improve the tracking performance to some extent, as seen from the gray curve, Figure 7b. However, the tracking error of PID +AW control is still not small enough (RMSE~3.254 deg). In addition, the output response of the PID + AW control is quite choppy due to the nonlinear Bowden cable friction and backlash when a more aggressive Ki term is used. While advanced PID + AW methods have been developed previously, the mathematical modeling involved is quite complicated [44,45], which is beyond the focus of this paper (i.e., the design of ILC). Furthermore, with the extra Ki and AW parameters, the PID + AW require more intensive tuning, especially when the operational conditions change (e.g., different human weight, different ground slope, etc). As a result, the PID + AW alone are still undesired for the safe and smooth operation of the soft exoskeleton robot.
While the analysis above is based on the theoretical simulation with certain simplifications made, the simulated curves offer useful insight into the physical causes for the frictional hysteresis and backlash. Due to the highly nonlinear and time-varying charac-teristic of the friction and backlash, the PD-type (or PID + AW) inner-loop digital servo controller alone is unable to track the reference curve accurately. Additionally, an outer learning control loop is needed, which is discussed below.

Design of Outer Loop Iterative Learning Controller
The block diagram of the outer-loop learning-based repetitive control system is illustrated in Figure 8 below, where Θ d (z) is the desired knee angle for the outer loop, Θ L (z) is the reference input knee angle for the inner loop, and Θ O (z) is the output knee angle. The goal of the outer-loop learning-based repetitive controller is to adjust the reference input knee angle Θ L (z) each cycle so that the output of the soft knee exoskeleton Θ O (z) will approach the desired knee angle Θ d (z) as the number of iterations increases. The design of the repetitive controller R(z) and compensator Γ(z) is crucial for the fast convergence and good transients (i.e., monotonic convergence) of learning. The speed of convergence is important for the efficient operation of soft exoskeleton, where the periodic tracking error could be reduced in as few iterations as possible through learning. Furthermore, the safe and smooth operation of the soft exoskeleton requires monotonic convergence of tracking error, so that any potential injury caused by large error transients (i.e., error in intermediate iterations) to the human user could be avoided. Here, a lower sampling rate of 40 Hz (∆T L = 0.025 s) was used for the outer-loop learning-based repetitive controller, which further helped stabilize the learning and provided adequate settling for the inner-loop PD controller.
AW require more intensive tuning, especially when the operational conditions change (e.g., different human weight, different ground slope, etc). As a result, the PID + AW alone are still undesired for the safe and smooth operation of the soft exoskeleton robot.
While the analysis above is based on the theoretical simulation with certain simplifications made, the simulated curves offer useful insight into the physical causes for the frictional hysteresis and backlash. Due to the highly nonlinear and time-varying characteristic of the friction and backlash, the PD-type (or PID + AW) inner-loop digital servo controller alone is unable to track the reference curve accurately. Additionally, an outer learning control loop is needed, which is discussed below.

Design of Outer Loop Iterative Learning Controller
The block diagram of the outer-loop learning-based repetitive control system is illustrated in Figure 8  The proposed learning-based repetitive controller can be formulated as follows [46]:  The proposed learning-based repetitive controller can be formulated as follows [46]: where θ L,j (k) and θ L,j (k) are the reference input knee angles at time step k of iteration j and (j − 1) respectively, e L,j−1 (k) = θ d (k) − θ m,j−1 (k) is the tracking error of the outer learning loop of iteration (j − 1), ϕ(i) is the coefficient of learning gain for e L,j−1 (k + γ + i), γ is the parameter for phase-lead compensation, and k = 1, 2, 3, . . . , p with p being the total number of samples per iteration. Note that time step k of the previous iteration (j − 1) is shifted by p time steps backward with respect to the current iteration j. Therefore, the following holds e L,j−1 (k + γ + i) = e L,j (k − p + γ + i) By substituting Equations (41) and (42) into Equation (40), the z-transform of the learning-based repetitive control law in Equation (40) can be obtained as where the compensator Γ(z) is defined as (44) and the repetitive controller is defined as Moreover, the block diagram in Figure 8 implies the following relationship Combing Equations (43), (45), and (46) produces the dynamical equation for the error E L (z) of the outer learning loop as where G IL−N (z) and G IL−D (z) are the numerator and denominator of the equivalent inner loop z-transfer function G IL (z), and Γ N (z) and Γ D (z) are the numerator and denominator of the compensator z-transfer function Γ(z). And the characteristic equation for the error dynamics is The stability of the outer learning loop requires all the roots of the characteristic Equation (48) to be inside the unit circle. However, the high order of the characteristic polynomial produced by the number of samples p per iteration in Equation (48) makes it impractical to use this condition directly to determine stability. Methods such as finding the actual roots, Jury test, or Routh test with bilinear transformation would not work well in this case. Another way is to use the departure angle criteria of the root locus plot to determine stability. However, this method works only with sufficiently small learning gains [47]. This paper used the stability theory based on frequency domain analysis, namely the Nyquist stability theory.
Rearranging Equation (48) yields where E(z) is the z-transformation of error at repetition (j − 1), and z p E(z) is the ztransform of the next repetition j. Then, the frequency transfer function from one repetition to the next can be obtained based on Equation (49). Assuming the settling time of the inner loop is short compared with the period of the knee angle signal θ O (t), the condition for the monotonic decay in the outer learning loop is for all ω up to the Nyquist frequency (ω N = 1/(2∆T L )). The simulated plot based on the frequency-domain stability requirement in (41) is shown in Figure 9. To simulate the model uncertainty in frequency domain, noises were added to both the magnitude and phase of z γ Γ(z)G IL (z). Here, a basic P-type learning law with unity learning gain was used, and the inner-loop nominal model is based on the simplified linear model of Equation (34) in Section 4.1. The monotonic decay condition in (41) requires the Nyquist plot of z γ Γ(z)G IL (z) to be inside the unit circle at (1, 0). As seen from Figure 9b, the outer learning loop was unstable when there was no phase-lead compensation (γ = 0) and marginally stable when γ = 1. For higher values of γ, the learning can be stabilized using an additional cut-off filter to terminate the learning at higher frequencies [48].
The simulated plot based on the frequency-domain stability requirement in (41) is shown in Figure 9. To simulate the model uncertainty in frequency domain, noises were added to both the magnitude and phase of ( ) ( ). Here, a basic P-type learning law with unity learning gain was used, and the inner-loop nominal model is based on the simplified linear model of Equation (34) in Section 4.1. The monotonic decay condition in (41) requires the Nyquist plot of ( ) ( ) to be inside the unit circle at (1, 0). As seen from Figure 9b, the outer learning loop was unstable when there was no phase-lead compensation ( = 0) and marginally stable when = 1. For higher values of , the learning can be stabilized using an additional cut-off filter to terminate the learning at higher frequencies [48].
(a) (b) Figure 9.Stability plot using frequency domain analysis, with magnitude and phase noise added. And a basic P-type learning law with unity learning gain is used. (a)Nyquist plot of ( ) ( ), with the unit circle stability boundary shown. (b) Zoom-in plot of region A in Figure 9a, where the outer learning loop is unstable for = 0, marginally stable for = 1 and requires frequency cut-off for = 2, 3, 4, 5.
Due to the friction and backlash of the Bowden transmission cable and gear reducer, the magnitude response of the real-world inner-loop model is actually zero when the excitation frequency is above a certain value (shown in Figure 10). Such a nonlinear effect acts as a physical cut-off filter, which helps stabilize the learning process for higher frequencies, even without a digital cut-off filter.  Figure 9a, where the outer learning loop is unstable for γ = 0, marginally stable for γ = 1 and requires frequency cut-off for γ = 2, 3, 4, 5.
Due to the friction and backlash of the Bowden transmission cable and gear reducer, the magnitude response of the real-world inner-loop model is actually zero when the excitation frequency ω is above a certain value ω c (shown in Figure 10). Such a nonlinear effect acts as a physical cut-off filter, which helps stabilize the learning process for higher frequencies, even without a digital cut-off filter.  The results of the time-domain simulation of the outer learning loop are presented in Figure 11, where the P-type learning gain was ϕ = 0.2, and the phase-lead compensation level was γ = 5.The simulated output knee angles θ O−sim,j (t) of all iterations (j = 1, 2, . . . , 52) are overlapped with the simulated desired knee angle curve θ d−sim (t) from time t = 0 s to t = 4.6 s in Figure 11a, which illustrates the history of convergence. It can be seen that the output knee angle θ O−sim,j (t) approached the desired knee angle θ d−sim (t) as the number of iteration j increased. However, there were some "unsmooth" areas of the output knee angle θ O−sim,j (t), especially when the knee joint switch edits direction of rotation. Such a phenomenon is caused by the highly nonlinear nature of the Bowden transmission cables, as well as gear-reducer backlashes. In Figure 11b, the RMS (root mean square) tracking error is plotted in the iteration domain to show the convergence/divergence of error. It was found that the learning system was unstable when there was no phase-lead compensation (e.g.,γ = 0 and ϕ = 1.2, 1.4, 1.8). Additionally, higher levels of phase-lead compensation γ (within a certain range) help stabilize the learning and improve the tracking performance (e.g., γ = 2, 4, 6). However, when γ is too large, the learning system becomes unstable again (e.g., γ = 18).

Test Setup
To evaluate the proposed learning-based repetitive controller for the soft knee exoskeleton with nonlinear friction and backlash of the Bowden transmission cables, an experimental setup was built. The associated mechanical structure, controller box, power source, sensors, signal displays, and acquisition modules are shown in Figure 12

Test Setup
To evaluate the proposed learning-based repetitive controller for the soft knee exoskeleton with nonlinear friction and backlash of the Bowden transmission cables, an experimental setup was built. The associated mechanical structure, controller box, power source, sensors, signal displays, and acquisition modules are shown in Figure 12.
The mechanical structure consists of the shank and thigh brackets of the knee exoskeleton, the knee joint assembly, the mounting brace, the Bowden transmission cables, the actuator module, and the waist bracket. The actuator module is composed of the DC motor and the gear reducer, which is attached to the waist bracket. The model of the DC motor is XD-42GA775-24V-25W, manufactured by Xin Da Motor Corp. Ltd., with a rated output speed of 50 round × min −1 and built-in gear ratio of 100:1. The maximum output torque is 0.917 N × m and the weight is 540 g. The thigh bracket of knee exoskeleton was fixed to the test frame using the mounting brace, while the shank bracket was free to move. The outer sheath of the Bowden transmission cable (5 mm in outer diameter and 3 mm in inner diameter) was connected to the adjustable stops. The inner cord (2 mm in diameter) was connected to the pulleys of the knee joint and actuator module. As the actuator rotates, its motion and torque were transmitted to the knee joint of the exoskeleton, causing the shank bracket to swing around the knee axle. Figure 11. Time-domain simulation of the outer-loop learning-based repetitive controller. A P-type learning law with the phase-lead compensation is used. (a) Convergence history for the exoskeleton knee joint angle in time domain, with all iterations overlapped. Here, the phase-lead compensation is = 5, and the learning gain is = 0.2. (b) Convergence plot of RMS tracking error in iteration domain. The outer learning loop is unstable for = 0 and higher values (within a range) help improve the convergence.

Test Setup
To evaluate the proposed learning-based repetitive controller for the soft knee exoskeleton with nonlinear friction and backlash of the Bowden transmission cables, an experimental setup was built. The associated mechanical structure, controller box, power source, sensors, signal displays, and acquisition modules are shown in Figure 12.  Figure 12. Experimental setup to test the learning-based repetitive controller for the soft knee exoskeleton with nonlinear friction and backlash of the Bowden transmission cables. Figure 12. Experimental setup to test the learning-based repetitive controller for the soft knee exoskeleton with nonlinear friction and backlash of the Bowden transmission cables.
The control system is a custom-built controller based on the ATMEGA32U4 microprocessor, as shown in Figure 13. The LM2596S voltage regulator was used to convert the 24 V output of the 12-cell 6000 mAH Li-ion battery pack to the 5 V input for the microcontroller and other sensors. The portable laptop compiled the C code in the Arduino IDE and programs the microprocessor through the USB re-programming cable. The output PWM signal of the microprocessor was amplified by the 160W-7A AQMH2407ND motor driver to power the DC motor through the aviation power plug. Wirings for peripherals were all integrated with the microprocessor and motor driver. A DB-9 connector was used for communications between the knee joint sensors and the microcontroller. For over-loading and over-heating protection of the motor driver, fuses were added with a cooling fan mounted on the cover of the controller box. An LED voltage display was also installed on the front panel of the controller box to monitor the supply voltage of the exoskeleton system's battery pack in real time.
The sensors and data-acquisition system for the soft exoskeleton knee joint are presented in Figure 14. As seen from Figure 14a, the CJMCU-103 rotary potentiometer was mounted on the knee joint axle and read the angular displacement of the exoskeleton knee joint. GK105 optical switches were installed on the PCB board and worked with the flexible baffles to limit the operational range of the shank bracket for user safety. The Tektronix TBS1104 oscilloscope displayed the important signals in real time, including the desired knee angle for the outer loop θ d (t), the reference input knee angle θ L (t) for the inner loop, the output joint angle θ(t), and the motor voltage signal u(t). In Figure 14b, the multi-channel data-acquisition system is shown, where the AD7606 chip is used for the 16-bit analog-to-digital (A/D) conversion. Additionally, the DAQ USB cable communicated with the portable laptop for acquisition configuration and data logging.
AQMH2407ND motor driver to power the DC motor through the aviation power plug. Wirings for peripherals were all integrated with the microprocessor and motor driver. A DB-9 connector was used for communications between the knee joint sensors and the microcontroller. For over-loading and over-heating protection of the motor driver, fuses were added with a cooling fan mounted on the cover of the controller box. An LED voltage display was also installed on the front panel of the controller box to monitor the supply voltage of the exoskeleton system's battery pack in real time.  Figure 13. Custom-designed controller box for the soft knee exoskeleton. The ATMEGA32U4 microprocessor is used for the embedded implementation of the proposed control algorithm, and the AQMH2407ND motor amplifier is used to drive the DC motor. The sensors and data-acquisition system for the soft exoskeleton knee joint are presented in Figure 14. As seen from Figure 14a, the CJMCU-103 rotary potentiometer was mounted on the knee joint axle and read the angular displacement of the exoskeleton knee joint. GK105 optical switches were installed on the PCB board and worked with the flexible baffles to limit the operational range of the shank bracket for user safety. The Tektronix TBS1104 oscilloscope displayed the important signals in real time, including the desired knee angle for the outer loop ( ), the reference input knee angle ( ) for the inner loop, the output joint angle ( ), and the motor voltage signal ( ). In Figure  14b, the multi-channel data-acquisition system is shown, where the AD7606 chip is used for the 16-bit analog-to-digital (A/D) conversion. Additionally, the DAQ USB cable communicated with the portable laptop for acquisition configuration and data logging.  To verify the proposed control algorithm in this paper, the dynamical tracking performances of the soft knee exoskeleton system using the different control methods were compared by experiments. Experimental data in Section 5.2 verify the frictional hysteresis of the knee joint angle, when only the inner-loop PD servo control was used. The test result confirms the need of the learning control method proposed in this paper. In Section 5.3, the improved tracking performance of the proposed learning-based repetitive To verify the proposed control algorithm in this paper, the dynamical tracking performances of the soft knee exoskeleton system using the different control methods were compared by experiments. Experimental data in Section 5.2 verify the frictional hysteresis of the knee joint angle, when only the inner-loop PD servo control was used. The test result confirms the need of the learning control method proposed in this paper. In Section 5.3, the improved tracking performance of the proposed learning-based repetitive controller is verified by additional tests. Additionally, the learning controller with different levels of phase-lead compensation is further compared and analyzed, in terms of both the tracking performance of knee joint angle and the smoothness of the motor signal.
Before running the test, tensions of the inner cable should be adjusted properly. Instead of creating ultra-high pretensions, the inner cables were pre-tightened just to remove the major slackness (with small amount of backlash left). Such a procedure mimics the realworld application of the soft knee exoskeleton, where the Bowden cables might become loose over time due to repeated usage. Moreover, lower cable pretensions help reduce the unnecessary frictional loss of the entire Bowden cable transmission system.

PD Control of the Inner Loopand Verification of Frictional Hysteresis
To illustrate the frictional hysteresis of the Bowden transmission cable with only the inner-loop PD controller, a sinusoidal signal is used in this article as the reference input knee angle θ L (t), which is formulated as where the frequency is f = 0.2174 Hz (period of 4.6 s), the amplitude is A = 28.8 deg (57.6 deg pk-pk), and the bias term is D = 45 deg. The experimental results of the soft exoskeleton's tracking performance are shown in Figure 15, which are very similar to the simulation results in Figure 7. In the upper plot of Figure 15a, the measured output knee angle θ O−mea (t) (in blue) lags behind the sinusoidal reference input knee angle θ L−mea (t) (in magenta). Furthermore, a significant amount of distortion existed in the output knee angle, where the top and bottom part were truncated due to Bowden cable friction. The lower plot of Figure 15a shows the time history of the measured motor control signal. Since the inner-loop PD controller generates the motor control signal u(t) only based on the servo error e S (t) of current and previous time steps, the DC motor was unable to compensate for the frictional disturbances of the Bowden cables. Figure 15b further shows in the X-Y plot the strong hysteresis and backlash caused by the friction in the Bowden transmission cables. Here, the tracking results using PID + AW are also presented (in gray). It can be seen that the integral action with anti-windage helps improved the tracking performance to some extent, as predicted by the simulation in Figure 7b. However, due to the nonlinear frictional hysteresis and backlash, the choppy response of the PID + AW control makes it undesirable to the smooth and safe operation of the soft exoskeleton.

Overall History of the Learning Process
To address the hysteresis issue of the inner PD control loop above, a phase-lead iterative learning control (PLILC) of the outer loop wasproposed and validated by experiments. The time history of the entire 52 iterations is presented in Figure 16, where theP-type iterative learning gain is ϕ = 0.25 and the phase-leadlevel is γ = 10.
turbances of the Bowden cables. Figure 15b further shows in the X-Y plot the strong hysteresis and backlash caused by the friction in the Bowden transmission cables. Here, the tracking results using PID + AW are also presented (in gray). It can be seen that the integral action with anti-windage helps improved the tracking performance to some extent, as predicted by the simulation in Figure 7b. However, due to the nonlinear frictional hysteresis and backlash, the choppy response of the PID + AW control makes it undesirable to the smooth and safe operation of the soft exoskeleton.

Overall History of the Learning Process
To address the hysteresis issue of the inner PD control loop above, a phase-lead iterative learning control (PLILC) of the outer loop wasproposed and validated by experiments. The time history of the entire 52 iterations is presented in Figure 16, where theP-type iterative learning gain is = 0.25 and the phase-leadlevel is = 10. The measured output knee angle − ( )wasplotted (in blue) and compared with the desired knee angle − ( ) (in magenta), as shown in Figure 16a. For the first few iterations, the phase of measured output knee angle − ( ) lagged behind the desired knee angle − ( ), where the amplitude was lower and the profile was distorted due to Bowden cable friction. As the soft exoskeleton repeated the sinusoidal track following for more repetitions, the output knee angle − ( )approached the desired knee angle − ( ) more and more closely. Figure 16b presents the time history of the measured motor control signal ( ) (in green) and motor direction signal ( ) (in orange). Instead of staying roughly unchanged as in the PD control loop (Figure 15a), the motor signals ( )and ( )updated themselves as the number of The measured output knee angle θ O−mea (t) wasplotted (in blue) and compared with the desired knee angle θ d−mea (t) (in magenta), as shown in Figure 16a. For the first few iterations, the phase of measured output knee angle θ O−mea (t) lagged behind the desired knee angle θ d−mea (t), where the amplitude was lower and the profile was distorted due to Bowden cable friction. As the soft exoskeleton repeated the sinusoidal track following for more repetitions, the output knee angle θ O−mea (t) approached the desired knee angle θ d−mea (t) more and more closely. Figure 16b presents the time history of the measured motor control signal u mea (t) (in green) and motor direction signal d mea (t) (in orange). Instead of staying roughly unchanged as in the PD control loop (Figure 15a), the motor signals u mea (t) and d mea (t) updated themselves as the number of repetitions increased, with the help of learning. The update of the motor signal led to the accurate tracking of the desired knee angle θ d−mea (t) as shown in Figure 16a.

Analysis of the Output Response
A detailed analysis of the experimental tracking performance is presented Figure 17. The convergence history of the measured output knee angle θ O−mea,j (t) is depicted in Figure 17a, where all iterations (j = #00 to #52) are plotted together in one period (for t = 0 s to 4.6 s ) and compared with the desired knee angle θ d−mea (t) in magenta. To demonstrate the process of convergence, the plot color of the measured output knee angle θ O−mea,j (t) evolves from light blue (for the initial iterations) to dark blue (for the final iterations). As can be seen from Figure 17a, the phase lag and amplitude distortion caused by the Bowden cable friction and gear-reducer backlash are both decreased as more and more iterations were learnt. The tracking performance for the final iterations (#50 to #52) is further illustrated as an X-Y plot in Figure 17b, where the desired knee angle − ( ) is plotted along the X-axis and the measured output knee angle − , ( ) is plotted along the Y-axis. For the ideal and perfect tracking, the X-Y plot is a straight line with a slope of 45 deg from the origin (dotted line in magenta). As seen from Figure 17b, the actual measured X-Y plot stayed mostly close to the ideal line for the final iterations. However, the RMS tracking performance of the knee flexion cycle (~0.916 deg) was a little better than that of the knee extension cycle (~1.734 deg).In particular, at the beginning of the knee extension cycle, the output knee angle − , ( ) lagged behind the desired knee angle − , ( ) at first and then quickly moved ahead until it tracked closely again. One possible cause is the gravitation disturbance, which over-assists the motion of knee extension when the motor torque surpasses the maximum static friction in the Bowden transmission cable. Another factor leading to this result is the bending angle difference of the flexion and extension cables that produce different Bowden cable friction for the flexion and extension cycles. Furthermore, asymmetric frictional and viscous resistances The tracking performance for the final iterations (#50 to #52) is further illustrated as an X-Y plot in Figure 17b, where the desired knee angle θ d−mea (t) is plotted along the X-axis and the measured output knee angle θ O−mea,j (t) is plotted along the Y-axis. For the ideal and perfect tracking, the X-Y plot is a straight line with a slope of 45 deg from the origin (dotted line in magenta). As seen from Figure 17b, the actual measured X-Y plot stayed mostly close to the ideal line for the final iterations. However, the RMS tracking performance of the knee flexion cycle (~0.916 deg) was a little better than that of the knee extension cycle (~1.734 deg).In particular, at the beginning of the knee extension cycle, the output knee angle θ O−mea,j (t) lagged behind the desired knee angle θ d−mea,j (t) at first and then quickly moved ahead until it tracked closely again. One possible cause is the gravitation disturbance, which over-assists the motion of knee extension when the motor torque surpasses the maximum static friction in the Bowden transmission cable. Another factor leading to this result is the bending angle difference of the flexion and extension cables that produce different Bowden cable friction for the flexion and extension cycles. Furthermore, asymmetric frictional and viscous resistances inside the gear reducer during the clockwise and counter-clockwise rotations might also contribute to this phenomenon. Despite these observed imperfections, the overall frictional hysteresis of the Bowden transmission cable was significantly reduced after learning, as compared with Figure 15b with only the inner-loopPD control.

Mechanism of the Learning Compensation
The essence of learning is the iterative update of the reference input knee angle signal θ L−mea (t) for the inner PD control loop. When there was no learning, the reference input signal θ L−mea (t) maintained the same as the desired knee angle command θ d−mea (t) for all repetitions. When learning was implemented, the reference input knee angle signal θ L−mea (t) changed from repetition to repetition, based on the tracking error e L−mea (t) and reference input knee angle θ L−mea (t) of the previous repetition j − 1.The design of the learning-based repetitive controller lends itself toward the the optimal tracking of the desired knee angle θ d−mea (t), including the speed of convergence, the learning transients, and the final error levels. Moreover, the complexity of the learning control algorithm and the computational time involved are of equal importance for practical implementations in real time. In this article, a basic, yet effective P-type iterative learning law with a phase-lead compensator was proposed to address the issue of frictional hysteresis of the Bowden transmission cables. The computation time of the proposed learning algorithm took around 0.010 s, which allows for 0.015 s of the 12-bit A/D sampling and other activities of the ATMEGA32U4 microprocessor. The detailed learning mechanism is illustrated in Figure 18. The updated reference input knee angle signal − , ( ) at iteration = 52 is plotted in red, as Figure 18a shows, where the learning gain = 0.25 and the phase-lead level = 10. The phase-lead compensator is of particular importance for the stability of learning and final tracking performance. It helps compensate for the nonlinear hysteresis delay and allows the outer loop to learn at higher frequencies fora more aggressive learning profile of − ,52 ( ). It can be seen that − ,52 ( ) was quite different from the desired knee angle signal − ( ) at iteration #52. The learnt reference knee angle − ,52 ( )wasgreater than the desired knee angle − ( ) during The updated reference input knee angle signal θ L−mea,j (t) at iteration j = 52 is plotted in red, as Figure 18a shows, where the learning gain ϕ = 0.25 and the phase-lead level γ = 10. The phase-lead compensator is of particular importance for the stability of learning and final tracking performance. It helps compensate for the nonlinear hysteresis delay and allows the outer loop to learn at higher frequencies fora more aggressive learning profile of θ L−mea,52 (t). It can be seen that θ L−mea,52 (t) was quite different from the desired knee angle signal θ d−mea (t) at iteration #52. The learnt reference knee angle θ L−mea,52 (t) was greater than the desired knee angle θ d−mea (t) during the knee flexion cycle, and θ L−mea,52 (t) was smaller than θ d−mea (t) during the knee extension cycle. The discrepancy between θ L−mea,52 (t) and θ d−mea (t) led to the learnt compensation for the inner PD control loop, which helped correct the output knee angle θ O−mea,52 (t) of the soft exoskeleton for accurate tracking. Here, the step transition of the learnt reference knee angle θ L−mea,52 (t) is very crucial for dealing with the hysteresis delay caused by the Bowden cable friction and gear-reducer backlash.
With the step transition in the reference knee angle signal θ L−mea,52 (t), the associated motor control signal u mea,52 (t) generateda sharp response when its direction of rotation d mea,52 (t) switched from knee flexion to knee extension, as illustrated in Figure 18b.Unlike the inner-loop PD control alone, where the motor signal changes gently (Figure 15a), the sharp response of motor control signal (after learning) raises/lowers the motor voltage very quickly when needed. As a result, the Bowden cable friction could be immediately surpassed by the output motor torque to minimize any unnecessary hysteresis delays.

Evaluation of the Tracking Error
To quantitatively evaluate the tracking performance of the proposed learning controller, the tracking error e L−mea (t) was obtained based on the difference between the desired knee angle θ d−mea (t) and the measured output knee angle θ O−mea (t), as shown in Figure 19. immediately surpassed by the output motor torque to minimize any unnecessary hysteresis delays.

Evaluation of the Tracking Error
To quantitatively evaluate the tracking performance of the proposed learning controller, the tracking error − ( ) was obtained based on the difference between the desired knee angle − ( ) and the measured output knee angle − ( ), as shown in Figure 19. The overall history of the tracking error − ( ) in the time domain is plotted in Figure 19a. For initial iterations, the tracking error was relatively large, which had an amplitude of approximately 20 deg (pk-pk). When more iterations were learnt, the tracking error started decreasing, showing the stable convergence of learning. Additionally, for the final iterations, the tracking error roughly stayed within a range and mostly consisted of noise. Figure 19b further analyzes the tracking error − ( ) in the frequency domain. Two dominant peaks at frequencies 1 = 0.217 Hzand 2 = 0.653 Hzwerefound in the error spectrum − ,2 ( )(in light blue) for the initial iteration (#02). After learning, these two dominant frequency components were significantly attenuated, as seen from The overall history of the tracking error e L−mea (t) in the time domain is plotted in Figure 19a. For initial iterations, the tracking error was relatively large, which had an amplitude of approximately 20 deg (pk-pk). When more iterations were learnt, the tracking error started decreasing, showing the stable convergence of learning. Additionally, for the final iterations, the tracking error roughly stayed within a range and mostly consisted of noise. Figure 19b further analyzes the tracking error e L−mea (t) in the frequency domain. Two dominant peaks at frequencies f 1 = 0.217 Hz and f 2 = 0.653 Hz were found in the error spectrum E L−mea,2 ( f ) (in light blue) for the initial iteration (#02). After learning, these two dominant frequency components were significantly attenuated, as seen from the spectrum E L−mea,52 ( f ) (in dark blue) for the final iteration (#52). The percentages of reduction for these two dominant frequency components were 95.1% and 80.2%, respectively. The result of the error spectrum verifies the ability of the outer learning loop for reducing the tracking errors, particularly the low-frequency error components. As the bio-mechanical motion frequency of a human's lower limbs are mostly in the low-frequency range (below 6.21 Hz [49,50]), the high-frequency error components are normally of less importance for the operation of a soft exoskeleton.

Comparison of Different Control Methods
The tracking performances of different control approaches were compared using the RMS tracking error, as shown in Figure 20. The process of convergence for the RMS error in the iteration domain (i.e., with respect to the number of iterations) is presented in Figure 20a. It can be seen that the RMS error of the inner-loop PD controller alone maintained aconstant level around 15.5 deg. The RMS error using the PID+AW controller was reduced significantly to around 3.4 deg. However, the response of the angular displacement was rather choppy using PID+AW control as seen from Figure 15b, which is undesirable for the smooth and safe operation of the soft exoskeleton. Since there is no learning for the either the PD or PID+AW controller itself, the tracking performance did not improve as the number of repetitions increased. The RMS error of the PD+ILC method (ϕ = 0.25) decreased initially to 4.31 deg at iteration #16 but then diverged. Smaller learning gains were also tested and similar results/trends were obtained for the PD+ILC approach. As a result, the PD+ILC method is unstable and ineffective in controlling the soft exoskeleton due to the large phase delay caused by the friction of the Bowden transmission cables.  Figure 20a. It can be seen that the RMS error of the inner-loop PD controller alone maintained aconstant level around 15.5 deg. The RMS error using the PID+AW controller was reduced significantly to around 3.4 deg. However, the response of the angular displacement was rather choppy using PID+AW control as seen from Figure 15b, which is undesirable for the smooth and safe operation of the soft exoskeleton. Since there is no learning for the either the PD or PID+AW controller itself, the tracking performance did not improve as the number of repetitions increased. The RMS error of the PD+ILC method ( = 0.25) decreased initially to 4.31 deg at iteration #16 but then diverged.
Smaller learning gains were also tested and similar results/trends were obtained for the PD+ILC approach. As a result, the PD+ILC method is unstable and ineffective in controlling the soft exoskeleton due to the large phase delay caused by the friction of the Bowden transmission cables. In response to this issue, a phase-lead compensator with level is introduced. With the lead compensation, the learning-based repetitive control could adjust the reference input knee angle − ( )a few time steps ahead for the Bowden cable transmission system to catch up with the change of the desired knee angle signal − ( ). As Figure 20a shows, the control method using PD + ILC + Lead was stable for = 5, 10, 15. Here, the RMS tracking error was relatively higher for = 5 and almost simi- In response to this issue, a phase-lead compensator with level γ is introduced. With the lead compensation, the learning-based repetitive control could adjust the reference input knee angle θ L−mea (t) a few time steps ahead for the Bowden cable transmission system to catch up with the change of the desired knee angle signal θ d−mea (t). As Figure 20a shows, the control method using PD + ILC + Lead was stable for γ = 5, 10, 15. Here, the RMS tracking error was relatively higher for γ = 5 and almost similar for γ = 10 and 15. The speed of convergence increased with the value of γ, which is consistent with the simulation results in Figure 11b. Figure 20b further compares these different control methods at three different iteration numbers to evaluate the transient performance of learning. At iteration #08, the RMS tracking errors of PD + ILC + Lead control (with γ = 0, 5, 10, 15) all converged, where the lowest was4.21 deg for γ = 15. At iteration #26, the RMS errors further decreased, and the learning control with γ = 15 still produced the lowest RMS error of 1.58 deg. At iteration #44, the RMS error of PD + ILC control (i.e.,γ = 0) diverged to 8.02 deg, and the learning with γ = 10 waslowest in RMS error at 1.37 deg.
Higher γ values were also tested, but the motor signal became noisier and less stable as predicted by the simulation results in Figure 11b, which is not beneficial to the safe and smooth operation of the exoskeleton. As a whole, the PD + ILC + Lead with γ = 10 offers the best performance in terms of speed of convergence and the final RMS tracking error level, as summarized in Table 2 below.

Conclusions
This article proposed a learning-based repetitive controller which could compensate for the nonlinear cable friction and gearbox backlash in an iterative manner. The presented control method does not rely on the accurate modeling of the friction and backlash characteristics of the Bowden transmission system as required by many of the existing methods. Instead, it applies iterative learning to adaptively update the reference trajectory based on the internal model principle (IMP), which minimizes the output hysteresis caused by cable friction and gearbox backlash. The direct application of the ILC to the PD feedback control loop, however, is unstable due to the considerable phase delay caused by friction and backlash. As a result, a digital phase-lead compensator was designed and integrated with the ILC for improved stability and tracking accuracy. With the proposed phase-lead iterative learning control (PLILC) design, the tracking performance of knee angle was greatly improved, where a reduction of 91.1% in RMS error was achieved, as compared with the conventional PD control. While the PID controller with anti-windage could also improve the tracking performance, the choppy response and intensive parameter tuning required makes it undesirable for the safe and smooth operation of soft exoskeletons. The proposed method is less sensitive to model uncertainties, and the RMS tracking error (~1.37 deg) is very close to other control methods which rely on the complex modeling of the Bowden cable system. Furthermore, the result is a significant advancement considering the limited power output of the actuator and finite quantization resolution of the microprocessor being used in this study. One limitation of this article is that the disturbance of human body is not considered in particular during the test, which will be considered in future research. Collaborations with the General Hospital of the Eastern Theater Command are also underway for the rehabilitation of orthopedic trauma, and additional work is needed for the proposed equipment to conform to the clinical requirements. Not with standing the limitation, the proposed learning-based repetitive control design offers promising options for the realization of lightweight and low-cost wearable exoskeletons with high tracking accuracies.

Data Availability Statement:
The data used to support the findings of this study are available from the corresponding author upon request.