## 3 Identification Algorithm  
The mathematical model function \(Y\), which serves as the base of the nonlinear identification, such as in the case of this work, is given directly by the nonlinear inverse dynamics model of the system, i.e. :  
\[Y=Q_{a}=f(q,\dot{q},\ddot{q},\Phi)=\overline{M}\dot{q}_{a}+\overline{V}. \tag{30}\]  
The residual error of the estimation is given by the difference between the estimated active joint forces \(\hat{Y}\) and the measured active joint forces \(\overline{Y}\):  
\[e=\hat{Y}-\overline{Y}, \tag{31}\]  
where the estimated active joint forces \(\hat{Y}\) are defined similarly to Equation (30) but using the estimated parameters \(\hat{\Phi}\) instead:  
\[\hat{Y}=\dot{t}=\hat{Q}_{a}=f(q,\dot{q},\ddot{q},\dot{\Phi}). \tag{32}\]An identification algorithm is defined to minimize the residual error in Equation (31). This is most commonly achieved by minimizing a cost function \(J\) given by the square of the residual error, i.e. :  
\[J=e^{T}e. \tag{33}\]  
The dynamic parameter identification can be stated as the following optimization problem: find the estimates of the dynamic parameters \(\Phi\) that minimize the cost function \(J\) defined in Equation (33). A bound-constrained optimization method was applied in this work to minimize the residual error. An iterative bound-constrained global optimization solver in MATLAB(r) R2020a, namely, a constrained _pattern search_[16; 17] was applied. The global search tool was used instead of a local search tool to avoid getting trapped in local minima. To ensure that the estimates are physically feasible, some physical feasibility constraints should be incorporated into the estimation algorithm. This changes the least squares problem into a constrained optimization problem as follows: minimize the residual error, which is commonly represented by the square of the residual error, subject to the physical feasibility constraints. In this work, the physical feasibility is imposed by predefining bounds of the estimates in the estimation algorithm. Since the bound constraints are used as the physical feasibility constraints, the estimation problem can be written as:  
\[\text{Minimize }J=e^{T}e\text{ subject to }LB\leq\Phi\leq UB\, \tag{34}\]  
where \(LB\) and \(UB\) denote the lower and upper bounds, respectively. The bounds are introduced to narrow the search space and avoid getting trapped at unexpected local minima. This approach requires a priori knowledge of the numerical values of the estimated parameters. This can typically be obtained by using CAD data, manufacturer's data, or direct measurements of the main components. In general, this a priori data is not accurate, and therefore some lower and upper bounds are determined to capture the expected true values of the parameters. In this case, one should provide acceptable bounds, which will ensure the physical feasibility but one should not provide bounds that are too tight as they may fall beyond the true values of the parameters. Moreover, the span from the a priori values to the lower bounds does not need to be equal to that from the a priori values to the upper bounds; the spans depend on how much the tendency of the true values to be shifted down or up from the a priori values. The true value of a mass, for example, tends to be shifted up from the a priori value rather than shifted down due to additional components or accessories mounted on the main components, such as fasteners, cables, etc. This approach is used since the design or nominal values of the parameters in this work can be obtained easily for some reasons: the masses of the components are known and the CAD models of the components are available. The masses of the components can be obtained by weighing them or calculating them from the volume and the material density of the components. The earlier is more practical when it is possible to disassemble the components and weigh them, whereas the latter can be done if weighing is not possible.