Design of integral backstepping controller - sliding mode along with admittance controller of knee joint robot in the presence of noise

: Nowadays, the using of robots in the field of rehabilitation has been increased, vehemently. Rehabilitation robots are designed to assist people who have physical disabilities. Patients often have the substantial limitation in movement. The knee joint as the largest blockage in the human body is always vulnerable to injury, some knee joint rehabilitation treatments are provided by physiotherapists by practicing the patient's leg around the knee joint to strengthen the knee-strengthened muscles to the patient gets his health. Most exercises that physiotherapists do is either manual or traditional way. Therefore, researchers are interested in designing a device to help these exercises. In this regard, devices were designed and built, such as Continuous Passive Motion (CPM). The main problems of CPM devices are lack of knowledge (feedback) from the position of the patient's leg and its resistance against the robot motion. Therefore, interactive forces between patient leg and robot will be increased if the patient's leg is unable to track the predetermined trajectory. This phenomenon can hurt the patient. In this thesis, in order to realize the flexible behavior of the robot against the potential force of the individual foot, the concept of admittance as well as impedance are used. At first, the dynamic equations of the robot and the patient leg were extracted and verified using Adams dynamic analytic software. Then, the design of nonlinear controllers is done. In this research, a variety of control methods including a combination of Sliding-Backstepping and Admittance Control, in order to control the knee rehabilitation robot and at the same time creating a soft interactive patient with the patient leg are developed.


