**3. The Process, the Model and the Control**

## *3.1. The Process*

The exoskeleton is joined to the patient, moving on the sagittal plane with joint motion of the pairs of ankles, knees and hips of the two legs; it can be represented as a four-link chain: feet, legs, thights and trunk. The trunk, comprising head and arms, is also often called *hat*. The hips are coincident with the pelvis. In a sitting position, as is represented in Figure 1, the reaction forces transferred from the chair are applied for simplicity at the pelvis point, without exchange of torque.

**Figure 1.** A biped sitting on a chair.

In a stationary posture, with relaxed muscles controlling ankles and knees, and the trunk attitude maintained by controlling the hips, *COGx* and *ZMPx* do not coincide as stated by the classical relationship (1), due to the presence of the external disturbance (with respect to the feet) represented by the chair reaction forces. *COGx* position is well behind the soles of the feet, close to the chair support, while the *ZMPx* alone is under the feet. The "sit-to-stand" transition starts by moving the *COGx* from its actual position from the chair toward the feet, tracking a preview signal which will be followed, also, during the second phase of the exercise. A typical behavior of this signal, based on Equation (1), imposing a step without overshoot of the *ZMPx* is given in Figure 2. Note that it depends on only one design parameter, i.e., the value of *COGz*.

**Figure 2.** A preview signal for the *COGx* position and velocity imposing a step forward to the *ZMPx*.

At the same time during phase 1, two torques are applied to the ankles and the knees to bring the reaction force under the pelvis to zero. As these torques influence the reaction forces/torques at the constraints, it is easy to see that this action, without trunk motion, would move the *ZMPx* back away from the feet (Figure 3), with obvious consequences on the balance.

**Figure 3.** The *ZMPx* on the feet releasing the load from the chair, without moving forward the trunk.

The physiological behavior through proprioception, sensing the reaction forces under the feet and the pelvis, coordinates the two actions, so that during phase 1 while the reaction forces under the pelvis are zeroed, moving the trunk forward the *ZMPx* is approximately maintained in the original position under the feet guarateeing balance for the next lift-off. Comparing Figures 2 and 3, (the comparison is only qualitative, as Figure 2 is generic), with transition from phase 1 to phase 2 at time 1.5 s, the behaviour of the inverted pendulum and the role of the preview can be better understood: the motion of the COG must start well in advance of any other action in order to compensate the negative effect on the *ZMPx* caused by releasing the load from the chair, moreover, dynamically postural equilibrium can be reached at the halfway through the transition period, even before the COG reaches the feet.

The choice of the design parameter *COGz* for the preview transition of the COG is not irrelevant; in fact, it can be seen in Figure 4 how the behavior of *COGx*, *COG*˙ *<sup>x</sup>*, *ZMPx* changes if the design parameter is chosen below (red plot-with an overshoot) or above (blue plot-smoother response) the actual value (green plot) of the inverted pendulum. At last, the choice of this design parameter influences the rotational velocity of the trunk at the time of lift-off from the chair when moving to phase 2, with consequences on the kinetic energy spent and on efficiency. We argue that it is the main parameter explaining the Alexander STS technique frequently cited in the STS literature [11].

Phase 1 ends when the reaction forces from the chair become zero. At this point, the biped is in postural dynamical balance and all three joints now contribute to the motion in phase 2 to complete the exercise and reach an erect standing posture.

Obviously, these and the following are simplified observations. In reality, physiologically, through neural plasticity, almost any person who does not know anything about preview control and inverted pendulum, learns how to control the COG and the torques on the joints during the exercise optimizing, contemporaneously, the expenditure of energy.

**Figure 4.** Responses of *COGx*, *COG*˙ *<sup>x</sup>* and *ZMPx* for previews with different parameter *COGz*.

#### *3.2. The Model*

