## 3 Human Derived Self-Balancing Control
### Human-Inspired Control System in Robotic Platform
The control system uses two versions of each orientation in space signal, one affected by the threshold (up-channeled from the foot) and the other one not affected by it (down-channeled from the head). The up-channeled signal is used in the servo loop, the down-channeled one is used for gravity compensation. The foot is assumed to be always in firm contact with the support surface (as shown in Figure 3B, \(\dot{\alpha}_{\text{fs}}=\dot{\alpha}_{\text{ss}}\)). The estimated foot in space tilt is  
\[\alpha_{fs}=\int_{0}^{t}\rho(\dot{\alpha}_{fs})-k\alpha_{fs}\,d\tau, \tag{2}\]  
where \(\rho()\) is the threshold function and \(t\) the current time. The term \(-\text{k}\alpha_{\text{fs}}\) is added to make the integrator leaky (\(k\) was set to 1/80). Given the threshold \(\theta>0\), the function \(\rho(\alpha)\) is defined as  
\[\rho(\alpha)= \begin{cases}\alpha+\theta&\alpha\leq-\theta\\ 0,&-\theta<\alpha<\theta\\ \alpha-\theta&\alpha\geq\theta\end{cases}  \tag{3}\]  
The value of \(\theta\) is a parameter of the ankle control module, in this setup it is set to 0.009 rad/s. The threshold function was introduced to mimic the nonlinear response exhibited by human subjects where larger support surface tilts are more compensated than smaller ones [7]. It can be shown that such nonlinearity does not harm the equilibrium, in that the stability of the system depends on the control parameters that are independent of the value \(\theta\)[33]. The estimate of support surface tilt from (2) is up-channeled through the modules to reconstruct the orientation in space of each segment. _Gravity._ The gravity torque \(T_{g}\) for the ankle joint is calculated by  
\[T_{g}=m\ g\ h\cdot\sin(\alpha_{bs})\cong m\ g\ h\ \alpha_{bs} \tag{4}\]  
where \(m\) is the mass of the body, \(h\) the height of the CoM, \(\alpha_{bs}\) its angle in space and g the gravity constant. In a similar way, the gravity disturbance acting on each joint is computed on the basis of the sway of the CoM of all the segments above the controlled joint. _Contact force disturbance._ The external contact force represents the interaction with the external world, i.e., with the impact that is not produced by gravity and the movement of the support surface. The contact force disturbance estimator also identifies the unmodelled effects such as the inertial force produced by an unknown additional mass. Considering that robots and exoskeletons do not usually have a full body sensor input for contact forces, the identification of unexpected contacts with the environment should be performed on the basis of the available sensors exploiting the knowledge of the dynamics. This, for example, can be performed using a Luenberger observer with an extended state vector featuring the external force as an additional state variable [36] or, in order to cover more general nonlinear cases, a particle filter [37]. In the case of the DEC, the contact force is represented as an extra torque applied on a joint. Such a torque is computed as the difference between the applied torque (which includes the compensation of the external disturbances) and the torque computed on the basis of the kinematics. For example, the total applied torque in the ankle joint is  
\[T_{A}=J\frac{d^{2}}{dt^{2}}\alpha_{\text{bs}} \tag{5}\]  
where \(J\) is the moment of inertia. The external torque becomes:  
\[T_{ext}=T_{A}-\left(T_{g}+T_{c}\right), \tag{6}\]where \(T_{g}\) is the gravity torque described in the previous paragraph and \(T_{c}\) is the control torque produced by the module. The same concept applies to all the joints, considering mass and moment of inertia of the set of links above the controlled joint, as explained in detail in [17]. _Control equations._ The disturbance compensation is implemented by summing the disturbance estimates with the input of the controller (PD in Figure 3A). For the support surface tilt, this can be seen as a coordinate transformation of the controlled variable from joint coordinates to space coordinates.