Intelligent and Hybrid Control Method of a 3-DOF Robot Used for Hip, Knee and Ankle Rehabilitation


 Background: There is an increasing trend in using robots for medical purposes. One specific area is rehabilitation. Rehabilitation is one of the non-drug treatments in community health which means the restoration of the abilities to maximize independence. It is a prolonged work and costly labor. On the other hand, by using the flexible and efficient robots in rehabilitation area, this process will be more useful for handicapped patients.Methods: In this study, a rule-based intelligent control methodology is proposed to mimic the behavior of a healthy limb in a satisfactory way by a 3-DOF planar robot. Inverse kinematic of the planar robot will be solved by neural networks and control parameters will be optimized by genetic algorithm, as rehabilitation progress.Results: The results of simulations are presented by defining a physiotherapy simple mode on desired trajectory. MATLAB/Simulink is used for simulations. The system is capable of learning the action of the physiotherapist for each patient and imitating this behaviour in the absence of a physiotherapist that can be called robotherapy.Conclusions: In this study, a therapeutic exercise planar 2-DOF robot is designed and controlled for lower-limb rehabilitation. The robot manipulator is controlled by combination of hybrid and adaptive controls. Some safety factors and stability constraints are defined and obtained. The robot is stopped when the safety factors are not satisfied. Kinematics of robot is estimated by an MLP neural network and proper control parameters are achieved using GA optimization

the patient safety by a flexible structure controlled by an intelligent control strategy. The hybrid and adaptive control are used for controlling the suggested system. As the reference input of the proposed control block diagram, neural networks is employed. Control parameters are optimized based on therapy sessions and safety factors and for this purpose a genetic evolutionary algorithm was applied. The suggested system can be used for rehabilitation of three limbs (knee, hip and ankle). The paper is organized as follows. Rehabilitation mode is explained in section 2. In section 3 control strategy used in the proposed algorithm is presented. Optimization of control parameters using GA is presented in section 4. In section 5 implementation and simulation of the proposed algorithm are performed. Finally, conclusions and discussions are presented in section 6.

Methods Rehabilitation mode
The proffered structure is based on the flexion and extension movement for knee, hip and ankle [7]. For this purpose a 3-DOF planar robot is defined that can be attached to the trunk of lower limb (Figure ure . 1). (1) (2) (3) As we know in robotic rehabilitation, the desired trajectory of manipulator obtained from the physiotherapist and then the related variables of the robot such as angles and velocity of them are computed based on inverse kinematic/dynamic problem. Thereafter these parameters are used for control of robot to track the desired trajectory. These issues will be described in the next stages.

CONTROL STRATEGY USED IN PROPOSED ALGORITHM
As mentioned earlier, as the reference input of proposed control block diagram, neural networks are employed. Thus, the neural network and its usages in proposed strategies are explained first and then the proffered control strategy will be described.

Neural network and its usages in proposed strategy
An important area of neural networks application is in the field of robotics. Usually, these

Link1
Link 2 Link3 networks are designed for learning and reconstructing complex non-linear mapping and have been widely used in the identification and control of a manipulator, which is the most important form of an assistant robot, and in tracking a trajectory based on sensory information. Generally, kinematics of parallel robot are non-linear problems and difficult to solve, thus an MLP neural network is used to estimate of the joint variables. The second idea of using neural networks is originated from the results of experiments those show that there are the results of experiments showing that there are training vulnerability centers in the adult mammalian spinal cord which activate and control motor neurons that are responsible for walking patterns [18][19][20]. These walking patterns that have been previously been reserved in can be replaced by other neurons. The MLP neural network used in suggested method has two layers tansig activation function in layer (1) and activation purelin function in layer (2). The best number of neurons in layer (1) is obtained from an iteration algorithm. The Levenberg-Marquardt back propagation or trainlm algorithm is used for network training.

Control strategy
Control strategies of rehabilitation systems can be classified into three categories: force control, position control, position and force control [13]- [15]. Nevertheless, unlike industrial robots, rehabilitation-aided robots must be conFigure ure .d for stable, safe and compliant motion while interacting with humans [16]. The impedance control strategy propounded by Hogan [14,15] is one of the most appropriate approaches for such applications. Impedance control aims at controlling the position and force by adjusting the mechanical impedance of the manipulator to the external forces generated by contact with the manipulator's environment. Mechanical impedance is roughly an extended concept of the stiffness of a mechanism against a force applied to it [17]. The proposed impedance control block diagram is shown in Figure2. Therefore, the necessary torques of proposed robot joints is computed as: Where, the and subscript denotes the task space and the denote the joint space. In this equation is the manipulator's end effector vector, is the joint angle vector, is the Coriolis and centrifugal force effects, ( ) is the inertia matrix, is the desired inertia matrix, is the Jacobean matrix, isthe desired damping coefficient matrix, is the desired e desired stiffness coefficient matrix and is external force exerted on the end-effector by its environment (this force can be defined as action and reaction force between patient and end-effector).
The term ( ) denotes the transfer function of any arm of robot, equipped with a DC servo motor, where is the gear reduction ratio in motor and the parameters and are the effective moment of inertia and viscous friction coefficient, respectively [21].
is the amount of approximated delay.
In the recommended block diagram, Neural Network box is used to convert (desired position or input of NN) to (desired joint angles or output of NN). And is the target of NN. In this block diagram, it is assumed that: Where represents the error, or deflection of the MP from its reference position and represents the error, or deflection of the joints from its desired position.