The model of the biped device in a standing up position is given in Figure 5. The kinematical chain has three degrees of freedom (DOF) with configuration variables of angles *θankle*, *θknee*, *θhip*, representing the *joint* space, with control torques *Tankle*, *Tknee*, *Thip*. The three coordinates, target variables representing three elemental postura tasks, in the *Cartesian* space, as the problem is dealing with body balance and posture, *COGx*, the height of the pelvis and the attitude *θtrunk* of the trunk. For simplicity, the height of the pelvis is substituted by the knee angle *θknee*, to which, in balance, it is strictly related. This choice also avoids singularity of the Jacobian when the knees are fully stretched. With reference to Figure 1, reaction forces from the ground to the feet, applied for convention to the vertical projection on the ground of the ankle *Anklex*, and torque are *Fz f eet* , *Fx f eet* (compensated by the

ground friction, is not further represented, as it has no roles) , *Ty f eet* . Forces from the chair to the pelvis (in the sitting position) are *Fzhip* , *Fxhip* .

**Figure 5.** The model of the biped device.

From previous definitions, the displacement of *ZMPx*, with respect to the position *Anklex* of the conventional application of reaction forces is given by

$$\begin{aligned} \Delta ZMP\_{\text{\tiny{X}}} &= -T\_{\text{\tiny{Y}}\_{fat}} / F\_{\text{\tiny{Z}}\_{fat}} \\ \text{i.e.,} \\ ZMP\_{\text{\tiny{X}}} &= Ankle\_{\text{\tiny{X}}} + \Delta ZMP\_{\text{\tiny{X}}} \end{aligned} \tag{2}$$

This indicates that maintaining *ZMPx* under the feet means keeping *Ty f eet* close to zero.

During phase 1, in the presence of the non-holonomic constraint given by the chair–pelvis contact, the degrees of freedom of the kinematic chain are reduced: the only *Position* variable controlling the trunk attitude is the hip angle, while ankle and knee are *Auxiliary*. The latter torques control the constraint reaction forces and torques. Their mathematical expressions are composed of three terms: a nonlinear function of the angular speeds, a term generated by acceleration, and a linear function of the angular accelerations of the *Position* joints and of the control torques of the *Auxiliary* ones. Obviously, all coefficients are function of the angle values:

$$
\begin{bmatrix} T\_{y\_{float}} \\ F\_{x\_{hip}} \\ F\_{z\_{hip}} \end{bmatrix} = NL(\theta\_{hip}, \dot{\theta}\_{hip}) + G(\mathcal{g}) + \\
$$

$$
\begin{bmatrix} M\_{11}M\_{12}M\_{13} \\ M\_{21}M\_{22}M\_{23} \\ M\_{31}M\_{32}M\_{33} \end{bmatrix} \cdot \begin{bmatrix} T\_{ankle} \\ T\_{knee} \\ \ddot{\theta}\_{hip} \end{bmatrix} \tag{3}
$$

In the right hand side of expression (3), only the linear relationships of the control torques are of interest, which coefficients *Mij* are basically Jacobians. Target velocities in the *Cartesian* space are linked to the joint angle velocities by the Jacobian matrix *J*:

$$
\begin{bmatrix}
\text{COG}\_{x} \\
\dot{\theta}\_{knec} \\
\dot{\theta}\_{trunk}
\end{bmatrix} = J \cdot \begin{bmatrix}
\dot{\theta}\_{amklc} \\
\dot{\theta}\_{knec} \\
\dot{\theta}\_{hip}
\end{bmatrix} \tag{4}
$$

with *J* given by

$$J = \begin{bmatrix} J\_{11} & J\_{12} & J\_{13} \\ 0 & 1 & 0 \\ 1 & 1 & 1 \end{bmatrix}. \tag{5}$$

The Jacobians of *COGx*, present in the Jacobian matrix with embedded knee and trunk motion (5) and the coefficients *Mij* in (3) can be generated in real time from the joint angles using expressions, which in our case, were obtained by the symbolic computational environment AutoLev [20] implementing Kane's method [14], when the kinematics is known, or better, for the *COGx*, they can be derived from a SESC model [21] identified by a priori experiments. For details see [17].

#### *3.3. The Control*

Depending on the transition phase, the joint motor drivers are configured to be controlled either in velocity or in torque. The control is obtained by closing the loop using the measures of the center of pressure under the feet and the reaction forces under the pelvis, obtained from appropiate loading cells mounted on the chair and on the floor. Moreover, the position/velocities of the joints angles from the motor drivers, torques on the joints, and inertial datas from the trunk are available.

#### 3.3.1. Velocity Control

When the joints are configured for velocity control, the inverse of the Jacobian matrix (4) of the previous section is used to generate the inputs of the motor drivers in the *joint* space to track the desired reference preview signals of the *COGx*, of the trunk attitude and of the knee angle in the *Cartesian* space. These, during phase 2, are

