Modeling and Design of ANFIS Dynamic Sliding Mode Controller for a Knee Orthosis of Hemiplegia

. The use of assistive devices to control the loss of strength and range of motion of hemiplegic patients is becoming common. It is dif ﬁ cult to develop a precise control approach for a knee orthosis system because of the unpredictability of the dynamics and the unwanted subject ’ s spasm, jerk, and vibration during gait assistance. In this study, an adaptive neuro-fuzzy inference system (ANFIS) control system based on a nonlinear disturbance observer (NDO) and dynamic sliding mode controller (DSMC) is presented to restore the natural gait of hemiplegic patients experiencing mobility disorder and strength loss as well as monitor patient-induced disturbances and parameter variations during semiactive assistance of both the stance and swing phases. The knee orthosis system ’ s nonlinear dynamic relations are ﬁ rst developed using the Euler – Lagrange formation. Using MATLAB/Simulink, the dynamic model and controller design for the knee orthosis system was created. The Lyapunov theory is then used to ensure the knee orthosis system is asymptotically stable in view of the proposed controller once the proposed control scheme has been designed. The proposed control scheme ’ s (ANFIS – NDO – DSMC) gait tracking performances are shown and contrasted with the conventional sliding mode controller (SMC). Furthermore, a comparative performance analysis for parametric uncertainties and disturbances is presented to look at the robustness of the proposed controller (ANFIS – NDO – DSMC). The coef ﬁ cient of determination ( R 2 ) and root mean square error (RMSE) between the reference knee angle and ANFIS – NDO – DSMC for stance phase are 1 and 0.000516 rad, respectively. For swing phase, R 2 and RMSE are 0.9999 and 0.003202 rad, respectively. For SMC, RMSE is 0.000643 and 0.003252 rad for stance and swing phases, respectively. Stance and swing phase R 2 is 0.9997 and 0.9994, respectively. As seen from simulation results, the proposed controller exhibited excellent gait tracking performance for the knee orthosis control with high robustness and very fast convergence to a steady state compared to SMC.