Patient safety in the proposed algorithm
Patient safety is one of the most important factors in rehabilitation systems and can be guaranteed by stability of software and hardware. Stability conditions for robotic systems under impedance or hybrid controllers had been investigated in some researches [7, 8, 14 and 15]. In this paper a new asymptotic stability conditions for stiffness and impedance controllers is presented using an appropriate Routh approach [21] based on the relationship between a joint angle of the robot and desired trajectory. Corresponding transfer function can be defined as: [21] based on the relationship between a joint angle of the robot and desired trajectory. Corresponding transfer function can be defined as: According to the (3) and the following substitutions: Where is the gravitational acceleration and is the mass of patient leg, the transfer function of (3) will be: The denominator polynomial is: After determining stability conditions of controller gains based on Routh theory [21], and taking into account that ( ) are positive definite matrices, there will be: If we consider one of the joints of suggested robot (angle joint ) these substitutions will be obtained: Where is the mass and is the leg length of patient. Now the transfer function of (5) will be: The denominator polynomial is: Then the stability condition will be: As it will be shown in the next sections, the deviation of actual path from the desired path is considered as another system stability factor. In this paper, safety is guaranteed since some of the controller parameters can be adapted under the following criteria: 1-The stability constraints in (11) or (13) 2-Deviation or difference between actual and desired path ( will be explained in next section). 3-Different stroked patients (obtained from physiotherapist). 4-Different states of progression in the therapy process (by progress of rehabilitation steps and improvement). 5-The action/reaction force (F) between patient and robot (by a force sensor). The robot is stopped when one of the mentored safety factors is not satisfied. Thus, the recommended control strategy will be based on combination of two strategies: impedance control and adaptive strategy. Controller parameters are finely tuned using a constrained nonlinear optimization strategy such as GA that will be discussed in next sections.

Optimization of control parameters
To find the minimal deviation between actual and desired path, the classic strategies of optimized control can be used and by getting transfer function, the optimal parameters (( ) ) are found to minimize the following cost function: Where ( ) is the deviation between actual and desired path and is the number of stages in rehabilitation mode. Nevertheless, using these classic strategies result in more complexity of optimization problem and probably not finding a closed form answer due to the two reasons: firstly the feedback loop in block diagram is not identical for different cases (robotics kinematic are different). Secondly, because the parameters are in matrix form, an increase in their number, results in increase of matrix dimensions. Therefore, defining an alternative strategy without the transfer function in order to minimize the cost function can be useful in decreasing complexity. Eq. (15) is used for calculation of deviation between actual and desired path [17]. (15) Where is the compliance matrix and it is defined as: Where is the stiffness matrix and is defined as: Now the impedance control parameters are modified so that cost function (18) can be minimized: In this case, because of the interaction between robot and human, the amplitude of force is very important and its high value can damage the patient. Therefore, the cost function is rewritten as: The threshold of force is changed based on the therapy of different stages and patient qualification. We can incorporate constraint of F in cost function (19) and define anew cost function as: Where are changed based on the therapy of different stages and patient qualification (this means adaptive strategy). can be called the accuracy factor as larger values of h will result in higher accuracy. Now the control parameters such as ( , ) and even used for determination of necessary torques of links based on (3) is optimized by using a genetic evolutionary algorithm that will be explained in the next section.

Genetic algorithm and using it in proposed algorithm
In the suggested algorithm value representation is used and the cost function is considered as (20). The main goal is to reach the minimum level of ( ) considering ( ) which will not be higher than the defined threshold. On the other hand, since the parameters are multidimensional, chromosomes will be multi-dimensional instead of being a linear vector. In this case each chromosome can be shown as: F Thus, the chromosome length will be increased which in turn would result in the increase of problem complexity. For this reason, it is essential to find some techniques to decrease the chromosome length. Some of applicable techniques are:  Converting the population of chromosomes to multi population.  Fixing some of the parameters in any chromosome that are not very important or critical.  Assuming the parameters of any chromosome as diagonal matrix.
In the first technique, the optimization of the whole parameters will not be done simultaneously and probably it will not led to optimum result. The second technique is incoherence with the desired aim (adapting the controller parameters under the stability condition for different stroked patients and for different states of progression in the therapy process). Therefore, the third technique is applied in this study. The flowchart of suggested algorithm is shown in Figure 3.

Figure 3
Flowchart of suggested algorithm.

