{'fraction_non_alphanumeric': 0.02908740570678911, 'fraction_numerical': 0.005965070514922926, 'mean_word_length': 4.958837180896543, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Functional Rehabilitation: Coordination of Artificial and Natural Controllers

Walking and standing abilities, though important for quality of life and participation in social and economic activities, can be adversely affected by central nervous system (CNS) disorders such as spinal cord injury, stroke or traumatic brain injury. One characteristic of motor deficiencies which affect lower extremities is their impact on both static and dynamic postural equilibrium. Depending on the impairment level, functional rehabilitation techniques may be needed for a patient to stand up and walk (Popovic and Sinkjær, 2003). Functional electrical stimulation (FES) can induce contraction of skeletal muscles by applying electrical stimuli to sensory-motor system via electrodes which can be placed on the skin (Kralj et al., 1983), or implanted (Guiraud et al., 2006). FES applications applied to lower limbs include foot drop correction, single joint control, cycling, standing up, walking... (Zhang and Zhu, 2007). Two distinct objectives may be targeted when using those techniques, depending on the type of disorder: chronic assistance or acute training. FES can be applied for standing and gait restoration in paraplegic patients. Paraplegia is a condition where both legs are paretic (incomplete paraplegia) or paralyzed (complete paraplegia). Physiological effects of FES-assisted verticalization in paraplegic patients include: prevention of muscle atrophy, promotion of renal functions, improvement of joint range of motion, well being, improved digestion, bowel and bladder functions, retardation of bone-density loss, decreased spasticity, reduced risks of pressure sores, improved cardiovascular health, improved skin and muscle tone (Cybulski and Jaegger, 1986). In theory, FES-assisted ambulation can give to the user greater access to locations inaccessible to wheelchairs, assist transfers, and facilitate face-to-face interaction with others. In addition to the physical effects of exercise, FES for standing, transfer, and ambulation applications can offer functional and psychological benefits. Today, all FES standing or ambulation systems use walkers, parallel bars, or elbow canes for balance and support. FES systems for standing and ambulation can be strictly FES, or combine FES with various types of braces (hybrid systems) like orthoses and exoskeletons (Kobetic et al., 2003). FES can also be applied for walking assistance and training in hemiplegic patients. Hemiplegia is a condition where one side of the body is paretic or paralyzed; it is usually the consequence of a cerebro-vascular accident. Both sensory and motor functions can be

In paraplegia and hemiplegia, it is important to notice that the upper extremities (trunk and arms) remain functional as well as one of the legs in the cases of hemiplegia (figure 1) . Therefore, when attempting to control posture and locomotion through FES, an important issue is the enhancement of the interaction between: a) the artificial FES-system controlling the deficient body segments and b) the natural system represented by the patient voluntary actions through his valid limb motion. In most of FESsystems, voluntary movements of valid limbs are usually considered as perturbations. As an example, the trunk represents 60% of the total body mass and is positioned relatively high with respect to the base of support. Therefore, trunk movements strongly influence the equilibrium control whereas legs have an adaptive role to ensure an adequate support base for the centre of mass projection. Collaboration between trunk and legs sounds therefore indispensable to ensure postural balance, and should be taken in account in a FES-based control system. In a similar way, when one leg functions normally, like in hemiplegia, it would be suitable to use information from this leg to inform the artificial controller about the contralateral leg state. This approach is also a way to give the patient an active role in the control of his/her movements. The FES-assistance system should adapt to patient behaviour and intentions expressed through his valid limbs motions, instead of imposing an arbitrary motion on the deficient limbs. This consideration (need for collaboration between healthy and deficient limbs) led us to the idea that valid limbs should be observed in order to improve the artificial control. Developing sensory based FES assistive-systems implies to use sensors to measure the voluntary actions of the patient. Our approach consists of placing sensors on subject's healthy limbs (trunk, intact leg...) in order to optimize the interaction at two levels: • Strategic level: identifying the postural action the patient intends to execute, as soon as possible, in order to allow for optimal posture preparation and execution • Tactic level: monitoring the ongoing action relatively to a reference pattern in order to generate an adapted and optimized command for the deficient limbs Therefore, our approach requires the specification of two classes of functions, which use sensor measurements from valid limbs as inputs (see section 2 for a description of the used sensors). Transitions functions Sij which correspond to detection of intention, will be detailed in section 3, and illustrated with a sit-to-stand transfer action for paraplegic patients under FES. Then, for each identified action, control functions Ci have to be defined, which monitor the ongoing movement and provide with the adapted command; this part will be presented in section 4, and illustrated with a walking action for stroke patients using FES. In both cases, after theoretical considerations followed by some simulation results, real-time experiments are presented in order to validate the developed methods. One can notice that the framework presented in Figure 2 mixes discrete (action to action transitions) and continuous (control functions within an action) behaviors; this duality raises some integration issues that will be addressed in section 5.