1.Introduction
Outerwear robots have wide applications, including physiotherapy and rehabilitation, military, load carrying applications.In recent years, the use of robots in medical applications, especially rehabilitation, has increased [1].Rehabilitation and training of people with disabilities and other motor disabilities has become a social problem that needs to be solved, although manual therapy, which mainly relies on the experience of the therapist, makes rehabilitation work difficult in long-term treatments and training with high repetitions.[2].The treatment methods of some physiotherapists are completely subjective and have not been evaluated, so the effects of the treatment cannot be guaranteed.In this situation, there is a significant need for advanced rehabilitation devices that respond to patients' expectations to help train the exercises scientifically and qualitatively [3].In the past decade, the branch of robotics has become a research field that has received more attention than before.Using a rehabilitation robot can not only relieve doctors from the heavy burden of training, but it can also be useful in evaluating the improvement of patients by analyzing the data recorded in the training process.Due to its advantages in terms of accuracy and reliability, rehabilitation robots are able to provide two useful methods to improve outcomes after stroke or surgery [4].Currently, the amount of use of robots, whether industrial or service, in a country is directly related to the level of development and progress of that country in various fields.At the end of 2007, about 1 million industrial robots and 5.5 million service robots were working around the world.The economic crisis in 2009 caused a decrease in the sale and use of industrial and service robots, in 2011 the robot market flourished again and the sale of robots increased.This widespread use will eventually lead to more and better quality production, easier and faster life and significant progress.Therefore, there is a tendency to use robots more widely in different areas of the world.Due to the fact that robotics is one of the main decisive sciences of the century, industrialized countries have done many activities in this direction [5].Wearable robotic systems are electromechanical systems that are worn by the user and operate in parallel with the body.By combining human intelligence and robot power, these systems cover the weaknesses in the human body (limitation of force) and robotic systems (appropriate level of intelligence) and by using it, they provide the possibility of achieving new capabilities that neither humans nor robots can achieve alone.They do not have them separately.Studying these systems has been one of the most active research fields in the field of robotics in recent years [6].Based on the field of use, these systems are divided into 3 general categories: empowerment robots, rehabilitative robots, and haptic systems and telerobots.Also, from another point of view, these robots can be divided into 3 categories: upper body, lower body, and middle body [7].Statistics show an increase in the number of strokes.One of the side effects of a stroke is the impairment of the ability to perform normal daily movements.In order to improve this category of patients, physiotherapy treatments are used.In addition, physiotherapy treatments are used for disabled people or those who have the problem of muscle weakness and paralysis in a part of their body [8].Removing humans from the treatment cycle will lead to high accuracy and improved treatment quality.Also, the great potential of outdoor clothing to improve the living conditions of people in the field of rehabilitation shows the need to address the issue even more, and the main factors are conducting a lot of research in the mentioned field [9].Today, efforts are aimed at producing products with high reliability and commercialization capability.A lot of research has been done in the field of empowerment [10].The prospect of achieving a comfortable but powerful mechanism in order to increase the carrying capacity and stability has caused a lot of interest in this field [11].Therapeutic exercise (rehabilitation) robots have attracted the attention of many scientists and researchers as a new and promising technology in recent years.Research has shown that robots can help physiotherapists well in this field [12].Passive continuous motion machines are the 2 first generation of therapeutic exercise machines, which are used during the early stages of rehabilitation after tissue surgery or physical injuries.With the help of these devices, muscles and joints are passively moved in a specific plane.While performing these exercises, the inflammation of the injured area is reduced, and these exercises also help the tissues that are damaged and torn to connect properly.These devices move the patient's leg in a certain direction and at a certain speed.The main problem of passive continuous motion devices is the lack of force feedback from the position of the patient's leg and the interaction forces between the patient's leg and the robot.This means that if during the exercise, the patient's leg is not able to follow the predetermined path, despite the generation of opposite torque from the patient's leg, the robot still tries to keep the person's leg on the path, which leads to An increase in interactive force can damage the patient's foot [13].Since the use of passive continuous motion devices was accompanied by problems, there was a need for devices that can perform rehabilitation according to the patient's condition and receive online feedback from the rehabilitation processes.In recent years, various people in this field tried to obtain more useful information from patients' biological signals (muscle and brain signals) and use them to control rehabilitation robots.Biological signals effectively reflect the activity of muscles and the way different body organs move [6].Therefore, one of the most popular fields of study in this field is the integration and combination of various data on the position, force and biological signals of patients, in the control of this category of robots, which makes the robot adapt its movement according to the physical condition of different patients.Also, considering that these robots interact directly with the patient's body, their control has always been an important challenge for specialists in this field [14].So far, various methods have been presented to control robots with a rehabilitation approach.In short, the innovations of this research are as follows.1. Extracting the dynamic equations of the robot and the patient's leg and validating them with ADAMS dynamic analysis software 2. Designing integral feedback controller along with admittance controller for knee joint rehabilitation robot 3. Designing the adaptive reference model controller in the joint space and considering the friction in the joint of the robot and the patient's leg 4. Design and integral-sliding model feedback controller along with admittance controller

Characteristics of knee joint rehabilitation robot
The system studied in this research, which consists of a knee and leg rehabilitation robot, is shown in Figure 1.For the purpose of rehabilitation exercises, the knee therapy robot should move the knee joint based on [15].[−45,90 ] in the range of motion of the exercises performed by this robot, all are in the sitting position of the patient.The patient sits on a chair and the robot bends and straightens his knee.In this situation, the robot's arm is parallel to the patient's leg and is connected to the top of the patient's ankle through a clamp, and thus the robot applies an auxiliary force to the patient's body.Also, the joint of the robot and the knee joint of the patient are in the same direction and have a rotation axis (see Figure 1).

Derivation of dynamic equations
In this section, dynamic modeling of the system is presented.In this type of exercises, only two parts of the patient's body, i.e. the leg and the sole of the foot, move, so considering these two parts of the patient's body in the modeling will be sufficient.In order to examine the behavior of the muscles and joints of the body, their dynamic model should be extracted.The modeling done in this research is based on the following assumptions.The bones and muscles of the body are considered as rigid links that are connected to each other with the help of rotary joints.
• The flexibility of the muscles is ignored.

