Admittance Controller Complemented with Real-time Singularity Avoidance for Rehabilitation Parallel Robots

Rehabilitation tasks demand robust and accurate trajectory-tracking performance, mainly achieved with parallel robots. In this field, limiting the value of the force exerted on the patient is crucial, especially when an injured limb is involved. In human-robot interaction studies, the admittance controller modifies the location of the robot according to the user e ff orts driving the end-e ff ector to an arbitrary location within the workspace. However, a parallel robot has singularities within the workspace, making implementing a conventional admittance controller unsafe. Thus, this study proposes an admittance controller that overcomes the limitations of singular configurations by using a real-time singularity avoidance algorithm. The singularity avoidance algorithm modifies the original trajectory based on the actual location of the parallel robot. The complemented admittance controller is applied to a 4 degrees of freedom parallel robot for knee rehabilitation. In this case, the actual location is measured by a 3D tracking system because the location calculated by the forward kinematics is inaccurate in the vicinity of a singularity. The experimental results verify the e ff ectiveness of the proposed admittance controller for safe knee rehabilitation exercises.


Introduction
Robotic rehabilitation can help patients recover and improve their mobility by performing repetitive movements aided by a robot under the supervision of a physiotherapist [1].For example, a robot can move the human limb accurately to perform lower limb rehabilitation over prolonged sessions [2].Among rehabilitation robots, a parallel robot (PR) offers excellent load capacity, stiffness, and accuracy [3].Thus, these features allow integrating PRs into rehabilitation tasks [4].In general, PRs are mechanical devices that control the end-effector by at least two closed kinematic chains where only a subset of joints are actuated [5,6].
Motion rehabilitation therapies can be divided into patientpassive and patient-active exercises.In the patient-passive exercise, the robot follows a reference trajectory defined by the therapist without considering the patient interaction, i.e., the robot requires a trajectory controller [7].In a patient-active exercise, the robot modifies the motion defined by the therapist according to the forces exerted by the patient [8].The control strategies applied to patient-active exercises are admittance control [9], hybrid force/position control [10], bio-signals based control [11], and adaptive control [12].The admittance control allows a dynamic relationship between the robot position and the patient effort making it one of the most appropriate for rehabilitation [8].
The admittance controller interacts with the patient by modifying the original trajectory according to the force exerted by the limb during rehabilitation [13].The original trajectory can be modified using a mass-spring-damper system that provides compliant behaviour to the robot within the entire workspace [14,15].However, singular configurations, such as Type II singularity, arise inside the workspace of a non-redundant PR [16].In this type of singularity, the PR cannot withstand external forces even if the actuators are locked, i.e., the patient loses control of the end-effector [17].Thus, conventional admittance controllers cannot be straightforwardly implemented in a PR because the patient could unintentionally drive the PR to a Type II singularity, which is an unsafe position.
McDaid, Tsoi and Xie [18] applied an admittance controller to an ankle rehabilitation PR after optimising the singularityfree workspace.Dong et al. [19] implemented an admittance controller by constraining the workspace by limiting all degrees of freedom (DOF) of the PR using mechanical stoppers.However, the optimisation procedures reduce the workspace of the PR, and in most non-redundant PR, a small percentage of singularities remain within the workspace [20].As the PR interacts with an injured limb or with a constrained mobility limb, ensuring an accurate avoidance of Type II singularities is essential.Thus, an additional approach is required to handle Type II singularities to make the admittance controller suitable for rehabilitation tasks with a PR.
Pulloquinga et al. [21] proposed the minimum angle be-tween two instantaneous screw axes from the Output Twist Screws (Ωi, j) to measure the closeness to a Type II singularity in spatial PRs.The minimum angle Ωi, j is calculated based on the actual location and orientation (pose) of the PR where the subindices i, j identify the actuators involved in the singular configuration.The study showed that the minimum Ωi, j is an effective proximity detector for Type II singularities.However, the approach was not implemented for offline or online trajectory planning.Subsequently, in [22], the authors developed a vision-based controller to release a 4-DOF PR for knee rehabilitation from a Type II singularity.The proposed controller releases the PR from a singularity by modifying the trajectory of the pair of actuators identified by the minimum Ω i, j.The actual pose of the PR is measured by a 3D tracking sensor to deal with the non-unique solution of solving the forward kinematics near a Type II singularity [23].This approach cannot prevent the 4-DOF PR from reaching a singular configuration.Thus, in [24] a Type II singularity avoidance algorithm based on the minimum Ωi, j was developed for offline singularity-free trajectory planning in a 4-DOF PR.In [25] the proposed Type II singularity avoidance algorithm was extended for online singularity-free trajectory planning in a 4-DOF PR for knee rehabilitation.The proposed singularity avoidance algorithm exhibits low computational cost and minimum deviation of the original trajectory.However, the Type II singularity avoidance algorithm was not applied to patient-active knee rehabilitation with a human limb, i.e., the proposed algorithm was not involved in force/position control.This study proposes an admittance controller improved with a real-time singularity avoidance algorithm for PRs.The proposed controller is applied to a 4-DOF PR for knee rehabilitation tasks.The contributions of this study are twofold.The first is to improve the admittance control with a real-time singularity avoidance algorithm.The complemented admittance controller ensures complete control over the end-effector during humanrobot interaction without optimising the workspace or adding mechanical limits.The effectiveness of the complemented admittance controller in rehabilitation procedures is verified by executing patient-active exercises with the actual 4-DOF PR.The patient-active exercises are performed with a mannequin limb and a human limb.The second contribution is that the proposed Type II singularity avoidance algorithm in [25] was combined with a trajectory controller.Therefore, the singularity avoidance algorithm is combined for the first time with a force/position control law.
The remaining of this manuscript is as follows.Section 2 introduces the 4-DOF PR for knee rehabilitation that has been used for the experiments, the 3D vision system employed to measure the pose of the PR, and the force sensor characteristics.Section 3 describes the singularities in PRs, the conventional admittance controller, the algorithm to avoid Type II singularities, and the proposed complemented admittance controller.Finally, the experimental results on the actual PR and the conclusions are presented in Section 4 and Section 5, respectively.

