Design and Trajectory Tracking Control of a Magnetorheological Prosthetic Knee Joint

: This paper developed a new magnetorheological (MR) prosthetic knee joint using an MR damper as the brake. According to the gait data of healthy people walking on flat ground, the struc ‐ ture of a MR prosthetic knee joint was expounded in detail, and its motion and dynamic model was also established. In addition, an MR damper was developed according to the specific needs of an MR prosthesis. The forward and reverse mechanical models of the MR damper were established, and its damping performance was obtained through experimental tests. In addition, to solve the problems of uncertainty and external interference in the MR prosthetic knee joint system, a second ‐ order sliding mode controller was proposed. The experimental test results show the maximum pos ‐ itive error of the knee joint swing trajectory is 9.4°, which effectively tracks the reference swing trajectory.


Introduction
The rapid development of science and technology has greatly changed the production and lifestyle of human society. While bringing convenience to mankind, it has also caused some irreparable accidental damage to mankind. The second sample data of the disabled shows that hundreds of thousands of people around the world are forced to amputate their lower limbs and experience intense psychological problems due to various accidents [1,2]. For lower limb amputees, the loss of lower limbs not only causes them to lose their basic athletic ability in daily life but also comes with the atrophy and degeneration of the disabled limbs and effects on their physical and mental health. Lower limb prostheses can replace the movement function of the limbs to a certain extent, thereby restoring part of the movement ability of lower limb amputees, so that the amputees can move freely like normal people, which not only causes them to regain their confidence in life but also greatly facilitates their daily life, improves their living standards, returns them to their family with a full spirit, and contributes to the development of themselves and society [3,4]. Therefore, it is of great practical significance to develop a prosthetic with excellent performance to return amputees to normal life [5].
The current prostheses on the market can be divided into passive prostheses, semiactive prostheses and active prostheses. Passive prostheses are relatively inexpensive and simple in structure, but they cannot adjust the damping torque according to the actual situation and will bring about a burden during walking; therefore, they cannot achieve natural and coordinated walking. By contrast, active prostheses can simulate normal hu-man knee joint movement, and they are mainly oriented to the high-end market. However, they have the disadvantages of complex structure, cumbersome control and low stability [6,7]. An MR prosthesis is a semi-active prosthesis based on an MR damper. Among them, the used MR damper is a new type of smart device that uses smart material MR fluid as the transmission medium, giving it the advantages of low energy consumption, wide dynamic range, fast response and continuously adjustable damping. For a typical MR damper used in the prosthesis, the maximum average energy consumption is about 5 W; the dynamic range can reach 9, and the response time is about 10 ms [8,9].
Prosthetic knee joints based on the MR damper can be divided into single-axis prosthetic knee joints and multi-axis prosthetic knee joints. The single-axis structure is common and can offer a stable pace and speed. Arteaga et al. [10] integrated a rotary MR damper into a prosthetic knee joint and designed a single-axis prosthesis. Compared with a single-axis MR damper prosthesis, the multi-axis MR damper prosthesis can better simulate the trajectory of the instantaneous center of rotation, so that it has better bionics and a more natural gait. Ochoadiaz et al. [11] combined the MR damper and the four-bar linkage to design a four-axis MR damper prosthesis, wherein the MR damper occupies a large installation space so that the MR damper and the four-bar linkage swing each other when the knee joint is moving, which reduces gait quality. Xu et al. [12] designed a prosthesis that not only reduces the space and mass of the prosthesis but also effectively solves the problem of relative movement between the four-bar mechanism and the MR damper during walking, using an integrated four-bar structure and a double-bar MR damper. Xie et al. [13] developed a four-bar MR prosthetic knee joint, which utilizes a four-bar linkage mechanism to simulate the rotation of the center of the knee joint and track the gait of the prosthesis; an MR damper is used to control the torque of the prosthetic knee joint, and the upper and lower ends of the knee joint are connected to the thigh and the lower leg, respectively. Bulea et al. [14] linked a four-bar linkage with a commercial MR damper of the type RD-8040-1 to create an MR prosthetic knee joint. However, the used MR damper occupied a large installation space, which seriously affects the gait of the prosthetic knee joint.
The control algorithm of MR prostheses is another research hotspot. According to the repetitive motion of the human body during normal walking, Herr et al. [15] introduced a finite state machine (FSM) to control the bending angle of an MR prosthetic knee joint by planning typical gait states. The method adopted open-loop control to command the MR damper to provide the required knee joint torque for the gait, thereby controlling the leg swing trajectory of the lower limb prosthesis. However, the FSM control can not track the reference swing angle of the leg of the lower limb prosthesis, and the open-loop control method has weak suitability to the environment and can not adjust the parameters for different sports and users, resulting in poor adaptability. Proportional-derivative (PD) control has the characteristics of simple structure and good robustness, can well track the reference swing curve and has become a widely used controller. Nandi and Park [16,17] applied a PD controller to control MR prostheses, but the parameter settings depend on experience. Moreover, since the MR prosthesis is a strongly non-linear system, especially the multi-axis MR prosthetic knee joint, the non-linear term of the system will greatly interfere with the PD controller. Therefore, Cong and Kim [18,19] added calculated torque, iterative learning, a neural network, and other nonlinear compensation items based on a PD controller to compensate for the influence of knee joint control swing angle. Aiming at the influence of the hysteresis effect of the MR damper on the swing angle of the MR prosthesis, Fu [20] designed a sliding mode trajectory tracking control (SMTC), and the simulation results illustrate that the SMTC controller had a good control effect and robustness for knee joint swing. Scandaroli [21] introduced adaptive control to the swing control of MR prostheses and proposed a model reference adaptive control (MRAC) algorithm, the principle of which is to design an appropriate adaptive law to estimate the model parameters and adjust the controller output to make it follow the desired trajectory. To solve the problem of parameter uncertainty and strong coupling, Fang et al. [22] devised an adaptive robust force/position control algorithm that makes use of time delay estimation technology, sliding mode control and a fuzzy neural network to achieve finite-time convergence and gait tracking. The simulation results indicate that this strategy has better trajectory tracking characteristics and strong robustness in the presence of unknown external interference. Electromyography (EMG) signal control system is a control method that, by judging the gait based on the electrical muscle signal and then controlling the movement of the prosthesis. Huang et al. [23,24] used surface electromyography (S-EMG) signals as the basis of intention recognition in continuous walking mode. The results show that the algorithm designed by the support vector machine (SVM) has a high road condition recognition ability, reaching more than 99% in the stance phase. A summary of related research work in the past is shown in Table 1. Huang et al [23,24] In this paper, the structure of an MR prosthetic knee joint is developed according to the gait data of healthy people, and its movement and dynamics models are also established. Then the MR damper is designed; the forward and reverse mechanical models of the MR damper are derived, and the dynamic performance of the MR damper is obtained through experimental tests. Finally, to solve the uncertainties and the existence of external interference in the MR prosthetic knee joint system, a second-order sliding mode trajectory tracking control method is proposed, and the built MR prosthetic knee joint control system is used to test and analyze its control effect on the swing angle of the knee joint.