•
The robot arm is considered rigid.According to the mentioned points, the dynamic equations of the system are obtained by writing the force and torque balance equations for all three parts of the sole of the foot, leg and arm of the robot.Figure 2 shows a schematic of the robot arm next to the patient's leg and the robot arm alone along with the forces applied to it.
Figure 2 The studied system includes the robot arm and the patient's leg (right side), the free diagram of the system (left side).According to Figure 2, the dynamic equations of the robot arm will be in the form of equation (1).
All the parameters used throughout this thesis, as well as the extraction of the system's dynamic equations, are introduced in the list of symptoms, and in Figure 3, the forces applied to the soles of the patient's feet and legs are shown.According to this figure, force equations for the sole of the patient's foot are obtained in the form (2) and for the patient's leg in the form (3).
In the above relations, there are subforms to   ,   and   ‫و‬   acceleration and torque are horizontal and vertical. { By placing relations (2) in relations (3), the amount of knee torque is obtained in the form (5).
Finally, the torque relationships obtained for the knee and the robot can be written in the form (6). 4 where in : It should be noted that in the dynamic relations related to the human body, the parameters of mass, length and moments of inertia of the body parts are placed according to the standard tables of human body data.In references [16,17] respectively, the data related to the body of Iranian students are given, and in general, in reference [18], the data of the human body are arranged and compiled in the form of tables.

Friction modeling
It should be noted that the dynamic equations obtained so far do not include all the effects applied to a skilled mechanical arm and a specific organ of the body, but only include the forces that result from the mechanics of rigid bodies.One of the most important sources of forces that are not taken into account is the friction force [19].In order to adapt dynamic equations to reality, a model of frictional forces (at least approximately) should also be considered in the modeling.One of the models used for friction is viscous friction, in which the torque resulting from friction is proportional to the movement speed of the joint and is described in the form (8).
Viscous friction constant.Another model that is sometimes considered for friction is   where it is Coulomb friction.The amount of this friction is constant, but its sign depends on the sign of the speed of the joint and is expressed as (9).
where   is called the Coulomb friction constant.
The model considered for friction in this research and tried to provide a relatively suitable model of friction includes both types of viscous and Coulomb friction and is written in the form of relation ( 10) [20].
By adding the friction model to the dynamic relationships of the robot and the patient's leg, the general form of the equations becomes (11).
represents the interactive torque between the robot and the patient's leg, the value of which is obtained in the dynamic equations.In practice, the value   is calculated with the help of force sensors located at the junction between the robot and the patient's leg.In the simulations presented in this research, the value of this interactive torque is considered as a spring-damper system in the form of relation (12).
Until this stage, the dynamic equations of the system were completely extracted.In the extracted dynamic equations, the following features can be expressed.These features are used in the next section.Feature 1: According to reference [21], if the general form of the dynamic equations of the system is as follows.
() ̈+ (,  ̈) + () =  The matrix resulting from C will be the inertia matrix and M will be an antisymmetric matrix.where  ̇− 2 is the matrix of the Coriolis and center terms.Similarly, in the knee therapy robot studied in this research,  ̇− 2  , considering that the general form of the dynamic equations of the robot is in the form of (11).The value is equal to zero.

Validation of the extracted model
In order to validate the extracted equations for the robot and the patient's leg, Adams dynamic analysis software was used.According to the characteristics of the robot arm and the patient's leg, including the mass and location of the center of mass and the moment of inertia, the robot arm and the patient's leg are modeled in this software.Then, the same input is given to the obtained Adams model as well as the equations extracted which are implemented in MATLAB software.By comparing the output of both software, which is shown in Figure 4 to Figure 5, we can conclude that the equations of the robot arm and the patient's leg are correctly extracted.In all these diagrams, the system input in both software is considered as a step.According to the results of the simulation, as expected, the output of both software completely matches each other, which indicates the correct extraction of the dynamic equations of the system.Initially, viscous friction was considered only for the joint of the robot arm.In this case, the output of Adams and MATLAB software will be according to Figure 6.

Non-linear control system design
The leg therapy robot moves the knee joint in the range of motion of the knee.In this way, the rehabilitation exercises can be realized.Therefore, the robot needs a position controller in this function.In this part of the current research, in order to realize the position controller, the integral feedback control method is used, and in order to control the interactive forces, the admittance controller is also used.

The design of integral feedback controller of the knee rehabilitation robot
In this section, the feedback method is presented to control the position of the knee therapeutic exercise robot.The approach of the backward method is based on designing a recursive controller considering some system states as virtual input, and finally the real control input is used to stabilize the whole system.By defining the state vector as: The obtained equations for the system are rewritten as (16) in state space form according to (11).
In relation (16), the friction torques are as follows. { In the following, the control input that includes the torque of the robot is designed using the backstep method.At the beginning, the tracking error is defined as follows. 1 =  3 −  3 (18) The derivative of the tracking error is We define the virtual controller in the form (20).
As it is, we also define the positive and constant value of  1 ,  1 as follows.
Lyapunov candidate pan is expressed as 23: By deriving from the relation (23) and using ( 22), we will have Therefore, we can conclude, the system described in (24) is stable under the condition that  2 is always equal to zero.Given that it is now impossible to show whether d is equal to zero or not, we need to develop a control system to ensure that d becomes zero.Therefore, in the second step, by deriving from (21) and using (16), we have: We define a new Lyapunov function as follows.
) According to the property of ( ̇ − 2  being zero) it is obtained in the following form.The derivative of the Lyapunov function  2 is calculated as follows: We choose the control signal as (29).
In the above relationship, the parameter  2 is positive and definite.By choosing this control signal, the derivative of the negative Lyapunov function is determined.
30) Due to the positive value of k, k and the negative value of v is realized.Therefore, with the passage of time and tending to infinity, the Lyapunov function v tends to zero.Also, e and the tracking error e will tend to zero.Therefore, the desired path is followed by the robot and the stability of the system is guaranteed.