Introduction
The neuromuscular and musculoskeletal systems must work together for human mobility to occur naturally, and any accident, ailment, or disease will change how a person moves [1]. Pathologies that affect the neuromuscular and musculoskeletal systems have severe mobility implications [2]. Because of brain damage and a disruption in the link between the brain and the spinal cord, the most frequent cause of disability and other neuromuscular injuries is stroke [3]. A handicap that affects only one side of the body, known as hemiplegia, is brought on by the brain's motor nerve cells being impaired. Patients with hemiplegia experience walking problems and exhaustion as a result of reduced muscle strength and mobility impairment [4].
Stroke victims' stride reveals several common issues. The walking speed and the knee position were revealed to be critical features in a recent study employing cluster analysis to characterize the gait of stroke patients [5]. Three distinct gait patterns for stroke patients with sluggish gait were demonstrated by Kramers de Quervain et al. [6]. The extension thrust pattern, which involved hyperextension of the paretic limb's knee joint, was one of these patterns. Excessive knee flexion, on the other hand, is caused by muscle weakness in the mid-stance. A lack of knee flexion during the pre-swing period might potentially produce inefficiencies in the pushoff [4].
The use of assistive devices to control the loss of strength and range of motion is becoming common. Knee-ankle-foot orthoses are frequently employed to help hemiplegic patients correct their gait. Ackermann and Cozman [7] used a spring at the patient's knee joint to generate the necessary knee extension at the end of the swing phase. Energy stored in the spring was also used to create knee flexion at the start of the swing phase. Yamamoto et al. [8] proposed an ankle-foot orthosis that aids the heel rocker in maintaining the center of pressure at the heel during loading response and delaying the onset of plantar flexion. Doing this, the forward inclination of the shank was obtained, which in turn reduces the hyperextension of the knee joint in the late mid stance. Weinberg et al. [9] proposed using a knee orthosis to teach stroke patients how to reduce knee flexion during the swing and correct knee hypertension during stance. Knee flexion during stance was aided by offering knee-buckling impedance. In this case, electro-rheological fluid (ERF) is used. During the swing, knee flexion and extension are also managed to allow for toe clearance and heel strike preparation. Park et al. [10] used a cable-differential system to provide the necessary torques and speeds while reducing the swing leg's inertia. Given that the pulley controller suggested in the cited paper relies on the dynamic of the device, it may be impacted by the wearer's uncertainties and disturbances.
The effect of the orthosis on the knee joint during the swing phase was not considered by Ackermann and Cozman [7]. Also, a spring was used at the knee joint to create knee and hip flexion. The friction of the knee joint was not taken into account here, which could affect the spring's effectiveness. The spring-based orthosis is extremely sensitive to joint stiffness. The orthosis' kinematics can be affected as a result of this. In a few studies, ERFs were used to offer knee flexion at stance to prevent knee buckling, as well as knee control during a swing. The device's resistive torque is modulated using an ERF brake. The ERF brake, on the other hand, is powered by 3 kV. ERFs require 2-5 kV [11], which is inefficient in terms of electricity.
Various control methods were suggested in earlier researches. Delavari and Jokar [12] presented a nonlinear disturbance observer (NDO)-enhanced intelligent fractionalorder sliding mode controller (SMC). It is asserted that NDO is utilized to calculate the muscle torque inserted by the patient, improving the precision and performance of the device. It is suggested by Narayan and Dwivedy [13] to use a neural-fuzzy control method based on linear quadratic regulators. The nonlinear relations are linearized into a state-space form using the input-output feedback technique. The exact understanding of the system characteristics is needed for this strategy, though. Narayan and Dwivedy [14] proposed a lower extremity exoskeleton system for use with a neuro-fuzzy compensated proportional integral derivative (PID) control for passive gait therapy in youngsters aged [8][9][10][11]. According to the authors, the root mean square error (RMSE) of the suggested control strategy is determined to be 40% lower than the traditional PID while monitoring the intended gait trajectory. Hasan and Dhingra [15] proposed an SMC with a super-twisting algorithm. The authors stated that the SMC chattering phenomena can be reduced by using the super twisting method. This article suggests the ANFIS dynamic sliding mode controller (DSMC) as a more effective approach. By introducing more dynamics into the controller, it integrates the SMC's switching function. This can greatly reduce the chattering. Mefoued et al. [16] suggested a second-order SMC-based assistive actuated knee joint orthosis assist standing-up and sitting-down movement. It is possible to further modify this controller and utilize it to control the assistance of normal ground walking. A flexion and extension movement assisting orthosis for human shank-foot rehabilitation was proposed by Hassani et al. [17]. This paper proposed a bounded control torque to ensure that a chosen trajectory is tracked. The mentioned controller can't provide the required assistance whenever there are nonlinearities, parametric/unmodeled uncertainty, and unwanted disturbances in the system. In the study by El Zahraa Wehbi et al. [18], an active impedance control technique for muscle weakness assistance during the swing phase of walking activities was developed. The orthosis was designed to reduce the human effort when walking while maintaining the user's control precedence. Here assistance is provided in the swing phase only. Chen et al. [19] developed model-free adaptive RBF neural network control for gait rehabilitation of patients with strokes or spinal cord injuries. The proposed control was utilized for trajectory tracking. In the assistive controller architecture of Ma et al. [20], the gait pattern was predicted using FSM, and the states were computed using a fuzzy inference method. The reference gait pattern was computed online as an assistive control input to provide support torque to the patient/wearer. The neural network and fuzzy inference system are employed individually in the two publications mentioned above. By utilizing ANFIS, it is feasible to benefit from both.
The majority of prior studies focused on springs, pneumatic, and hydraulic actuators, which are heavyweight and have an impact on the orthosis's assisting process. In this article, a multipurpose actuator that integrates motor and magnetorheological (MR) fluids (MRFs) is adapted as a motor and brake. In assistive knee orthoses, there are nonlinearities and undesired disturbances. A dynamic SMC is designed in conjunction with an AI-based technique called ANFIS, which combines the benefits of neural networks with fuzzy inference systems. NDO and DSMC-based adaptive neuro-fuzzy inference system (ANFIS) tracking control for knee joint is developed. In unusual instances, such as a large patient jerk, spasm, and undesired disturbances, nonlinear controllers are required to maintain the patient's safety.
This article is presented under seven sections. Dynamic model for the knee orthosis is developed by using Euler-Lagrange formation in Section 2. In Section 3, the modeling of a multifunction actuator comprised of motor and MR brake is presented. Then, Section 4 presents the design of ANFIS-NDO-DSMC and its simulation on MATLAB. The effectiveness of the developed controller is confirmed in Section 5 through the analysis and presentation of simulation results and comparisons. Section 6 presents a discussion of the simulation results. The article is concluded in Section 7.