$$
\dot{\theta}\_{ref}(t) = \mathcal{J}^{-1} \cdot \mathfrak{u}(t) \tag{6}
$$

where

$$
\dot{\theta}\_{ref}(t) = \begin{bmatrix}
\dot{\theta}\_{anklc\_{ref}} \\
\dot{\theta}\_{knc\_{ref}} \\
\theta\_{hip\_{ref}}
\end{bmatrix} \tag{7}
$$

is the vector of speed reference in the *joint* space and

$$u(t) = \begin{bmatrix} u\_{COG}(t) \\ u\_{hat}(t) \\ u\_{knc^\*}(t) \end{bmatrix} \tag{8}$$

is the vector of the return difference signals of the feedback in the *Cartesian* space derived in the Appendix A. During phase 1, as only the hip is controlled in velocity, (6) simplifies to

$$
\dot{\theta}\_{\text{lip}\_{rf}}(t) = J\_{13}^{-1} \cdot \mathfrak{u}\_{\text{CGG}}(t). \tag{9}
$$

#### 3.3.2. Torque Control

For the drivers of ankles and knees configured to torque control during phase 1, Equation (3) are used to bring to zero the chair reaction forces, based on a recursive weighted least square scheme (described in details in Appendix B):

$$\begin{aligned} \mathfrak{u}\_T(t+\Delta) &= \mathfrak{u}\_T(t) + \\ \mathfrak{a}\mathfrak{M}^+ \cdot \left( \mathcal{F}\_{\text{react}\_{ref}}(t) - \mathcal{F}\_{\text{react}}(t) \right) \end{aligned} \tag{10}$$

where Δ is the sampling time, *uT*(*t*) is the vector of reference inputs to the torque control drivers of the motors

$$\mathbf{u}\tau(t) = \begin{bmatrix} T\_{\text{amkle}\_{\text{ref}}}(t) \\ T\_{\text{kne}\_{\text{ref}}}(t) \end{bmatrix} \tag{11}$$

*α* is a coefficient to guarantee convergence, *M*<sup>+</sup> is the solution of the least square problem (A5), and *<sup>F</sup>reactref*(*t*) and *<sup>F</sup>react*(*t*) are the vectors of reference to track and measured reaction force/torques :

$$\begin{aligned} \,^cF\_{\text{react}\_{ref}}(t) = \begin{bmatrix} T\_{y\_{f\text{out}\_{ref}}} \\ F\_{\text{xhip}\_{ref}} \\ F\_{\text{zhip}\_{ref}} \end{bmatrix}, \,^cF\_{\text{react}}(t) = \begin{bmatrix} T\_{y\_{f\text{out}}} \\ F\_{\text{x}\_{hip}} \\ F\_{\text{zhip}} \end{bmatrix} \end{aligned} \tag{12}$$

*Fxhipref* , *Fzhipref* are chosen to send the reaction forces on the chair from their starting value to zero, and *Tyf ootref* is kept equal to 0. The measure of *Ty f oot* is not avilable, however it can be inferred by the distance of *ZMPx* from *Anklex*.

The choice of the weighted least square allows to blend torque transition with the need to control the *ZMPx*. In fact, with *Ty f ootref* close to zero *ZMPx* becomes fairly insensitive to the choice of the other references signals.

#### 3.3.3. Lift off Transition

The control switches from phase 1 to phase 2 when the module of the reaction forces reaches a neighbourhood of zero. At that moment, a smooth transition must be imposed on the control of knees and ankles to avoid torque spikes. The simplest approach, adopted here, is to maintain (for a fraction of time at the joints) the value of torques that is reached at the end of phase 1 while the velocity control of phase 2 goes into action with a loop gain increasing from zero to the design value.

#### **4. A Haptic Exoskeleton**

The control described in the previous sections refers to an autonomous behavior, and it can be used to program the exercise into a biped robot, or applied in an exoskeleton in the first phase of the reabilitation when a patient is completely unable to operate.

In the case of a haptic exoskeleton partially or totally controlled by the patient, two different aspects have to be considered: the joints controlled in torque and the jonts controlled in velocity. For both aspects, EMG signals that are measured on the appropriate muscles offer approximate information of the torques applied by the patient to his joints. For the torque control, the contribution to the patient's effort is achieved with a classical technique as described in [22].