Admittance controller design
If, while moving the leg with the help of the robot, an involuntary movement occurs in the patient's leg, which increases the interaction force between the robot and the patient's leg, the possibility of the patient's injury increases.In order to control the interactive force in this part of the research, the inverse of impedance control, i.e. the idea of admittance control, is used.In this way, feedback is taken from the interactive force between the robot and the patient's leg, and accordingly a deviation is created in the reference path, the result of which is the reduction of the interactive force.
Before the measured interaction force enters the admittance control block, it passes through the gravity compensator block.This allows only the force from the patient's leg muscles that caused the involuntary movement to be detected.In order to create a smooth interaction between the robot and the patient's leg, the considered model for the admittance controller is expressed as a mass-spring-damper system in the form (31).
In this relation,   has been specified as the optimal values for inertia, viscous damping and stiffness   ،  ،   with spring index, as well as the impedance coefficients that   and the desired physiotherapist path   are the output of the reference model.
In the above relationship,   is the interactive torque,   p is the compensatory torque caused by   from factors such as gravity and is defined as follows: (33)

controller and parameter matching rule
The adaptive control law according to equation ( 34) is written as follows.
The positive scalar error  is defined as follows.
=   −  (36) The relation (37) can be written in the following linear form in terms of parameters: where  ̂ and parameters are the vector   of the regressors, they are defined as (38).
Now we define the parameter update rule as follows:  ̂̇= −    (39) So that Γ is a symmetric and positive definite matrix.

Proof of stability
In order to prove the stability of the control law presented in relation (34), the Lyapanovi function is considered as follows It is the parameter estimation error vector, which is in the form of (41).
̇=     ̇+ 1 2      +  ̂̇  −1  ̃ (42) The above relation assumes that the changes of the robot parameters are constant with respect to time.That is,  ̃̇=  ̂̇ ̇ is written.On the other hand, by using relations (35) and (36), the derivative of the sliding surface can be written in the form (43) ̇=  ̇ −  ̇ (43) Now, using the relation (43), the derivative of the Lyapunov function can be written in the following form.