Modeling of a Knee Orthosis
By considering the thigh and shank segments of the human leg as depicted in Figure 1, the Euler-Lagrange technique is utilized to derive the nonlinear dynamic equation of motion for the coupled human orthosis system. In the stance phase, a double inverted pendulum (thigh, shank) is used to model the leg, while in the swing phase, a double pendulum is utilized to mimic the leg dynamics [21]. In the swing phase, the ankle joint is regarded passive but in the stance phase, it serves as a pivot point on the ground, as seen in Figures 2(a) and 2(b). Joint variables for the orthosis linkages 1 and 2 are θ t and θ s . The link lengths are l t and l s , the link mass is m t and m s , and the distance between the joint and the center of mass of the link 1 and 2 is r t and r s , as shown in Figures 2(a) and 2(b).
A double pendulum can be used to model a human leg in the swing phase of walking on level ground, as shown in Figure 2(a) [21]. A double inverted pendulum can be used to model a human leg in the stance phase of walking on level ground, as shown in Figure 2(b) [21].   Applied Bionics and Biomechanics 3 The Euler-Lagrange equations of motion are given as follows: The dynamic equation governing the nonlinear model of human/orthosis is given as follows: where θ is joint angle, M θ ð Þ is inertial matrix, C θ ð Þ is Coriolis-centrifugal matrix, G θ ð Þ is gravity effects matrix, and ζ is torque.
Considering knee and orthosis frictions, patient jerk/ spasm, and other modeling uncertainties the dynamic equation can be written as follows: Fθ where Fθ À Á is friction torque, B s is viscous friction parameter, A s is dynamic friction parameter, and ζ d is disturbance due to patient spasm, jerk, and unmodeled uncertainties.
The knee joint of the person under investigation [22] will be regulated because a considerable gait deviation was seen there. The dynamic equation to focus on in swing phase is as follows: where θ t is thigh angle and θ s is shank angle. The dynamic equation for stance phase is as follows: where m s ¼ m so þ m sh : combined mass of the orthosis segment and human shank. I s ¼ I so þ I sh : combined inertia of the orthosis segment and human shank. A s ¼ A so þ A sh : combined dynamic friction parameter of the orthosis segment and human shank. B s ¼ B so þ B sh : combined static friction parameter of the orthosis segment and human shank. ζ s ¼ ζ so þ ζ sh : the torques generated by the orthosis actuator and the human muscles.
In the equations of motion, the length and mass requirements of the wearer's limbs are constant and must be determined separately for each wearer. A man with a weight of 80 kg and a height of 1.75 m was considered in this study. Winter's synthesis of classic anthropometry literature [23] was used to determine the mass of the thigh segment, the shank segment, the length of each segment, the moment of inertia, and the center of mass of each one. These numerical values are used to model dynamic equations of the orthosis using MATLAB/Simulink. From the passive pendulum experiment by Ferrarin and Pedotti [24], viscous friction of the shank is identified. The required wearer's anthropometric data can be determined based on each wearer's height (H) and body mass (M). The clinical gait cycle data for this study comes from Nadeau et al. [22] and includes both normal and hemiplegic patients (i.e., patient A). The kinematic profiles of the hemiplegic patient's knee joint are similar to those of healthy people, although the amplitude of peak values is smaller [22]. The hip joint profile of the subject under consideration is slightly different from the normal one. Whereas for knee joint, significant deviation is observed in the gait profile. So knee joint is the main focus. The hamstring group of muscles provides significantly higher torque during the loading response phase of the normal gait cycle than hemiplegic gait cycle to sufficiently flex the knee joint. This is brought on by a lack of muscle strength. Maximum torque is reached in the mid-swing phase of a typical knee. In addition to its delay, the hemiplegic knee provides much smaller torque. Mid-stance is when the knee joint maintains the body's stability. The hemiplegic knee hyperextends during this phase because the muscles are unable to deliver sufficient weight-bearing torque/ moment. Aberrant limb instability (knee buckling or hyperextension) in the stance phase and insufficient limb advancement (restricted knee flexion) in the swing phase are the two prevalent pathologies that need to be corrected [22].

Modeling of Actuators
Normal knee muscles provides two types of torques [25]. These are driving and passive torques. To restore the natural gait of hemiplegic patient, an actuator that can provide both driving and passive torques is required. A multifunctional actuator comprises of DC motor and MRF [26] is used to assist a disabled person in swing and stance phases as shown in Figure 1. By resisting hyperextension, a MRF-based actuator is employed to enable knee flexion during stance. Additionally, patients can successfully achieve the necessary knee flexion for toe-off and enough knee flexion to prepare for a heel strike with the use of a knee orthosis when they are in the swing phase of their gait. Figure 3, is employed to regulate the knee position throughout the gait cycle. According to Spong and Vidyasagar [27], the following mathematical equation can be used to describe the electromagnetic dynamics of a permanent magnet DC motor:

