# Inducing Optimality in Prescribed Performance Control for Uncertain Euler-Lagrange Systems
## 5 Simulation Results
### Case B: 2-DOF Robotic Manipulator  
In this section, we present simulation results that demonstrate the effectiveness of our methodology in deriving a near-optimal control law, while taking into consideration prescribed performance specifications, for a two-degree-of-freedom robotic manipulator, as illustrated in Figure 6. The robotic manipulator obeys the following dynamic model  
\[M(q)\dot{q}+C(q,\dot{q})\dot{q}+G(q)=\tau, \tag{26}\]  
where \(q=[q_{1}\ \ q_{2}]^{T}\) and \(\dot{q}=[\dot{q}_{1}\ \ \dot{q}_{2}]^{T}\) denote the joint angular positions and velocities, respectively, \(M(q)\) is a positive definite inertia matrix, \(C(q,\dot{q})\) is the matrix that describes the Coriolis centrifugal phenomena, \(G(q)\) is the vector describing the influence of gravity, and \(\tau\) is the torque that acts as the system's input. Figure 4: The state response of the calculated optimal scheme (**top**). Control effort \(\tau-G(q_{d})\) requested by the optimal policy (**bottom left**). Comparison of the tracking error’s evolution for the initial condition \(x_{0}^{1}\) between our method (\(\sigma_{1}\)) and successive approximation (\(\sigma_{2}\)) (**bottom right**). Figure 5: Evolution of the transformed error \(\epsilon\) by utilizing \(w_{L}\) obtained from the constrained (**left**) and the unconstrained (**right**) least-squares problem. The dashed lines represent the values of \(\epsilon\) on the boundary of \(\Omega_{2}\). More specifically, the inertia matrix is formulated as:  
\[M= \begin{bmatrix}M_{11}&M_{12}\\ M_{21}&M_{22}\end{bmatrix} \]  
where  
\[M_{11}=I_{Z_{1}}+I_{Z_{2}}+m_{1}\frac{l_{1}^{2}}{4}+m_{2}({l_{1}}^{2}+\frac{l_{2 }^{2}}{4}+l_{1}l_{2}c_{2})\]  
\[M_{12}=M_{21}=I_{Z_{2}}+m_{2}(\frac{l_{2}^{2}}{4}+\frac{1}{2}l_{1}l_{2}c_{2})\]  
\[M_{22}=I_{Z_{2}}+m_{2}\frac{l_{2}^{2}}{4}\]  
In addition, the vector containing the Coriolis and centrifugal torques is defined as follows:  
\[C(q,q)\dot{q}= \begin{bmatrix}-c\dot{q}_{2}+k_{1}&-c(\dot{q}_{1}+\dot{q}_{2})\\ c\dot{q}_{1}&k_{2}\end{bmatrix}\begin{bmatrix}\dot{q}_{1}\\ \dot{q}_{2}\end{bmatrix} \]  
with \(c\) being \(c=\frac{1}{2}m_{1}gl_{1}l_{2}s_{2}\). Additionally, the gravity vector is given by  
\[G(q)= \begin{bmatrix}\frac{1}{2}m_{1}gl_{1}c_{1}+m_{2}g(l_{1}c_{1}+\frac{1}{2} l_{2}c_{12})\\ \frac{1}{2}m_{2}l_{2}gc_{12}\end{bmatrix}  \tag{27}\]  
and the terms \(c_{2},s_{2}\) and \(c_{12}\) correspond to \(\cos(q_{2})\), \(\sin(q_{2})\) and \(\cos(q_{1}+q_{2})\), respectively. The values adopted for the simulation are depicted in Table 2, with \(m_{i}\), \(I_{zi}\) and \(l_{i}\) denoting the mass, the moment of inertia and the length of link \(i\), respectively, \(k_{i}\) being the joint friction coefficient and \(g\) the acceleration of gravity. In order to retrieve the manipulator's dynamics, a reference trajectory was designed so that it traversed (in random order) 71 points scattered over the compact set \(\Omega_{q}\times\Omega_{\dot{q}}=[-1,1]\times[-1,1]\times[-1,1]\times[-1,1]\). In order to track it, a PPC controller with gains \(k=2\) and \(\lambda=7\) was used, with performance specifications dictated by \(\rho_{0}^{1}=\pi/3\), \(\rho_{\infty}^{1}=\pi/180\), \(l_{1}=1.5\), \(\rho_{0}^{2}=\pi/3\), \(\rho_{\infty}^{2}=\pi/180\) and \(l_{2}=1.5\). In addition, the gains of the tracking differentiator were chosen as \(k_{z_{1}}=k_{z_{2}}=0.2\) and \(R=10^{5}\). For the system identification phase, a shallow neural network of one hidden layer containing 12 neurons was utilized to extract the system dynamics via the learning process, and the simulation was carried out for 20 iterations so that a sufficiently accurate approximation was obtained.