## 4 Nonlinear Control Design
Thus, from (6) we have  
\[\mathbf{M_{2n}}\ddot{\mathbf{q}}_{2n}+\underbrace{\mathbf{C_{2n}}\dot{\mathbf{ q}}_{2n}+\mathbf{g_{2n}}}_{\mathbf{v^{\prime}}}=\boldsymbol{\tau}=:\mathbf{M_{2n}} \mathbf{\cdot v}+\mathbf{v^{\prime}},\]with \(\mathbf{v}\) the fictitious input, resulting in the following  
\[\mathbf{\ddot{q}_{2n}}=\mathbf{v}. \tag{8}\]  
On the other hand, the outer loop is in charge of calculating the fictitious input \(\mathbf{v}\) as a function of the outputs \(\mathbf{y}\). For, the output dynamics of \(y_{1}\in\mathbb{R}\) become  
\[\dot{y}_{1}=\mathbf{p}(\mathbf{q})\dot{\mathbf{q}},\quad\ddot{y}_{1}=\underbrace {\mathbf{\dot{q}}^{T}\cdot\triangledown\mathbf{p}\cdot\dot{\mathbf{q}}+p_{1} \ddot{q}_{1}}_{f(\cdot)}+p_{2}\ddot{q}_{2}+\mathbf{p_{3n}}^{T}\mathbf{\ddot{q}_ {3n}}\]  
where \(\mathbf{p}(\mathbf{q})=[p_{1},p_{2},...,p_{n}]^{T}\) and whose components read  
\[p_{i}=-\sum_{j=i}^{n}\beta_{j}\sin\left(\sum_{k=1}^{j}q_{k}\right). \tag{9}\]  
Therefore, together with (8) the output dynamics become  
\[\underbrace{\left( \begin{array}{c}\ddot{y}_{1}\\ \mathbf{\dot{y}}_{2}\end{array} \right)}_{\mathbf{\dot{y}}}=\underbrace{\left( \begin{array}{c}f(\cdot)\\ \mathbf{0}\end{array} \right)}_{\mathbf{r}_{n-1}}+\underbrace{\left( \begin{array} []{cc}p_{2}&\mathbf{p_{3n}}^{T}\\ 0&\mathbf{I}_{n-2}\end{array} \right)}_{\mathbf{r}_{n-1}}\mathbf{v}\]  
where \(\mathbf{I}_{n-2}\) is the identity matrix. These dynamics represent an explicit relationship between \(\mathbf{y}\) and \(\mathbf{v}\). By defining \(\mathbf{v}:=\mathbf{P}_{n-1}^{-1}(\mathbf{u}-\mathbf{F}_{n-1})\), \(p_{2}\
eq 0\), the linear output dynamics become  
\[\mathbf{\ddot{y}}=\mathbf{u}. \tag{10}\]  
Finally, we enforce the closed-loop Hurwitz, \(\lambda_{1},\lambda_{2}>0\), with  
\[\mathbf{u}:=\mathbf{\ddot{y}}^{*}+\lambda_{2}\mathbf{\dot{y}}+\lambda_{1} \mathbf{\ddot{y}} \tag{11}\]  
where \(\mathbf{\ddot{y}}:=\mathbf{y}^{*}-\mathbf{y}\). To sum up, the controller designed reads  
\[\mathbf{\tau}=\mathbf{M_{2n}}\mathbf{P}_{n-1}^{-1}(\mathbf{\ddot{y}}^{*}+ \lambda_{2}\mathbf{\dot{y}}+\lambda_{1}\mathbf{\ddot{y}}-\mathbf{F_{n-1}})+ \mathbf{C_{2n}}\mathbf{\dot{q}_{2n}}+\mathbf{g_{2n}}. \tag{12}\]  
The controller (12) cancels out all the nonlinearities of the system and assures that the tracking error of the outputs of the closed-loop system converges to zero exponentially while keeping the whole state bounded. In Figure 7, we depict the block diagram of the control architecture. The stability result is summarized in the proposition below. Figure 7: Controller block diagram. **Proposition 1**: _Consider the input-output nonlinear system (6) and (7) and a desired output trajectory \(\mathbf{y}^{*}(t)\), \(t\geq 0\), such that \(p_{2}(\mathbf{q})\) defined through (9) is away from zero. Then, the smooth static-state feedback (12), with \(\lambda_{1},\lambda_{2}>0\), ensures that the origin of the output error is locally exponentially stable in \(\Omega_{0}\subseteq\Omega\), for any initial condition inside the set_  
\[\Omega:=\{(\mathbf{q}(0),\dot{\mathbf{q}}_{\mathbf{2n}}(0),\ddot{\mathbf{q}}_ {\mathbf{2n}}(0))\in\mathbb{R}^{3n}:\dot{q}_{1}(0)=0,|\tau_{1}|\leq\tau_{c,l}\}.\]  
First, any initial condition in \(\Omega\) implies that the passive link is at equilibrium at \(q_{1}(0)\equiv q_{10}\). Secondly, the condition \(p_{2}\
eq 0\) guarantees the existence of the static-state feedback (12) that forces an equivalent dynamics between \(\mathbf{q}_{\mathbf{2n}}\) and \(\mathbf{y}\), from (8) to (10). Thus, defining \(\mathbf{\tilde{Y}}:=[\mathbf{\tilde{y}}^{\mathbf{T}},\mathbf{\hat{y}}^{ \mathbf{T}}]^{T}\), the closed-loop output linear dynamics become \(\mathbf{\hat{Y}}=\mathbf{A}\mathbf{\tilde{Y}}\) with  
\[\mathbf{A}:=\left( \begin{array}{cc}\mathbf{0}_{n-1}&\mathbf{I}_{n-1}\\ -\lambda_{1}\mathbf{I}_{n-1}&-\lambda_{2}\mathbf{I}_{n-1}\end{array} \right),\]  
which is Hurwitz for any \(\lambda_{1},\lambda_{2}>0\).