Kinematic Calibration of a Parallel 2-UPS/RRR Ankle Rehabilitation Robot

In order to better perform rehabilitation training on the ankle joint complex in the direction of dorsiflexion/plantarflexion and inversion/eversion, especially when performing the isokinetic muscle strength exercise, we need to calibrate the kinematic model to improve its control precision. The ankle rehabilitation robot we develop is a parallel mechanism, with its movements in the two directions driven by two linear motors. Inverse solution of positions is deduced and the output lengths of the two UPS kinematic branches are calibrated in the directions of dorsiflexion, plantarflexion, inversion, and eversion, respectively. Motion of each branch in different directions is fitted in high-order form according to experimental data. Variances, standard deviation, and goodness of fit are taken into consideration when choosing the best fitting curve, which ensures that each calibration can match the most appropriate fitting curve. Experiments are conducted to verify the effectiveness of the kinematic calibration after finishing the calibration, and the errors before and after calibration of the two kinematic chains in different directions are compared, respectively, which shows that the accuracy after calibration has been significantly improved.


Introduction
Rehabilitation training is an effective way to help patients restore their ankle joint complex's (AJC) motor abilities for patients with ankle injuries. e movement of AJC has three Degrees of Freedom (DOFs), Dorsiflexion/Plantarflexion (DO/PL), Inversion/Eversion (IN/EV), and Adduction/ Abduction (AD/AB) [1], with its coordinate system definition shown as in Figure 1.
To augment conventional physical therapy, many robotic ankle rehabilitation devices have been developed to provide repetitive, task-specific, interactive treatment of the impaired limb and monitor its motor recovery [2][3][4][5][6]. Passive rehabilitation training, which means that the AJC is driven by the robot for rehabilitation at a predetermined trajectory, is often used in the early stage of ankle therapy. Many ankle rehabilitation robots have realized the trajectory tracking control for passive rehabilitation training [7][8][9]. To improve the effect of rehabilitation training, many active rehabilitation training methods including the active participation of patients have been developed such as the ARBOT [5], CARR [10], and Anklebot [11]. Among different kinds of ankle rehabilitation robots, the platform ones are better suited for ankle exercises [12], and parallel mechanism is the most common among them with the above-mentioned exercise modes [5,6,13,14].
Besides that, isometric and isotonic exercises have also been developed for muscle strength exercises of AJC [5,15]. However, there was no isokinetic muscle strength exercise specially developed for ankle rehabilitation robot, during which the exercise speed is constant, while the resistance encountered varies with the degree of exertion, so that the muscle tension of the moving ankle maintains the optimal state of strength training [16], and the isokinetic muscle strength exercise is usually used for strength training with only one DOF per time. ere have been isokinetic exercises used for joint rehabilitation, such as the IsoMed-2000 developed by D. & R. Ferstl, Germany [17].
To realize the isokinetic muscle strength exercise in DO/ PL and IN/EV direction using our developed 2-UPS/RRR parallel ankle rehabilitation robot (PARR), we need to have the precise kinematic model of the two UPS kinematic branches. U, P, S, and R stand for universal, prismatic, spherical, and revolute joint, respectively, and the underlined letter represents the actuated joint. Considering machining and assembly errors, the designed robot needs to be calibrated firstly to make the positional inverse solution obtained by theoretical analysis more accurately. e conventional approach toward kinematic calibration generally begins with formulating the problem in terms of constraint equations that are derived from the kinematic model of the robot. In the data acquisition phase, the pose of the moving platform and the corresponding actuated joint coordinates are obtained. Finally, a suitable optimization method utilizes the obtained data to determine the actual geometry [18]. In contrast, an alternative response surface methodology based method is proposed for performing kinematic calibration that does not require constraint equations and additional input data [19] and physical experiments have been conducted on a 3-PSS/S mechanism to evaluate the accuracy. By analyzing different objective functions for the parameter identification of parallel mechanisms and studying the influence in the position and orientation errors to improve their accuracy, a new objective function considering deviation terms is presented in [20], showing better kinematic parameters identification performance corresponding with passive joints that cannot be measured. Reference [21] proposes a stepwise approach to kinematic calibration of a 5-DOF Gantry-Tau parallel kinematic machine and achieves accuracy of about 20 micrometers for the base actuators by using measurements from a laser tracker and least-squares estimates of polynomial functions. Besides that, the kinematic calibration problem of overconstrained PM is addressed in [22] to improve accuracy and promote its practical application. Instead of establishing conventional error mapping model, a nonlinear error model is built by inserting geometric errors of parts to the real inverse position analysis, and the nonlinear identification equations are directly solved by optimization technique, with results showing very good orientation accuracy. Besides that, maximum likelihood estimation (MLE) is also often used for the calibration of robot or sensors [23].
In this work, we focus on the kinematic calibration of our 2-UPS/RRR PARR according to field experiments and highorder data fitting, with variances, standard deviation, and goodness of fit as the criterion of fitting evaluation. e rest of the paper is organized as follows. Section 2 demonstrates the inverse solution of positions of the PARR. e kinematic calibration process is presented in Section 3. Section 4 displays the experiments and validation, while conclusions are drawn and discussed in Section 5.