Modeling of PMDC Motor. DC motor, shown in
where V m is motor supply voltage, R m is the resistance, i a is the current, L m is the inductance, E m is the back-EMF, K b is EMF constant, andθ is the angular velocity.

Applied Bionics and Biomechanics
The electromagnetic torque is proportional to the current flowing through the armature winding and is caused by it. This can be expressed mathematically as follows: where ζ m is the motor torque, J m is the moment of inertia, ζ L is the load torque including the external load, B m is the viscous damping coefficient, and K m is torque constant.

Modeling of MR
Brake. An MRF is a smart fluid whose properties (such as viscosity) can be altered using an electric or magnetic field. A fluid's apparent viscosity rises sharply in the presence of a magnetic field, eventually turning it into a viscoelastic solid. Microscale ferromagnetic particles suspended in a carrier oil make up the MRF. These particles create iron powder clusters when a magnetic field is applied, solidifying the MRF between the active magnetic poles.
In the adapted actuator, fixed discs are configured to the outer cylinder (thigh segment), and rotatable discs are coupled to the motor shaft. The MRF fills the spaces between the discs mentioned above. Clusters of iron powder are formed when ferromagnetic particles drifting in the MRF are exposed to an electric current that travels through the coil to produce the magnetic field. The stationary and rotational discs compel the clusters to shear. This resistance generates the braking torque.
The brake torque can be estimated using the following formula [28]: where A is the overlapping area, ζ mr is the yield shear stress of MRFs, and r is the radius of the brake. The Bingham plastic model [28], whose shear stress ζ mr describes the features of the MRFs, can be used to characterize these properties.
where ζ y is the yield stress of the MRF-132DG; μ is plastic viscosity of MRF when in off; andγ is the change of shear, which can be given as follows:γ where ω is the angular velocity and g mr is the gap that separates input and output discs.
The following formula can be used to calculate the brake's torque [26]: The brake's torque can be modified as follows if the rotational velocity is slow and the torque from the fluid's viscosity is nearly zero: The magnetic flux density B in the MRF is constrained by the MR brake discs and the current density of the MR coil. Therefore, the relationship between ζ y and B is approximated by a linear function, such as follows: where μ mr is MRF permeability, k is MRF characteristic coefficient, and H is magnetic flux intensity in MRF. Then, To understand the effect of magnetic and non-magnetic materials, as well as assess the magnetic flux density and flux path of the magnetic field, a finite element analysis (FEA) of the MR brake is performed using ANSYS software by Chen and Liao [26] is adapted. The coefficient of determination (R 2 ) given in Equation (18) [29] is used to depict the relationship between the experimental data and its fit.
where θ i is knee angle position of the orthosis, θ di is reference knee trajectory, θ di is the mean of the reference trajectory, and m is the sample of data. In the study by Lord Corporation Material Division [30], the experimental relationship between the flux density and the field intensity for MRF-132DG is reported. As the maximum field in MRF is less or equal to 0.539954 T [26], with an appropriate coefficient of determination (R 2 ) of 0.9998, the relationship between field density and field intensity may be fitted to map a second-order polynomial over the experimental data as follows: For MRF-132DG, the variation of yield stress as a function of flux intensity was achieved experimentally and is published in the manufacturer's specifications [30]. The fluctuation in yield stress vs. the applied field intensity was then quantitatively described by fitting a linear equation to the experimental data. The resulting linear equation for the yield stress of this particular MRF, which can be represented as follows: which gives a coefficient of determination (R 2 ) of 0.9963. Equation (17) shows the torque equation that is used to calculate torque. The magnitude of the magnetic field directly affects how much torque an MR brake produces. As the number of MR brake discs increases, the developed braking torque will grow as well. The MR brake can generate 26 Nm of braking torque at 1.5 A, which is enough to assist a hemiplegic patient during normal walking.