Knee rehabilitation parallel robot
The goal of the knee rehabilitation process is to recover the plasticity of the lower limb on the knee's ligaments after a knee injury or surgery.The knee rehabilitation procedure requires three fundamental movements of the lower limb: flexionextension of the knee, flexion of the hip and internal-external knee rotation [26].
The human leg requires two independent translations in the tibiofemoral plane combined with one autonomous rotation of the ankle for the flexion-extension of the knee.The internalexternal knee rotation requires that the human leg rotates around the coronal plane.Thus, a PR for knee rehabilitation requires four DOFs, two translations and two rotations.A 3UPS+RPU PR provides the four DOFs required for the fundamental knee rehabilitation movements [27], see Fig. 1a.This PR has three external limbs with UPS configuration and a central limb with RPU configuration.The letters P, R, S, and U stand for prismatic, revolute, spherical, and universal joints, respectively, where the underlined letters represent the actuated joints.In contrast to other 4-DOF PRs, the 3UPS+RPU PR is suitable for knee rehabilitation because it provides a high payload capacity with a compact size [28].Moreover, the revolute and universal joints in the central limb supply invariant constraints of the translation in the Ym axis and the rotation around the Xm axis (Fig. 1a).
The pose of the knee rehabilitation PR is represented by the X ⃗ as follows: T where xm and zm represent the two translational movements in the tibiofemoral plane, while θ and ψ stand for the rotation around the Ym and Zm axes, respectively.The X ⃗ is controlled by four linear actuators represented by ⃗ qind, defined as: ⃗ q ind = q 13 q 23 q 33 q 42 T (2) with q13, q23, q33 and q42 are the length of the linear actuators on the limbs 1,2,3 and 4 respectively.
The orientation of the external limbs is defined by the universal joints represented by the variables ql1, ql2 where l = 1 . . .3. The orientation of the central limb is defined by the revolute joint q41.
The configuration of the PR is defined by points A0, B0, C0, D 0 connecting the four limbs to the fixed platform, and A1, B1, C1, Om connecting the limbs to the mobile platform, see Fig.

