Near Real-Time Simulation and Control of Autonomous Underwater Vehicles for Hydrobatics
By Ivan Stenius and Sriharsha Bhat, KTH Royal Institute of Technology
Like their airborne counterparts, autonomous underwater vehicles (AUVs) are preferable for use in many applications that would be either too risky—or simply impossible—for larger, manned vehicles to attempt. These applications, including arctic exploration, underwater bridge and pipeline inspection, and aquaculture automation, often require the AUV to travel some distance to reach a target site. Once there, the vehicle may have to perform agile maneuvers—or hydrobatics—to capture images, video, and other important data.
Developing control algorithms for these AUVs is complicated by several factors. Among the most critical challenges is the wireless radio signal attenuation of water, which makes it impossible for AUVs to reliably receive GPS or communication signals as they operate remotely at depth. This lack of communication places greater importance on the AUV’s ability to operate autonomously.
Our team at KTH researches control strategies that could enable AUVs to complete lengthier, more complex missions by minimizing energy consumption. We use Model-Based Design with MATLAB® and Simulink® to simulate, optimize, and implement the control algorithms we develop. This approach lets us rapidly develop and evaluate algorithms via simulation before field-testing the algorithms on our hydrobatic AUV SAM (Figure 1)—and increase the pace of our research.
Engineering Tradeoffs in AUV Design
AUVs designed to hover in place generally incorporate multiple thrusters—making them bulky and hence unable to cover large distances easily. On the other hand, while slender AUVs have greater range, their shape and lack of multiple thrusters makes it more difficult to hover or orient cameras and other sensors toward an object of interest once they reach a target site.
SAM—short for Small and Affordable Maritime robot—was developed in the Swedish Maritime Robotics Centre (SMaRC) at KTH with this tradeoff between range and maneuverability in mind. At 1.4 meters long and weighing about 15 kilograms, SAM can easily be handled by a single operator and is relatively inexpensive, making it possible to conduct multivehicle operations with several AUVs. To keep SAM small and light, we have equipped it with a relatively small battery back and a limited number of sensors.
Equipped with two counter-rotating propellers within a single thruster and additional trim subsystems to change its buoyancy and CG position, SAM, while agile, is still underactuated. It requires the advanced control systems our team develops to perform precise maneuvers and get the most out of the onboard sensors. The development of these control systems comes with its own engineering tradeoff between simulation speed and fidelity. While computational fluid dynamics enables highly accurate fluid flow simulations, it would take days to complete the necessary computations to run just one of our control algorithm tests. In contrast, our vehicle motion simulations in Simulink run in close-to-real-time and are sufficiently accurate to model qualitative behaviors, enabling us to rapidly verify and optimize control ideas in simulation before testing them on the AUV.
Modeling the AUV
Modeling an AUV is a complex undertaking because hydrodynamics change depending on flow conditions. For instance, forces at high angles of attack, when flows are turbulent, are vastly different from those at low angles of attack. To account for this complexity, we created hydrodynamic models of individual AUV components and then brought them together using the component build-up method—a technique often used in aerodynamics modeling.
For exterior (or wet) components—such as the AUV’s hull and nozzle—we modeled the hydrodynamic characteristics using the best available data, which we included in our Simulink model as lookup tables. This data came from a variety of sources. For example, we used data from CFD simulations for low angles of attack. For high angles, we used MATLAB scripts based on USAF Stability and Control DATCOM formulas. Finally, for the AUV’s wings, we used data from XFOIL, a software package that calculates airfoil aerodynamics, which we adapt for water density and viscosity.
Our Simulink model also incorporates interior components such as the variable buoyancy system (VBS), the rotating counterweights used for transverse center of gravity (TCG) trim, and the mass that we can shift forward and aft for longitudinal center of gravity (LCG) trim. We modeled the masses and actuators of these subsystem in Simscape™, which made it easy for us to assemble the various components into the larger plant model framework (Figure 2).
Modeling and Simulating Controllers
Once we had a plant model that accurately reflected the dynamics and behavior of our AUV, we were ready to begin modeling and simulating controllers in Simulink with Control System Toolbox™.
Our early control systems comprised a set of proportional-integral-derivate (PID) controllers. Taking input from the accelerometer, compass, depth gauge, and other onboard sensors, each controller was assocated with a single degree of freedom. More recently, we’ve started evaluating model predictive control (MPC) approaches, including linear, linear time-varying, and nonlinear MPC, as well as linear-quadratic regulator (LQR) designs.
Connecting the controller model with the plant model, we run closed-loop simulations for specific hydrobatic maneuevers. These vary in complexity from simply holding a specific position to performing tight loops in horizontal and vertical planes (Figure 3). The controllers used range from simple scripted sequences to optimization-based techniques such as LQR and MPC.
Simulation has been instrumental in developing and implementing effective control strategies. In one case, for example, we wanted the AUV to perform an inverted pendulum maneuver, which involved the vehicle diving backward, holding a vertical orientation, and then moving upward until its nose was above the water’s surface. Finding an effective control strategy for this maneuver would have been extremely difficult if we were limited to solely conducting tests with the AUV itself. Via simulation, however, we were able to rapidly try various MPC designs and combinations of PID controllers, as well as generate detailed plots of the simulation results in MATLAB (Figure 4) to see which approach worked best.
Code Generation and Validation
After we have identified a promising control strategy via simulation, we follow one of two paths to prepare for testing on the AUV. In some instances, we simply write control code based on the Simulink controller model. Alternatively, we generate C code directly from the model using Simulink Coder™ and deploy it as a standalone Robot Operating System (ROS) node on the AUV using ROS Toolbox.
When we test the controller on the AUV—typically during field tests performed in a tank or in the sea—we compare the performance and behavior of the vehicle against our simulation results. We’ve consistently found that the behavior of the AUV in field tests is qualitatively similar to the simulated behavior (Figure 5).
Current and Future Research
When the AUV is performing hydrobatic maneuvers, it is in an operational mode that requires precise control. The AUV’s second operational mode—employed in traveling large distances in open water—prioritizes path following and minimal energy consumption over precision orientation. With these two operational modes in mind, we are currently working on more advanced strategies that adaptively switch between different controllers.
Our group is also using modeling and simulation to assess potential enhancements to the AUV itself. One of our colleagues, for example, added a gripper to the nose of the AUV plant model. Although we don’t have the physical hardware for the gripper yet, she used simulation to help design an LQR controller that would respond well to impulse loads and other disturbances that are likely to be encountered when the gripper is used. We are also exploring the use of a similar gripper—mounted on the side of the AUV—to enable the vehicle to latch onto one or more identical AUVs and begin operating as a single multiagent system.