Sensors
Our approach aims at observing valid limbs to help the control of deficient limbs. One important constraint is to minimize the number and size of sensors involved in movement observation to propose realistic solutions for rehabilitation applications to be used by physiotherapist and/or the patient himself. Fig. 2. This table sums up the two envisioned cooperation levels between valid and deficient limbs. The strategic levels, i.e. transitions from a task to another, are represented by transitions functions Sij from a task to another. Tactic level is represented by control functions Ci which role is to provide an adapted command to the controlled limbs. Both of these processings are based on measurements from sensors placed on valid limbs. Different types of sensors may be used to achieve motion identification and monitoring. Although EMG (Electro-Myo-Graphic), ENG (Electro-Neuro-Graphic) or even EEG (Electro-Encephalo-Graphic) measurements could possibly provide with early information about the intention of action, they suffer from important drawbacks (reliability and robustness) which prevent from their use as embedded on a patient. Foot switches are easy to use and reliable, but provide with very weak information about the movement. Flexible goniometers can measure joint angles, but are difficult and time demanding to mount on the subject, and can be easily broken. We therefore preferred movement sensors which can provide us with some extrinsic information, such as the dynamics of the movement itself. We found that this kind of information was well-suited for a further adaptation of the artificially generated movements with respect to the natural ones. Such embedded systems of motion capture, like accelerometers, or gyrometers, are today widely used for movement analysis purposes, and find lots of applications in medical or rehabilitation systems (Luinge and Veltink, 2004;Pappas et al., 2002). Since size and cost of those systems are important issues in our application, we selected a set of micro-sensors minimizing these parameters. The movement sensor we use is a micro-sensor developed by CEA-LETI (Grenoble, France), which associates 3 accelerometers and 3 magnetometers in a minimal volume (see Figure 3). This attitude sensor is able, through the processing algorithms associated, to reconstruct the orientation in space of the segment to which it is attached (Bonnet and Héliot, 2007). It is also possible to have access to accelerometer measurements, which often provide with reliable "signatures" of movements. A particular care was paid to an easy donning and doffing of these sensors on the subject. A wireless version of this sensor has been developed, which is suitable for motion capture.

Strategic level: intention detection
A first issue in our approach is to identify the intention of the patient, i.e. to detect as soon as possible the action (posture or movement) he/she is intending to perform. This can be done through motion observation, based on information from sensors placed on valid parts of the body. The operating scheme is thus the following: the patient uses his valid limbs to initiate or stop the movement, or switch from an action to another. Once the intended action recognized, the system triggers the correct command to apply (FES stimulation), so that the movement the patient intends to realize is achieved through both the valid and deficient parts of the body. Of course, this scheme will work in a better way if the initial motion that the patient has to perform through is valid limbs is normally (i.e. in healthy subjects) occurring before the rest of the movement which will be artificially controlled on the deficient limbs. For this reason, an important issue is the understanding of the temporal organization of the whole movement, in order to place the sensors on the valid parts of the body which are normally involved in the initiation of the movement. In this section, we will focus, without loss of generality, on one example: the sit-to-stand transfer, for paraplegic patient's FES assisted rehabilitation. Rising from a chair with the help of open-loop electrical stimulation of knee extensors is well accepted in paralyzed persons (Kuzelicki et al., 2000). However, electrically stimulated knee extensors only generate low joint moment during rising. Thus, the effort of upper extremities during standing-up is extensive. Excessive physical effort and large upper limb forces often lead to syndromes of shoulder overuse. This movement is of great interest in a rehabilitation issue, since it is repeated many times in everyday activities and is usually a prerequisite to gait initiation (Kerr et al., 1997). In healthy subjects, the movement of the trunk precedes the action of the legs: sit-to-stand is impossible without arm support if trunk inertia is not used and associated with a proper postural preparation and action of the legs. In a paraplegic patient, the coordination between the trunk and the legs, which is no more occurring, must be re-introduced. Using a FES system, it is essential to optimize the sit-to-stand transfer, in terms of muscle fatigue. Indeed, minimizing the energy needed in rising up may improve the efficiency of the patient in his following activities. For this reason, classical techniques consisting in stimulating as strongly as possible the knee extensors throughout the rising process are inadequate with prolonged and functional standing. We therefore aim at proposing a solution where the global movement is "energetically" optimized, while the use of arm support is minimized. Although the following will be illustrated through the sit-to-stand example, the proposed methodology can be applied for other types of transitions S from the framework described in Figure 2.