For the motion, admittance control is adopted as described in [6]. The EMG signals, processed by an admittance filter, are translated into motion information that is used as reference velocity of the corresponding joint speed drivers of the exoskeleton.

Torque control applies to phase 1 of the exercise, the contribution of the exoskeleton is to help the patient to coordinate the two actions; *motion* with the rotation of the trunk and contemporaneously *torque* for the release of the load from the chair. This can be achieved by plotting on a display in front of the patient the position of the center of pressure in relation to the feet, with total or partial automatic support of the exoskeleton. Two options are available: automatic motion tracking a preview (different previews can be tested), and torques supported by the patient, or vice versa.

After transition to phase 2, only motion is involved, with three postural tasks, described in (4), to execute, and three joints to control. Let indicate the motion references driven by the patient's efforts, as output of the admittance filters, for ankle, knee and hip as

$$\boldsymbol{\dot{\theta}}\_{p}(t) = \begin{bmatrix} \boldsymbol{\theta}\_{mklc\_{p}}(t) \\ \dot{\boldsymbol{\theta}}\_{knc\_{p}}(t) \\ \boldsymbol{\theta}\_{hip\_{p}}(t) \end{bmatrix}. \tag{13}$$

In a training program, it is desirable that the patient progressively takes control, in number and strength, of the joints of the exoskeleton, and in so doing assumes responsibility of one or more of the postural tasks, without affecting the remaining tasks performed autonomously by the feedback. For this, the concept of *tutoring-cooperation-coordination* is introduced, where some of the elemental postural tasks, under the control of the patient, and the complementary tasks, under the automatic postural loop, can be completely decupled. This is a variant of whole body coordination (WBC) discussed in [16] and introduced in [23]. *Tutoring* means that all tasks are performed fully automatically, without intervention of the patient that is completely tutored, it is equivalent to the WBC. *Coordination* is when the patient takes complete control, through some joints, of one or more elemental postural tasks of the exercise, without interfering with the complementary tasks controlled by the automatic postural loop and, hence, he must perform coordinate motions. In between of the two extreme situations with *cooperation*, the two players can operate jointly on some tasks and their actions are overlapped. Through a modulation parameter *β* the patient takes partial control and must cooperate with the automatic tasks, as depicted in Figure 6. The approach is based on two aspects: the separation of the elemental postural tasks operated by the two players, and for the tasks operated jointly, on the modulation of the two actions.

**Figure 6.** Mixing cartesian postural and patient joint controls.

Let *Ru* represents the 3 × 3 selection matrix, with ones and zeros on the diagonal covering the range of the elemental tasks performed exclusively by the autonomous feedback and *Nu* its nullspace with tasks controlled partially or totally by the patient through the joints in the range of *Rp*. As an example, when autonomous processes control *COGx* and trunk attitude and the patient controls the height of the pelvis through the knee, the matrices *Ru* and *Rp* are:

$$R\_u = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}, R\_p = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{bmatrix},\tag{14}$$

or, the patient, through knees and hips, controls height and attitude of the trunk, with the balance, through *COGx*, guarateed automatically, the matrices *Ru* and *Rp* are:

$$R\_u = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}, R\_p = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}. \tag{15}$$

The postural tasks in the range of *Ru* are completely controlled by the postural feedback, while the complementary tasks in its null-space *Nu* are jointly controlled by the feedback and by the patient, through the joints in the range of *Rp*, according to the value of a coefficient 0 *β* 1. *β* indicates the level of the patient's involvement in the control: *tutoring* is when *β* = 0, *coordination* is when *β* = 1, *cooperation* is when *β* > 0 *and β* < 1. As the coefficient *β* modifies the admittance filter gain, it has, also, influence on the compliance felt by the patient on the joints in the range of *Rp* (in fact, the joints in its null-space, not being controlled by the patient, don't offer any compliance): *β* = 0 completely stiff joints, *β* = 1 fully compliant.

The general expression for the references of the speed control of the actuators, merging automatic postural control and patient action through EMG signals, according to *tutoring-cooperationcoordination* is:

$$\begin{aligned} \dot{\theta}\_{ref}(t) &= J^{-1} \cdot \mathfrak{u}\_{\mathcal{P}}(t) + \mathcal{R}\_{\mathcal{P}} \cdot \dot{\theta}\_{\mathcal{P}}(t) \cdot \beta \\ \mathfrak{u}\_{\mathcal{P}} &= \left( \mathcal{R}\_{\mathcal{U}} + \mathcal{N}\_{\mathcal{U}} \cdot (1 - \beta) \right) \cdot \mathfrak{u} - F \cdot \mathcal{R}\_{\mathcal{P}} \cdot \dot{\mathcal{O}}\_{\mathcal{P}} \cdot \beta \end{aligned} \tag{16}$$

where *<sup>F</sup>* <sup>=</sup> *Ru* · *<sup>J</sup>*, and with the condition

$$\text{range}(\mathbb{N}\_{\mathfrak{u}}) \subset \text{range}(\mathfrak{f} \cdot \mathbb{R}\_{\mathfrak{p}}).\tag{17}$$

The proof of Equation (16) is presented in Appendix C.

During phase 1, while the torque control operates on ankle and knee, the *COG* tracking (9) is modified as follows

$$\dot{\theta}\_{\text{hip}\_{\text{ref}}}(t) = f\_{13}{}^{-1} \cdot u\_{\text{COG}}(t) \cdot (1 - \beta) + \dot{\theta}\_{\text{hip}\_{p}}(t) \cdot \beta. \tag{18}$$

Moving *β* from 0 to 1, the physiotherapist increases the admittance of the joints, so that the patient gains more and more control of them. Changing *Ru* to the zero matrix, and *Rp* to the identity, with *β* = 1, the patient assumes complete control of the exoskeleton. In this condition, the autonomous control can continue to monitor the postural balance, and eventually, it inhibits incorrect patient postures, by automatically returning *β* to 0.

## **5. A Simulation Example and Comparisons**

In this section the simulation of the automatic control is offered. The test of the complete exercise on the exoskeleton of Figure 7 has not been performed yet. However, in [6] several examples (phase 2 only) of the transition with the cooperation of the patient using this control have been reported.

The simulation uses the same data of a patient of 75 kg, 1.8 m tall wearing an exoskeleton of 35 kg presented in [6]. The model considers only one leg and the weight of the trunk (hat) is divided by 2. So that the magnitudes of forces (N) and torques (Nm) are referred to each leg. The exercise lasts 3 s. Approximately at 1.5 s the transition from phase 1 to phase 2 occurs, with the lift off. The *COM* preview for a step transiton of the *ZMP* of Figure 2 has been chosen, testing different values of the parameter *COGz*. Different experiments, with different degrees of difficulty, obtained with the feet in different positions with respect to the initial value of *COGx*, i.e., to the chair, have been performed. Each position is characterized by the angle of the ankles from 10◦ to 45◦ when sitting, (i.e., feet far away from the chair and exercise more difficult, in the first case, or feet under the chair and easier exercise, in the second case). The lift-off time and transition from phase 1 to phase 2 is triggered when the module of the reaction forces on the pelvis enter into a neighbour of few Newtons of the zero. During phase 2, simple transition functions drive knees and trunk attitude angle positions and velocities from their initial values, left from phase 1, to zero in 1.5 s. The next figures represent the most difficult experiment (experiment 1) that can be performed using this control with ankle angle of 10◦. With a lower angle, e.g., 5◦, the *CoP* cannot be guaranteed to remain inside the foot print. The behavior of reaction forces and torques are shown in Figure 8.

**Figure 7.** The prototype exoskeleton for the sit-to-stand exercise.

**Figure 8.** The behavior of reaction force on the hip and torque on the foot: experiment 1.

The behavior of *COGx* and *ZMPx* during the transition is given in Figure 9. The position of *Anklex* is 0.

**Figure 9.** The behavior of *COGx* and *ZMPx* during the transition: experiment 1.

The torques at the joints are in Figure 10.

**Figure 10.** The torques at the joints: experiment 1.

Figure 11 shows the animation of the exercise.

**Figure 11.** The animation of the exercise: experiment 1.

Figure 12 shows how the hat and knee angles track the references.