Mechanical Design of the PARR.
e mechanical structure of the developed 2-UPS/RRR PARR is shown in Figure 2. e mechanism is very simple with only a fixed base, a moving platform, two UPS kinematic branches, and a series RRR constraint branch, with its three rotation axes orthogonal to one point. It has three DOFs, with its three rotational DOFs, respectively, equipped with absolute encoders (CALT HAN28E5V360A2, analog output, resolution ±0.1%). e controller and the data acquisition system used in the robot are based on STM32F103ZET6, and the drivers used for the motors are HDT Servodrives DX060. e advantage of the designed PARR is that different patients' rotation centers of the AJC can coincide with the mechanism's rotation center in addition to its compact configuration. e estimated range of motion (ROM) of the human AJC in each direction is given in Table 1 [24], which is used as a reference to design the allowable motion range of the mechanical limits. Specifically, the limits for the rotation angles of the PARR are set as in Table 1, which determine the maximum allowable workspace (MAW) of the parallel mechanism and ensure that the robot is suitable for the left and right AJCs.
Details of mechanical design of the developed PARR are shown in our previous work [25]. During the ankle isokinetic muscle strength exercise, only the movements of DO/ PL and IN/EV are usually considered. erefore, here we just study the kinematic calibration of the two UPS kinematic branches actuated by two linear motors (SKF CAHB-10, driving distance of 150 mm).

Coordinate System of the Parallel Mechanism.
e kinematic coordinate system of the parallel 2-UPS/RRR rehabilitation robot is shown as in Figure 3(a) [26]. e fixed coordinate system O − X o Y o Z o and the moving coordinate system M − X m Y m Z m are established at the rotation center of the mechanism coinciding at the initial position, all along the directions of three rotation axes. e moving coordinate system is fixed on the moving platform of the parallel mechanism. A i , B i , and C i (i � 1, 2, 3) are the moving distances of the universal joint, spherical joint, and prismatic joint, respectively. e revolute joints R 1 , R 2 , and R 3 are orthogonal to point "O," with their rotation angles being c, α, and β in turn, respectively, where α represents the angle of DO/PL and β represents the angle of IN/EV (right foot here),  Moving platform Fixed base

Constraint branch
Moving platform while c denotes the angle of AD/AB, and the angle value is defined to be positive with counterclockwise rotation.
e coordinate system of the UPS branch is shown in Figure 3(b), where A i − X A,i Y A,i Z A,i is the coordinate system whose origin A i is at the center of the universal joint with its axis X A,i coinciding with the first axis of the universal joint and axis Y A,i coinciding with second axis of the universal joint when the mechanism is in the initial position: i is the coordinate system whose origin C i is at the center of the universal joint with its axis Y C,i coinciding with the second axis of the universal joint and Z C,i coinciding with the mechanism rod vector i is the coordinate system whose origin B i is at the center of the spherical joint with its three axes parallel with the corresponding axes of

Inverse Solution of Positions.
e inverse solution of positions is to deduce the inputs of three branches based on the output angles of the moving platform around the fixed coordinate system, that is, the above-mentioned α, β, and c. e rotating matrix R OM of the moving platform relative to the fixed base can be expressed as in the following equation: where c and s are the abbreviations of cos and sin, respectively. en, the position vector of the center of spherical joint B i in the O − X o Y o Z o coordinate system can be expressed as in the following two equations, respectively:  (2) and (3), we can obtain (4), where represents the length of the inside vector.
According to the parameters of the developed 2-UPS/ RRR PARR, the coordinate values of points B 1  erefore, we can get the theoretical inverse solution of positions as in the following equation: For our PARR, the angle of AD/AB c is equal to the rotation angle of the servo motor due to the mechanical design of the parallel mechanism. Considering the isokinetic muscle strength exercise, the kinematic calibration here is mainly for the movement of DO/PL and IN/EV; that is, we need to compensate the output length of the two UPS kinematic branches to get the accurate relationship between l i and α and β.
From (5), we can get the initial values of l 1 and l 2 as in the following equation: e length changes of l 1 and l 2 during DO/PL are as in (8), from which we can see that Δl 1 � Δl 2 , and their direction is consistent.

