# Evaluation of Linearization Methods for Control of the Pendubot
## 4 Simulation and Experimental Results
### Simulation Procedure  
In the research considered in this paper in order to establish \(u_{\text{lin}}\) gains the following cost function \(J\), dependent on state and control signal, is defined  
\[J=\int_{t}^{\infty}\Bigl{(}x^{T}Qx+u^{T}Ru\Bigr{)}d\tau, \tag{26}\]  
where \(Q\) and \(R\) are the weight matrices for states and inputs, respectively. The optimal \(K\)-gains (\(K=[-29.6,\ -4.1,\ 12.4,\ 5.0]\)) were obtained for the linear approximation of Equation (10) at the equilibrium point with \(Q=\text{diag}(50,50,0.01,0.01)\), and \(R=1\). In the conducted simulations we compare different approaches for the swing-up motion. The purpose of this comparison is to check properties of the control scheme investigated in Section 3.1 with other well known algorithms based on collocated and non-collocated linearization [3]. To facilitate the description, we use the following nomenclature:  
* Algorithm 1--\(u_{\text{nonlin}}\) is defined using the collocated linearization;
* Algorithm 2--\(u_{\text{nonlin}}\) is defined using the non-collocated linerization;
* Algorithm 3--\(u_{\text{nonlin}}\) is defined based on the maximum partial linearization approach described in this paper. It is essential to emphasize that the controllers were verified in the presence of the input saturation. Namely, it was assumed that the maximal motor input voltage is equal to \(10\) V. Thus, each algorithm was checked whether it would be capable of controlling the robot presented in Section 4.1. To determine the convergence area of each analyzed method, a series of tests were conducted. As some properties cannot be deduced analytically, one can use some other techniques, such as those based on sampling-based methods. It was assumed that the set of initial configuration conditions are defined in a discrete domain and specified by a 2D grid. The ranges of \(\theta_{1}\) and \(\theta_{2}\) are selected from \(-180\) to \(180\) degrees and from \(-105\) to \(105\) degrees (the second range results from physical constrains, as the second joint cannot be deflected more than \(\pm 105\) degrees), respectively. The spacial resolution of the grid is set to \(\Delta\theta=2^{\circ}\) (the resolution is chosen based on preliminary simulation studies in order to achieve a compromise between the required accuracy and the duration of simulation experiments). Each cell of the grid corresponds to the initial condition \((\theta_{1_{0}},\theta_{2_{0}})\) applied for each simulation trial. The trial was being taken as  
Figure 5: Experimental test-bed: (**a**) original plant, (**b**) used plant. successful while the root of the sum of both angle errors (error between actual and desired angle) was smaller than 0.05 within simulation time \(t=15\,\mathrm{s}\) or less. In order to obtain objective comparative data the following two criteria are taken into account: the integral of square of error in transient state  
\[E_{p}=\int_{0}^{t_{\mathrm{max}}}e_{p}^{2}dt, \tag{27}\]  
and the integral of square of control signal (computed based on motor input voltage over time),  
\[V=\int_{0}^{t_{\mathrm{max}}}V_{m}^{2}dt, \tag{28}\]  
which can be considered as an indicator of the energy used by the algorithm [20]. In addition, parameters of the controllers were optimized. For each pair of initial condition defined by the grid 100 iterations were performed with randomly chosen values of gains. To be more detailed, proportional, and derivative coefficients were considered for Algorithms 1 and 2, while positive parameter \(\omega_{0}\) was adjusted for Algorithm 3, see (21). By this, one can look for a near-optimal choice of regulator gains, which provides the best performance for the given initial condition. Taking into account all cells of the grid almost 2 million simulation trials were conducted with respect to each algorithm. The performed simulations allows one to find a region of initial (starting) positions (Figures 5(a)-5(a)) that leads to a stable upright position.