Movement characterization
In , we demonstrated the pertinence of observing the trunk using a movement sensor system placed on the back of healthy subjects. Indeed, the trunk normally initiates the sit-to-stand transfer, and remains a healthy limb in paraplegic patients. We showed that trunk orientation and acceleration patterns present low intra and inter-variability as well as a high temporal reproducibility and could therefore be a nice characteristic "signature" of the sit-to-stand transfer (see Figure 4). The next step is to develop a recognition algorithm able to robustly detect this sit-to-stand pattern; in the following section we propose and test two different algorithms for movement detection and recognition.

Method 1 -monitoring a correlation coefficient
This first algorithm uses a correlation computation to compare the Az acceleration (acceleration along the Z axis, see Figure 4) with a reference (the typical pattern characterizing the sit-to-stand transfer). This reference is built averaging the same accelerometric signal over several the trials from a given subject, truncated in a way that it only contains the initiation of the movement, stopped at the time when the legs actually start moving. Provided that the reference contains N samples, we compute at each instant k the correlation coefficient between the last N samples of the current Az acceleration measurement and the reference: where Az is the measured acceleration and Ay is the reference. Once the movement begins, the correlation coefficient starts changing, and begins increasing after a while. When the Az acceleration which we are testing reaches the instant corresponding to the point when the reference has been truncated, the correlation coefficient begins to decrease. Its maximum value should be very close from 1 if the acceleration pattern matches the reference. Thus, movement detection / recognition is achieved in an easy way: once the correlation coefficient reaches a value greater than 1 -ε, ε being small, the movement is recognized as a sit-to-stand transition. The trigger for leg muscles activation should be set as soon as the correlation coefficient begins to decrease (see Figure  5).

Method 2 -sequential detection of abrupt changes
Abrupt changes theory has been widely explored by (Basseville and Nikiforov, 1993); we will introduce here only a simple application of this approach. Indeed, our detection issue belongs to the area of detection of abrupt changes, which itself relies on sequential Likelihood Ratio (SLR) estimates. . When the acceleration signal shows a pattern corresponding to the reference, the correlation coefficient increases and gets close to 1. The vertical line corresponds to the estimated time of leg movement onset, given by the maximum of correlation.
Given a non-stationary signal, one can ask when statistical changes occur. Computing a Likelihood Ratio (LR), we can test between two or more hypotheses and then check if some statistical characteristic of a signal belongs to one class or another. A sequential LR is then a way to look online for any changes in the signal properties.
We, here, apply this technique to detect a very simple change: transition from resting to moving. Assuming that the acceleration locally behaves as a signal with constant mean and variance σ , the computed LR allows to test between the two following hypotheses: • (H0): the acceleration is close to its "resting" value, 0 • (H1): the acceleration is close to its "moving"' value, 1 Therefore, sk is positive if (H1) is achieved, negative otherwise. Then the cumulative sum, SLR, is computed: Assuming that the signal starts at its resting value (hypothesis (H0)), SLR decreases until a change arises. Finally, let us set the following decision function, g: where h is an adequate threshold. As Sk first decreases, gk stays around 0; as soon as hypothesis (H1) appears to be the good one, Sk increases and g will become true. This threshold h reflects to what extent the signal has to be statistically close to 1: the higher this threshold is, the longer the signal will have to belong to (H1) before activating the detection event. This will make the algorithm more robust, but also introduce some delay in the detection. Finally, we are able with this method to robustly detect the movement initiation. Figure 6 shows an example.  The next step is to compute the integral of the reference (the same reference as in section 3.2.1) between the two following boundaries, regarding to its baseline value: • time when movement initiation is detected • time when legs start moving (actually, end of reference, by definition) This computation only has to be run once, and this can be done off-line. As we have one reference for each subject, we save one integral value per subject (called "ending value"), which will be useful. We finally apply the following processing to each trial: • detection of movement initiation trough SLRs method. This is performed using the previously described method. Parameters for this detection must be the same than those used for the corresponding reference. Then, the acceleration integral is computed on line, regarding to its baseline value, between the detected onset of movement and current time. • checking that, at the beginning of the movement, this integral goes below a given value, which means that the initial forward acceleration is significant. This will allow us to discriminate between a "true" and "false" sit-to-stand transition. These "false" movements can be for example the grasping of an object placed in front of the patient. • the integral then increases, and finally reaches the corresponding reference ending value. In theory, if the measured acceleration has exactly the same dynamics as its reference, then this ending value is reached exactly as the time when legs start moving ( Figure 7).

Results
Performance of the two proposed algorithms was evaluated, using sit-to-stand recordings from 10 valid subjects. Full details about these results can be found in . Sensitivity (ability for the algorithm to recognize an effective sit-to-stand movement) and selectivity (ability for the algorithm to reject a "false" sit-to-stand movement, as grasping an object placed in front of the patient) were found identical for the two methods. Delays for recognition (elapsed time between the intended and actual detection time) are comparable, around 40 ms, which is very low regarding to the total duration of the movement (1.5 s).