𝑣̇= 𝑠 𝑇 (𝑀 𝑅 𝜃 ̈𝑅 − 𝑀
By using the robot model and placing the controller designed according to the equation (34) and using the feature 1 stated in also slightly simplifying the relations, the derivative of the Lyapunov function is obtained as the following relation (45) ( ̇− 2 = 0).̇=      ̃−      +  ̂̇  −1  ̃= (     ̂̇ 1 −1 ) ̃−  −1   (45) According to the matching law presented in relation (39), it is clear that the derivative of the Lyapunov function given in relation ( 45) can be a negative semi-definite expression, for this purpose, to prove the stability, the second derivative of the Lyapunov function must also be calculated.Is.Barbala's lemma has a mathematical nature and states that if it is shown that the Lyapunov function has a limit in infinite time and its second derivative is also finite, then it can be concluded that its first derivative tends to zero over time.and the stability of the system is guaranteed.It will be used for the system.As a result of this incident, it is an error, so ̇≤ 0can be concluded that ̇≤ 0 discussed in this research considering that the derivative of the Lyapunov function is limited.On the other hand, by putting the controller equation according to equation (34) in the equations of a ̃ and s of these dynamic terms of the robot, the slip derivative can be concluded in the form of the following equation.
̇=   −1 (   ̃−   −   ) ′ (46) The derivative which, due to the limited parameters  ̃,  the non-zero inertia of the robot, it can be concluded that the sliding surface is also a limited parameter.Therefore, the second derivative of the Lyapunov function, which is calculated as follows, is a bounded expression.
̈= −2̇   (47) Therefore, according to the above lemma, the error  tends to zero and the stability of the system is adjusted.

Integral backstepping control -sliding mode
In the first step of designing, the tracking error and its derivative are defined as (49).
We consider the following positive definite function, which is in terms of the error and integral of the tracking error and the sliding surface, as the candidate Lyapunov function.
where  1 ,  1 are the  integral of the output error defined in relation (49).
In the convergence of  1 to  1 asymptotically, it is guaranteed that if the desired value of  2  tends to  2 .In the second step, the error of the state of the desired value (relation ( 50)) is considered as the sliding surface  2 : (51) The considered slip surface shows good performance if it is absorbent, hence the condition is considered.To fulfill the condition of the slip surface being absorbent, we take a derivative from it as  2 ̇2 < 0. ̇= ̇4 − ̈3  −  1 (̇ 3 − ̇3) 1 ( 3 −  3 ) (52) In the following (53) Now by choosing the control signal as ( 54) (54) where coefficients  1 and  2 are assumed as positive values.The slip surface derivative is obtained as follows (55).Also, the condition of the sliding surface being absorbent is established.

Proof of stability
In order to check the stability of the controller designed in the previous section, we use the Lyapunov stability method.For this purpose, we consider the following positive definite function, which is the tracking error and slip surface in terms of error and integral, as the candidate Lyapunov function. = 1 2 ( 1  2 +  1 2 +  2 ) (56) By deriving the Lyapunov function, we will have: ̇=  1  2 +  1 ̇1 +  ⋅ ̇1 (57) By rewriting the relation (51) as follows: (58) Also, using (55), the derivative of the Lyapunov function will be as follows.
The derivative of the Lyapunov function is a limited negative semi-definite function (̇≤ 0)because the result is now, therefore, () ≤ (0) we can say that the variables  and  1 are bounded.let the derivative ̇ ̈ be the given function, it is equivalent to or is the uniform continuous function of one ̈ ̇ is a bounded function, and the second function of the Lyapunov function is: ) So far it has been shown that the variables    1 are bounded.Now, according to the relation of the second derivative of the Lyapunov function, it should be shown that the derivative of these variables is bounded.According to the relation (55), we can conclude that the derivative of the inferred surface (̇1) is the boundary slip.Also, according to the relation (52), it is concluded that the derivative of the tracking error is bounded.Therefore, it follows that the second derivative of the Lyapunov function is bounded.Accordingly, according to the above lemma, in the passage of time, the derivative of the Lyapunov function s of the surface slip tends to zero, and the tracking error e tends to zero.The designed controller is discontinuous due to the existence of the  function, and since there is uncertainty and delay in real systems, switching does not occur simultaneously, and this leads to oscillations called chattering in the control signals.The phenomenon of chattering has adverse effects such as stimulation of unmodeled expansion and heat dynamics in actuators, which must be prevented from occurring.Therefore, in order to eliminate chattering, the discontinuous function () σ is replaced by the continuous ℎ( ∕ ) the thickness of the boundary layer and whatever the value 1 Xiamen Academy of Arts and Design, Fuzhou University, Xiamen，China, 576079447@qq.com 2 Luting Xia, Zhejiang Gongshang University Hangzhou College of Commerce, Hangzhou， China, Xgirl0074905@qq.com,Corresponding Author: Xgirl0074905@qq.com 3 Zhao Ruoyi, Department of Art Design, Zhejiang Gongshang University, Hangzhou, China, Email: zhaoruoyi208@zjgsu.edu.cn 4 Charles Shieh, International association of organizational innovation, FL, USA, Email: charles@iaoiusa.org 10 In the simulation of this section, similar to the previous section, it is assumed that in the time interval 25 < t < 27, a movement is made by the patient, and in exchange for this movement, the interaction force between the patient's leg and the robot increases, in this case, the path traveled by the robot is shown in Figure 9, and the interactive torque is shown in Figure 10.In order to further investigate the controller's efficiency, the controller's performance, the performance of the designed controller, has also been checked in the presence of measurement noise, in this case, the tracking error and interactive torque are given in the following figures (10).
1 Xiamen Academy of Arts and Design, Fuzhou University, Xiamen，China, 576079447@qq.com 2 Luting Xia, Zhejiang Gongshang University Hangzhou College of Commerce, Hangzhou， China, Xgirl0074905@qq.com,Corresponding Author: Xgirl0074905@qq.com 3 Zhao Ruoyi, Department of Art Design, Zhejiang Gongshang University, Hangzhou, China, Email: zhaoruoyi208@zjgsu.edu.cn* Mostafa Jalalnezhad, Kharazmi University (Khu), mostafajalalneghad@yahoo.com, Std_mostafajalalnezh@khu.ac.ir 1 Xiamen Academy of Arts and Design, Fuzhou University, Xiamen，China, 576079447@qq.com 2 Luting Xia, Zhejiang Gongshang University Hangzhou College of Commerce, Hangzhou， China, Xgirl0074905@qq.com,Corresponding Author: Xgirl0074905@qq.com 3 Zhao Ruoyi, Department of Art Design, Zhejiang Gongshang University, Hangzhou, China, Email: zhaoruoyi208@zjgsu.edu.cn 4 Charles Shieh, International association of organizational innovation, FL, USA, Email: charles@iaoiusa.org13 Figure 13.Control signal of sliding-mode feedback controller in the presence of noise In the following, the way the robot follows the path designed by the physiotherapist has been checked in both controllers, due to the almost similar behavior of the controllers in following the designed path, in order to better compare them with each other, the error of following the path is also given.Figure 14 shows the diagram of the hypothetical path designed by the physiotherapists, as well as the path obtained by applying the controllers of the adaptive reference model and feedback with admittance control.As can be seen, all three graphs are almost on top of each other, and the error of the paths obtained by applying the controllers compared to the paths designed by the physiotherapist is shown in Figure 15.As it is known, the error is very small and in most case it is less (2 degrees in 135 degrees).Also, the torque〖-45,90〗 of 2 degrees in an interactive span path caused by the application of both controllers is shown in Figure 16.* Mostafa Jalalnezhad, Kharazmi University (Khu), mostafajalalneghad@yahoo.com, Std_mostafajalalnezh@khu.ac.ir 1 Xiamen Academy of Arts and Design, Fuzhou University, Xiamen，China, 576079447@qq.com 2 Luting Xia, Zhejiang Gongshang University Hangzhou College of Commerce, Hangzhou， China, Xgirl0074905@qq.com,Corresponding Author: Xgirl0074905@qq.com 3 Zhao Ruoyi, Department of Art Design, Zhejiang Gongshang University, Hangzhou, China, Email: zhaoruoyi208@zjgsu.edu.cn 4 Charles Shieh, International association of organizational innovation, FL, USA, Email: charles@iaoiusa.org14 Now, the effect of presence and absence of admittance controller on the compensation of interactive force due to involuntary movement in the patient's leg is investigated.Suppose that the robot lacks an admittance model in both the reference model controller as well as the feedback controller along with the admittance controller, and in such a situation, an involuntary   movement occurs in the patient's leg.This involuntary movement which is activated in Figure 17.The behavior of the controllers shows that in the absence of 25>t>27 in the time interval of the controller, the admittance of the interaction force increases.Now, the admittance model has been added to the controllers, and the system is simulated again, according to Figure 18, it is clear that the interactive force has decreased in this case compared to the previous case when the admittance model was removed.The reason for this decrease is the deviation of the robot from the path designed by the physiotherapist, which is due to the existence of the admittance model, and is shown in Figure 18.Therefore, the admittance controller has been able to reduce the interactive force and prevent possible damage to the patient's foot. .The angle of the robot in the presence of admittance control and its absence and the presence of involuntary movement in the patient's leg In order to check the efficiency of the controllers, the performance of the designed controllers, in the presence of noise, has also been measured.It is assumed that the interaction force measured between the robot and the patient's leg, which is measured in practice with the help of a force sensor, is accompanied by noise.For this purpose, noise with zero mean and variance of 2 is added to the modeled torque as interactive torque in the designed controllers, and the performance of the controllers has been re-examined and simulated.Figure 19 interactive torque Figure 20 shows the error of the robot following the initial reference path in this case.Due to the very close proximity of the robot from the designed reference path in both adaptive and backtracking model controllers, and for more detailed analysis, the path following error plot is also given.As [-45,90], which is clear, the error is small and in the maximum value, it is less than 2.5 degrees in an interval path.(2.5 degrees in 135 degrees) Figure 19.Interactive torque in the presence of noise and involuntary movement in the patient's leg Figure 20.Error of following the path of the robot despite the noise In order to compare the performance of the designed control systems, each of the controllers is considered in their best performance conditions, and the tracking error, interactive torque between the robot and the patient's leg, and the generated control input are compared with each other, and a controller that has less tracking error per input.And at the same time, having less interactive torque is selected as a suitable controller for knee joint rehabilitation robot.For quantitative comparison, the root mean square criterion for tracking error, interactive torque and control input generated based on the following formula is used.
At first, assuming the absence of measurement noise and movement from the patient's foot, the root mean square error of the output, interactive torque, and control input is calculated and listed in Table 2 In the second evaluation, the mean square root of the output error, interactive torque and control input of each of the controllers, assuming the presence of measurement noise and sudden movement in the patient's leg, has been recorded in Table 3. Table 3. root mean square error of output, interactive torque and control input despite noise and movement from the user (  ) (   ) (  ) Backstep control system along with admittance control 5.5331 4.2964 5.1639 Backstep-sliding model control system with admittance control 6.545 5.1074 5.4182 As it is clear from the comparison recorded in Table 1 and Table 2, the integral feedback control system along with admittance control has a better performance compared to other controllers by producing a larger interactive torque and a smaller input.Of course, as can be seen from the table above, the tracking error in the impedance controller is better than the backstep controller with admittance control, but due to the importance of the interactive torque, the behavior of the backstep controller is better evaluated next to the patient's foot.Especially from the comparison of Table 3, it can be seen that the integral feedback controller together with the admittance control shows a much better performance in the presence of noise and the presence of movement in the patient's leg.Therefore, integral feedback control system along with admittance control is selected as the most efficient non-linear control system for knee joint rehabilitation robot.