Vision-based tracking sensor
A 3D tracking system (3DTS) was implemented as a visionbased sensor to track the location and orientation of the knee rehabilitation PR.The 3DTS allows an accurate avoidance of Type II singularities, increasing the safety of the patient.In particular, the 3DTS consists of 10 infrared cameras (Flex 13) manufactured by OptiTrack, see Fig. 2. The cameras can achieve an average accuracy greater than 0.1 mm.Moreover, the cameras have a resolution of 1.3 Megapixels at 120 Hz, i.e., 8.3 ms between two subsequent captures.
In the architecture of the 3DTS (see Fig. 3a), the cameras are connected to two OptiHub2 devices to record the captured images.The OptiHub2 devices send the image data through a high-speed USB to the camera control computer.Finally, the location data are sent to the PR control computer via an Ethernet connection.
In the camera control computer, the software Motive, provided by OptiTrack, processes the 2D camera images in the 3D location of markers inside the tracking area.In particular, the software Motive can associate a custom set of markers in a virtual object defined as a rigid body that can be set with 3 to 20 markers.A marker is a sphere covered with a reflective material.Motive can perform a real-time stream of the location and orientation of all rigid bodies, including the location of each marker, via Ethernet using unicast or multicast protocols.This study implemented a NatNet client/server architecture where the server could be run in the camera control computer, and a native client could be executed in the PR control computer (see Fig. 3b).The native client had attached to a C++ handler named PR pose node that was executed when a new frame of data was available.
The actual pose of the 3UPS+RPU PR was retrieved by measuring the 3D location of six markers.Three markers were placed on the mobile platform while the other three were attached to the fixed platform, where both sets were elements of two different rigid bodies.Given the location of the six markers, the actual position and orientation of the mobile platform were calculated with respect to the fixed frame Of Xf Yf Zf .The actual position and orientation of the mobile platform were represented by X ⃗ c and sorted as xm zm θ ψ T , analogous to expression (1).
All cameras required calibration to ensure a correct reconstruction of the 3D location provided by the 3DTS.The calibration process is: 1. Set the orientation of the cameras so that they focus on the centre of the tracking area.2. Adjust the brightness and illumination of the cameras to avoid the detection of unwanted objects.3. Adjust the relative position of the cameras by moving the calibration wand provided by OptiTrack.An empty tracking area is required.4. Set the ground plane for the tracking area with a calibration square provided by OptiTrack.
Steps 2-4 of the calibration process were executed in Motive, consuming less than five minutes.

Force/torque sensor
The admittance control requires an accurate measurement of the external force applied to the PR.The proposed system measures the forces and moments exerted by the patient's foot on the mobile platform using an FTN-Delta sensor.The FTN-Deltas sensor is a six-axis force/torque sensor (Schunk).For the knee rehabilitation PR, the FTN-Delta sensor was installed at Om on the mobile platform, see Fig.  where the Fx stands for the force exerted by the patient on the axis Xm, and the Fz is the force exerted on the axis Zm.The My and Mz are the moments exerted by the patient around the tibiofemoral and coronal planes, respectively.The reference frame of the FTN-Delta sensor matches the mobile reference frame, see Fig. 4a.
The zero adjustments of forces and moments were performed considering no load on the mobile platform.Moreover, a death zone was defined as three times the standard deviation of data measured with the sensor unloaded to account for the noise.

Proposed Controller
First, the singularities in a PR and the admittance control law are described.Subsequently, the method to detect the proximity to a Type II singularity based on Output Twist Screws is explained.After that, the proposed algorithm to avoid a Type II singularity is explained.Finally, the admittance controller complemented with the Type II singularity avoidance algorithm is shown.

Singularities in parallel robots
In [16], Gosselin and Angeles define the velocity relationship between the cartesian coordinates and joint coordinates as follows: The Netbox NETB was connected to the PR control computer as a single client using a UDP interface on the Ethernet protocol, see Fig. 4a.The single client had a C++ handler named Force node attached, which was executed when the admittance controller required a new frame of data, see Fig. 4b.The force node provided the measurements of force and moments in the 4-DOF of the knee rehabilitation PR in the vector F ⃗ c as follows: where X ⃗ ˙ stands for the velocity of the end-effector, ⃗ q ˙ind represents the velocity of the actuators, JD is the forward Jacobian matrix, and JI is the inverse Jacobian matrix.For a nonredundant PR, JD and JI are square (d f d f ), with d f as the number of the DOFs of the PR.
According to (4), the rank deficiency of the Jacobian matrices defines two types of singularities.In a Type I singularity (∥JI∥ = 0), the PR loses mobility in at least one direction, i.e.,

∥ ∥
• the PR reaches the workspace boundary.Thus, Type I singularities are not a challenging task [29].In a Type II singularity ( JD = 0), the PR loses control of the end-effector at least in one direction despite all actuators being locked.In this singular configuration, if an external force is applied to the end-effector, an uncontrolled motion is produced at least in one arbitrary direction.
Type II singularities are configurations within the workspace where the PR loses the end-effector motion, making them potentially dangerous for the user and PR.In particular, rehabilitation robots interact with human limbs, where the robot must ensure complete control of the end-effector motion, making Type II singularities a major problem to solve.

Admittance control
In lower limb rehabilitation, a patient-active exercise lets a patient modify a predefined movement according to the pain limitation of the limb in rehabilitation [30].Therefore, a robot must exhibit compliant behaviour according to the effort applied by the patient while a rehabilitation exercise is executed, i.e., force/position control is required.Compliant control uses the feedback force to modify directly (impedance control) or indirectly (admittance control) the dynamic behaviour of the controlled system [13].The admittance controller has a cascade architecture, where the force control takes place in the outer loop, and the position control takes place in the inner loop [13].The force controller aims to minimise the deviation in the force exerted by the patient (⃗ eF ), which is defined as follows: where F ⃗ r represents the reference forces and moments for rehabilitation in the d f DOFs of the PR.F ⃗ c stands for forces and moments measured on the human limb in the same d f DOFs of the PR or configuration space.
The minimisation of ⃗ eF is achieved by modifying the ref- the − ∆ − → X enables the patient to drive the PR to an arbitrary pose within the workspace.However, if a Type II singularity arises, the PR loses control of the end-effector motion and could hurt the limb in rehabilitation.For example, during knee rehabilitation, if the patient flexes the knee because of pain and the PR extends the knee due to loss of control, that could damage the lower limb.Consequently, the conventional admittance controller is unsuitable for PR-assisted lower limb rehabilitation.Therefore, the conventional admittance controller must be improved using online detection and avoidance of Type II singularities.

