# Modifications to ArduSub That Improve BlueROV SITL Accuracy and Design of Hybrid Autopilot
## 5 Controller Tuning Methodology
### Additional Damping Term to Correct for Nonlinear Behavior
The resulting step response with the added \(\delta k_{d}\) term is shown in Figure 13 with dash-dotted lines. It can be seen that with this additional term, the controller creates the desired behavior for the nonlinear vehicle system. At \(\omega_{d}=2.0\,\mathrm{rad/s}\), the \(k_{d}+\delta k_{d}>0\) modified derivative gain addresses the initial undershoot, and is large enough to prevent any overshoot having an even better settling time than the LTI theoretical settling time. For the \(\omega_{d}=3.0\,\mathrm{rad/s}\)  
Figure 13: Step response testing in the nonlinear simulation; a tolerance of \(\pm 5\%\) was needed to enable convergence because the thruster deadzone prevented slight adjustments when very close to the steady-state value of \(90^{\circ}\). and \(\omega_{d}=4.0\,\)rad/s cases, there are slight overshoots, but they are acceptable for practical purposes. A range of experimental step response settling times of the nonlinear system with \(\delta k_{d}\) were tested in \(0.25\,\)rad/s increments in the range of \(1.5\,\)rad/s \(\leq\omega_{d}\leq 5.0\,\)rad/s and compared with their theoretical linear settling times shown in Figure 14. In the case of \(\omega_{d}=3.0\,\)rad/s, the overshoot falls within the \(\pm 5\%\) tolerance and may be neglected. In the case of \(\omega_{d}=4.0\,\)rad/s, the initial overshoot exceeds the tolerance, but after one oscillation the step response converges; this is why there is a jump in the settling times for \(\omega_{d}\geq 3.5\). Also shown in Figure 14 are the settling times for the water tank step response tests at \(\omega_{d}=\{2.0,2.5,3.5,4.0,4.5\}\) rad/s using the tuned yaw controller of Equation (24) with \(\kappa=20.0\). Every \(\omega_{d}\) was tested seven times each during water tank testing. Like the open-loop tests described in Section 3, each step response test was performed with the BROV2 nearly completely submerged, floating near the surface of the water, and initiated once while the BROV2 was totally at rest. Figure 14 demonstrates that the SITL simulation better approximates the actual response of the BROV2 than the LTI model, because the simulation predicts faster settling times at lower \(\omega_{d}\) and the simulation results mirror this pattern. Settling times progress in a continuous fashion because they do not oscillate before converging; yet, there is a discontinuity in the simulation settling because the SITL model, while taking into account hydrodynamic nonlinearity, does not account for thruster unsteady behavior and other physical complexities beyond the scope of this work. Tuned step responses of \(\omega_{d}=\{2.0,3.0,4.0\}\) rad/s of the water tank experiments are shown with their accompanying simulation step responses in Figure 15. The \(\omega_{d}=2.0\,\)rad/s experimental response is nearly identical to the simulation; however, as \(\omega_{d}\) increases the responses diverge slightly. This is in part due to the thruster ramp up time causing lag and otherwise resulting from imperfections in the model. It appears that the SITL model predicts sharper overshoots and faster convergence, which may be due to un-modeled higher dimensional drag terms. Despite these shortcomings, the updated simulation model is a vast improvement over the old simulation model, as can be seen in Figure 16. The old hydrodynamic model predicts a much slower step response than what was actually observed during the water tank experiments. This is due to the numerous errors outlined in Section 2.2.4. Further quantification is presented in Table 1, where the average normalized error of the simulated step responses of the old and new SITL models are compared to what was observed experimentally across a range of \(\omega_{d}\) settings.