# Quadrupedal Robots' Gaits Identification via Contact Forces Optimization
## 2 Mathematical Model for the Gait Optimization
Several experiments available in the technical literature [25,26] suggest the following gait dynamics for leg locomotion. When the leg touches the ground, in the first phase, a backward longitudinal reaction brakes the body run, followed by a second phase, in which the leg accelerates the body through a forward longitudinal reaction force (Figure 3d). Moreover, the amplitude of the longitudinal reaction force is roughly proportional to the normal vertical force. A similar force trend holds for the lateral force that is responsible for the unavoidable lateral staggering of the quadruped's body. For both longitudinal and lateral forces, one can introduce the suitable factorization form as constitutive relationships:  
\[ \begin{array}{l}F_{x_{i}}(t)=\mu_{x_{i}}(t)F_{z_{i}}(t)\\ F_{y_{i}}(t)=\mu_{y_{i}}(t)F_{z_{i}}(t)\end{array}  \tag{4}\]  
that use the proportionality of the planar forces to the vertical one. Moreover, the role of the factors \(\mu_{x_{i}}(t),\;\mu_{y_{i}}(t)\) is that of reproducing the time history of the planar force, \(F_{x_{i}}(t)\) or \(F_{y_{i}}(t)\), as reported in Figure 3c,d, modulating the amplitude of the vertical reaction \(F_{z_{i}}(t)\). In particular, \(\mu_{x_{i}}(t),\;\mu_{y_{i}}(t)\) are vanishing outside of the CP. Within the CP, in the first part of the contact, \(\mu_{x_{i}}(t)\) takes negative values to reproduce the braking effect, while, in the second part, it becomes positive, to reproduce the acceleration effect. Figure 2: Time diagram of the quadruped’s locomotion over the entire period \(T\) shows the times \(t_{i}\) at which each leg touches the ground and the time duration \(T_{i}\) of each contact phase. The subscripts \(i=FR,FL,HR,HL\) are \(FL\) (front left), \(FR\) (front right), \(HL\) (hind left), and \(HR\) (hind right). Combining Equations (4) and (3), the two modulating factors must satisfy the condition:  
\[\sqrt{\mu_{x_{i}}^{2}+\mu_{y_{i}}^{2}}\leq\mu_{s} \tag{5}\]  
Looking at Figure 3b, this implies that at any time the point \(Q_{ij_{i}}\left[\mu_{x_{i_{i}}}(t),\ \mu_{y_{i_{i}}}(t)\right]\) remains confined in the circle of radius \(\mu_{s}\) over the plane \(\mu_{x_{i}}(t),\ \mu_{y_{i}}(t)\). Moreover, we assume a correlation between the modulating factors during the gait. This implies, concerning Figure 3b, the point \(Q_{ij_{i}}\left[\mu_{x_{i_{j}}}(t),\ \mu_{y_{i_{j}}}(t)\right]\) describes a closed curve in the plane \(\mu_{x_{i_{j}}}(t),\ \mu_{y_{i_{j}}}(t)\) as time is spent, and \(Q\) completes the loop in a period T. More precisely, the time histories of \(\mu_{x_{i}}(t),\ \mu_{y_{i}}(t)\) are determined by a spline passing through the points \(\left[Q_{1};Q_{2};Q_{3_{i}}\right]\) selected by the designer within the contact cone (see Figure 3b). The expressions for the moments \(M_{x}\) and \(M_{y}\) follow directly from the leg's reactions. From Figure 4, let's consider, for example, the \(FR\) foot at the incipient contact phase and foot position \((x_{FR},y_{FR},z_{FR})\):  
\[ \begin{array}{l}M_{y}=F_{x}\Delta z_{FR}-F_{z}\Delta x_{FR}\\ M_{x}=F_{y}\Delta z_{FR}+F_{z}\Delta y_{FR}\end{array}  \tag{6}\]  
where \(\Delta x_{FR}(t)=x_{FR}-x,\ \Delta z_{FR}(t)=z_{FR}-z\) and \(\Delta y_{FR}=y_{FR}-y\). Figure 3: (**a**) Vertical ground force; (**b**) trend of the coefficient of adhesion inside the static friction cone; (**c**) longitudinal adhesion coefficient as a function of time; and (**d**) longitudinal ground force.