## 6 Parameter Estimation of 2-DOF Planar Arm
#### Trust Region Algorithm for Nonlinear Least Squares
\begin{tabular}{l l l l} \hline \hline
**Algorithm 1**[34] & \\ \hline
1. & Step: & Given: & \(x_{1}\in R^{n}\), \(\Delta_{1}>0\), \(\epsilon\geq 0\), \(b_{1}\in R^{n\!x\!n}\); \\  & & & \(0<\tau_{3}<\tau_{4}<1<\tau_{1}\), \(0\leq\tau_{0}\leq\tau_{2}\langle 1\), \(\tau_{2}\rangle 0\), \(k1\) \\
2. & Step: & If & \(\left\|g_{k}\right\|_{2}\leq\epsilon\) then stop; \\  & & & & Solve is \(S_{k}\) \\
3. & Step: & Calculated \(r_{k}=A_{k}/P_{k}\) \\  & & & \(x_{k+1}=\left\{\begin{array}{ll}x_{k}&\text{if }r_{k}\leq\tau_{0}\\ x_{k}+S_{k}&\text{otherwise}\\ \end{array}\right.\) \\ Choose & \(\Delta_{k+1}\) that satisfies & & \(\Delta_{k+1}\in\left\{\begin{array}{ll}\left[\tau_{1}\|g_{k}\|_{2},\tau_{4}A_ {k}\right]&\text{if }r_{k}<\tau_{2}\\ \Delta_{k},\ \tau_{1}\Delta_{k}&\text{otherwise}\\ \end{array}\right.\) \\
4. & Step: & Update & & \(b_{k+1}\); \(k:=k+1\); & go to 2. Step. \\ \hline \hline \end{tabular}   
\(\tau_{i}\) is chosen by the user (usually \(\tau_{0}=0\), \(\tau_{1}=2\), \(\tau_{2}=\tau_{3}=0.25\), \(\tau_{4}=0.5\)). Normally, \(\tau_{0}\) is chosen to be zero, but if \(\tau_{0}>\)0, count of \(\lim\limits_{k\rightarrow\infty}inf\left\|g_{k}\right\|_{2}=0\) will be stronger. As a satisfactory optimal criterion for terminating the algorithm at point \(x_{k}\) is \(\left\|g_{k}\right\|_{2}\leq\epsilon\). **7. Parameter Estimation of Simulink Model**  
Within the estimation of model parameters, attention, in this case, was focused on the parameter estimation of the Simulink model, where the task is to process the input/output data used for the testing phase. In the validation phase, tests were performed separately for link 1 and link 2 and at the same time for each axis at four different initial joint angles. However, when estimating the model parameters, the estimation takes place simultaneously for link 1 and link 2 for the specified joint angle. To create the experiment, it was necessary to select the measured outputs--the matrix of the required measured outputs depending on time. Specifically, in this case, it was the time dependence of the mean response obtained from the measured data. Another important step in configuring the experiment was to choose which parameters to estimate. In the performed experiment, all physical parameters of the system were selected for estimation, which are listed in Table 5. At the same time, it was necessary to determine the limits of the set parameter. The limits were set to \(\pm 30\%\) of the original parameter values obtained from the CAD software (excluding friction). The basis of parameter estimation is an optimization method and algorithm that determine the sequence of steps in which the estimation takes place and what criteria for parameter estimation are chosen. Based on what was mentioned in Section 4, the Trust Region Algorithm for Nonlinear Least Squares was chosen. The result of parameter estimation is new estimated values of selected model parameters, which were reused for validation to obtain better model results. An overview of these parameters is summarized in the list of model parameters after parameter estimation in Table 6. The simulation scheme in Simulink was modified with new detected parameters, and the process of output validation based on measured data was performed as in section Validation. The results of the validation after estimating the parameters are divided into two parts--for link 1 and link 2.