Design of MR Prosthetic Knee Joint
A complete movement cycle can be divided into a support phase and a swing phase according to the classification of walking characteristics [25]. Figure 1 shows the reference swing curves of the hip and knee joints when a normal person walks on flat ground. It can be seen that the bending extension angle of the normal knee joint is 2°~15° in the standing stage, and the bending extension angle of the normal knee joint is 2°~60° in the swinging stage. The flexion and extension angle of the normal hip joint is −15°~ 22°.  Figure 2 shows the change of thigh swing angle 1 and calf swing angle 2 when a normal person walks on flat ground. It can be seen that the thigh swing angle 1 has a minimum value of −19.1° at the gait cycle of 52%, and the thigh swing angle 1 has a maximum value of 24.7° at the gait cycle of 0%. When the gait period is 67%, the calf swing angle 2 has a minimum value of −61.4°, and the maximum leg swing angle 2 is 21.5° at the gait period of 0%. The thigh swing angle 1 and the calf swing angle 2 are fitted using Matlab software, and the fitting equation can be expressed as: where w is the movement frequency with a value of 1 Hz; t is the time with a value of 1 s; a1 i, a2 i, a3 i, b1 i, b2 i and b3 i are the fitting parameters. The specific fitting parameters are shown in Table 2.  Figure 3 shows the three-dimensional model of MR prosthesis, and Figure 4 shows the structural principle of MR prosthesis. The MR prosthesis is mainly composed of thigh link, MR prosthetic knee joint, connecting tube and a prosthetic foot, among which the MR prosthetic knee joint consists of a two-link mechanism and a MR damper. The twolink mechanism includes a knee joint link and a shell. The knee joint link is connected to the thigh link; the shell part is connected to the prosthetic foot through a connecting tube, and the knee joint link and the shell are connected through hinge C. The lifting lugs at both ends of the MR damper are respectively connected to the knee joint connecting rod and the shell through hinges B and D. The key structural parameters of MR prostheses are shown in Table 3.   It can be seen from Figure 4 that the length of the MR damper can be expressed as:

Working Principle of MR Prosthetic Knee Joint
where lCD is the length from hinge C to hinge D, and lCB is the length from hinge C to hinge B, whose values are 240 mm and 45 mm, respectively. Substituting Equations (1)-(3), the length of the MR damper is obtained and shown in Figure 5. It can be seen that the length of the MR damper reaches the maximum and minimum values at the gait cycle 72% and 100% respectively, which are 227 mm and 193.7 mm. Therefore, the stroke of the proposed MR damper should be greater than 33.3 mm.

Kinetic Modeling of MR Prosthetic Knee Joint
To realize the controllable damping force of the MR prosthetic knee joint and reasonably design the MR damper structure, it is necessary to determine the required damping force of the MR prosthetic knee joint. Since the control object of the MR prosthetic is the knee joint, the main research is to control the knee joint in the swing phase. According to the Lagrangian equation, the kinetic equation of the MR prosthetic knee joint in the swing phase can be expressed as: (4) where 1 and 2 are the moments applied to hinge E and hinge C, respectively; 1 and 2 are the angles between EC, CA and the vertical direction respectively; M11, M12, M21 and M22 are the moments of inertia matrix components respectively; C1 and C2 represent the centripetal force and Coriolis force of EC and CA respectively; G1 and G2 express the gravity of EC and CA, respectively.
The moment of inertia matrix components M11, M12, M21 and M22 can be expressed as: where I1 and I2 are the moments of inertia of EC and CA, respectively; m1 and m2 are their masses, respectively; lp1 and lp2 are the lengths to their center of mass, respectively.
Coriolis force C2 can be expressed as: where l1 is the length of EC.
The gravity G2 can be expressed as:

 
The control torque 2 of MR damper acting on hinge C is: where F is the output damping force of the MR damper; d is the distance from hinge C to BD, which can be expressed as: where l2 is the AC length, and lMRD is the BD length. Substituting Equations (5)- (11) into (4), it can be deduced as: It can be seen that the MR prosthetic knee joint is a highly nonlinear system. Nonlinear terms such as moment arm d, Coriolis force C2 and self-weight G2 will affect the knee angle control of the MR prosthetic knee joint.

Structure Principle of the Proposed MR Damper
According to the working principle of the MR damper, the designed MR damper is shown in Figure 6. As can be seen from the figure, the MR damper is mainly composed of lifting lugs, piston rods A and B, an end cover, a cylinder, a coil winding frame and an excitation coil. Among them, piston rods A and B are connected to each other through threads and play the role of fixing the coil winding frame. The excitation coil is evenly wound on the coil winding frame; both of them form a piston head, and there is an annular gap between the piston head and the MR damper cylinder. The MR fluid flows into the cylinder of the MR damper to make the gap between the piston head and the cylinder form an effective damping channel. The piston rod moves up and down due to external vibration, so that the MR fluid in the upper and lower chambers flows back and forth at the effective damping gap. The excitation coil is powered on, and a variable magnetic field is generated. The rheological characteristics of the MR fluid change under the action of the magnetic field. The viscosity of the MR fluid increases as the increase of current, that is, the pressure difference between the two ends of the effective damping gap, increases. Therefore, within a certain range, the output damping force of the MR damper can be adjusted by controlling the applied current of the excitation coil.  Figure 7 shows the prototype of the developed MR damper. To test the dynamic characteristics of the proposed MR damper, a test system is set up as shown in Figure 8. The test system is generally composed of a fatigue stretching machine, MR damper, DC power supply, electro-hydraulic loading controller and PC. The fatigue stretching machine provides different types of excitation for the MR damper. The DC power supply offers different current signals for the excitation coil. The electro-hydraulic loading controller is used to adjust the working state of the stretching machine and to adjust the damping force and displacement on the fatigue stretching machine. The signal is transmitted to the data acquisition interface of the PC.   Figure 9 shows the dynamic performance of the MR damper under different currents at an amplitude of 15 mm and a frequency of 1 Hz. Observing Figure 9 a, it can be seen that the damping force increases with the increase of the applied current. The output damping force is 22.4 n at zero current, and the output damping force reaches 147.7 n at a current of 2 A. Observing Figure 9 b, when the current is fixed, the damping force increases slightly with the increase of velocity. When the speed is fixed, the damping force increases significantly with the increase of current, but when the current exceeds 1.6 A, the increasing trend of damping force gradually slows down; the reason is that the magnetic circuit of the MR damper tends to saturate with the increase of current.