Movement of IN/EV. During the movement of IN/EV
(α � c � 0), we can deduce the values of l 1 and l 2 as follows: e length changes of l 1 and l 2 during IN/EV are as in the following equation: We can see that Δl 1 ≠ Δl 2 during the movement of IN/EV when β ≠ 0 and they change in the opposite direction. Based on the above analysis, Δl 1 and Δl 2 can be calibrated simultaneously during DO/PL, while during IN/EV, Δl 1 and Δl 2 need to be calibrated separately.

Calibration Process of the Designed
Parallel Mechanism e error model of the kinematic calibration is as in (11), and we do not know the exact form of the errors in advance.
During the calibration, firstly, we control the output lengths of l 1 and l 2 using the position controller for the two linear actuators to realize the movement of DO/PL and IN/ EV, respectively. Secondly, we record the corresponding output angles of DO/PL and IN/EV, that is α, β, respectively. Finally, the recorded α and β are used to deduce the theoretical values of the lengths of l 1 and l 2 according to the inverse solution of positions. e difference between the theoretical values of l 1 and l 2 and the controlled lengths of l 1 and l 2 is used to calculate and compensate the errors. e result of calibration in DO/PL is as in Figure 4, from which we can see that the error trends in DO and PL are different, so we calibrate them separately. e second-order fitting, third-order fitting, fourth-order fitting, fifth-order fitting, and sixth-order fitting are, respectively, performed on the errors between actual and theoretical values of l 1 and l 2 during the movement of DO, with their fitting results shown as in Figure 5. In order to better analyze the results, we calculate the variances, standard deviations, and goodness of fit of each of the fitting values with the errors, as shown in Table 2, where Var, Std, and R 2 represent the variance, standard deviation, and goodness of fit, respectively.
After comprehensive consideration of variances, standard deviations, goodness of fit, and computation complexity according to the fitting result, we define the criterion of choosing the optimal fitting curve as in the following equation: According to Figure 5 and Table 2, we choose fifth-order fitting as the optimal fitting curve of error compensation of l 1 and l 2 in DO direction as in the following equation: 3.1.2. Error Calibration of l 1 and l 2 in PL Direction. e second-order fitting, third-order fitting, fourth-order fitting, fifth-order fitting, and sixth-order fitting are, respectively, performed on the errors between actual values and theoretical values of l 1 and l 2 during the movement of PL, with their fitting results as in Figure 6. e variance, standard deviation, and goodness of fit of each of the fitting values with the errors are shown in Table 3.
According to Figure 6 and Table 3, we choose secondorder fitting as the optimal fitting curve of error compensation of l 1 and l 2 in PL direction as in the following equation: Figure 7, from which we can see that the error trends in IN/EV are also different, so we will calibrate them separately.

Error Calibration of l 1 in IN Direction.
e secondorder fitting, third-order fitting, fourth-order fitting, fifthorder fitting, and sixth-order fitting are, respectively, performed on the errors between actual values and theoretical values of l 1 during the movement of IN, with their fitting results shown as in Figure 8. e variance, standard deviation, and goodness of fit of each of the fitting values with the errors are shown in Table 4.
According to Figure 8 and Table 4, we choose third-order fitting as the optimal fitting curve of error compensation of l 1 in IN direction as in the following equation:

Error Calibration of l 1 in EV Direction.
e secondorder fitting, third-order fitting, fourth-order fitting, fifthorder fitting, and sixth-order fitting are, respectively, performed on the errors between actual values and theoretical values of l 1 during the movement of EV, with their fitting results shown as in Figure 9. e variance, standard deviation, and goodness of fit of each of the fitting values with the errors are shown as in Table 5.
According to Figure 9 and Table 5, we choose secondorder fitting as the optimal fitting curve of error compensation of l 1 in EV direction as in the following equation:

Calibration of l 2 in IN/EV Direction.
e result of l 2 calibration in the direction of IN/EV is as in Figure 10, from which we can see that the error trends in IN/EV are also different, so we also calibrate them separately.

Error Calibration of l 2 in IN Direction.
e secondorder fitting, third-order fitting, fourth-order fitting, fifthorder fitting, and sixth-order fitting are, respectively, performed on the errors between actual values and theoretical values of l 2 during the movement of IN, with their fitting results shown as in Figure 11. e variance, standard deviation, and goodness of fit of each of the fitting values with the errors are shown in Table 6.
According to Figure 11 and Table 6, we choose thirdorder fitting as the optimal fitting curve of error compensation of l 2 in IN direction as in the following equation:

Error Calibration of l 2 in EV Direction.
e secondorder fitting, third-order fitting, fourth-order fitting, fifth-order fitting, and sixth-order fitting are, respectively, performed on the errors between actual values and theoretical values of l 2 during the movement of EV, with their fitting results shown as in Figure 12. e variance, standard deviation, and goodness of fit of each of the fitting values with the errors are shown in Table 7.
According to Figure 12 and Table 7, we choose secondorder fitting as the optimal fitting curve of error compensation of l 2 in EV direction as in the following equation: 3.4. Calibration Results of l 1 and l 2 . rough the above analysis, we can obtain the calibration results of the controlled lengths of l 1 and l 2 for the two linear actuators, which are the calibrated inverse solutions of positions.

Experiments and Validation
In order to better verify the calibration effect of the PARR, we conducted relevant experiments in the directions of DO/ PL and IN/EV, respectively. e method is to control the input of l 1 and l 2 and record the output angles of α and β, used to deduce the controlled lengths of l 1 and l 2 according to the calibration results. By comparing the inputs of l 1 and l 2 with the deduced lengths of l 1 and l 2 according to the calibration results, we can judge whether the calibration result is valid or not. Firstly, we control the lengths of l 1 and l 2 using position controller for the two linear actuators to realize the movements of DO/PL and IN/EV, respectively. e lengths of l 1 and l 2 are controlled to run 1.875 mm (100 pulses) at a time. en, we record the corresponding α, β, respectively. Lastly, the theoretical inputs of l 1 and l 2 are deduced based on the calibration results from (19) to (22) and the obtained α, β. By comparison with the theoretical inputs of l 1 and l 2 deduced from the inverse solution of positions without calibration, we can verify the effectiveness of the kinematic calibration of the parallel rehabilitation mechanism. e prototype of the 2-UPS/RRR PARR system used is as in Figure 13, with its human machine interface of the upper computer developed using C# programming language.

Results of DO.
e experiment results of Δl 1 and Δl 2 in DO (Δl 1 � Δl 2 , α > 0) are as in Table 8, where Δl 1ref denotes the controlled input length of l 1 with its unit being mm, α output is the detected angle of DO with its unit being°), l 1no represents the theoretical input of l 1 without kinematic calibration, and l 1yes denotes the theoretical input of l 1 with kinematic calibration, while err no and err yes represent the corresponding errors, respectively. For the reason that Δl 1 � Δl 2 , we just show l 1 in Table 8 for the sake of simplification.
In order to show the error changes before and after calibration more intuitively during the DO movement, we compare the errors before and after calibration in the same figure, as in Figure 14.

Comparison of Errors before and after Calibration.
Based on the experiment results, the average errors before and after calibration are shown in Figure 18, where Err l 1 uncali, Err l 1 cali, Err l 2 uncali, and Err l 2 cali denote the errors of l 1 without calibration, errors of l 1 with calibration, errors of l 2 without calibration, and errors of l 2 with calibration, respectively. e average errors of l 1 after calibration in the four directions have reduced by 98.32%, while the average errors of l 2 after calibration in the four directions have reduced by 98.33%.

Analysis of the Calibration Results
. From (15) to (18), we can see that the calibration results of l 1 and l 2 in the IN and EV directions have almost the same behaviour and fitting orders, while from (13) and (14), we can see that l 1 and l 2 in the DO and PL directions have different behaviour and different fitting orders. e reason for this is that the two linear motors (SKF CAHB-10) used for actuating the two UPS kinematic branches are not servo motors and suffer from their nonlinear control, except for the mechanism's machining and assembly errors. In spite of this, we can see from Figure 18 that the errors after calibration become very small and the precision is significantly improved. e fact that that there is no need to calibrate the PARR before each use needs to be specially noted. e calibration results have been added in the control system to improve the control precision for isokinetic muscle strength exercise.

Conclusion
Kinematic calibration of the two UPS kinematic branches of the developed 2-UPS/RRR PARR is conducted and described in this paper in detail in order to improve the control precision for the rehabilitation training like isokinetic muscle strength exercise. Motion of each branch in different directions is fitted in high-order form according to experimental data. Variance, standard deviation, and goodness of fit are taken into consideration when choosing the best fitting curve. Experiments have been conducted, which show that the accuracy after calibration has been significantly improved and verify the effectiveness of the kinematic calibration.
In the future, we will study the repeatability performance of the kinematic calibration, as the repeatability of the kinematic calibration is an important aspect for the validation of the procedure. In addition, we will also focus on the kinematic calibration in the direction of AD/AB, compliant and interactive control strategies, as well as multimode rehabilitation training method.

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