It is interesting to see the estimates *COG*ˆ *<sup>x</sup>*, *ZMP*ˆ *<sup>x</sup>* theoretical assuming no disturbances and *ZMP*ˆ *<sup>x</sup>* actual (i.e., the *CoP*), along with the estimate of the disturbances, i.e., the reaction forces on the chair, obtained by the extended estimator [17]. These are given in Figure 13.

The performance of the exercise, expressed as the ratio between the change in potential energy and the total work consumed to complete the motion, as defined in [11] is 60%, and the maximum angle reached by the trunk is 79◦. As oppose, the remaining figures, from Figures 14–18, show a relatively easy exercise (experiment 2) with an ankle angle of 45◦. The performance here is 95% with a maximum trunk angle value of 11◦. To show the robustness of the control this exercise was performed with the identical control parameters of the previous experiment.

**Figure 12.** The tracking of hat and knee angles: experiment 1.

**Figure 13.** Estimates of COG and ZMP resulting from the extended estimator accounting for the pelvis-chair disturbances: experiment 1.

**Figure 14.** The behavior of reaction force on the hip and torque on the foot: experiment 2.

The behavior of *COGx* and *ZMPx* during the transition is given in Figure 15.

**Figure 15.** The behavior of *COGx* and *ZMPx* during the transition: experiment 2.

The torques at the joints are in Figure 16.

**Figure 16.** The Torques at the joints: experiment 2.

Figure 17 shows the animation of the exercise, while Figure 18 shows how the hat and knee angles track the references.

**Figure 17.** The animation of the exercise: experiment 2.

**Figure 18.** The tracking of hat and knee angles: experiment 2.

#### **6. Conclusions**

The paper approaches the sit-to-stand exercise under two aspects: analysis of the dynamics of the exercise/design of the feedback control of an autonomous biped device, and its application to an haptic exoskeleton with the cooperation of a patient.

In regard to the autonomous execution of the exercise, several authors have argued that two components are involved in solving the control problem in the humanoid STS motion: (1) phase and trajectory planning, and (2) feedback control.

With respect to the former, the most significant are the COM preview to follow in the transition, and the time coordination between motion of the hips and torques on ankles and knees in phase 1. From the experiments, the chair reaction forces, the knee angle and trunk attitude to reach an erect posture are not critical. The COM preview can be synthesized by exploiting the linearized inverted pendulum model, with basis the step transition of the *ZMP*, and selecting the appropiate parameter *COGz*. The value of this parameter is not necessarily identical to the real height of the COG of the biped, but it is chosen according to the difficulty of the exercise. This difficulty here is represented by the distance of *COGx*, i.e., the chair, from the feet when sitting. The design parameter *COGz* can explain the Alexander STS technique. If its value is lower or equal than the height of the *COG*, the transition is steep, the lift off is early, the biped will be in dynamical balance, with the *COGx* still far from the feet, and with a relatively high trunk angular velocity to be conveyed in the successive lift motion, on the contrary if the transistion is slower, the balance will be almost statical with the *COGx* already under the feet, and the trunk attitude almost stationary. Based on these elements, the final trajectories can easily be planned to reduce maximum torque on the joints and energy expenditure. In the simulated experiments, two examples are considered: one is difficult with a performance, expressed as the ratio between the change in potential energy and the total work consumed to complete the motion of 60%, with the trunk reaching a maximum angle of 79◦; the other is relatively easy with a performance of 95% and a maximum trunk angle of 11◦.

With respect to the latter, exploiting the inverse or pseudo-inverse of Jacobian matrices and a linearized inverted pendulum model of a simple linear feedback, based on feet and chair pressure sensors, and position/velocity measures of the joint angles, can be obtained either for joint velocity or torque controls. This feedback requires a limited number of model parameters and design gains without the need to perform cumbersome inverse kinematics or dynamics. Symbolic environments such as Autolev can offer efficient expressions for the necessary Jacobians that can be computed in real time.

When the postural control is applied to an exoskeleton interacting with a patient, the paper proposes an innovative approach to blend the patient's actions with the automatic execution of the exercise. Several options are offered by the approach for proposing protocols of physiotherapy tracking the evolution of the process of rehabilitation, in terms of strenght of the support offered by the exoskeleton, and specific joints and postural tasks to be controlled by the patient. The process of rehabilitation can start with a complete *tutoring* of the patient, evolving to a *cooperation* between automatic control and patient on the same postural tasks and jonts, e.g., reaching an erect posture moving the knees, or a *coordination* between the two players operating on different tasks, e.g., the patient raises the pelvis and rotates the trunk through knees and hips while an automatic balance is guaranteed with a feedback on the ankles.