Detection of proximity to a Type II singularity
The motion of the mobile platform is produced by the combined action of d f actuators, i.e., the contribution of each actuator is challenging to identify.Using Screw Theory, Takeda and Funabashi [31] consider all actuators locked except one to divide the motion of the mobile platform ($) into d f Output Twist Screws (OTSs): erence trajectory for the location and orientation of the mobile platform or end-effector (X ⃗ r ) according to the expression: X ⃗ a stands for the trajectory generated in the outer loop.∆ ⃗ X is the modification on the pose of the PR to reach a specific F ⃗ r .
where ρ stands for the amplitude of each OTS, and $ ˆO represents the normalised OTSs.
If only one actuator can contribute to the motion of the mobile platform, a $ ˆO is defined by the work not applied by the Both X ⃗ a and ∆ ⃗ X are measured in configuration space.In the ⃗ locked actuators.Hereby, the d f $ ˆO are determined by solving the following equations: inner loop, the position controller takes Xa as the set point.
Using the Laplace transform, the − ∆ − → X is related to ⃗ eF by a second-order model as follows: $ ˆO = ⃗ µω O ; ⃗ µ * vO (10) where m, c, and k are square matrices defining the mass, viscous coefficient, and spring stiffness of the dynamic system, respectively.
In Fig. 5a, if where is the reciprocal product, and $ ˆT stands for the normalised wrench screw transmitted by each actuator to the mobile platform.The ⃗ µω O and ⃗ µ * vO represent the angular and the instantaneous linear motion of the end-effector, respectively.to move the PR against the human limb and increase the F ⃗ c.
X varies X ⃗ r to move the PR away from the limb under rehabilitation and reduce the F ⃗ c, see Fig. 5b.Thus, In a Type II singularity, at least two $ ˆOs are linearly dependent [32], i.e., both ⃗ µω O and ⃗ µ * vO are parallel.This feature allows to measure the proximity to a Type II singularity using the angle between two different ⃗ µω O named Ωi, j, as follows: Ωi, j = arccos (⃗ where i and j sub-indices are the two limbs under analysis, respectively.With i, j = 1, 2, . . ., d f , i j. The expression (11) comprises several indices Ωi, j.Therefore, the proximity detection to a Type II singularity is measured considering the minimum angle Ω i, j.The closeness to a Type II singularity is verified by the equality of the linear components ⃗ µ * vO .
The capability of the minimum angle Ωi, j to detect the proximity to a Type II singularity was verified experimentally [21].A crucial feature of the minimum angle Ω i, j is that the subindices i and j identify the limbs responsible for the singular configuration.In [22], the identification of the limbs responsible for the Type II singularity was applied to release the 3UPS+RPU PR from a singularity already reached.In this study, we proposed implementing the minimum angle Ωi, j for an online avoidance algorithm to prevent the PR from reaching a Type II singularity.In particular, the Type II singularity avoidance algorithm complements the admittance control to ensure complete control within the workspace.
First, the Type II singularity avoidance algorithm calculates all possible indices Ωi, j based on the X ⃗ a stored at V − → Ωa.Next, the minimum element in − V − → Ωa is calculated in minΩa.In parallel, the − V − → Ωc and minΩc are calculated for X ⃗ c.The ⃗ iav stores the two limbs responsible for the Type II singularity identified by minΩc.Finally, the proposed avoidance algorithm calculates the ⃗ qind d as follows: where ⃗ qind a stands for the joint space trajectory for X ⃗ a calculated by the inverse kinematics.The νd is the avoidance velocity for each actuator, and ts is the controller sample time.The ∆ ⃗ ι stands for the integer deviation required in the d f actuators to avoid a Type II singularity.
If minΩa is below a predefined threshold Ωlim, the ∆ ⃗ ι is modified as the reference X ⃗ a is approaching to a Type II singularity.The ∆ ⃗ ι is modified by one in the two rows corresponding to the elements in ⃗ iav.The two rows identified by ⃗ iav could hold, increase, or decrease (the actuator stops or moves forward or backward), generating eight possible modifications of ∆ ⃗ ι.The best option from the eight modifications of ∆ ⃗ ι is selected to generate a ⃗ qind d within the workspace and increase the value of minΩ .The reference ⃗ q is continuously modified in , ⃗ r Om B1 , back to a singular configuration.As soon as the reference X ⃗ a becomes non-singular, the binary variable extpin is reactivated.and ⃗ rO mC1 stand for the location vector between the point Om and the vertices A1, B1 and C1, respectively.
The ⃗ z12 is defined by the universal joint orientation between limb 1 and the fixed platform (see Fig. 1a).The universal joint can be modelled by two revolute joints q11 and q12; thus, ⃗ z12 is defined as follows: After avoiding a Type II singularity, minΩc > Ωlim, if the reference X ⃗ a becomes non-singular (minΩa > Ωlim), ∆ ⃗ ι must return progressively to zero.The two rows of ∆ ⃗ ι with the maximum value (max∆) are identified.By unitary modifications in the rows of the max∆, all eight possible new ∆ ⃗ ι are calculated.The best option of ∆ ⃗ ι is selected to decrease the absolute value of ∆ ⃗ ι and generate a non-singular pose ⃗ qind .The returning pro-⃗ z = cos q sin q − cos q sin q sin q T (13) ⃗ ⃗ d The ⃗ z22 is calculated analogously to ⃗ z12 by using q21 and q22 instead of q11 and q12.The same procedure is applied to calculate ⃗ z32.In the central limb, the ⃗ z41 is defined by the orientation of the revolute joint q41 as: suitable for real-time operation because no optimisation procedures are required.The accuracy during the avoidance algorithm depends on the parameters ts, νd, and Ωlim.Moreover, the parameter ts is defined by the admittance controller sample ⃗ z = − sin q 0 cos q T (14) time, and the νd is set to the average velocity of the actuators on For a detailed explanation of the calculation of the six indices Ω1,2, Ω1,3, . . ., Ω3,4 the reader could review [21].

Type II singularity avoidance algorithm
In the outer loop, the Type II singularity avoidance algorithm considers the reference X ⃗ a to generate a singularity-free trajectory for the actuators ⃗ qind based on measuring X ⃗ c.The trajectories that progressively approach a Type II singularity.
The X ⃗ c could be measured using a 3DTS or solving forward kinematics based on embedded encoders on the actuators' joints.However, the forward kinematics could be inaccurate because the solution is not unique near a Type II singularity [23].In rehabilitation, the PR interacts with an injured limb or with a constrained mobility limb, making it essential to ensure an   preferred over the calculation based on the forward kinematics problem for robotic rehabilitation.
The Type II singularity avoidance algorithm developed for the 3UPS+RPU PR is described in Appendix A.

Complemented admittance controller description
The architecture of the admittance controller complemented with the Type II singularity avoidance algorithm for the 3UPS+ RPU PR is shown in Fig. 7. Taking advantage of the cascade architecture of conventional admittance controllers, the outer loop is divided into two layers.In the first layer, an admittance model modifies the reference X ⃗ r by adding − ∆ − → X to achieve the reference efforts F ⃗ r using the measurement F ⃗ c as feedback.In the second layer, the Type II singularity avoidance algorithm collects the adapted cartesian reference X ⃗ a and generates a singularityfree trajectory ⃗ qind d in the joint space.The avoidance algorithm keeps ⃗ qind d = ⃗ qind a as long as X ⃗ a is not singular.The ⃗ qind a stands for the inverse kinematic solution of X ⃗ a.If the reference X ⃗ a or the actual pose of the PR X ⃗ c is singular, the avoidance algorithm modifies ⃗ qind a to generate the singularity-free trajectory ⃗ qind d .The proposed avoidance algorithm modifies the trajectory of the two actuators identified by the minΩc.The minΩc is calculated based on the measurement of the actual pose of the PR X ⃗ c.
When the reference X ⃗ r is non-singular, the trajectory X ⃗ a becomes singular due to the output − ∆ − → X from the admittance model, see the outer loop in Fig. 7. Therefore, when avoiding a Type II singularity, the admittance model must temporally be deactivated to prevent conflict with the proposed avoidance algorithm.The admittance model could be deactivated by setting − ∆ − → X to zero, see Section 3.2.However, if the output − ∆ − → X is suddenly set to ⃗ 0, the X ⃗ a presents random discontinuities that could hurt the human limb.In contrast, if the input ⃗ eF immediately changes to ⃗ 0, the admittance model is gradually deactivated, i.e., the ∆ − → X decreases smoothly according to the dynamics of the second-order function (7).Therefore, the proposed Type II singularity avoidance algorithm multiplies the binary variable extpin by the ⃗ eF to deactivate the admittance model, the first layer of the outer loop in Fig. 7.In the proximity to a Type II singularity, the avoidance algorithm sets the extpin = 0 to decrease − ∆ − → X.As soon as the trajectory X ⃗ a becomes nonsingular, the proposed avoidance controller sets extpin = 1 to reactivate the admittance controller.It is important to note that this mechanism enables the admittance control and the avoidance algorithm to coexist to ensure the safety of the limb under rehabilitation.
In the PR under analysis, the F ⃗ c is measured using the FTN-Delta sensor as described in Section 2.3.The 3DTS is used to determine X ⃗ c.The system allows an accurate avoidance of a Type II singularity, increasing the safety of the PR during knee rehabilitation, see Section 2.2.The calculation of X ⃗ c by solving forward kinematics could be inaccurate near a Type II singularity.Hereby, the 3DTS is a solid option to ensure accurate singularity avoidance during a robotic rehabilitation procedure and ensure the integrity of the constrained mobility limb.
In the inner loop of the complemented admittance controller, a trajectory controller takes ⃗ qind d as a set point, see Fig. 7.In the PR under analysis, the trajectory controller is a proportional derivative controller with gravitational compensation (PD+G).The PD+G controller calculates the control actions (⃗ µ) required to track the trajectory ⃗ qind d based on the measurements of the location reached by the actuators ⃗ qind c .The ⃗ µ are electrical signals proportional to the mechanical forces applied by the linear actuators ⃗ τ.
The PD+G controller was selected because the 3UPS+RPU PR works at low velocity making unnecessary the compensation of the inertial, centrifugal, and Coriolis forces.The gravitational forces are calculated with high accuracy and low computing cost by using a model of eight base parameters identified in the actual PR [33].Thus, the gravitational compensation (G) ensures a minimal steady-state error without the need for integral actions.However, the trajectory controller on the inner loop could be changed depending on the necessities of the application.Before selecting the PD+G controller, the authors implemented and analysed other control laws such as computed torque (CT), adaptive, linear algebra-based (LAB) and proportional integral derivative (PID).
Note that identifying a proper set of dynamic parameters of the admittance model for each user remains open.Nevertheless, this study aims to prove that Type II singular configurations in PRs can be overcome using admittance control by adding a realtime singularity avoidance algorithm.

Results and discussion
First, the experimental settings to test the proposed admittance controller complemented with the Type II singularity avoidance algorithm are presented.Subsequently, the performance of the complemented admittance controller is shown and compared with the conventional admittance controller.

Experimental setup
A patient-active exercise close to a Type II singularity was designed to compare the performance of the complemented admittance controller with that of the conventional admittance controller.The patient-active exercise comprised an internalexternal knee rotation with the 3UPS+RPU PR.During the internalexternal knee rotation, the patient had a zero-effort trajectory (F ⃗ r = ⃗ 0).Thus, the patient had complete control over the PR movements, i.e., the PR was completely compliant.The starting pose for the knee rotation exercise was set close to a Type II singularity by experimentally searching on the actual 3UPS+RPU PR based on the minimum angle Ω.In this study, the reference X ⃗ r was constant and equal to the starting pose for the knee rotation exercise.
Before implementing the proposed complemented admittance controller on the actual PR, several simulations were executed using a virtual model of the human leg.Here, only the experiments with the actual robot are presented.The experiments have two phases designed to prioritise the patient's safety.Phase I considers a mannequin leg to mimic an internalexternal knee rotation, see Fig. 8a.Phase II considered an uninjured and unrestricted human knee to perform the same internal-external knee rotation, see Fig. 8b.The experiment in Phase II was approved by the Ethics Committee of the Universitat Politècnica de València, and the patient signed an informed consent document.
The conventional admittance controller was applied to Phase I to expose the risk of the straightforward application to a PR.Phase II implemented the complemented admittance controller to verify that PR could overcome the singular configurations.In this case, the admittance model was set experimentally to provide minimum resistance to the limb of the patient.Table 1 lists the parameters of the admittance controller.It is because our purpose was to verify that the proposed controller can overcome Type II singularities during admittance control.The identification of a suit set of k, c and m for knee rehabilitation was not discussed in this study.
During the flexion-extension of the knee, the latency of the lower limb muscular response exceeds 50 ms [34,35].Moreover, knee rehabilitation exercises are designed for low-velocity movement in impaired lower limbs.Thus, the proposed admittance controller is executed each 10 ms (100 Hz) to ensure a sufficiently fast response.The Type II avoidance algorithm, νd = 0.01 m/s and ts = 0.01 s to suit the maximum velocity during a knee rehabilitation procedure.After performing several experiments where the 3UPS+RPU PR moved to a Type II singularity, we set Ωlim = 2 • to prevent the loss of control on the mobile platform.The Ωlim was set experimentally owing to the mechanical imperfections of the actual PR.For a profound explanation of the setting of Ωlim, the reader could refer to [21].
Table 1: Settings for the admittance model.the reference calculated for the conventional admittance controller and minΩc is the index Ω2,4 for the actual pose reached by the PR.At t = 11.46 s, the minΩc < Ωlim verifies that the 3UPS+RPU PR reaches Type II singularity, see Fig. 10.The index minΩc detects the proximity to a Type II singularity at t = 9.77 s, i.e., 1.69 s before the PR falls.Therefore, the minΩ is a feasible option to prevent the PR from reaching a Type II singularity.

Variable Value
The proposed combined controller was executed modularly on an industrial computer using Robot Operating System 2 (ROS2) and the C++ programming language.The length of the actuators was measured by a PCI 1784 Advantech card connected to four quadruple AB phase encoder counters with a resolution of 500 counts per turn.The linear actuators were driven using four ESCON 50/5 servo controllers, where the ⃗ µ was sent through a 12-bit, 4-channel PCI 1720 Advantech card at a rate of 100 Hz.

Complemented admittance controller performance
In phase I, during the internal-external knee rotation, the conventional admittance controller drives the PR to a Type II singularity.In this case, the PR falls due to the gravity effect, and then the mannequin leg was extended abruptly.A recording of this experiment is available in ht tp : // ro bo pr op .ai2 .upv .es/ ad mi tt an ce _w it ho ut _e va de r .Fig. 9 shows the tracking of PR location on the Zf axis, i.e., the height of the mobile platform during the knee rotation in phase I.In Fig. 9, the solid line za represents the reference calculated by the conventional admittance controller, and the dashed line zc is the location measured in the actual PR.The zc shows the loss of control on the PR from t = 11.46 s, and the subsequent fall because the conventional admittance controller reaches a Type II singularity.Thus, the inherent danger of using a conventional admittance controller for human-robot interaction in rehabilitation based on PRs is verified.Fig. 10 shows the proximity detection of the Type II singularity based on minΩ.In this case, the proximity is detected by Ω2,4 during the entire experiment of the internal-external knee rotation.In the figure, minΩa represents the angle Ω2,4 for as follows: 1 measured on the actual PR.In Fig. 11, three periods arise where the patient tries to drive the PR to a Type II singularity, and the complemented controller avoids that singularity.
where nt is the number of periods of activation of the singularity avoidance algorithm.n is the number of samples in each k period.h is the initial instant of each period of activation of the singularity avoidance i and j identify the actuator and the time instant analysed, respectively.The absence of discontinuities or sudden changes in forces applied by the PR with the complemented admittance controller is verified by absolute variation rate (AVR).The AVR calculates the average instantaneous change between two subsequent time samples of the control actions during the singularity avoidance periods, i.e.: Fig. 12 shows the moment around the Zf measured during the internal-external knee rotation in phase II.Fig. 12 indicates that no discontinuities or sudden changes arise in the patient's foot during the three periods of Type II singularity avoidance.Note that during these three periods of Type II singularity avoidance, the patient did not perceive the deactivation of the admittance control.The non-perception of the deactivation of the admittance control was qualitatively verified by asking the patient.Therefore, the proposed complemented admittance controller overcomes the limitation of the Type II singularities  Phase I Phase II in PRs, making it a safe option for knee rehabilitation.
The deviation from the prescribed trajectory due to Type II singularity avoidance was quantified using the mean absolute error (MAE) between the ⃗ qind d and ⃗ qind a .This deviation could also be represented by the absolute percentage error (MAPE) between the same variables.If ⃗ qind d comes from the real-time This table shows that the deviation on the q inda during a Type M pa II singularity avoidance was lower than 2.5 mm (0.4%).The AVR during a Type II singularity avoidance is lower than 5 N.This variation in the forces exerted by the PR is negligible because during human walking the leg could exert 500 N on average [36].Thus, the proposed combined admittance controller ensures a smooth behaviour of the 3UPS+RPU PR with a minimum deviation of the rehabilitation trajectory.In this paper, only the trajectories of the actuators on limbs 2 and 4 were modified as they are responsible for the singular configuration (minΩc = Ω2,4).Fig. 13 shows the location of the actuator on limb 2 during the experiment in Phase II.The solid line qa represents the trajectory defined by the admittance model.The dashed line qd represents the trajectory generated by the real-time singularity avoidance algorithm, and qc is the actual location reached the actuator.Fig. 13 indicates that the difference between qd and qa is less than 2.5 mm during the three periods of Type II singularity avoidance.
Ensuring the safety of patients with impaired limbs undergoing knee rehabilitation requires a high-accuracy robotic system.One crucial factor in achieving accuracy is the real-time Type II singularity avoidance algorithm, which relies on precise pose measurements of the PR.In this study, we utilised a 3DTS for accurate measurement of the PR pose.Although a 3DTS may be costly for a single PR, it can accurately measure the location of multiple PRs simultaneously, thereby increasing the productivity of rehabilitation sessions.For instance, a physiotherapist can supervise knee rehabilitation for a 4-DOF PR while another 3-DOF PR executes ankle rehabilitation.

Conclusions
This research evaluated the performance of a conventional admittance controller in a 3UPS+RPU PR designed for knee rehabilitation.The experimental results showed that this controller cannot maintain the stiffness required for the PR in the proximity of a Type II singularity, making it unsafe for humanrobot interaction.This limitation was overcome by an admittance controller complemented with a real-time singularity avoidance algorithm.The proposed complemented admittance controller successfully provided complete control over the mobile platform during an internal-external knee rotation performed by an uninjured and unrestricted patient.The real-time singularity avoidance algorithm required a maximum deviation of 2.5 mm model with a model-based controller without dynamic model degeneration.
In future work, the Type II singularity avoidance algorithm could be modified to smooth further the deviation of the actuators responsible for the singularity.Moreover, the complemented admittance controller has only been implemented in a 3UPS+RPU PR.The proposed controller will be tested in a 3RPS PR for ankle rehabilitation to verify the advantages provided by the admittance controller complemented with the realtime singularity avoidance algorithm.Finally, the 3UPS+RPU PR and the 3RPS PR could be analysed simultaneously to verify the advantages of using a 3DTS in robotic rehabilitation.
4a.The forces measured in the x, y, and z axes of the sensor reference frame can be represented by Fx, Fy, and Fz, respectively.Similarly, Mx, My, and Mz stand for the moments measured by the FTN-Delta sensor in the reference frame O xyz , see Fig. 4a.The FTN-Delta sensor measures force with a resolution of 0.065 N for Fx, Fy, and 0.125 N for Fz.The moments Mx, My, and Mz are measured with a resolution of 0.004 N m.The FTN-Delta sensor has a measuring range of 330 N for Fx, Fy and 990 N for Fz.The measuring range for the moments Mx, My, and Mz is 30 N m.The data from the FTN-Delta sensor were amplified, filtered, and transmitted by a Netbox NETB that supports CAN bus, DeviceNet, PROFINET, and UDP interface protocols at up to 7 Mhz.

Figure 5 :
Figure 5: Compliant behaviour achieved by the second-order admittance model when (a) F ⃗ c < F ⃗ r (b) F ⃗ c > F ⃗ r .
∆ι = 0.The proposed Type II singularity avoidance algorithm is 41 41 41 ) successive iterations until Xc becomes non-singular.During the where ⃗ z12, ⃗ z22, ⃗ z32, and ⃗ z41 are the direction of the forces applied admittance controller to prevent the patient from driving the PR by each actuator with respect to the fixed frame.⃗ rO m A1