Conclusion
The purpose of this article was to model, design the controller for preliminary investigation to build a robot for knee rehabilitation.First, the dynamic equations of the robot and the patient's leg were extracted and validated with the help of dynamic analysis software.Then, the design of the non-linear controller for the knee rehabilitation robot was discussed.The ADAMS controllers designed in this part of the article include: integral feedback controllers with admittance control, adaptive reference model controller, integral-sliding model feedback controller with admittance control were simulated and the results of all the designed controllers were analyzed in MATLAB software.Also, a comparison was made between the designed controllers and their performance was evaluated in the presence of measurement noise, and it was concluded that the integral feedback controller along with the admittance control show better performance compared to other designed controllers.Also, the knee rehabilitation robot was designed with a new mechanism, in this direction, in order to create a smooth interaction between the patient's leg and the robot, force sensors (load cells) and admittance algorithm were used.The results of the practical implementation of the controller showed that when the robot is equipped with The admittance control system, if for any reason the force applied to the patient's leg increases, the robot will show a soft behavior and prevent the patient from being injured.In addition, due to the high importance of the health of the patient who uses the robot, two safety systems Mechanical and electronic are used in the design of the robot.In this way, the user of the robot can be assured that in addition to the control system of the robot, the safety system of the robot is also such that the possibility of injury due to the operation of the robot has reached the minimum possible value.