Establishment of Forward Mechanics Model of the MR Damper
The Bingham model can effectively reflect the relationship between the output damping force and the structural parameters, but the accuracy of the model is not high when the damper works in low speed. To accurately reflect the mechanical properties of the MR damper, the adjustable sigmoid model shown in Figure 10 is used to establish a positive mechanical model of the MR damper. The adjustable sigmoid model is formed by the parallel combination of the sigmoid function and the viscous damping element, which is expressed as: where Fm is the maximum yield force, which affects the length of the hysteresis loop; a is the parameter related to the damping coefficient of the pre-yield zone; k is the scale factor of the hysteresis loop width; C0 is the viscous damping coefficient, and f0 is the bias damping force. Since the applied current has a great influence on the output damping force, the parameters of the damping force data under different currents are identified. Based on the least square method, the relationship between parameters and the currents is acquired. The parameter identification results are shown in Table 4. It can be seen that the parameters a, k and C0 do not change significantly with the current, but the parameters Fm and f0 are greatly affected by the current. Therefore, the average value of the identified a, k, and C0 is used to replace the parameters in the model, that is, the values of a, k, and C0 are 0.32, −0.47 and 0.33, respectively. The polynomial fitting method was adopted to fit the relationship between the parameters Fm, f0 and the current, and the results are shown in Figure 11. It can be seen that the parameter Fm increases with increase of the current, while the parameter f0 decreases with increases of the current. The relationship between parameters Fm, f0 and current can be expressed as follows: where b1, c1, b2 and c2 are fitting parameters. According to the results of parameter identification, an adjustable sigmoid model is established and compared with the experimental data, the result is shown in Figure 12. It can be seen that the established adjustable sigmoid model can better reflect the characteristics of damping force with displacement and damping force with velocity. Compared with the Bingham model based on structural parameters, the adjustable sigmoid model can better reflect the damping characteristics of the MR damper at low speeds.

Establishment of Reverse Mechanics Model of the MR Damper
In order to make the MR damper accurately output the expected damping force, a reverse mechanical model of the MR damper is needed. Since the relationship between the current and the damping force cannot be directly inverted and since the BP neural network can realize the approximation of any nonlinear mapping relationship and has a strong generalization ability, the BP neural network is used to establish the inverse mechanical model of the MR damper.
Due to the limited experimental data, the established adjustable sigmoid model data is used as the training and verification samples of the BP neural network. Training samples are obtained by changing the piston rod displacement, piston rod speed and output  damping force in the adjustable sigmoid model. The sample data is randomized, and the BP neural network is initialized for training, and finally, the data is normalized. The established BP neural network is trained and verified by setting the training number to 100 times. The result is shown in Figure 13. It can be seen that the fitted value of the BP neural network is close to the sample value, showing a sinusoidal distribution. Figure 14 shows the error curve between the sample value and the fitted value, and the maximum training error of the BP neural network is only 0.026.

