A Robot-Assisted Framework for Rehabilitation Practices: Implementation and Experimental Results

One of the most interesting characteristics of collaborative robots is their ability to be used in close cooperation scenarios. In industry, this facilitates the implementation of human-in-loop workflows. However, this feature can also be exploited in different fields, such as healthcare. In this paper, a rehabilitation framework for the upper limbs of neurological patients is presented, consisting of a collaborative robot that helps users perform three-dimensional trajectories. Such a practice is aimed at improving the coordination of patients by guiding their motions in a preferred direction. We present the mechatronic setup, along with a preliminary experimental set of results from 19 volunteers (patients and control subjects) who provided positive feedback on the training experience (52% of the subjects would return and 44% enjoyed performing the exercise). Patients were able to execute the exercise, with a maximum deviation from the trajectory of 16 mm. The muscular effort required was limited, with average maximum forces recorded at around 50 N.


Introduction
The use of collaborative robots (cobots) in industry is gaining traction due to their great flexibility.Their success is mostly determined by the possibility of implementing workflows in a shared environment where both humans and robots can cooperate safely [1][2][3].This feature is being exploited in application fields that are different from traditional production, where the use of classical industrial robots would be impossible due to obvious safety reasons.Healthcare, for example, is a widely investigated field that many researchers have focused on since it provides a wide range of challenges and applications [4][5][6].
For years, the robotics field has played a pivotal role in providing assistance, and the use of collaborative robots is not a novelty [7].Yin and Yushenko [8], among other authors, used a collaborative robot for surgeries; Colucci et al. [9] developed a mobile service robot exploiting a Kinova lightweight cobot; Mišeikis et al. [10] tested an assistive mobile collaborative manipulator prototype in retirement facilities.Researchers have been further driven by the COVID-19 pandemic [11], which made the lack of healthcare operators even more evident, and stressed the importance of human-human distancing in certain environments (e.g., hospitals and geriatric yards).Many applications involve rehabilitation.For example, Kajopoulos et al. [12] designed a robot-assisted training protocol based on joint attention responses for children with autism.Kyrkjebø et al. [13] analyzed the potential of the UR5, a collaborative robot from Universal Robots, for the rehabilitation of stroke patients.Gherman et al. [14] envisaged the use of a cobot for upper limb rehabilitation, while Prendergast et al. [15] focused on shoulder diseases.For further details on the use of cobotics in the rehabilitation scenario, see [16][17][18][19][20][21].
This paper follows up on the analyses conducted over the last two years, as detailed in references [22][23][24].We propose a mechatronic implementation of a platform for rehabilitation practices.The testbench was developed to specifically enhance the ability of stroke patients to follow specific trajectories with their upper limbs.Such directions have been constrained via a collaborative robot (namely, a UR5e by Universal Robots), using a novel control law described subsequently.The collaborative robot is able to help the user perform expected motions by preventing different directions using a dedicated impedance control law.It is worth noting that, from a clinical point of view, regarding the neurorehabilitation of patients, there would be no advantage in an assisted mode where the robot guides the patient's hand through a given trajectory.The main purpose of the exercise is not to simply increase the joint range of motion, or strengthen the upper limb muscles, but to promote the relearning of goal-directed activities (such as picking up objects from a table).This outcome can only be achieved by allowing patients to produce an active movement, thus engaging the complex neural network underlying the generation of task-oriented gestures.The target of the motion can be dynamically moved by the exercise supervisor in order to optimize the result.For such reasons, no assisted modalities were implemented that involved the robot dragging the patient's limbs.
In the easiest version of the exercise, the robot applies weak force in the same direction applied by the patient.However, the control on the handle trajectory is completely on the patient's ability to perform the motion, while the robot simply provides minimum help, barely enough to overcome the machine's internal friction.
The novelty of the method lies in the reconfigurability of the exercise based on the patient's needs and the physician's expertise.In contrast to other approaches, the parameters of the exercise can be set almost completely, satisfying the particular needs of each patient.From a technological point of view, an additional advantage involves the use of commercial hardware that can offer flexibility, reliability, technical and maintenance support, and relatively low costs.In fact, collaborative robots are becoming increasingly common in industrial plants nowadays, and costs are decreasing, just as commercial and technical support is increasing.Finally, the cobots also offer facilitated programming tools that allow even inexperienced operators to create programs of some complexity in a short time, promoting flexibility and personalization of therapy.
The rest of the paper describes the rehabilitation device in detail (Figure 1) and presents a series of experimental data collected in preliminary clinical trials on neurological patients.

