Performance-based robotic assistance during rhythmic arm exercises

Rhythmic and discrete upper-limb movements are two fundamental motor primitives controlled by different neural pathways, at least partially. After stroke, both primitives can be impaired. Both conventional and robot-assisted therapies mainly train discrete functional movements like reaching and grasping. However, if the movements form two distinct neural and functional primitives, both should be trained to recover the complete motor repertoire. Recent studies show that rhythmic movements tend to be less impaired than discrete ones, so combining both movement types in therapy could support the execution of movements with a higher degree of impairment by movements that are performed more stably. A new performance-based assistance method was developed to train rhythmic movements with a rehabilitation robot. The algorithm uses the assist-as-needed paradigm by independently assessing and assisting movement features of smoothness, velocity, and amplitude. The method relies on different building blocks: (i) an adaptive oscillator captures the main movement harmonic in state variables, (ii) custom metrics measure the movement performance regarding the three features, and (iii) adaptive forces assist the patient. The patient is encouraged to improve performance regarding these three features with assistance forces computed in parallel to each other. The method was tested with simulated jerky signals and a pilot experiment with two stroke patients, who were instructed to make circular movements with an end-effector robot with assistance during half of the trials. Simulation data reveal sensitivity of the metrics for assessing the features while limiting interference between them. The assistance’s effectiveness with stroke patients is established since it (i) adapts to the patient’s real-time performance, (ii) improves patient motor performance, and (iii) does not lead the patient to slack. The smoothness assistance was by far the most used by both patients, while it provided no active mechanical work to the patient on average. Our performance-based assistance method for training rhythmic movements is a viable candidate to complement robot-assisted upper-limb therapies for training a larger motor repertoire.