Conclusion
In this section, we presented two methods for early motion identification, enabling to identify as soon as possible the action (posture or movement) he/she is intending to perform. Although presented through the specific sit-to-stand example, these methods remain applicable in a very large spectrum of actions. Let us recall that it is particularly important to detect the transitions between activity modes as soon as possible after the patient has taken the decision to perform a new action. Normal postural control performance is largely based on the human capacity to anticipate. This anticipation could be relative to external events but also to internal disturbances. Indeed any movement is source of perturbation. To counteract these destabilizing effects, the initiation of a voluntary movement is preceded by dedicated muscular activities so-called Anticipated Postural Adjustments (APA) (Crenna and Frigo, 1991). In our sit-to-stand example, rising off a chair is normally preceded by the inhibition of the soleus muscle (ankle plantar-flexor) and the activation of the antagonist muscle, tibialis (ankle dorsi-flexor) without producing any movement, in preparation to the future change of support base when leaving the seat. Integrating these anticipatory corrections in artificial controllers of FES-systems appears to be a possible way of improving their performances.

Tactic level: movement monitoring
Once a movement has been detected, there is a need to monitor the ongoing action in order to provide with adapted commands (FES stimulation parameters), based on the information given by sensors placed on the patient. Again, the valid part of the body is of crucial importance, since it should be used to somehow "teleoperate" the deficient limbs. Since coordination between limbs is critical during locomotion, we will focus on one example from that domain in the following: gait monitoring in hemiplegic patients using multi-channel FET. Today, in rehabilitation centres, pre-programmed stimulation patterns that are triggered by the therapist of the patient himself are used. One main problem is the fact that patients dramatically modify their gait all along the training session and some adaptability is therefore needed. Although some automatized triggering systems have been proposed, using heel switch detection through external sensors (Meadows et al. 1992) or implanted electrodes for nerve activity measurement (Burridge et al., 2005), the applied stimulation sequences are still pre-programmed. When multi-channel FES is used for walking rehabilitation of hemiplegic individuals the timing of the stimulation needs to be set properly in order to optimize the use of preserved sensory-motor systems and lead to a symmetrical gait pattern. To this end, sensors are often used to get information concerning the ongoing movement. Of course there is a need for processing these input signals to provide with an adapted stimulation command.

CPG concept
This online timing adaptation issue can be seen as a trajectory generation problem, where the command has to be synchronized on sensory inputs. In the case of gait, the considered movement is cyclical. A classical way of generating cyclic motions for articulated systems is to synthesize a rhythm generator, called CPG (Central Pattern Generator) by reference to biological systems (Cohen et al., 1988). The CPG concept refers to a small neural network, probably located at the spinal level, able to generate rhythmic commands for the muscles. It can be divided into two parts: a rhythm generator, and a patterning mechanism. CPGs receive inputs from higher parts of the central nervous system, and also from peripheral afferents; thus, its functioning results from an interaction between central commands and local reflexes (see Figure 8). The CPG can be modelled either with a simulated neural network, for example using the Fitzhugh-Nagumo model (Matsuoka, 1985) or by using explicitly nonlinear differential equations. In both cases, the idea is to encode the desired behaviour in a stable limit cycle. In robotics, a CPG-based command structure has several advantages for the design of cyclic trajectories: the system is robust with respect to small perturbations, thanks to the intrinsic stability of the limit cycle; one can easily modulate the amplitude or the period of the trajectory; a multidimensional output can be generated for the same low computational price, which is helpful when dealing with robots with numerous Degrees Of Freedom (DOFs), having to exhibit multiple synchronized periodic motions, like walking machines. For this kind of classical CPG-based approach, the literature is quite extensive (see for example (Williamson, 1998;Endo et al., 2004) as recent typical studies). However the need for adaptation of the system to environmental changes, external requirements or proprioceptive information through sensory signals is more rarely addressed. We can nevertheless refer the reader to a few recent papers in the field which give a good idea of the state of the art (Fukuoka et al., 2003;Dong et al., 2006;Simoni and DeWeerth, 2007). Actually, there is a lack of design tools in the framework of oscillators and synchronization.
A lot of analysis tools are available (Guckenheimer and Holmes, 1990;Pikovsky et al., 2001), but few design tools, as pointed out by (Bailey, 2004) and (Righetti et al. 2006). It appeared that the question of using continuously a set of sensor measurements as driving inputs to an artificial CPG aimed at controlling several links in a safe way is still an open question. In the following, we will focus on the input integration problem in the CPG framework: "How can we build a rhythm generator (oscillator) such as we can be sure it will synchronize with a given input?"