d
accurate avoidance of Type II singularities.Thus, a 3DTS is inputs Xa and Xc are the references generated by the admittance the PR under analysis.The Ωlim is set experimentally, executing Type II singularity avoidance, the output extpin deactivates the ⃗ z41; ⃗ 0 $T 4 = $T 3 =

Figure 6 :
Figure 6: Diagram for Type II singularity avoidance algorithm.

Figure 7 :
Figure 7: Architecture of the complemented admittance controller.

Figure 10 :
Figure 10: Conventional admittance controller: index minΩ.The admittance controller, complemented with the Type II singularity avoidance algorithm, effectively completes the two experimental phases without losing control.The execution of the complemented admittance controller during phase I and phase II are available in ht tp : // ro bo pr op .ai2 .upv .es/ ad mi tt an ce _w it h_ ev ad er _v f/ and ht tp : // ro bo pr op .ai2 .upv .es/ ad mi tt an ce _w it h_ ev ad er _p ie rn a_ hu ma na _v f/ , respectively.Fig. 11 shows the proximity detection to a Type II singularity based on the minΩ for the complemented admittance controller during phase II.The minΩa represents the angle Ω2,4 calculated for the trajectory generated by the admittance model.The minΩc represents the angle Ω2,4 calculated for the pose

Figure 13 :
Figure 13: Complemented admittance controller: location tracking for the actuator on limb 2.

Table 2 :
Performance of the complemented admittance controller.

Table 2
lists the MAE, MAPE, and AVR for the complemented admittance controller during the two experimental phases.Type II singularity avoidance algorithm and ⃗ qind a is generated by the admittance model, the MAE and MAPE are calculated

Table A .
2: Inputs and Outputs of the Type II singularity avoidance algorithm.