ANFIS-NDO-DSM Controller
SMC is among the most effective nonlinear resilient control techniques [31]. The SMC is resistant in the face of system perturbation and external disturbance under specific conditions [32]. This control technique, on the other hand, has several problems associated with substantial control chattering, which can wear coupled systems and generate unwanted high-frequency dynamics. The chattering phenomenon will worsen if the top bound of the uncertainty is overestimated, which is undesirable. Yet underestimating this bound can cause the system's performance to suffer as the tracking error rises. Numerous techniques have been used in prior studies to reduce chattering. Koshkouei et al. [33] suggests using a DSMC to get the control law by integrating a function that includes the switching control term. The chattering is significantly reduced by this integration. In this work, ANFIS and DSMC are used together to address the parametric variation, disturbances caused by patient spasms, jerks, ground response effects, and unmodeled uncertainty that are situated to the system adaptively. An observer for NDO is first designed because the knee orthotic system has patient-induced disturbances and uncertainty. Then composite controller containing NDO and DSMC is designed. Finally, the design of an adaptive neuro-fuzzy controller based on dynamic SM is developed. The control method used in this study is based on supporting hemiplegic orthosis users in normal groundlevel walking. By comparing the output trajectory tracking results, the controller's performance is checked and assessed.
4.1. Design of NDO. The proposed system is extremely nonlinear, with disturbances caused by patient spasms, jerks, ground response effects, and unmodeled uncertainty. In practice, these uncertainties and disturbances are not detectable. As a result, it must be estimated in order to obtain reliable system performance. For a dynamic system given as in Equation (3), The following basic disturbance observer structure has been proposed by Chen et al. [34] as follows: where c ζ d is estimated disturbance and l is observer gain. Defining the observer error as follows: Assuming that initially, the derivative of the disturbance is zero (i.e.,ζ d ¼ 0) [34], from Equations (3) and (22), the error dynamics of the observer is given as follows: By choosing l >0, the observer can be proven to be globally asymptotically stable.
However, the problem with observer in Equation (21) is that it is not possible to measure acceleration of the orthosis. Therefore, to modify the observer dynamics, Chen et al. [34] defined auxiliary variable as follows: where p is internal state of the observer and can be calculated from the changed observer gain l: Therefore, the modified observer is independent of the acceleration term M θ ð Þθ and it is given as follows: 4.2. Controller Design and Stability Analysis. The design of DSMC integrated with NDO and ANFIS is presented in this section. The block diagram of the proposed ANFIS-NDO-DSMC is shown in Figure 4. From Figure 4, the control signal is the sum of u eq , u sw , and u anfis . With no disruptions or uncertainties, u eq is utilized to obtain desired performance under a nominal model. The same control effort, however, cannot guarantee the successful control performance in the situation of unpredictable disturbances or uncertainty. In order to prevent the impact of the unpredictable disturbance, supplementary control effort (u sw ) must be designed. u anf is is used to address the parametric variations in the system by providing adaptive switching control. The NDO is applied in stance phase only as spasms, jerks, and vibrations are observed in this phase.

Applied Bionics and Biomechanics
From Equation (3), the dynamic equation of the system can be written as follows: The NDO designed in Section 4.1 is applied in the stance phase of the gait cycle since patient spasms and jerks are occurred in this phase. Thus, to integrate the NDO and dynamic SM controller, the disturbance ζ d is replaced by its estimate c ζ d . The purpose of the control is to develop a control law that allows the position of knee joint θ s to track normal knee trajectory θ ds . As shown in Figure 4, the armature voltage of the motor (V m ) and MR voltage (V mr ) are used as a control input (u) for controlling the orthosis. The tracking error is defined as follows in this regard: The introduction of a good sliding surface is an essential step in the design of an SMC, as it allows the reduction of tracking errors and output variations to a tolerable value. A PID-type sliding surface is defined as follows: where c 1 , c 2 , and c 3 are positive constants, e andė are error and its rate, respectively. The derivative of first sliding surface with respect to time is as follows: whereë ¼θ ds −θ s . It can be seen that if s m st ¼ṡ m st ¼ 0, then lim t→1 e ¼ 0 when the controller gain c 1 , c 2 , and c 3 are appropriately chosen. Therefore, the characteristic polynomial in the right side of equation Hurwitz. It means that the control system is globally asymptotically stable. Let δ be the new dynamic sliding surface given by the following: where λ 1 and λ 2 are positive constants. If the value of δ ¼ 0, then the systemṡ þ λ 1 s þ λ 2 R t 0 s is asymptotically stable hence lim t→1 e ¼ 0, which implies that the controller can be designed based on δ: The derivative of the dynamic sliding surface with respect to time is as follows: The control effort is calculated using theδ ¼ 0 solution. This control effort which contain equivalent (u eq ) and switching control (u sw ) is denoted asu.
Assuming that 9 l; m; β 2 R þ are constant numbers and always meet the following expression: Therefore, the control law that makes the dynamic sliding surface converges to zero is designed as follows:

Applied Bionics and Biomechanics
To confirm the stability of the control system, the Lyapunov stability theory is applied. The error should asymptotically disappear because the dynamic sliding surface should be stable.
The Lyapunov stability function is selected as follows: The following is a sufficient condition that ensures that the tracking error will translate from reaching to sliding phase:V The derivative of the dynamic sliding surface can be rewritten as follows by substitutingu into it.
Then, the derivative ofV calculated from Equations (38) and (39) is as follows: It is clear from Equation (34) that, where β is a positive constant, and it denotes reaching control gain with an upper bound of uncertainty. k is a positive constant and used to force the state to reach the sliding surface faster. Equation (41) shows that the designed controller is stable according to the Lyapunov stability theorem.

ANFIS Design for the Knee Orthosis.
ANFIS is a popular artificial intelligence that takes advantage of fuzzy logic (FL) and neural networks. We can obtain good reasoning in both quality and quantity if we combine these two intelligent approaches. We have fuzzy reasoning and network calculations, in other words. It is commonly utilized in a variety of domains for complex and nonlinear systems. Jang [35] developed the ANFIS design, which is shown in Figure 5, with a fixed node in the circle and an adaptable node in the square. It generates a Tagaki-Sugeno type Fuzzy Inference System using the NN learning algorithm, which uses a number of linear systems to approximate a nonlinear system [35]. The Sugeno fuzzy model is the most applicable fuzzy system model because of its excellent computing efficiency and interpretability, as well as integrated optimization and adaptive strategies. ANFIS is composed of five layers and has a multi-input single-output structure. Figure 5 depicts the typical structure of the ANFIS controller under consideration. ANFIS structure consisting of two inputs (i.e., x and y) and one input is considered. The first layer and the fourth layer of this ANFIS architecture are the two adaptive layers. Three variables that can be changed in the first layer a i ; b i ; and c i are connected to the input membership functions. These variables make up the "premise parameters." Three additional adjustable parameters for the first order polynomial, p i ; q i , and r i , are present in the fourth layer. They are referred to as the consequent parameters. The learning method of ANFIS changes all the variables, namely a i ; f b i ; c i g and p i ; f q i ; r i g so that the output and training data are correlated. The output of the ANFIS model shown in Figure 5 can be expressed as follows: The ANFIS is different from typical FL systems in that both the premise and the ensuing parameters are customizable. The ANFIS' hybrid learning algorithm is its most outstanding feature. This learning algorithm contains two steps (i.e., a forward pass and a backward pass) in the process of adapting the ANFIS's parameters. Since the ANFIS produces a linear combination of the subsequent parameters as its output, the forward pass of the consequent parameters training is carried out using the least squares technique. The parameters of the premise are now established. After the subsequent parameters have been changed, the learning error is back-propagated across each layer so as to update the premise parameters as the following step.
In this work, NDO and DSMC are integrated to generate datasets used for ANFIS to control parameter variation in the system. The ANFIS control approach is employed to enhance the normal knee trajectory tracking performance of 8 Applied Bionics and Biomechanics knee orthosis system by addressing the parametric variation in the system. MATLAB R2021a neuro-fuzzy designer GUI is used to develop the ANFIS controller. NDO-DSMC and DSMC strategies for stance and swing phase, respectively, are used to create a training dataset with two inputs and one output. The two inputs utilized to create the neuro-fuzzy controller are the sliding surface (s) and the derivative of the sliding surface (ds). The output/target of the ANFIS controller is the switching control of the NDO-DSMC and DSMC. By evaluating the switching control of NDO-DSMC and DSMC for variation of coupled mass of the human-orthosis system, the training dataset is retrieved. The nominal mass values are raised by up to 20% to account for the parametric variation/ uncertainties [36]. For data generation, switching control is retrieved for different parameter variations varying from 0% to 20% with a step size of 20% parameter variation [37]. Total 2,004 number of datasets of sliding surface (s), its derivative (ds), and switching control (u sw ) as in Equation (43) where u sw is the switching control and used to control unexpected disturbances or uncertainties. ANFIS training result using different membership functions is presented in Table 1. From Table 1, it can be seen that trimf and gaussmf, respectively, give the lowest training error (bolded values) throughout the stance and swing phases. As a result, the ANFIS network for NDO-DSMC in stance phase : ANFIS configuration [35].
Applied Bionics and Biomechanics and DSMC in swing phase is designed using the membership functions that were previously discussed. For parameter fluctuations in the orthotic system, the ANFIS model offers adaptive switching control (u anf is ). The ANFIS structures are created and trained after numerous simulation runs with different MF and epoch numbers have been performed. Then, the ANFIS architecture is inputted to the coupled human-orthosis system by adding up with the NDO-DSMC.