An exoskeleton for this specific exercise has been built, and some preliminary tests of phase 2 have been documented in a previous paper. However, more work is needed in future research: testing a complete exercise using the exoskeleton, not only during phase 2; decoupling the interaction not only from joints to elemental postural tasks, but also vice versa; generalizing the admittance filters from single joints and related muscles to multivariable filters processing the vector of the available EMG signals to collectively control all joints. This will be obtained exploiting muscle synergies, and training artificial neural networks that directly link EMG patterns to motion.

**Author Contributions:** Methodology, G.M. and M.G.; writing—original draft, G.M.; writing—review & editing, M.G.

**Funding:** This research has been partially supported by MIUR the Italian Ministry of Instruction, University and Research and the Piedmont Region.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A. Derivation of the Velocity Controls of Section 3.3.1**

The COG tracking requires a preliminary disussion of the *COG* − *ZMP* estimator. Evaluations of *COGx* and *COG*˙ *<sup>x</sup>* are obtained from the joint angle measures through a SESC model [21], while *ZMPx* is given by measuring the center of pressure under the feet (*CoP*). These outputs, using the state estimator based on an extended inverted pendulum described in the parent paper [17], generate in real time the estimates needed to close the loop: *COG*<sup>ˆ</sup> *<sup>x</sup>*, *<sup>C</sup>* <sup>ˆ</sup> *OG*˙ *<sup>x</sup>*, *ZMP*ˆ *<sup>x</sup>* (the theoretical value in the assumption of no disturbances) and ˆ *δ*, the difference between *ZMPx* and *CoP*, needed to take into account the chair-pelvis contact. Then, the feedback return difference signals, at each sampling time, is:

$$u(t) = \begin{bmatrix} u\_{COG}(t) \\ u\_{htt}(t) \\ u\_{kmc}(t) \end{bmatrix} \tag{A1}$$

where *uCOG*(*t*) refers to to the *COG* tracking

$$\begin{aligned} u\_{\text{COG}}(t) &= \mathbf{C}\dot{\mathbf{O}}\mathbf{G}\_{\text{x}\_{\text{ref}}}(t) + \\ k p\_1 \cdot (\mathbf{C}\mathbf{O}\mathbf{G}\_{\text{x}\_{\text{ref}}}(t) - \mathbf{C}\dot{\mathbf{O}}\mathbf{G}\_x(t) - \hat{\boldsymbol{\delta}}) \\ &+ k v\_1 \cdot (\mathbf{C}\dot{\mathbf{O}}\mathbf{G}\_{\text{x}\_{\text{ref}}}(t) - \mathbf{C}\dot{\mathbf{O}}\mathbf{G}\_x(t)) \\ k - k z \cdot (\mathbf{Z}\mathbf{M}\mathbf{P}\_{\text{x}\_{\text{ref}}}(t) - \mathbf{Z}\hat{\mathbf{M}}\mathbf{P}\_x(y) - \boldsymbol{\delta}) \end{aligned} \tag{A2}$$

*uhat*(*t*) refers to to the trunk attitude tracking

$$\begin{split} u\_{\text{flat}}(t) &= \theta\_{\text{flat}\_{ref}}(t) + kp\_2 \cdot (\theta\_{\text{flat}\_{nf}}(t) - \theta\_{\text{flat}}(t)) \\ &+ k\upsilon\_2 \cdot (\dot{\theta}\_{\text{flat}\_{nf}}(t) - \dot{\theta}\_{\text{flat}}(t)) \end{split} \tag{A3}$$

and *uknee*(*t*) refers to the knee angle tracking

$$\begin{split} u\_{\text{knre}}(t) &= \dot{\theta}\_{\text{knre}\_{rf}}(t) + kp\_3 \cdot (\theta\_{\text{knre}\_{rf}}(t) - \hat{\theta}\_{\text{knre}}(t)) \\ &+ kv\_3 \cdot (\theta\_{\text{knre}\_{rf}}(t) - \hat{\theta}\_{\text{knre}}(t)) \end{split} \tag{A4}$$