Implementation and simulations of the proposed algorithm
For implementation of the suggested algorithm on the planar 3-DOF robot described in Section 2, there are several requirements (in terms of position, joint torques, impedance parameters) needed to control the manipulator (MP) as the sequel: 1-Desired position and velocity (trajectory) of MP and obtained from the physiotherapist. 2-Finding the appropriate joint variables with desired trajectory based on IK implemented by NN. 3-Optimizing of impedance control parameters using GA in order to determine the required torques. All these requirements were explained in the previous sections. For this purpose, a physiotherapy simple mode and its trajectory is defined which has been shown in Figure 4. The angles and velocities of joints for this robot are planned in three phases: 1) Horizontal trajectory from ( ) to ( ) with the speed of 1m/s where is the leg length in maximum extension and is the distance between hip source and manipulator in minimum flexion in direction (it is marked as 1'th phase in Figure 4). 2) Circular trajectory around hip from ( ) to ( ) with the speed of 1 rad/s where is the distance between source and manipulator in minimum flexion in direction (it is marked as 2 nd phase in Figure 4). 3) Vertical trajectory from ( , ) to ( ) with speed of 1m/s where is the leg length in maximum extension (in it is marked as 3nd phase in Figure 4). 4) The joint of ankle is rotated only according to condition of (3). Assuming: The velocities in three phases will be: Angles of the joints in this physiotherapy mode are obtained based on the equations of the inverse kinematic (IK) problem in the suggested 3-DOF planar robot. We assume: ( ) The forward Kinematic in the suggested 3-DOF planar robot is: If we consider these substitutions: We will have: Thus, the value of obtained by: ( ) Thereafter, will be: And finally, from equation (22) we will have: And they are shown in Figure 5. This Figure shows three phases in desired trajectory described in Figure 4. Where the range of joint1, joint2 and joint3 are complementary of and in (1),(2) and (3),respectively. Now, the proposed MLP neural network is used for solving the IK problem. The weight and bias of the MLP neural network for joint1 approximation are obtained after training after 100 epochs and are shown in Table1. In this table w{1,1} and bi{1} are the weights and biases of layer (1), respectively and w{2,1} and bi{2} are the weights and bias of layer (2), respectively.

Table1
Weight and bias of proposed MLP neural network for joint1 approximation.

Figure 6
Approximated joint angles that produced from MLP network after 100 epochs. The forces and torques that will be used for moving manipulator on the desired path (for 140 points of trajectory in 4 sec) are shown in Figure 8 and Figure 9, respectively.  The evident peaks in Figure 9 denotes the complementary movement. The final optimized control parameters based on related torques and forces obtained as: Now, the obtained torques from Figure 9 are used for moving the robot. It should be noted that the desired joint angles were approximated by MLP neural network that has been already described. The difference between desired and actual trajectory is shown in Figure 10. According to Figure 10 the deviation or difference between desired and actual variables is large for the first stages which are not suitable for rehabilitation without supervision. The deviation becomes smaller and converges to zero with the progress of simulation steps.

Figure 10
Difference between desired and actual trajectory.
Finally, fitness function diagram of GA for Eq (20) is displayed in Figure 11.

CONCLUSION and DISCUSSION
In this study, a therapeutic exercise planar 3-DOF robot was designed and controlled for lower-limb rehabilitation. The robot manipulator was controlled by combination of hybrid and adaptive controls. Some safety factors and stability constraints were defined and obtained. The robot is stopped when the safety factors are not satisfied.
Kinematics of robot is estimated by an MLP neural network and proper control parameters are achieved using GA optimization. The advantages of the proposed algorithm can be classified as the following: 1.
The system is capable of learning the action of the physiotherapist for each patient and to imitating this behavior in the absence of a physiotherapist that can be called robotherapy [20].

2.
Generation of the source path is completely deliberative and it is done in accordance with the patient's condition and the therapy's duration. In this research, the source path was specified after various efforts such as visiting the specialists of the physiotherapy and observing several sessions in that section to completely gather the whole required information. 3.
The neural network identifiers were used for solving the inverse kinematic of robot. The first idea for using NN is to cope with a non-linear identification problem and the second, more important one, is that the patient's joints controlling system can be probably replaced by the artificial neural network.

4.
Safety is guaranteed since some of the controller parameters can be adapted under the stability condition for different stroked patients and for different states of progression in the therapy process. 5.
To reduce the complexity of optimization of control parameters, genetic evolution method was used. A different aspect of the defined chromosomes in the suggested algorithm in comparison to conventional methods is that they are defined as matrices not as vectors which were placed because of the abundance of DOF for a system. In comparison to other related works, surplus mentioned issues, in particular it must be said that: 6.
The work places that are needed for LOKOMAT [4] and LOPES [6] must be in a large room while the whole place that is needed for manufactured Stewart parallel robot is 1 in maximum. Moreover, the cost of rehabilitation with LOKOMAT is very high. 7.
The number of DOF in ALEX [5] is very high but in Stewart parallel robot it is limited to 2. 8.
Only two parameters regarding the patient are used for starting the rehabilitation including mass of patient and ability in posture of ankle on the MP. The other parameters such as patient muscles, length and posture of whole body are not required.