# Enhanced Trajectory Tracking via Disturbance-Observer-Based Modified Sliding Mode Control
## 3 Simulation and Discussion
### Simulations on Two -DOF Virtual Robot Manipulator  
The two-DOF virtual robot manipulator (RR robot manipulator) was designed in the MATLAB/SimScape multibody toolbox (Figure 23). The SimScape multibody was used to generate the CAD model of the robot manipulator. Control algorithms were implemented to track the reference trajectory. A polynomial reference trajectory was assigned to both joints of the manipulator (Figure 24). The tracking-error results are presented in this section. The tracking error of joint 1 can be observed in Figure 25. The ESO-based PIDSMC error was better than that of the ESO-based SMC. Figure 26 depicts the control input of joint 1. Similarly, the ESO-based PIDSMC had a better performance for joint 2 (Figure 27). Figure 28 presents the control input of joint 2. The absolute average error of the proposed method was much smaller than that of the previous method. The results indicate that the ESO-based PIDSMC is effective against perturbation. The controller parameters for both joints are presented in Table 5. The observer gain (a) was selected through a trial-and-error method. The values of the switching gains (K and K\({}^{\prime}\)) were chosen based on Equation (44). The other control parameters were selected through a trial-and-error method. The parameter values for both algorithms were the same, where m\({}_{1}\) = 2 kg and m\({}_{2}\) = 1.5 kg. The dynamics of the two-DOF robot manipulator are well known in the literature. The dynamics of the first joint of the robot manipulator can be expressed as follows:  
\[\tau_{1}=M_{1}\ddot{q}_{1}+C_{1}\dot{q}_{1}+G_{1}, \tag{65}\]  
\[\ddot{q}_{1}=\frac{1}{M_{1}}\big{(}\tau_{1}-C_{1}\dot{q}_{1}-G_{1}\big{)}, \tag{66}\]  
where \(M_{1}\) is the inertia, \(C_{1}\) is Coriolis, \(G_{1}\) is gravity, \(\tau_{1}\) is the torque, and \(q_{1}\) is the robot-joint angle of link 1. \[\ddot{q}_{1}=\frac{\tau_{1}}{M_{1}}+\left(\frac{-C_{1}\dot{q}_{1}-G_{1}}{M_{1} }\right), \tag{67}\]  
the perturbation is defined as:  
\[q_{31}=\left(\frac{-C_{1}\dot{q}_{1}-G_{1}}{M_{1}}\right), \tag{68}\]  
Figure 22: Bar chart of absolute average error of three different cases. \[\ddot{q}_{1}=M_{1}^{-1}\tau_{1}+q_{31}, \tag{69}\]  
the value of \(M_{1}^{-1}\) was assumed as unity (\(M_{1}^{-1}=1\)) in the control design,  
\[\ddot{q}_{1}=\tau_{1}+q_{31}. \tag{70}\]  
Figure 23: Two-DOF robot manipulators (SimScape multibody). \begin{table}
\begin{tabular}{c c} \hline \hline
**ESO-Based SMC** & **ESO-Based PIDSMC** \\ \hline \(a_{1}=20,\ a_{2}=18\) & \(a_{1}=20,\ a_{2}=18\) \\ \(K_{1}=100,\ K_{2}=88\) & \(K_{1}^{\prime}=100,\ K_{2}^{\prime}=88\) \\ \(\epsilon_{01}=\epsilon_{02}=1\) & \(\epsilon_{01}=\epsilon_{02}=1\) \\ \(\epsilon_{c1}=\epsilon_{c2}=1\) & \(\epsilon_{01}=\epsilon_{02}=1\) \\ \(c_{11}=10,\ c_{12}=5\) & \(c_{11}=10,\ c_{12}=5\) \\  & \(c_{21}=2.5,\ c_{22}=2.5\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Controller parameters. Figure 24: Reference trajectory of each joint. Figure 26: Control inputs of joint 1: **(a)** ESO-based SMC, and **(b)** ESO-based PIDSMC. Figure 25: Comparisons of tracking errors of joint 1: **(a)** ESO-based SMC, **(b)** ESO-based PIDSMC, and **(c)** average error. Similarly, the dynamics of the second joint can be written as:  
\[\ddot{\vartheta}_{2}=\tau_{2}+q_{32}, \tag{71}\]  
The overall comparison between the designed method and the existing method is presented in Table 6. The designed algorithm is a classical control technique. In future research, intelligent control techniques (neural network, reinforcement learning) will be integrated into the designed algorithm. The intelligent technique will be helpful in the selection of the optimal values of the control parameters (K and c). The intelligent control algorithm will be implemented to tackle fractional-order dynamical systems [39; 40; 41; 42]. Figure 28: Control inputs of joint 2: (**a**) ESO-based SMC, and (**b**) ESO-based PIDSMC. Figure 27: Comparisons of tracking errors of joint 2: (**a**) ESO-based SMC, (**b**) ESO-based PIDSMC, and (**c**) average error.