Rehabilitation Framework Description
As mentioned, the main objective of the rehabilitation framework is to train the ability of stroke patients to follow a given trajectory chosen by the physiotherapist to accomplish a task.Thus, UR5e, a collaborative robot by Universal Robots, has been equipped with a handle that is specifically designed for individuals who, due to mild to moderate spasticity, struggle to exert grasping force or have difficulty opening their hands.The patients are asked to move the handle, which is provided with a pointer, toward an object, which serves as a target.The position is dynamically recorded by a COGNEX camera and transmitted to the UR5e controller via TCP communication.A specific program was developed to make the robot accomplish two basic tasks: helping the patient in running the linear trajectory toward the target, and hindering possible deviations from that path by means of an elastic pull-back force.The implementation was conducted using Polyscope 5, by Universal Robots software, Odense, Denmark.For patient safety, robot velocity and accelerations were limited; moreover, the framework allowed patients to sit outside of the robot's reach to prevent accidental head contact.

Exercise Phases
The exercise phases are shown in Figure 2. Briefly, they can be described as follows: 1.
The caregiver (or patient, if he/she is able) sets the starting point P i of the trajectory by positioning the handle (i.e., the UR5e end-effector, EE) in front of the subject, so that it can be grabbed comfortably.

2.
The caregiver chooses a final point P f for the trajectory by moving the ring target on the plane of the bench.The COGNEX camera frames the target's coordinates and communicates them to the robot.