Results
To control the joint's position, ANFIS-NDO-DSM controller is built in MATLAB/Simulink R2021a. Two types of clinical gait cycle data were presented by Nadeau et al. [22]. The first one is the normal knee trajectory taken from healthy person. The second is hemiplegic gait cycle taken from stroke victims. So, in this article, the gait cycle from healthy person is taken as a reference gait cycle. The hemiplegic/stroke patient is enabled to follow trajectory collected from healthy person. A normal knee joint trajectory taken from Nadeau et al. [22] is utilized as a reference, and the tracking accuracy of the reference trajectory is used to evaluate how well the control system is working. The coefficient of determination (R 2 ) is also used to quantify the tracking performance of the proposed controller. The proposed control strategy's gait tracking effectiveness is compared with that of the conventional SMC. Then, using patient-induced disruptions and parameter changes, the controller's performance is evaluated. The controller parameters selected for the proposed controller are given in Table 2. Figures 6 and 7 show the simulation results of reference knee tracking and tracking error of SMC and proposed controller for stance and swing phase, respectively. Table 3 shows the performance comparison of these two controllers. The sliding surfaces of SMC have chattering and oscillations and it takes 0.0286 s to converge to zero. In contrast, the suggested controller has no chattering or oscillation and quickly converges to zero. The maximum voltage provided by the proposed controller to drive the motor in stance and swing phase is 44 and 14.5 v, respectively. The MR voltage for stance and swing phase are 12 and 5 v. Motor control voltage of SMC for stance and swing phase is 59.76 and 32.14 v, respectively. MR, however, uses 17.8 and 8.8 v. In these figures, it is observed that high amplitude chattering is there for SMC. In the proposed controller, there is no chattering and oscillation. Therefore, it is reasonable to conclude that the proposed controller has significantly superior performance for knee angle orthosis control with a fast convergence to a steady state.
Patient muscle-induced vibration, patient jerk, and spasm are the three uncertain disturbances considered in this study. The considered disturbances and the performance of NDO are shown in Figure 8. It can be seen that the estimated disturbance asymptotically tracked the considered disturbance. 20% increment of the shank (1.476 kg) and thigh (1.6 kg) segment is considered as a parameter variation. According to Figures 9 and 10, the trajectory tracking performance of ANFIS-NDO-DSMC with and without parameter variation is almost the same. For stance phase SMC, the rising time increased to 0.05. The rising and settling times increased to 0.045 and 0.18, respectively, for swing phase SMC. The control effort of SMC increased to 68.86 and 35.95 v for motor functions of both phases. The MR control effort of SMC is 22.66 and 10.8 v for both phases. The chattering of the control voltage is significantly increased with the application of disturbance and parameter variation for SMC. While the proposed controller rejects the applied disturbance as an NDO is applied to it, it is insensitive to parameter variation. Its tracking performance is unaltered by the disturbance and parameter variation. The amplitude of the control input of SMC with disturbance and parameter variation is much larger when compared to the proposed controller effort. For the proposed controller, the control effort is increased to 45.24 and 16.68 v for the motor function of both phases. Increased to 13.54 and 6.99 v for MR function of both phases. The tracking performance indices of the two controllers are presented in Table 4. The performance indices shown in Table 4 depict that a much smaller error is obtained by ANFIS-NDO-DSMC than SMC. Therefore, the proposed ANFIS-NDO-DSMC exhibited excellent tracking performance for the knee orthosis control with a high robustness compared to SMC. Figure 11 shows the performance of the proposed controller over multiple gait cycles (i.e., four gait cycles). The transition between stance and swing phase is perfectly regulated by the proposed controller. In contrast, the trajectory tracking response for SMC is distorted for a significant amount of time.
The performance of the proposed controller (ANFIS-NDO-DSMC) is validated by comparing its normal knee joint trajectory tracking response with previously published works. Maximum error (ME) and RMSE between the actual and desired trajectory are used to compare the performances of the systems. As it can be seen clearly in Table 5, the tracking error of the proposed controller is significantly smaller than the considered previous studies. Figure 12 shows the trajectory tracking error of the proposed controller and previous studies. The performance of the proposed controller is superior to previous studies for knee angle orthosis tracking control.