Oscillator design
Our working hypothesis is that we are dealing with a cyclical activity: this means that each signal (sensors, actuators …) can be described along a cycle. The phase φ can be introduced, as a coordinate along the limit cycle (Pikovsky et al., 2001), i.e a variable which grows uniformly in the direction of the motion and gains 2π during each rotation, thus obeying the equation: is the frequency of the oscillations.
Our aim is to build an oscillator which will synchronize with a given cyclic sensory input. We present in this section a design methodology for such an oscillator. It can be synthesized in two steps: • building a system as a phenomenological model, which simulates the sensor measurements • building an observer of this system, in which are injected the real sensor measurements Fig. 9. A two-steps methodology for oscillator design.
To simulate a cyclical sensor measurement, one could choose a linear system as model, and provide it with a cyclical input u (for example, a sinusoidal input); in that case the linear system is shaping the input so as its output simulates the given measurement. A problem arises then: there is a need for providing with a cyclical input which has to be synchronous with the measurement. This problem has been explored previously (Righetti et al. 2006), but the proposed solutions adapt to the frequency changes too slowly for our targeted applications. For this reason, we chose a non-linear oscillator as a phenomenological model for our sensor measurements: it can autonomously (without input) generate a cyclical signal.

Non-linear oscillator model
The first step is to model the cyclical sensor signal with a nonlinear oscillator. In this section, we will focus on the modelling of one specific signal: thigh inclination during human gait observation.

a) Class of candidate oscillators
To some extent, and under the assumption of rigidity, a bipedal walking system can be modelled as a tree-structured n-link mechanical system free in space. Its dynamics can therefore be described through a Lagrange equation: where q is the set of joint coordinates, ) 3 ( SE q n ƒ ℜ ∈ , M is a sdp. mass matrix, N gathers coriolis and centrifugal forces, B is the friction term, G the gravity vector, Γ the actuation input, and ) (q C T Λ are the constraints of ground contacts, which are unilateral and timevarying. In the absence of constraints, friction and control, this equation becomes autonomous (i.e. with a right-hand side equal to zero), with mechanical energy as first integral, in which the continual exchange between kinetics energy and potential energy produces a periodic motion.
Let us now consider a single coordinate qa, (the thigh inclination). Starting from the autonomous version of eq. (6), we can express its dynamics as: where T is a set of bounded perturbations depending on all the variables and their derivatives, H(.) the equivalent of a mass term, F is analogous to a potential function. Therefore, the behaviour of qa is the one of a periodic solution, issued from a nonlinear second-order equation, with a potential term and disturbances. This incitates to seek the nonlinear oscillator preferably within the class of modified and disturbed second-order mass-spring systems. b) Need for a limit cycle As seen previously, the natural behaviour of a mechanical robotic system without dissipative and other inputs is an oscillator with constant energy. Nevertheless, this does not correspond with the idea of an attractive limit cycle which underlies the oscillator-based approach. To justify this point of view, we have to refer to another class of mechanical systems: the passive walking machines. Indeed, let us consider the case of a planar compass, walking on a slope, with instantaneous and inelastic step transitions, as addressed in (Mcgeer et al. 1990) and several others (Goswami et al., 1998). It then can be shown that, for a given slope, such a system exhibits a limit walking cycle, with a rather large basin of attraction (see Figure 10). This behaviour can be compared to the concept of "natural gait" or "comfort gait" which is spontaneously reached and followed by a human in steady state walking, and which corresponds to a minimum of the metabolic energy consumption with respect to distance. Fig.10. Mechanical model of a passive walking machine, and its stable limit cycle.
In conclusion, it appears that searching for an oscillator of second-order type and exhibiting a limit cycle is a natural way of modelling the periodic walking behaviour of a human link measured with an adequate sensor.

c) Structure choice and parameters setting
From the previous sections, we know that we have to choose a nonlinear oscillator which is derived from a second-order mass-spring system. Another requirement that will be explained in section 4.2.2, is that the oscillator has to belong to the Lur'e class. Two common oscillators fit these requirements: the van der Pol oscillator and the Rayleigh oscillator, which are very similar. Let us start from the van der Pol equation in order to simulate our sensory input. However, depending on the sensor measurement, this equation has to be slightly modified to be able to correctly simulate it. For practical reasons due to our sensors (see section 2), we observe the thigh inclination with regards to vertical. During human gait, this inclination presents a dissymmetrical pattern, with an ascending phase shorter than the descending one. The van der Pol equation provides with symmetrical signals; thus, we have to introduce a new term in the equation: Where -bx is the new introduced term. The idea is to modify the damping coefficient so as it is different when x<0 or x>0. In that way, the output of the modified van der Pol oscillator won't be symmetrical anymore: for a given |x| when x<0, x bx − − μ is higher than when x>0.
Once the structure of the nonlinear oscillator is chosen, we have to find the best parameters , b, and ω0, so that the trajectory of the limit cycle of this oscillator will fit the sensor measurement. We write this identification problem as a least squares one: minimizing the error between the measurements and the output of the oscillator: x are the simulated oscillator outputs, thus following the dynamics of eq. (8). One can notice that this problem is similar to an optimal control problem, which can be solved using a direct method (Betts, 1997). We include the discrete output of the oscillator in the parameters to optimize, and we add constraints on to follow the dynamical model of the oscillator. The discretization of this problem leads to a "nonlinear programming" problem which has been solved using a successive quadratic programming solver: FSQP (Lawrence et al., 1997). This method gave good results: we obtained a very good matching between measurement and oscillator output (Figure 11).