3.
The EE is steadily maintained at P i until the patient exerts force F p that is greater in the module than a pre-defined threshold value (possibly customized to the patient's characteristics) F t : From that point, the actual exercise begins, and the robot acts according to a control law, which will be described later in the text.

4.
During the exercise, which is cycled for a number n of times, and decided a priori, the robot exerts force, which depends on the patient's interactions and the EE tip point position (called P), with respect to line r : P f − P i .In particular, two components of force are of interest, as described in Figure 3: a component F that is parallel to line r and proportional to the force, exerted by the user in the same direction (F p, is measured by means of the onboard force sensor), and a component F ⊥ that is parallel-perpendicular to r, configured as a variable stiffness elastic force.

5.
The exercise repetition is considered complete when the EE tip reaches the target position P f .When this occurs, the cobot moves the handle to P i , driving back the patient's hand to the starting point.

6.
Once the subject completes n repetitions, the exercise is over, and the patient's hand is moved back to P i ; the caregiver then decides if a further set of repetitions has to be conducted with identical or new force parameters.

Control Law
As mentioned above, the three components of force to be exerted by the cobot are computed to pursue two different aims: to help the motion along line r, and to contrast any deviation from such a trajectory.Thus, two components of the human-robot interaction force are considered, i.e., parallel and perpendicular to r (see Figure 3).
Component F was chosen to be proportional to the component of the force applied by the patient to the handle (F p ) parallel to r, denoted here as F p, .To provide the exercise with a further degree of customization, the proportionality can be selected by the caregiver, according to three different intensity levels: The robot applies force toward the target, actively helping the patient in reaching the target.The constant c is set to 0.5, following the suggestions of professional caregivers who personally tested the device.• MEDIUM → F = 0: The robot does not apply force toward the direction of the target.Therefore, the patient must apply the necessary force to move the handle, as if the robot is set in free-drive in that direction.
The robot counteracts the patient by providing force toward the opposite direction of the desired motion.
It is worth noting that a proper set of safety protocols and force thresholds was implemented to prevent the robot from pushing on the patient's hand in an uncontrolled manner.These programming details are not specified here for the sake of conciseness, and are complementary to the standard safety settings of collaborative robots.
The force component that is orthogonal to the ideal direction of motion is determined by a variable stiffness law designed to provide smooth robot reactions, especially across the r line.In addition, according to the suggestions of practitioners, it is useful for patients to have higher compliance when the handle pointer is far from the target, while it should become stiffer when approaching P f .To achieve this purpose, a variable stiffness k is implemented, as graphically presented in Figure 4.In a few words, a conic transition space is defined around line r (Figure 4a).Within such a space, the stiffness follows a cubic trend, from 0 (when P ∈ r, i.e., when the patient follows the trajectory) to a maximum value k max on the surface of the cone (as shown in Figure 4b).The apex of the cone coincides with P f , while its aperture is given by the maximum radius ρ max reached at P i .For simplicity, ρ max is set proportionally to the distance P f − P i .Here, the constant σ that rules the proportionality is σ = 1/3.Thus, the cone radius is a linear function of the distance d between the handle pointer P and the target P f projected on the line r, i.e., ρ = σd.
The formula is as follows: where d is the distance between the handle pointer P and the target P f projected on the line r, as shown in Figure 4a; the stiffness k * is a cubic function of dist(P, r), expressed by The maximum stiffness k max is set at 20 N/mm.It should be noted that the robot's maximum force is quite limited (50 N), providing an intrinsic force saturation, which ensures the overall safety of the application.

Experimental Results
Ten patients (mean age of 66.90 years ± 6.93) with chronic stroke (>6 months) attending the outpatient neurorehabilitation clinic of Marche Polytechnic University in Ancona were enrolled.In addition, a control group of nine healthy subjects (mean age 33 years ± 5.20) participated in a single experimental session.Figure 5 shows some participants performing the exercise.Patients were enrolled if they presented a disabling upper limb paresis (as proxied by a muscle strength score of 2 to 4 on the Medical Research Council test at the shoulder, elbow, and wrist/finger levels) and were free from moderate to severe upper limb spasticity (i.e., if they exhibited a modified Ashworth Scale score of less than 2 at any level).Exclusion criteria for both patients and controls included severe cognitive deficits, pain, disabling comorbidities, drug or alcohol abuse, or any conditions that would prevent them from providing informed consent.The timeline of the study protocol is shown in Figure 6.At the beginning of the experimental session, all subjects were informed about the goal of the exercise and how to interact with the robot.After a short break, each subject had to independently perform the exercise.The patient group was asked to perform three repetitions of the exercise (i.e., repeating the passages three times from phase three to five, as enumerated in the previous section), while the control group was asked to perform the exercise five times.In this way, each patient was not overloaded during the therapy session.At the end of the session, all participants were given a qualitative questionnaire to gauge their acceptance of the exercise.None of the subjects found the exercise difficult to perform (except for patient no. 1, who failed to complete it); moreover, they were not afraid of robotic technology.Furthermore, 52% of the subjects would return for another therapy session; however, the exercise should be modified to enhance stimulation and motivation, as after several trials, some subjects began to feel bored.However, the system was well accepted by volunteers and medical staff.Only two subjects declared that they preferred human interaction rather than sitting in front of a machine to perform therapy.Additional comments emerged about the handle system, especially from the patient group; some found it difficult to see the pointer under the handle and, consequently, had a hard time reaching the center of the target.The participants completed the protocol without adverse events related to the device.Only subject no. 1 was unable to complete the exercise and was not considered in the data analysis.Table 1 presents the demographic characteristics of all participants.In the P i setup phase, the caregiver asked each volunteer to grasp the handle with their arm relaxed for 5 s and then apply high force to the handle.This phase was necessary to personalize the exercise and establish the force limits (maximum and minimum) of the training in order for it to be accomplished effortlessly.The average of the maximum force measured in the setup phase of the patient group is 43.45 (21.98)N; for the control group, it is 50.2 (33) N. The executed trajectories and forces recorded by the robot are shown in Figure 7a for one patient and in Figure 7b for one healthy subject.These figures are related to an execution in easy mode, which is the first modality tested.The trajectory created by the subject's hand during the exercise to reach the target is derived from the pose coordinates of the robot.In order to make the three repetitions comparable, the force components are plotted versus a normalized time abscissa.The actual times for the three executions were 26.82 s, 5.4 s, and 6.04 s (mean 12.75 s) for the patient and 8.35 s, 4.13 s, and 3.99 s (mean 5.49 s) for the healthy subject.As can be seen, deviations from the line P f − P i are larger for the patient, with respect to the control subject.In particular, during the first repetition, the patient does not follow a linear movement but deviates from the planned trajectory.This may be due to the fact that during the first trial, the patient does not yet have confidence in the system.Moreover, the deviations at the beginning of the exercise (next to point P i ), are higher, likely due to the force threshold that the subject is asked to overcome in order to begin the motion (phase 3 of the exercise).Despite such deviations, the perpendicular (or radial) force F ⊥ in this region of space is mostly low since the end-effector is provided with great compliance.On the contrary, the robot strictly guides the subject's hand next to P f , where the transition between the null stiffness and k max is pretty fast.The parallel (or longitudinal) force F is an indicator of how much the robot is helping the subject in performing the exercise; for the three repetitions, its value is different for each subject.In general, the average value of absolute force required for the user to perform the exercise (which is 1/c times that exerted by the robot) is ∼6 N. It is worth noting that the rehabilitation value does not lie in the muscular effort, but in the coordination required to achieve the goal of planning and following a trajectory.The trajectory's error is defined as the difference between the real trajectory and the ideal one.The quantitative results from the trajectory analysis are listed in Table 2, which shows the mean error calculated for the impaired and the control group in each working mode (i.e., easy, medium, and hard).For comparable results between the two groups, errors are calculated based on trajectories performed by the impaired arm in the patient group and the non-dominant arm in the control group.The trajectory executed by the patient group deviates more from the planned one than that performed by the control group; the largest mean error for both groups lies in the easy mode, with an overall value of 0.016 ± 0.01 m (for the patient case) and 0.008 ± 0.004 m (for the control case).Even if patients have coordination problems, they still manage to perform the exercise with low error values.Figure 8 shows the trend of the trajectory error for each subject and the average error (in black) for all subjects during the first repetition of the easy modality (Figure 8a for patients, Figure 8b for the control group).In patients, the average error is the highest at the beginning of the exercise (20%), reaching a value of 0.02 m.In the control group, the error slightly increases from 30% and 50% phases and decreases from 70% in the completed exercise.However, the error is still very low and subjects are able to follow the planned trajectory smoothly.Figure 9 shows the trajectory error trend and the average for all subjects during the last repetition in the hard-working mode.As each subject performed the exercise several times, the average curves for both groups are similar; however, the errors for the patients are slightly higher than for the healthy subjects, peaking at around 30% of the exercise's completion.Force data recorded by the robot's TCP are listed in Table 3 for the patient group and Table 4 for the control group, where the mean, minimum (min), and maximum (max) force values are reported with the standard deviations (std) in the three modes.The mean values in the control group increase as the difficulty of the exercise increases; however, for the patients, there is a lower value in the medium mode, while in the remaining modes, the values are approximately the same.This is because the differences between each mode are very small and the perception of increased difficulty is minimal.This strategy was devised with clinical staff to prevent muscle fatigue in patients.The minimum values, on the other hand, are proportional to the increase in difficulty, and the negative sign indicates its opposite direction, with respect to the direction of movement.This is an indicator that the subject is braking or decelerating the handle.Since patients apply more effort to complete the exercise, their maximum forces are higher than those in healthy subjects and, in both groups, the higher forces are in the hard mode.Figure 10a shows the longitudinal force applied by each impaired limb and the corresponding standard deviation calculated over a sliding window of 500 samples.Only the longitudinal force applied by patient no.10 differs significantly from the general trend of all the others, ranging between −20 N and 30 N. Figure 10b shows the longitudinal force and the sliding standard deviation of each unimpaired limb applied by the patient group.In most cases, the values of the forces are similar to those applied by the impaired limb, while their trends are different.In the case of the impaired arm, the trend of the standard deviation presents higher peaks.Figure 11 shows the longitudinal force applied by the non-dominant arm the corresponding standard deviation for the control

Discussion
The authors would like to point out that the primary focus of this manuscript is not on the clinical benefits of an extended rehabilitation process; this research is aimed at providing the preliminary impressions of patients and physicians regarding the rehabilitation process.For this reason, the number of participants and collected results were limited to better appreciate some technical information on the mechatronic framework.A metric for evaluating the efficacy of the robot-assisted framework from a clinical point of view should come after its repeated and structured use.In practice, it would be interesting to analyze the long-term effects on patients to understand how (and how much) the approach is beneficial for the neurorehabilitation of patients.However, the purpose of the paper is foundational with respect to such considerations; therefore, the quality metric for movement is only represented by the error between the anticipated linear trajectory and the trajectory actually performed by the patients.
We should also note that the framework is targeted at hemiparetic patients, aiming to train their capacity to follow simple trajectories (e.g., lines) toward a target without deviating from the shortest path.The exercise phases, which have been refined in collaboration with professional caregivers, were presented with the robot's control law.This law was developed to assist motion along the linear trajectory and counteract any deviation from it.This task was accomplished by using force proportional to that exerted by patients along the trajectory, with an elastic pull-back in the perpendicular direction.
The development of the framework allowed us to perform experimental tests on 9 healthy volunteers and 10 chronic stroke patients.The participants completed the protocol without adverse events related to the device.The three modes developed with the exercise were designed to produce a force that helps (or counteracts) the training subject.The trajectory executed by the patient (Figure 7a) differs from the trajectory of the healthy subject (Figure 7b), especially for the first repetition.At the beginning of the exercise, the patients did not know the right direction to follow.Progressively, in subsequent repetitions, the patients became familiar with the exercise and discerned the right direction to follow.The average trajectory errors were always greater than those of healthy subjects.However, in both groups, the error reached its highest mean value in the easy modality, respectively, registering 0.016 ± 0.01 m for the patient group and 0.008 ± 0.004 m for the control group.After all repetitions, patients discerned the right direction to follow, leading to a reduction in trajectory errors.
The force data recorded by the robot's end-effector show that the average baseline force in patients (43.45 (21.98)N) is lower than in healthy subjects (50.2 (33) N), as expected in subjects with upper limb paresis.During the exercise, patients strained their arms more and exerted higher force than healthy subjects, especially in the hard mode.Since the patients had more difficulty performing the exercise, they applied higher force to compensate for their arm weakness.
The robotic system was well-accepted by volunteers (52% of the subjects would return for another therapy session and 44% enjoyed the exercise) as well as the therapists who supervised the exercise.
The system enables the recording of therapy data, ranging from the tracking of the executed trajectory to the interaction force applied by each subject.The robot's sensors evaluate how much help the patient needs, ensuring that the exercise is at the appropriate level required by the subject.Moreover, the therapy could be prolonged through intensive sessions requiring minimal intervention from the therapist, who has to supervise the exercise.

Conclusions
In this paper, a novel framework for robot-assisted rehabilitation practices is presented; the main objective is to use industrial commercial hardware that can offer safety, flexibility, and reliability, paving the way for large-scale implementation that benefits the increasing number of treated patients.In addition, the current programming tools offered by cobots allow for a high degree of therapy customization with little software reconfiguration time.The framework targets stroke patients with upper limb paresis, aiming to train their capacity to follow simple trajectories (e.g., lines) toward a target without deviating from the shortest path.To achieve this, a collaborative UR5e robot was equipped with a specifically designed handle.The exercise phases, which were refined in collaboration with professional caregivers, were presented alongside the robot's control law.This law was developed to assist motion along the linear trajectory and counteract any deviation from it.The task was accomplished by using force proportional to that exerted by patients along the trajectory, and an elastic pull-back in the perpendicular direction.The development of the framework allowed us to conduct experimental tests on non-sick volunteers and neurological patients.
None of the subjects found the exercise difficult to perform (except for patient no. 1, who failed to complete it); moreover, they were not afraid of robotic technology.Furthermore, 52% of the subjects would return for another therapy session; however, the exercise should be modified enhance stimulation and motivation, as after several trials, some subjects began to feel bored.However, the system was well accepted by volunteers and medical staff.Only two subjects declared that they preferred human interaction rather than sitting in front of a machine to perform therapy.Additional comments emerged about the handle system, especially from the patient group; some found it difficult to see the pointer under the handle and, consequently, had a hard time reaching the center of the target.
Future research should focus on the suitability of this framework in training hemiparetic stroke patients, both in their subacute and chronic stages, to ensure repetitive, intensive, and engaging training of proper duration to stimulate brain plasticity, reduce motor impairment, and increase functional capacity [25][26][27][28].

Figure 1 .
Figure 1.(a) CAD model of the rehabilitation device; (b) patient exercising during a preliminary experimental test.

Figure 2 .
Figure 2. Main phases of the rehabilitation exercise.

Figure 3 .
Figure 3. Force components of the UR5e robot thrust.

Figure 4 .
Figure 4. (a) Conic transition space around the line r; (b) trend of the stiffness used for impedance control of the UR cobot.

Figure 5 .
Figure 5. Participants performing the experimental session.

Figure 6 .
Figure 6.Timeline of the study protocol.

Figure 7 .
Figure 7. Example of the experimental results in terms of trajectories and force components for a patient (a) and a control group subject (b).

Figure 8 .
Figure 8. Trajectory errors for all subjects and average value for patients (a) and control subjects (b) during the first repetition in EASY MODE.

Figure 9 .
Figure 9. Trajectory errors for all subjects and average value for patients (a) and control subjects (b) during the last repetition in HARD MODE.

Figure 10 .
Figure 10.Longitudinal force during one repetition of the EASY MODE of all patients: (a) impaired and (b) unimpaired limbs.

Figure 11 .
Figure 11.Longitudinal force during one repetition of the EASY MODE of all participants of the control group.

Table 1 .
Demographic characteristics of participants.

Table 2 .
Mean error between the planned and measured trajectories for the patient group and the control group.

Table 3 .
Mean, min, and max values of the applied force for the patient group.

Table 4 .
Mean, min, and max values of the applied force for the control group.