Discussion
ANFIS-NDO-DSMC is employed in this study. By integrating a function that contains the switching control term, the control law is derived. The chattering phenomenon observed in classical SMC is significantly reduced by this integration. Additional dynamics are added by using dynamic SM control. The added dynamics are intended to increase system stability, resulting in the desired system behavior and performance. Dynamic SM control improves precision while also reducing or eliminating chattering brought on by the control's high-frequency switching. The ANFIS control approach is utilized to improve the typical knee trajectory tracking performance for parametric fluctuations in the orthotic system. The coefficient of determination (R 2 ) between the reference knee angle and actual knee angle trajectory provided by the proposed controller (ANFIS-NDO-DSMC) is one (1). This implied the knee orthosis control system perfectly tracked the reference/normal human knee angle. Both motor and MR brake are used to assist the hemiplegic patient knee. Driving and passive torque are required to assist the patient for the entire gait cycle. Thus, switching function is designed to switch between motor and MR functions for both stance and swing phases.
The pathologies observed in the hemiplegic patient considered are corrected, as discussed below. The limited knee flexion that leads to hyperextension at the mid and terminal stance, at initial contact, and loading response is correct by the driving torque provide by the motor. This decreases the tendency toward hyperextension in mid and terminal stance. The −7°hyperextension in mid-stance that is caused by weakness of quadriceps and hamstring muscles is corrected by passive/resistive torque provided by the MR brake. In mid terminal stance momentary braking torque is provided by the MR brake to get the limb ready for the next flexion. The limited knee flexion in late terminal stance phase, which impede the limb from being ready for the swing phase, is corrected by motor-provided torque. Despite the required 37°flexion during the pre-swing phase, the hemiplegic knee is able to provide only 24°. Driving torque is provided to produce sufficient toe-off/foot clearance. After the required flexion is achieved, MR brake is applied at the end of stance and keeps providing resistive torque till the initial swing is started. The limb continues to flex by the driving torque provided by the motor in the initial swing. The limb extends in terminal swing by the driving torque, and just before heel strike, braking torque is applied momentarily. Finally, driving torque is applied to extend the limb to its fully extended position.

Conclusions
This article's objective is to develop a dynamic model and design ANFIS-DSMC for knee orthosis of hemiplegia. The mathematical models of the knee orthosis for both stance and swing phases have been developed. A multifunctional actuator which comprises of motor and MR brake, was adapted and modeled. ANSYS is used to model MR brake   by FEA. Then NDO-DSMC for stance phase and DSMC for swing phase is designed. MATLAB/Simulink model of the developed control strategy is then designed. After the parameters of control system (DSMC) were selected, various simulation runs were done to test the performance of the control system. Then, datasets to train ANFIS are generated from the tuned controller to improve its performance when there are parameter uncertainties. The performance of the proposed controller (ANFIS-NDO-DSMC) is compared with conventional SMC. Finally, RMSE, R 2 , and performance indices are used to quantify the trajectory-tracking performance of the two control strategies.
In the stance phase, the reference knee angle and ANFIS-NDO-DSMC have a coefficient of determination (R 2 ) and RMSE of 1 and 0.000516, respectively. R 2 and RMSE are, respectively, 0.9999 and 0.003202 for the swing phase. For the stance and swing stages of SMC, the RMSE values are 0.000643 and 0.003252, respectively. R 2 is 0.9997 and 0.9994 for the stance and swing phases, respectively. As can be observed from these simulation results, the suggested controller greatly outperforms the reference knee angle tracking performance with quick convergence to a steady state and resilience.
The control system created for this study is robust and reaches steady state fairly quickly. By using various walking  speeds, the effectiveness of the suggested controller can be further verified. Another suggestion is to enable real-time implementation of the system. To demonstrate the validity of the suggested control system, it would be preferable to compare the simulation findings with actual experimental results. In this study, Semi-active assistance is provided by the knee orthosis system. The future work of this article is the application of active assistance of the knee orthosis for hemiplegic patients. This includes identifying the intent of the patient and varying walking speed. The other future work for this research is to use various optimization techniques to optimize the control system parameters so that it    Applied Bionics and Biomechanics can achieve the controller's intended goal with the least amount of control effort.

Data Availability
The original contributions presented in the study are included in the article; further inquiries can be directed to the corresponding author.

Ethical Approval
This article does not contain any studies with human or animal subjects performed by any of the authors.

Conflicts of Interest
The authors declare that they have no conflicts of interest.