Background
Rhythmic and discrete movements have recently been recognized as two of the most fundamental units of the upper- [1] and lower-limb [2] motor repertoire. Rhythmic movements capture periodic movements like hammering or scratching, while discrete movements capture movements between a succession of postures with zero velocity and acceleration, like reaching and pointing [3,4]. These two fundamental motor primitives are controlled by distinct neural circuitries, at least partially [3,[5][6][7][8][9][10][11][12][13][14]. For example, previous research with healthy subjects showed that (i) discrete movements require more cortical activity than rhythmic ones [7], and (ii) no learning transfer occurs from rhythmic to discrete movements and only a little transfer occurs from discrete to rhythmic movements when they are executed in altered visual or haptic conditions [13,14].
After a stroke, both rhythmic and discrete movements can be impaired [15][16][17][18][19][20][21][22][23]. Recently, we compared the performance in executing both movements in the same stroke population. As a main conclusion, we found that rhythmic arm movements are less affected than discrete ones. In particular, stroke preserved the smoothness of rhythmic movements so that fewer submovements were identified than in the discrete counterparts [24]. However, rhythmic movements were impaired compared to healthy subjects. Stroke patients decelerated more than healthy subjects at the movement reversal, and some patients displayed a larger amount of submovements.
If rhythmic and discrete movements are two distinct primitives, they deserve specific and differentiated training to permit the full recovery of the complete motor repertoire. This is a necessary condition to recover autonomy life activities requiring a combination of rhythmic and discrete movements (such as wiping a table or playing the piano [5]).
Most post-stroke therapies tend to focus on functional and thus mainly discrete movements [25][26][27], although some previous contributions did focus on upperlimb rhythmic movement training. Interestingly, they all tended to display an improvement in motor skills [28][29][30][31][32][33][34]. For instance, [28,29] highlighted that the intensity of the training is critical to enhance motor skills. In [33], the authors compared bilateral arm training with auditory cueing (BATRAC) to dose-matched therapeutic exercises and concluded that none was superior to the other, although the adaptations in brain activation were greater after BATRAC. Whether this result is due to the rhythmic nature of the movement, its bimanual nature, the auditory cueing, or a combination of these features, is however difficult to establish, since these are closely intertwined in BATRAC.
The current state-of-art of rhythmic upper-limb movement therapy calls thus for the development of post-stroke therapies tailored to unilateral rhythmic movement training, in order to study their exact effect on motor skills. The development of such a therapy is presented in this paper.
Robotic devices are particularly suited for implementing post-stroke therapies, with a specific focus on movement intensity. Rehabilitation robots enable patients to practice well-specified motor actions and can deliver an appropriate amount of assistance to help patients in improving their motor behavior [17,[35][36][37][38][39][40][41][42]. Motor performance can be computed in real-time by the robot controller, allowing for continuous adaptation of the type and amount of assistance. The patient only receives the necessary support and is prevented from slacking [36,43]. In the literature, this is often referred to as the "slacking hypothesis, " which suggests that too much assistance will cause a progressive decrease in patient effort to accomplish a desired task and reduce motor recovery. This assistance principle is also called "assistance as needed" and has progressively emerged as a hallmark of successful robot-assisted therapies [35,36,43,44]. This principle lies also at the core of the present contribution.
Most upper-limb robot-assisted therapies are designed for discrete movement training and implement the assistas-needed principle through different strategies. One type of strategy delivers assistance proportional to the trajectory error with respect to a predefined trajectory [42,[45][46][47][48][49][50]. Another assistance approach relies on dynamical systems and adapts the assistance parameters as a function of the patient performance [45]. Other approaches tune the amount of assistance across sessions as a function of the performance during the preceding session [45,51]. Another method [47] performs an online adaptation of the amount of support depending on the activity (for a survey, see [35]).
In contrast with these approaches, a rhythmic movement therapy should exploit the cyclic nature of the movement to anticipate the future trajectory based on previous cycles. This can be achieved by using adaptive oscillators [52]. These mathematical tools are particularly suited to track the main features of a typical rhythmic movement (like amplitude and frequency). This continuous assessment allows the robot to constantly seek to improve movement features with the appropriate amount and type of assistance. Moreover, this approach naturally allows for trajectory-free assistance algorithms so that the therapist does not have to specify an arbitrary target trajectory for the patient to follow. The patient receives assistance to improve the impacted movement features, but is left free to produce any rhythmic trajectory.
Our previous work already paved the way in using adaptive oscillators to deliver trajectory-free assistance for upper- [53] and lower-limb [54,55] rhythmic movements. These contributions focused on movement assistance for healthy subjects, showing evidence of decreases in metabolic consumption when the assistance was switched on. The present study is the first to propose a metricbased assistance method for patients with motor disorders, with emphasis on the potential to assist different rhythmic movement features as a function of the patient needs.
This paper outlines the performance-based assistance method and its mathematical foundations in details. The method was validated with data from simulations and a pilot study with two stroke patients with upper-limb impairments is also reported. The proposed performance-based assistance method can (i) enhance motor-performance, (ii) give appropriate assistance according to patient performance, and (iii) maintain active patient participation in the task so that no slacking effect occurs.

Methods
The main interest of the developed method is that it can independently assist different movement features, only if needed. In particular, the method implements parallel strategies to assist the patient in improving performance regarding movement smoothness, velocity, and amplitude. Therefore, the method requires measuring (Fig. 1a) and quantifying (Fig. 1b) the amplitude, velocity, and smoothness features of patient movement in real-time in order to assess the corresponding performance. The method must also compute and deliver the appropriate amount of assistance in amplitude, velocity, and/or smoothness as a function of the performance (Fig. 1c).
The most comprehensible way to develop the proposed assistance method requires focusing on a simple rhythmic movement. This movement is a rhythmic circular trajectory executed with the upper-limb. It advantageously combines different desirable features: it is harmonic by essence, involves no contact with the environment, and requires the coordination of several degrees of freedom. The parameters shaping this movement are the amplitude, offset (i.e. position of the circle center), and rotational frequency. The desired movement kinematics are characterized by the vectorial position and velocity in Cartesian space, as a function of time: where α d is the movement amplitude, ω d is the angular frequency and ϕ x,d and ϕ y,d are the offsets along the x-and y-axes, respectively.

Real-time measurement of the movement features
Adaptive oscillators are particularly suited for estimating the real-time movement parameters of a rhythmic movement [52,[56][57][58]. From the ideal movement in (1), an adaptive oscillator can learn an equivalent movement captured by the following model: where α osc is the learned amplitude, φ osc is the learned phase (the time integral of the learned angular velocity ω osc ), and ϕ x,osc and ϕ y,osc are the learned offsets. These variables are the state variables of the adaptive oscillator. Their learning dynamics are governed by: where F x = x − x osc and F y = y − y osc are the error signals that capture the difference between the oscillator input (x and y, i.e. either the simulated or real 2D hand position in the experiments reported in this paper) and the estimated position output. By properly tuning the learning gains ν φ , ν ω , and η ϕ , the output signal will synchronize with the input signal after only a few cycles while learning the actual input features in the internal state variables. The learning dynamics can be finely tuned by adapting the learning gains [56]. If the input signal contains higher harmonics in its frequency a b c Fig. 1 Methodology. Outline of the overall control strategy of the performance-based assistance. First, the movement features are computed by the adaptive oscillator (a) and serve as input to compute the real-time performance in smoothness, velocity, and amplitude (b). These features are then used to compute the gains to tune the level of the assistance forces in smoothness, velocity, and amplitude (c). These three forces are eventually summed up and delivered to the patient spectrum, the oscillator output can be considered as a "smoothed" or filtered version of the input, although both will be phase-synched on average. In sum, this adaptive oscillator provides real-time estimates of the parameters of a time-varying periodic signal while filtering this signal in its output. The method can also provide a smooth estimate of the signal derivatives [56]. For instance, the estimate of the signal's first derivative is obtained by analytical timedifferentiation of the augmented phase oscillator (3): More details about the mathematical foundations of these adaptive oscillators can be found elsewhere [52,55].
The adaptive oscillator is used for two different purposes throughout the proposed therapy: for measuring the initial abilities of the patient through an initialization phase and for measuring the real-time performance (smoothness, velocity, and amplitude) of the patient during the robot-assisted rhythmic exercises (Fig. 1a). The second item is further detailed in the next section.

Real-time smoothness metric
Assessing the smoothness of a discrete movement after completion (off-line) has been the topic of many former studies. The challenge lies in determining a dimensionless metric that is independent of the movement amplitude and duration while having a univocal response to the motion characteristics: the smoothness has to monotonically decrease when the amount of submovements and the inter-submovement duration decrease [59,60]. Several metrics were proposed and analyzed to quantify the movement smoothness after the completion of the whole movement, such as the normalized mean absolute jerk, number of peaks in the velocity profile, logarithmic dimensionless jerk, spectral arc length, and speed arc length [18,20,59,61].
Real-time measurement of rhythmic movement smoothness is required to continuously adapt the assistance. The metrics mentioned above are thus ineligible since they can only provide a smoothness estimate after the completion of one or several movement cycles. Hence, we propose measuring the smoothness performance in continuous-time by comparing the actual velocity of the patient,ẋ pat andẏ pat , with the desired velocity computed by the adaptive oscillator (9); i.e., the filtered version of the patient actual velocity. This error is normalized with respect to the angular velocity (the product of ω osc and α osc ) to obtain a dimensionless metric: Next, we compute the numerical differentiation of this velocity error signal and normalize it again with the angular velocity: Consequently, if a patient smoothly accelerates or decelerates, this dimensionless differentiated velocity error ξ will stay bounded. Finally, the absolute value of ξ is low-pass filtered to obtain a quasi-real-time smoothness measurement. The time constant (and bandwidth) of this filter is proportional to ω osc , which normalizes the filter response with respect to the movement frequency: In (12), a is a constant gain that tunes the frequencydependent time constant of the filter. If the movement is performed as an ideal circle of constant tangential velocity, η, ξ , and thus sm will converge towards 0. Moreover, a circular movement performed with a constant acceleration will cause sm to converge towards 0 since the velocity error η will reach a plateau. The more fluctuations there are in the velocity error, the higher sm is.

Real-time velocity error
The real-time velocity error is simply obtained from the difference between the desired movement frequency ω d and the actual one estimated by the adaptive oscillator:

Real-time amplitude error
Similarly to the real-time velocity error, the real-time amplitude error is the difference between the estimated amplitude of the circles drawn by the patient, α osc , and the desired amplitude, α d :

Performance-based assistance forces
The estimates of different movement features allow for three types of assist-as-needed forces to be delivered to the patient. "Smoothness assistance" is delivered if the performed movements are detected to be jerky and deviate too much from the ideal movement given by (1). "Velocity assistance" is delivered if the performed movements are too slow, which is determined by the detected movement tangential velocity (the product of the movement frequency ω osc and amplitude α osc ) being too far below the desired one α d ω d . "Amplitude assistance" is delivered if the performed movements are too small, i.e. if the detected movement amplitude α osc is too far below the desired one α d . Since the types of assistance are managed by parallel algorithms, they can occur simultaneously ( Fig. 1c): (15) where F robot is the total assistance force being delivered by the robot.

Smoothness assistance
Smoothness assistance is provided by a virtual damped spring between the current estimated position provided by the adaptive oscillator and the actual position of the patient (Fig. 2a). This type of assistance guides the patient hand to a "smoothed version" of its own movement since the adaptive oscillator synchronizes to the input while filtering out the frequency content from its main harmonic. The oscillator neither lags behind nor leads the patient hand on average since it is phase-synched to it. Accordingly, the force applied to the patient hand (F smoothness ) is equal to: (16) where k sm is the adaptive stiffness of the spring and c is the damping coefficient. To render the behavior of a spring with critical damping, c = 2 √ mk sm (where m is the equivalent virtual mass of the robot, see Section 'Validation with experimental data'). In (16), p pat andṗ pat denote the measured vectorial position and velocity of the patient hand, respectively.
Due to the adaptive nature of the oscillator used to compute the movement features, p osc andṗ osc constantly adapt to the movement being performed by the patient. Therefore, the smoothness assistance should equally accelerate and decelerate the patient hand during steady-state behavior. Said differently, it should provide no positive mechanical work to the patient on average. In sum, the smoothness assistance helps in making a smoother movement but does not directly make it larger or faster.

Velocity assistance
If the patient is not able to perform the desired movement at the desired frequency, velocity assistance can be provided. This assistance is implemented through a force that is tangential to the desired velocity profile: if |ṗ d | > |ṗ |; otherwise, F velocity = 0. k vel denotes the adaptive gain (Fig. 2b),ṗ is the orthogonal projection oḟ p pat onṗ d , andṗ d is the desired velocity vector, which is tangential to the ideal circle being learned by the adaptive oscillator:ṗ a b c Fig. 2 Assistance forces. The three assistance forces that can be provided to the patient to enhance the movement features are presented in the three panels. a The smoothness assistance attracts the patient to the smooth position produced by the adaptive oscillator, b the velocity assistance tangentially supports the patient to reach the desired velocity, and c the amplitude assistance is a radial force towards the desired amplitude In sum, this assistance provides a smooth longitudinal force if the patient's tangential velocity is below a desired threshold.

Amplitude assistance
Finally, if the amplitude of the patient movement (captured by the adaptive oscillator state variable α osc ) is below the desired amplitude, a radial force is provided by the robot to encourage larger movements. Therefore, if the actual position of the patient is inside the minimal amplitude circle (|α pat | < |α d⊥ |), assistance is delivered through a force: Otherwise, F amplitude = 0. In (21), α pat is the vector between the center of the circle ϕ osc = (ϕ x,osc , ϕ y,osc ) and the actual position of the patient, α d⊥ is the vector from the center of the circle towards the actual position of the adaptive oscillator (with length α d ), and k amp is the adaptive gain (Fig. 2c). In mathematical terms, and

Gain tuners
To prevent the patients from slacking [36] and to mimic the way a physical therapist would help a patient during an exercise, the levels of assistance have to evolve as a function of the real-time patient performance. If a performance metric is low, the gain of the corresponding assistance has to increase. If the performance improves, the gain should decrease in order to encourage the patient to stay active. Three parallel low-pass filters are thus used to tune the three gains of the assistance forces: k sm (16), k vel (17), and k amp (21); see Fig. 3. They dynamically evolve between 0 (no assistance if the performance is good) and a maximum value (if the performance is poor) through a scaling factor k %,metric ∈ [ 0, 1], such that k metric = k %,metric k max,metric . The input of these three filters are the corresponding metric : the performance indices sm (12), vel (13), and amp (14). min,metric is the minimum error tolerated before k %,metric increases, and max,metric is the maximal error that causes k %,metric to saturate to 1. The time constant of these filters is set to τ g seconds.

Validation with simulated data
Before validating the performance-based assistance with patient data, the adaptive oscillator, smoothness metric, and performance-based assistance were validated with simulated jerky circular movements. These unideal rhythmic signals were generated by augmenting a smooth rhythmic circular movement (similar to (1)) with lateral and longitudinal errors of time-varying amplitude and frequency captured by: φ jerky = ω jerky dt (27) α andω are the mean amplitude and frequency of the simulated jerky movement, while ω lat and ω long capture the frequency of the lateral errors and longitudinal errors, and δ lat and δ long capture the amplitude of the lateral and longitudinal errors, respectively (Fig. 6, top). The longitudinal velocity v long of the simulated jerky movement with longitudinal errors is equal to: v long =ᾱω 1 + δ long cos ω long t (28) which is obtained by time-differentiating (1) with φ d = φ jerky and α d = α jerky . By varying δ long , the longitudinal velocity error varies proportionally to the mean longitudinal velocityᾱω. These simulated jerky signals were first used to validate the convergence of the adaptive oscillator towards the average amplitudeᾱ and frequencyω. The values of the parameters that were used during the learning phase are shown in Table 1 ("Sim. data and learning" column).ᾱ was set to 5 cm andω to 3.14 rad/s. Next, in order to validate the smoothness metric, a variety of simulated movements were computed with different magnitudes of lateral and longitudinal errors. Ideally, the metric should increase when the amplitude (δ lat ) or frequency (ω lat ) of the lateral error increase, or when δ long or ω long increase for the longitudinal error. Simulations were achieved by testing different sets of parameters (δ lat ∈ [0, 3.75] cm, ω lat ∈ [ 0, 4]ω, δ long ∈ [0, 3.75], and ω long ∈ [0, 3]ω), as well as for different movement amplitudes (ᾱ ∈ [ 4, 10] cm) and frequencies (ω ∈ [ π/2, 3π] rad/s). The column "Sim. data and learning" contains the values of the parameters used in the validation with simulated data and in the learning phase of the patient performance. The second column "Pat. data" shows values used during the assisted trials with the pilot patients. The adaptive oscillator gains were tuned using a published method [56] to obtain fast (τ = 3s) and slow (τ = 10s) learning time constants, respectively for both columns The other parameters are displayed in Table 1 ("Sim. data and learning" column). Finally, to validate the performance-based assistance, we built a signal composed of different types of errors. This signal was composed of (i) five cycles of unperturbed circular rhythmic movement (ᾱ = 5 cm andω = 3.14 rad/s, δ lat = 0 and δ long = 0), followed by (ii) five cycles of smaller circular rhythmic movements (ᾱ = 3 cm), (iii) five cycles of slow movements (ω = 2.09), (iv) five cycles of jerky movements with lateral errors (δ lat = 0.2, ω lat = 4ω, α = 5 cm,ω = 3.14), and (v) five cycles of jerky movements with longitudinal errors (δ long = 0.6, ω long = 4ω, α = 5 cm andω = π rad/s). These simulated pathological movements were separated from each other by five periods of unperturbed rhythmic circular movements.
This signal was used to compute the real-time performance metrics and evolution of the corresponding gains of the performance-based assistances. The minimum desired amplitude α d was set to 4 cm, and the minimum desired frequency ω d was 2.8. The values of the parameters used to compute the metrics and gains are displayed in Table 1 ("Sim. data and learning" column). In all simulations, no assistive force was actually delivered since the kinematics was prescribed to follow the simulated signals.

Validation with experimental data
Finally, the performance-based assistance was implemented on an end-effector robot, and the protocol was tested with two stroke patients (see Table 2). Both patients gave written informed consent to participate in the study, which was approved by the scientific and ethical committees of the Université catholique de Louvain.

Experimental apparatus
The robotic assistance was implemented on an upperlimb end-effector robot, REAplan, which was developed within our university. This device was designed to quantify upper limb impairments of disabled patients [22,62] and to provide robot-assisted therapies to the same populations [21]. The robot is composed of (i) a heightadjustable horizontal table, (ii) a handle equipped with strain gauges force sensors held by the participant, (iii) two MAXON motors (EC40 170W 42VDC with planetary gearheads GP42C6/1 and encoder HEDL5560 1000imp 2ch) actuating the handle in the horizontal plane, (iv) a flat screen and loudspeakers in front of the participant, which can provide visual feedback of the position of the handle and any other visual or auditory information, and (v) an interface next to the robot for the therapist. All these components are shown in Fig. 4. When controlled to be transparent, i.e. to deliver no force hindering the patient's voluntary movements, the actual robot impedance was identified to be similar to the one of a damped mass. The residual force F res thus obeyed a dynamical equation like F res = mp pat + bṗ pat . The residual virtual mass of robot was identified to be equal to m = 0.45 kg and the virtual damping factor to b = 2.26 kg/s. Patients were too weak to hold the handle by themselves with their paretic hand. Consequently, it was strapped to the handle, and their forearm was supported by a plate rigidly attached to the handle.

Proposed therapy
After seating the patient in front of the robot, his initial abilities were computed. Patients were asked to perform ten rhythmic circular movements at a comfortable speed and amplitude while moving the robot handle with their paretic hand. The robot was configured to be transparent in this case. During this initialization phase, the adaptive oscillator learned the movement features of the patient with dynamics governed by Eq. (3) (see "Sim. data and learning" column in Table 1 for the numerical values of the parameters). For the next phase, the therapy itself, the desired amplitude α d and tangential velocity v d = ω d α d Fig. 4 Experimental apparatus. Planar end-effector robot (REAplan) used to validate the performance-based assistance. The patient is seated in front of the device and holds the handle with the paretic hand were set 10 % higher than those obtained after this initialization. This increase was administered in order to make the patient performing close to their maximum capacity.
Next, patients were asked to perform rhythmic circular movements while receiving assistance with the desired movement parameters during half of the trials. The screen displayed a circular path with inner radius set at α d . The width of this path was set to 4 cm. Patients were asked to perform circular movements while staying inside the path. The path was displayed in red if they moved too slowly on average (ω osc < ω d ), while the path was green if they were going faster than ω d . The patients were instructed to maintain the green color as much as possible.
This task was continuously performed by the patients during 40 seconds and was repeated ten times, i.e. 10 trials of 40 seconds. They received assistance during half of these trials with random distribution in order to prevent them to display different behaviors in anticipation of a trial with or without assistance. They received at least one minute of rest between two consecutive trials.
The therapist interface served as control unit, i.e. to select if the assistance has to be delivered or not, and to follow the real-time performances of the patient. Importantly, the therapist was instructed to not to mention to the patient if he was receiving assistance or not, and to deliver no other feedback than what was displayed on his screen.
To validate our approach, we show that the assistance (i) adapts to the real-time motor performance, (ii) enhances the global motor performance, (iii) does not increase with time (no slacking), and that (iv) the smoothness assistance does not provide positive mechanical work on average. The last analysis was performed by computing the mechanical work transferred from the robot to the patient during each cycle: (29) where dl represents the infinitesimal trajectory of the patient hand, and F patient is the actual force being measured at the interface between the patient and the robot. The numerical parameters used during the therapy are provided in Table 1 ("pat. data" column).

Data acquisition
Data were acquired by the robot at a frequency of 250 Hz and exported in a text file with a sampling frequency of 125 Hz. The handle position and velocity were directly taken from the motor drivers with no extra filtering or signal processing.

Validation with simulated data Adaptive oscillator
Simulation data confirm the capacity of the adaptive oscillator to quickly synchronize to an input rhythmic movement while learning its features in state variables. Figure 5 (left) shows an illustration of the adaptive oscillator synchronizing with the simulated data with a mean amplitude ofᾱ = 5 cm and mean angular velocity ofω = πrad/s. This simulated signal was distorted both with longitudinal (δ long = 0.6 and ω long = 4ω) and lateral errors (δ lat = 0.2 and ω lat = 4ω). The state-variables are also displayed and reach steady-state after about two cycles (3 seconds), which corresponds to the expected settling time (see Table 1 and [56]). The oscillator output produces a smooth quasi-sinusoidal version of the distorted input and is fully synchronized after the same amount of time. This result confirms that the state-variables ω osc and α osc are good candidates for estimating the real-time frequency and amplitude of quasi-harmonic movements performed by the patients. They can also be extracted in real-time during the therapy given the low computational cost of the discrete-time integration of the oscillator state equations. Interestingly, these state variables are also good candidates for assessing the initial ability of the patient to perform circular movements before receiving the therapy (see "Proposed therapy" section). Figure 6 shows the impact of longitudinal and lateral errors on the metric quantifying movement smoothness. These graphs were generated by varying both the mean amplitude and angular velocity of the circles and the frequency or amplitude of the longitudinal or lateral error. Longitudinal error mostly impacts the signal temporality, while lateral errors mostly impact the signal spatial distribution.

Validation of the real-time smoothness index
The figure shows that the smoothness metric is insensitive to the mean movement amplitude and frequency during movements being distorted with lateral errors. This is visible in both left panels of Fig. 6, which show no variation of the metric with the mentioned parameters (i.e., flat surfaces). This capacity to predict movement smoothness independently of the movement amplitude and frequency is highly desirable. It complies with efforts made to construct a smoothness metric for discrete movements that is dimensionless and independent of the movement amplitude and duration [18,20,59]. With longitudinal errors, the smoothness metric is also insensitive to the average movement amplitude but displays small sensitivity to the movement frequency (right panels of Fig. 6). This is due to inherent non-linear dynamic couplings between the state variables of the adaptive oscillator. Figure 7 shows the evolution of the gains of the three types of assistance as a function of their corresponding errors (smoothness error, velocity error, and amplitude error; bottom panel). From top to bottom, the different panels show (i) the position signals, (ii) velocity signals, (iii) absolute error in velocity η, its time derivative ξ , and the smoothness metric sm (the filtered version of ξ ), and (iv) the evolution of α osc and ω osc with respect to the desired amplitude α d and angular velocity ω d . The three assistance gains respond as expected. When the error of the corresponding assistance is above min , the assistance increases. If the error goes above max , the gain saturates to 1 with a settling time of about 1 s.

Experimental validation with patient data Initialization
The adaptive oscillator were used to assess the patient abilities at the beginning of the therapy. Patients were asked to execute ten circles with their paretic arm, at comfortable velocity and amplitude while receiving no Fig. 6 Real-time smoothness metric as a function of lateral and longitudinal errors. The left panels present the impact on the metric due to lateral errors (errors in amplitude), and the right panels show the impact due to longitudinal errors. The two upper panels display the simulated variation of amplitude and velocity (the product of amplitude and frequency), while the middle panels represent the metric variation as a function of the error frequency (fixed error amplitude), mean signal frequency, and mean signal amplitude, and the bottom panels present the metric variation as a function of the error amplitude (fixed error frequency), mean signal frequency, and mean signal amplitude assistance. Meanwhile, the adaptive oscillator learned the corresponding movement features with a small time constant (see Table 1). Figure 5 (right) shows a representative result of this adaptation in the form of the adaptive oscillator trajectory, x osc and y osc , synchronizing to the actual position data x and y. For this particular patient and trial, the initialization finished with the oscillator state variable equal to α osc = 9.1 cm and ω osc = 1.71 rad/s. Consequently, setting the target movement amplitude and longitudinal velocity to 10 % higher during the therapy is achieved by setting α d = 1.1α osc = 10.01 cm and ω d = ω osc (remember that the longitudinal velocity is the product of the amplitude α d and frequency ω d ). The patient initial average longitudinal velocity was thus equal to v osc = ω osc α osc = 15.56 cm/s, while the target velocity used for the therapy was 10 % higher: v d = α d ω d = 17.1 cm/s. Consequently, the patient is encouraged to perform both larger and faster movements than those executed during the initialization phase. Fig. 7 Comparison of the performance-based assistance with simulated data. The simulated data is composed of a succession of 5 periods of unperturbed sinusoidal movements and 5 periods of simulated pathological movements. The pathological movements are first small movements, followed by slow movements, jerky movements with lateral errors, and finally jerky movements with longitudinal errors. The upper panel shows the position signal along the x-axis, and the second panel shows the velocity along the x-axis. The third and fourth panels display the signals used to assess the motor performance. The third panel shows the signals involved in computing the smoothness metric ( η, ξ , sm and sm,min ), and the bottom panel shows the adaptive oscillator state variables ω osc and α osc together with the corresponding minimum desired values ω d and α d . The corresponding assistance gain increases when the performance is lower than the desired threshold, as displayed in the bottom panel. This panel shows the evolution of the three assistance gains k %,sm , k %,vel , and k %,ampl . When the corresponding error is above the threshold, a color background is added (smoothness in blue, velocity in green, and amplitude in red) Figure 8 illustrates the evolution of the error signals ( sm , vel , amp ; Eqs. (12), (13), and (14)) during a trial without assistance (upper panel) and with assistance (bottom panel). The bottom panel also shows the evolution of the level of smoothness assistance. Both tested patients showed a consistent ability to execute the circular movements at desired amplitude (α d ) and speed (v d ). Only a small amount of amplitude or velocity assistance was provided at the beginning of some trials, but this never lasted longer than 5 seconds. Maybe this reveals that 10 % of increase with respect to the natural velocity and amplitude was not high enough to make the movement really challenging. In contrast, the smoothness assistance was active during all trials. The assistance decreased when the smoothness metric sm was close to 0 and increased when the smoothness metric increased.

Performance-based assistances adapt to real-time motor performance
Interestingly, the low use of the amplitude and velocity assistance by the patients could also reveal an interaction between the assistance modes. This suggests that providing smoothness assistance also had a positive impact on the steady-state movement amplitude and velocity. However, this observation should be investigated further with a larger population.

Performance-based assistance enhances motor performance during training
On the right side of Fig. 8, the hand trajectory during a trial with and without assistance is traced. This clearly shows that the hand trajectory was smoother when assistance was provided. This observation can be quantified by measuring the mean smoothness errors during the trials with and without assistance (Fig. 9c). As expected, the error was significantly higher during the trials without assistance than with assistance for both patients (one-way anova, assistance effect: patient 1, F (1,8)  This result shows that the smoothness assistance had the expected impact on motor performances, by improving the smoothness feature of both patients movements.

Performance-based assistances keep the patient active
The slacking hypothesis suggests that when receiving too much assistance, a patient relies on the assistance and stops providing the maximum effort to execute the task alone [36]. This can be observed both within a trial and between trials. If patients display slacking behavior, the amount of assistance should increase over time. The evolution of the smoothness assistance gain is displayed in Fig. 9a (inter trials) and b (between trials) for a b Fig. 8 Performance with experimental data. Panels a and b show trials without and with assistance, respectively. The left displays the smoothness, velocity, and amplitude error and gain signals, and the right shows the corresponding 2D hand paths both patients. Figure 9a shows the amount of assistance provided during the five assisted trials for both patients (colored dashed lines) and their average (black solid line). The figure clearly illustrates that the assistance did not increase over time during the trials, except during the initialization phase where the level of assistance reached steady-state. Figure 9b shows the mean assistance provided during each trial and confirms that the assistance was also not increasing across the 5 trials. These results show that the patient stayed equally active during the successive trials. Indeed, if they would have displayed a slacking behavior, the movement would have been a b c d Fig. 9 Patient data. a Evolution of the smoothness gain along the 5 assisted trials for both patients. The averaged evolution over the 5 trials is displayed in black. b Mean gain for each assisted trial for both patients. c Mean real-time smoothness metric during the trials with and without assistance for both patients. d Mean mechanical work provided by the robot to the patient during one cycle with and without assistance for both patients. Vertical lines in panels b, c, and d capture the patient standard deviation across trials degraded and the assistance gains would have increased accordingly.
Since both patients maintained the desired amplitude and velocity, the amplitude and velocity assistance did not turn on. Therefore, conclusions about a possible slacking behavior with these modes of assistance would require more experiments. Slacking is however unlikely since these assistances are based on same principles as for the smoothness assistance. Figure 9d illustrates the average mechanical work delivered by the patients to the robot during the execution of one movement cycle with assistance and without assistance (see Eq. (29)). This mechanical work was positive on average, revealing that the robot was actually dissipating energy in both the transparent mode (no assistance) and when the assistance was switched on. This is due to the residual robot friction b, which was not entirely hidden by the robot force controller. Patient 1 delivered the same amount of energy to execute the circles with and without assistance (one-way ANOVA; assistance effect: F (1,8) = 0.13, p = 0.73). Patient 2 delivered a little bit more energy with assistance than without, although this did not reach significance (F (1,8)

Smoothness assistance does not provide positive mechanical work, on average
This result indicates that our smoothness assistance obeys passivity-like properties, as it does not provide mechanical energy to the patient on average. Passivity has recently emerged as a highly desirable feature for rehabilitation robots since it does not compromise the stability of the patient-robot interaction once they are connected to each other [63][64][65][66].

Perspectives
The data that were reported in the present paper were acquired for the purpose of validating our approach with two representative pilot patients. Consequently, this opens several perspectives for future research. The first is to validate our assistance principle with a larger stroke population, in order to confirm the reported preliminary results. The second is to explore the short-and long-term effects of the suggested unilateral rhythmic movement training on the motor performances of stroke patients. Moreover, possible improvements should also be quantified on other types of movements, like discrete reaching, although the litterature established that there is few to no learning transfer from rhythmic to discrete movements in healthy subjects [13,14]. Interestingly, our previous study suggested that stroke patients tend to perform their rhythmic movements kinematically close to discrete movements of healthy subjects [24]. Therefore, investigating possible transfer of learning between rhythmic and discrete movements in a stroke population is of high interest, in particular regarding movement features like smoothness. In sum, our future investigations will aim at establishing which movement features could be improved, both in rhythmic and discrete primitives, after a unimanual rhythmic movement training. The assistance presented in this paper is proposed as a candidate for implementing such a robot-assisted rhythmic movement training.
In parallel, a progression in the exercises could also be proposed, owing to the fact that our recent findings also revealed smaller impairments of rhythmic movements in a typical stroke population [24]. Discrete elements could be combined with rhythmic movements, supporting the execution of movements with a higher degree of impairment by those that are performed more stably. The combination of rhythmic and discrete movements, like those performed by [67] for single-joint movements or [8] for two-joint movements, are viable candidates for this type of training. Our performance-based assistance could assist the rhythmic component of such movements, although it would have to deal with the reported conflicts between both neural controllers that are being trained. For instance, [8] revealed that the discrete component of a combined rhythmic+discrete movement is systematically triggered during a limited phase window of the rhythmic one.
Finally, the presented performance-based assistance could be extended to more functional rhythmic movements such as wiping a table, brushing teeth or even walking [54]. Indeed, the assistance principle is applicable to any rhythmic movement performed with an end-effector robot, but also with an exoskeleton.

Conclusion
Rhythmic and discrete movements are considered to be two different motor primitives, and both are affected after stroke. Therefore, both movements should be trained during post-stroke therapies. Currently, mainly functional discrete movements are used during post-stroke therapies, and similarly, the majority of assistance methods being developed for rehabilitation robots target only discrete movement training. To bridge this gap, our study presented a new performance-based robotic assistance training for rhythmic movements that should ideally complement similar discrete-specific therapies in order to recover the most complete motor repertoire.
The proposed assistance method relies on the repetitive nature of rhythmic movements to independently assist three movement features, i.e. smoothness, velocity, and amplitude, without constraining the participant to follow a predefined trajectory. Three assistance forces are combined in order to enhance these features. The forces are modulated as a function of corresponding realtime metrics and therefore assist the patient as needed to prevent slacking. Our approach ideally combines several blocks: an adaptive oscillator that extracts the real-time movement features while providing the movement main harmonic, three estimators that compute the real-time movement features, and three adaptive blocks that compute the feature-based assistance forces. Notably, these blocks consist of a few dynamic equations and can thus be implemented in a discrete-time version with a limited amount of code and reasonable computational cost.
These different blocks were tested using both simulated and actual experimental data. The simulation data mainly served to validate the independent and decoupled computing of the different movement features using signals with controlled distortions. In particular, the proposed real-time smoothness metric proved to quantify movement smoothness while being independent of the mean movement amplitude and frequency. Patient data revealed the method efficiency in assisting patients to produce smoother movements while keeping them active in the task. In particular, we showed that the robot did not provide mechanical energy to the patient on average such that our strategy displayed passivity-like properties.