Observer design
The observer theory, has been introduced in the early seventies by Luenberger (Luenberger, 1971) in the linear case; in the non-linear case, some partial results exist (Isidori, 1995). The idea of observation is to estimate the state variables of a system, only given the inputs and the outputs of the system. Let's consider the system Σ: and build a copy of Σ with output injection: In the linear case, if the original system Σ is observable (see (Kailath, 1980) for a complete description of the observability conditions), and if gain K is correctly set, then the observer state will converge towards the original system state. When the output error ) ( y y − is cancelled, the observer state exactly matches Σ's state: the observer is synchronized with the observed system. In the non-linear case, there is no general result concerning the observer existence. However, it is sometimes possible to build a non-linear observer, when the error dynamics is feedback linearizable. To achieve this, the system has to belong to the Lur'e class (Lur'e and Postnikov, 1944), in which the non-linearity is a function of the output only: The observer is then given by: and the error dynamics can be linearized: We applied the observer theory to our specific case, and built an observer of the dynamical system described by the modified van der Pol equation (8), which can be written as: For practical reasons, mathematical details of the computation of the observer are not shown here, but can be found in (Nijmeijer and Mareels, 1997).

Phase estimation through isochrones
By injecting a measurement input in the computed observer, we get an estimation of the two state variables 1 x and 2 x . Since this observer is also a (forced) oscillator, we can compute its phase based on its state variables. This can easily be done using isochrones. We said earlier (in section 4.2) that the limit cycle of an oscillator can be parameterized using a phase variable φ. There is a natural way to define the phase variable not only on the limit cycle but in its neighbourhood as well. To this end, we define the so-called isochrones in the vicinity of the limit cycle. Observing the dynamical oscillatory system stroboscopically, with the time interval being exactly the period of the limit cycle T0, we get a mapping: This construction is illustrated by Figure 13. Let us choose a point X* on the limit cycle and consider all the points in the vicinity that are attracted to X* under the action of Φ. They form a hypersurface I called isochrone, crossing the limit cycle at X*. An isochrone can be drawn at each point of the limit cycle, thus we can parameterize the hypersurface according to the phase as I(Φ). We now extend the definition of the phase to the vicinity of the limit cycle, demanding that the phase is constant on each isochrone. In this way, phase can be defined in the neighbourhood of the limit cycle. Fig. 13. Isochrones in the vicinity of the limit cycle.
Isochrones can be computed, using the free nonlinear oscillator equation (8), in two different ways. The first approach is to transform the oscillator equation in polar coordinates (R,θ), define the phase φ such as it grows uniformly, and compute the lines of constant phase on the (R,θ) plane. However, the resolution of this problem under an analytical form is possible only in a few simple cases. The second idea is to obtain them by simulation: first, let's assess the free oscillator period T0. Then, for each point xi on the phase plane which is in the vicinity of the limit cycle, simulate its trajectory under oscillator dynamics during a time n.T0, with n being an integer large enough such that the distance from the point xi (n.T0) to the limit cycle is small. In that case, the original point xi has the same phase as xi (n.T0), which is known, since it is on the limit cycle.

Summary: command generation
Finally, let's assume that the (cyclical) trajectory we want to generate is parameterized by its phase: we thus have a trajectory pattern T(φ) for φ =[0, 2π]. The online computation scheme for command generation estimation is then the following (see Figure 14): • inject the sensor measurement yk in the adapted observer, to compute its state variables k x • from the observer state variables k x , compute the phase φ of the oscillator through isochrones • provide with the command desired trajectory C = T(φ)