Equation (A2) was originally suggested by Choi in [16] and extended in [17], while (A3) and (A4) are basically a proportional-derivative feedback with a feedforward contribution.

During both phase 1 and 2 a preview *COGxref* of the type of those in Figure 4 has been chosen, specifically the one of Figure A1, to transfer *COGx* from the starting position during sitting to *Anklex*.

**Figure A1.** The COG preview signal for the sit-to-stand transition adopted in the examples.

For phase 2 *θhatref* , *θkneeref* are the references to bring the patient to a standing posture. *θkneeref* has no special characteristics, it simply imposes a transition to the knee angle during the desired period from sitting to standing, vice versa, *θhatref* is chosen to take trunk attitude position and velocity from lift-off values at the end of phase 1 to zero (Figure 12).

*kpi* , *kvi* , *i* = 1 − 3, *kz* are the feedback gains.

#### **Appendix B. Derivation of Torque Controls of Section 3.3.2**

For torque control during phase 1, Equations (3) are used to solve the following weighted least square scheme:

$$
\Lambda \cdot \begin{bmatrix} T\_{y\_{fot}} - T\_{y\_{fot}} \\ F\_{x\_{hip\_{ref}}} - F\_{x\_{hip}} \\ F\_{z\_{hip\_{ref}}} - F\_{z\_{hip}} \end{bmatrix} \approx \Lambda \cdot \mathcal{M} \cdot \begin{bmatrix} T\_{ankle} \\ T\_{knee} \end{bmatrix} \tag{A5}
$$

and

$$\mathcal{M} = \begin{bmatrix} \mathcal{M}\_{11}\mathcal{M}\_{12} \\ \mathcal{M}\_{21}\mathcal{M}\_{22} \\ \mathcal{M}\_{31}\mathcal{M}\_{32} \end{bmatrix} \tag{A6}$$

where Λ is a diagonal matrix of weighting factors, with solution

$$
\begin{bmatrix} T\_{anklc}^{\*} \\ T\_{knec}^{\*} \end{bmatrix} = \mathbf{M}^{+} \cdot \begin{bmatrix} T\_{y\_{foot\_{ref}}} - T\_{y\_{fost}} \\ F\_{x\_{hip\_{ref}}} - F\_{x\_{hip}} \\ F\_{z\_{hip\_{ref}}} - F\_{z\_{hip}} \end{bmatrix} \tag{A7}
$$

$$\mathbf{M}^{+} = (\mathbf{M}^{T}\Lambda^{2}\mathbf{M})^{-1}\Lambda^{2}\mathbf{M}^{T},\tag{A8}$$

#### **Appendix C. Proof of Equation (16)**

Consider the building block diagram Figure A2. It implements Equation (16), and shows the generation of the *θ***˙** *ref* with both autonomous control and patient's contribution. With block diagram manipulations advance the patient's contribution *θ***˙** *<sup>p</sup>* before *J*−<sup>1</sup> from *joint* to *Cartesian* space.

The speed signals in the Cartesian space result as

$$\left(\left(\mathbb{R}\_{\boldsymbol{u}} + \mathrm{N}\_{\boldsymbol{u}} \cdot (1 - \beta)\right) \cdot \boldsymbol{u} + (\boldsymbol{I} - \mathrm{R}\_{\boldsymbol{u}}) \cdot \boldsymbol{\mathcal{J}} \cdot \boldsymbol{\mathcal{R}}\_{p} \cdot \boldsymbol{\theta}\_{p} \cdot \boldsymbol{\beta}\right) \tag{A9}$$

It should be noted that *<sup>I</sup>* <sup>−</sup> *Ru* <sup>=</sup> *Nu*, then

$$\left(\left(R\_{\rm u} + N\_{\rm u} \cdot (1 - \beta)\right) \cdot \mathbf{u} + N\_{\rm u} \cdot \mathbf{J} \cdot R\_{\rm p} \cdot \dot{\boldsymbol{\theta}}\_{\rm p} \cdot \beta\right) \tag{A10}$$

Condition (17) assures that the action of the patient on the joints in the range of *Rp* encompasses all postural tasks not covered by the automatic control.

Equation (A10) can be interpreted as follows:


**Figure A2.** Integrating autonomuos control and patient action in controlling the joints of the exoskeleton.