Trajectory Tracking Control Based on Second-Order Sliding Mode
Due to uncertainties and external interference, traditional PD control cannot track the knee joint swing trajectory well in the MR prosthesis control model. In addition, the firstorder sliding mode control is to make the control system switch on the sliding mode surface, which easily causes the chattering phenomenon in the control system. Therefore, a second-order sliding mode control (SOSMC) algorithm is developed to control the swing trajectory of the actual MR prosthesis. The sliding mode surface of sliding mode control is constituted of the error and derivative of the current state quantity and the ideal state quantity of the system, and the phase plane is defined to make the state variables converge on the ideal state. The SOSMC algorithm can effectively eliminate the chattering phenomenon of the system by designing its sliding mode surface and switching rate. The principles of SOSMC are shown in Figure 15, which mainly includes equivalent continuous term and equivalent discrete term. The proposed SOSMC can be expressed as: where τeq is the equivalent continuous term, and τdis is the equivalent discrete term. The equivalent continuous term can be expressed as: where S is the sliding mode surface function; λ is the parameter to be designed and 2 d   is the second derivative of the reference gait.
The sliding mode surface function S is defined as: The equivalent discrete term is established by using super-twisting, which can be expressed as: In the Equation (19), the positive real numbers μ1 and μ2 need to satisfy: where 0 , , and The Lyapunov function V is defined as: Taking the derivative of V, it can be obtained as: Substituting Equation (18) into Equation (23), the derivative of V is: Substituting Equation (25) into Equation (24), it can be obtained as: Substituting Equations (16), (17) and (19) Since μ1 and μ2 are positive real numbers, and 0 t  , it can be deduced as:

Test System Setup
In order to test the designed MR prosthesis, the thigh receiving cavity is processed by 3D printing technology according to the relevant parameters of the thigh of the experimenter. The receiving cavity material is processed by the photosensitive resin, which can ensure that the receiving cavity has a certain strength and toughness so that it is convenient to fix with the MR prosthesis and the leg of the experimenter. In addition, the upper link and the lower link are made of aluminum alloy, which effectively reduces the weight of the MR prosthesis. The connecting tube is made of stainless steel, and its length can be adjusted according to the height of the experimenter, so as to ensure that the experimenter can stand normally and swing the legs. The prosthetic footboard is made of silicone material and rigidly connected with the connecting tube. Since the focus is on the trajectory tracking of the knee joint, the degree of freedom at the ankle joint is ignored.
The MR prosthesis control system and its prosthetic test system are shown in Figures  17 and 18, respectively, mainly including MR prostheses, microcontrollers, potential sensors, a data acquisition system and corresponding wearable devices. The control system is based on a single-chip microcomputer and consists of a signal conditioning module, a decision module, a controller module, a reverse model and a positive model of the MR damper. The working diagram of the MR prosthesis is shown in Figure 19, wherein the piezoelectric potentiometer converts the electrical signal during the swinging process of the prosthesis into an angle signal. The DC power supply supplies power to the microcontroller and the MR damper; the control torque signal generated by the microcontroller is converted into a current signal through the decision module, and the signal is controlled by the current driver to control the current of the MR damper. The data acquisition card is used to collect the angle signal detected by the potential sensor and import it into the PC. In addition, the monitor platform in the PC is used to adjust the relevant parameters of the designed controller offline, so that the MR prosthesis can better track the reference gait.

Analysis of Trajectory Tracking Control
The swing trajectory of the MR prosthetic knee joint based on SOSMC is shown in Figure 20. It can be seen that the MR prosthesis can better track the motion trajectory of the knee joint, but there are relatively obvious errors around the gait cycle of 15%-18% and 68%−72%. In the gait period of 76%−94%, the knee joint swing trajectory can almost achieve the unbiased tracking of the knee joint reference trajectory, but when the gait period is 100%, the knee joint swing angle has a lower error than the reference swing angle. The reason is may be that the MR prosthesis is in contact with the ground at this moment, and impacts on the ground affect gait quality.  reference swing trajectory is −3.8° at the gait cycle of 77%. The main reason is that the range of damping force of the MR damper is limited, which means the control torque of SOSMC cannot reach the expected value.

Conclusions
In this work, a new MR prosthetic knee joint using an MR damper as the brake is designed, and a dynamic model is established according to the gait data of healthy people walking on flat ground. To investigate the performance of the MR prosthesis knee joint, an MR damper is designed, and its dynamic performance is also tested. A forward mechanical model of the MR damper based on the adjustable sigmoid model is deduced, and an inverse mechanical model of the MR damper is also proposed using BP neural network.
The SOSMC algorithm is developed considering the uncertainty of the MR prosthesis model and the existence of external interference, and an MR prosthesis knee joint experimental test system is set up. The experimental test results show that the maximum positive error of the knee joint swing trajectory based on SOSMC is 9.4°, which effectively proves that the MR prosthesis tracks the reference swing trajectory well.
However, a mature prosthesis must consider the impact of various realistic terrain and environmental conditions. Meanwhile, it must be tested for different use scenarios to realize commercialization and marketization. In the next work, further verification of the reliability of the prosthesis on conventional roads will be carried out.