Results
The synchronization of the observer with the given input signal is ensured: thanks to observer theory, it can be assessed that the behaviour of the observer will match the behaviour of the observed system. In (Héliot and Espiau, 2007), we assessed the practical efficiency of the method, considering three important issues. First of all, we checked through a bifurcation analysis that the theoretical behaviour of the modified van der Pol oscillator was still the behaviour of an attractive limit cycle. We also evaluated the robustness of the approach with respect to errors in parameters; the estimation error was found to be linear w.r. to parameters. Finally, we validated the ability of the method to track changes in the input dynamics, thus allowing coping with transient walking stages and rapid rhythm changes; this issue is illustrated in Fig 15. Robustness and accuracy can be improved using multidimensional sensory inputs, rather than a single sensor measurement. One can for example use thigh and shank inclinations, feet pressure as complementary inputs. We ran an online experiment to test this method: by installing the sensor on the leg of a human, we observed the thigh angle and computed online a biped robot command, such that the robot "follows" the human gait, in a synchronous way. This was done by first generating with our oscillator-observer method a desired trajectory for each active DOF of the robot (in our case: ankle, knee and hip sagittal angles on both legs), and then following this trajectory with a PID controller. Such experiments were conducted on a biped robot, BIP (Azevedo and the Bip team, 2000). We thus fully validated the online trajectory generation based on sensor measurement. Thus, this method can be a useful design tool for sensory integration in CPG-type architectures.

Application
Providing bipedal locomotion by means of FES can be formulated as generating control inputs for the stimulator that acting via electrodes will result with adequate muscle contractions leading to functional movements. Muscle activations necessary to execute one reference step can be obtained by direct transposition of electro-myographic recordings or model-based transformation from the desired behaviour. Cloning able-bodied locomotion is not suitable because many neuro-muscular mechanisms are greatly modified due to the injury, and in a FES driven locomotion only one portion of the body is externally controlled. Reference trajectories should be adapted to each individual patient capability and should be adjusted to performance evolution along the training. The patterns we used are obtained with a modelling and simulation tool such as described in (Popovic et al., 1999). Muscles activities are optimized to perform the tracking of a reference walking trajectory with minimal level of activations with a prescribed level of co-contraction according to a model of the patient leg. All the parameters of the model are identified for each individual subject. In this context our method resulted in perfect adaptation of stimulation patterns to walking rhythm changes within a range classically observed during walking. Observing valid leg in hemiplegic patients could lead to adaptation of the timing of the pre-programmed stimulation patterns in order to achieve a symmetric gait.

Conclusion
In this section, we presented a methodology for motion monitoring, enabling to provide with adapted commands corresponding to the ongoing action (in our example, FES stimulation amplitudes). This methodology in two steps (building a phenomenological m o d e l , a n d t h e n a n ob s e r v e r of t h i s mo d e l ; s e e F i gu r e 9 ) , i s of c ou r s e r e -u s a b l e f o r monitoring any other action. In this framework, some important issues should be addressed, as transitions between different gait styles (flat ground, stairs, slope, …).

An unified safe framework to merge strategic and tactic levels
The approach proposed in this chapter uses two levels of coordination. First, a strategic level, dealing with transitions from an action to another, thus expressing an event-driven behaviour. Secondly, a tactic level, which monitors the ongoing action and generates an adequate control, thus expressing a continuous behaviour. The final system has to encompass both aspects, thus falling into the hybrid systems class. Since the classical tools from automatic control theory are not directly applicable to hybrid systems, specific analysis tools have been developed in recent years (Brogliato and Heemels, 2003;Lygeros et al., 2003;Morari et al., 2003). Other works propose a general formulation allowing to describe in a single framework all the systems expressing a continuous behaviour associated with discrete events (Johansson et al., 1999). This formulation is able to address various kinds of applications, from electronics (Brogliato and Heemels, 2003) to biology (De Jong et al., 2004)… However, the complexity of such applications often prevents from performing a formal analysis producing enough knowledge about the possible behaviour of the system, for anticipating its properties. In that case the most useful results come from simulation. In addition, the application considered here, the rehabilitation, belongs to the class of critical systems. Indeed, system safety issues are critical because any dysfunction of the system can lead to dramatic injury. For example, the consequences of an inappropriate electrical stimulation on a paraplegic patient's leg, can possibly lead to bone breaking if he/she has fallen on the ground. Fig. 16. Example of hybrid system. Two states are represented, with their associated transitions. From one state to another, evolution laws are structurally different, thus requiring a hybrid formulation.
As a consequence, there is a need for a system development approach that can handle both hybrid aspects as well as safety ones. It should be emphasized that safety involves many components: hardware (sensors, stimulator, computer, wiring), software (algorithms, programming, real-time implementation), human-machine interface (in order to prevent from wrong utilization). This requires that particular attention should be paid to the monitoring of possible dysfunctions, in order to anticipate the related actions to undertake. From a robotic point of view, this issue has already received much attention, mainly in the area of autonomous robots (Borrelly et al., 1998;Ingrand et al., 2001). Among the proposed approaches, the ORCCAD (Open Robot Control Computer Assisted Design) framework (Borrelly et al., 1998) presents interesting safety features; although it has been initially designed for classical robotics, it looks well suited for rehabilitation applications,

