# Modifications to ArduSub That Improve BlueROV SITL Accuracy and Design of Hybrid Autopilot
## 6 Conclusions and Future Work  
The SITL simulation suite offered by ArduSub is a potentially useful tool for designing systems for the BROV2 Heavy, because it allows for rapid testing without requiring actual water or even the vehicle itself. The main advantage of using ArduSub SITL over other simulations is that the exact same programs, like those written in the ROS for example, and customized firmware can be used both in SITL and in the field. Software frameworks which implement control can be iterated on at a much higher rate with SITL, be in a much better state by the time of the first field test, and have greater improvements between subsequent deployments. However, in its current configuration available to the public, these potential advantages cannot be capitalized on because the vehicle model and hydrodynamic model are so inaccurate. Proper control applications also require a quantitative model that can work with physical quantities like force and torque; the current manual control is a heuristic model which caters to more casual users. In order to access the full potential of ArduSub for our particular project, a few steps were taken. First, on the firmware side of ArduSub, a rework of the manual control flight mode was implemented which incorporated inverse thruster allocation, determined from BROV2 Heavy vehicle specifications found in the available literature, to enable precise control applications by allowing requested forces and torques to be interpreted by the vehicle. Second, open-loop experimental testing was performed to build a reliable model for the specific configuration of the BROV2 that the hybrid autopilot was being developed for. Third, on the simulation side of ArduSub SITL, the thruster allocation complementing the firmware's inverse thruster allocation that updates the vehicle state with respect to thruster inputs was incorporated, as well as a new hydrodynamic model including added mass parameters, updated drag calculations, and corrections to physics. The development process of a hybrid autopilot for assisting AR ROV pilots was started on this new and improved ArduSub platform. A PD control law for critically damped yaw trajectory following was derived using an effective linear drag \(\tilde{N}_{r}=5.97\,\mathrm{Nms/rad}\), which approximated the nonlinear drag. Through thee ROS, the error feedback control mechanism was implemented and could be set to different sensitivities with the selection \(\omega_{d}\). During simulation step response testing, it was found that the nonlinear system behaved in an underdamped manner and was corrected with the addition of a \(\delta k_{d}\) term creating nearly critically damped response. It was found in the water tank tests that the controller tuned in SITL performed as expected in the real world and demonstrated the improved ArduSub SITL's value as a design tool. In continued simulation testing, recorded in Appendix C, a linear regime of the closed-loop yaw frequency responses occurring within gains of \(0.71\leq|H|\leq 1.0\) was identified, providing a working definition for the control bandwidth of the nonlinear system. Testing of the hybrid autopilot proceeded with extending the tuned control law for yaw to roll and pitch terms with additional feed-forward terms. The control laws for all three angular degrees of freedom were implemented simultaneously and linear controls were passed through directly without error feedback. A dive was simulated with prerecorded simulated inputs containing low-frequency angular trajectories and open-loop linear control followed the desired states well. Simulated dive testing highlighted the challenges that pilots are bound to face in managing autopilot settings, energy costs, and mastering the AR/VR pilot's interface. It is hard to draw definite conclusions from the simulation data alone because ultimately the future human pilots' experience of the hybrid autopilot will be the deciding factor in performance.