Figure 1 .
Figure 1.Positioning of the patient's leg next to the robot during rehabilitation exercise3.Derivation of dynamic equationsIn this section, dynamic modeling of the system is presented.In this type of exercises, only two parts of the patient's body, i.e. the leg and the sole of the foot, move, so considering these two parts of the patient's body in the modeling will be sufficient.In order to examine the behavior of the muscles and joints of the body, their dynamic model should be extracted.The modeling done in this research is based on the following assumptions.The bones and muscles of the body are considered as rigid links that are connected to each other with the help of rotary joints.•The flexibility of the muscles is ignored.•Therobot arm is considered rigid.According to the mentioned points, the dynamic equations of the system are obtained by writing the force and torque balance equations for all three parts of the sole of the foot, leg and arm of the robot.Figure2shows a schematic of the robot arm next to the patient's leg and the robot arm alone along with the forces applied to it.

Figure 3 .
Figure 3. Forces on the sole of the foot (right side) and leg of the patient (left side)

Figure 4 .
Figure 4.The angle of the robot in Adams and MATLAB software in the presence of viscous friction of the robot jointIn the second case, in addition to viscous friction, Coulomb friction is also included in the robot arm joint, in this case the simulation result will be as shown in Figure5.

Figure 5 .
Figure 5. Robot angle in Adams and MATLAB software in the presence of viscous and Coulomb friction in the robot joint In the third simulation, in addition to including friction for the robot arm joint, viscous and Coulomb frictions are also included for the patient's knee joint.The output of both software generally has a maximum difference of 0.65 degrees, which according to the investigations, this amount of difference is due to the difference in the type of solvers of the two software.

Figure 6
Figure 6 The angle of the robot in Adams and MATLAB software in the presence of viscous and Coulomb friction in the robot joint and the patient's knee joint

Figure 7 .
Figure 7. Output error in continuous and discontinuous regressive-sliding model controllers

Figure 9 .
Figure 9. Robot angle and output of admittance controller with backstepping-sliding controller

Figure 11 .
Figure 11.Tracking error in presence of noise and absence of noise

Figure 14 .
Figure 14.Following the reference path in both the adaptive reference model controller and post-step with admittance control.

Figure 15 .
Figure 15.Path tracking error in both adaptive reference model controller and backtracking with Adminats control

Figure 17 .
Figure 17.Interactive moment in the presence of admittance control and its absence and the presence of involuntary movement in the patient's leg . Table2.root mean square error of output, interactive torque and control input in the state of no noise and movement from the work side.