An ORCCAD-based Specification Approach
ORCCAD is a programming environment aimed at building complex robotics applications which are characterized by strong real-time issues and by high safety requirements. It is mainly organized around two key entities: a basic task, called ROBOT-TASK, which gathers elementary components called MODULES, and the ROBOT-PROCEDURE, which allows modular construction of complex applications. Thanks to the use of the synchronous language Esterel, ORCCAD offers tools of formal verification, simulation and visualization. It is also implementation-oriented, which means that it automatically produces real-time code to download. On the basis of ORCCAD concepts, we propose the following specification principles, which include two main hierarchical levels, i.e. from the bottom to the top: An ACTION, kind of elementary task, is defined as the complete specification of: • a control in continuous time, usually sensor-based, which has an invariant structure along the whole duration of the ACTION • a set of events to be received and emitted at the beginning of the ACTION, during its execution, and at its end, and the associated processing. The ACTION is made of communicating COMPONENTS which may have some genericity in their design: controller, observers, trajectory generators… An ACTIVITY is used to logically and hierarchically compose ACTIONS into structures of increasing complexity. It is defined as: • a main program, describing the logical and temporal arrangements of ACTIONs and other ACTIVITIES • a set of triplets (event, processing, assertion) that specifies the processing to apply in order to handle each event and the related information to cast to an APPLICATION level. Thus, the full specification of an application requires the description of both the continuous and discrete aspects, as well as their real-time features. The detailed specification of one of the applications presented earlier is beyond the scope of this chapter. However, as a short illustration of the instantiation of this architecture in the case of the sit-to-stand transition in a paraplegic patient, let us just give a correspondence between the generic entities defined above and their practical meaning The APPLICATION is for example the FES-assisted function: "going from a chair to another". It implies three ACTIVITIES: TO STAND UP; TO WALK; TO SIT DOWN. The "TO STAND UP" ACTIVITY involves itself three ACTIONS to be sequenced (figure 17). All details (used components, events, signals…) can be found in (Héliot et al., 2007).

Discussion
In the framework of FES-assisted rehabilitation and reeducation, we addressed in this chapter the problem of the interaction between artificial and natural systems co-existing within patient's body. Our approach consisted in placing micro-sensors on subject's healthy limbs (trunk, intact leg...) in order to observe voluntary actions at two stages: detecting patient's intention, and monitoring an ongoing action. We also formalized a unified framework to merge these strategic and tactic levels. We illustrated the approach by implementing solutions for two practical examples: detection of sit-to-stand transfer and gait monitoring, and validated the developed algorithms with online experiments performed on valid subjects. Since the targeted application of these results is FES for disabled people, the next step is to adapt the developed techniques to patient characteristics. Detection of postural transitions and action monitoring are based on reference patterns which will have to be elicited by patients; thus, a phase of training will be needed in order to determine for each person the optimal valid limb motion according to lesion type and individual postural capabilities. Another issue to keep in mind is that in hemiplegia and incomplete paraplegia, the paretic extremities are under influences of both artificial and biological controls. The patient can have a partial voluntary action on its deficient limbs with limited sensorial information. Coexistence of natural and artificial control loops is also true within the SIT-TO-STAND STANDING WAITING-DETECTION deficient limb itself. Indeed, even in complete paraplegia, spinal reflex loops often remain in somewhat modified form. Thus, contractures and spasticity can raise problems for FES applications. The applications of the developed approach are not only restricted to FES. Prosthetic limb control could benefit from the presented algorithms. Not only deficiency affecting lower limbs could find interest, but also any type of disability which could be addressed through neuroprostheses and needing for sensory based control with phase monitoring and transition detection skills: respiratory control, suppression of seizures in epilepsy and tremor attenuation… Elderly activity monitoring and falls detection could also be a possible application. The idea of using the real-time measurement of a human motion in the control device of another system can be also exploited in non-rehabilitation applications. Recalling that the considered sensors are embedded autonomous microsystems, they can for example be easily spread on a human for motion capture purposes in virtual reality. In robotics, we can imagine to teleoperate, in some sense, legged robots (or exoskeletons) from several sensor outputs, either in a master-slave mode if the addressed structure is anthropomorphic, or in a joystick-like approach in other cases.

Rehabilitation Robotics
Edited by Sashi S Kommu The coupling of several areas of the medical field with recent advances in robotic systems has seen a paradigm shift in our approach to selected sectors of medical care, especially over the last decade. Rehabilitation medicine is one such area. The development of advanced robotic systems has ushered with it an exponential number of trials and experiments aimed at optimising restoration of quality of life to those who are physically debilitated. Despite these developments, there remains a paucity in the presentation of these advances in the form of a comprehensive tool. This book was written to present the most recent advances in rehabilitation robotics known to date from the perspective of some of the leading experts in the field and presents an interesting array of developments put into 33 comprehensive chapters. The chapters are presented in a way that the reader will get a seamless impression of the current concepts of optimal modes of both experimental and ap-plicable roles of robotic devices.