• Control Systems
October 6, 2020

ROV and its LQR implementation

A few years ago, Combine purchased a small submarine. This vehicle is connected to a workstation with a long ethernet cable and is known as a ROV (remotely operated underwater vehicle). During several projects, some degree of autonomous capability has been added to the vehicle, and we are planning to turn it into a fully AUV (autonomous underwater vehicle) in the future. Students from Linköping University have performed most of the developing work and the ROV has been the focus of both master’s theses and project courses. At this moment, we have eight students working on creating a digital twin with an associated simulation environment. The plan is to make the software development as efficient as possible, removing the drawback of needing a pool for every test. The ROV is also an excellent platform to show interested people how to work with model-based development and how to set up HIL (hardware-in-the-loop) testing.
The ROV we are using has a variety of sensors, such as IMU, magnetometer, barometer, ultrasonic sensors, and a camera. An HKPilot handles the sensor data while all the computations are, since last year, made on a Raspberry Pi also mounted on-board. This change increases the ROV’s autonomy, and the ethernet connection to the workstation is now only used to transmit commands to the ROV and to be able to watch the live feed from the on-board camera.Several different autonomous modes have been implemented. It is, for instance, possible to follow objects, once the camera has found the object in question (such as a yellow ball). It will then be able to maintain the same distance to it as it moves. Furthermore, it is possible to position the ROV in the pool and to maintain position while being exposed to streams or other movements, e.g. by people. Of course, an operator can control the ROV by hand via the ethernet connection. With the wide range of sensors mounted in the ROV today, the door is open for future development of even more advanced autonomous modes.The codebase, as of today, consists of a mixture of manually coded functions as well as generated code from Matlab/Simulink models. After the ongoing project, all code will hopefully be generated, which will give the development environment a lower threshold for new users.

Now, a deep dive (pun intended) into how the controller was updated during the last year. Previously, the control system of the ROV consisted of six different PID controllers, one for each degree of freedom (DOF). It resulted in poor performance when controlling multiple DOFs simultaneously. The reference generated only excited one DOF at a time, which made the pathfinding inefficient. For this reason, a Linear Quadratic Regulator (LQR) was implemented, and the system model was linearized.

The implemented LQR is a multiple-input-multiple-output (MIMO) controller which minimizes the criteria

which should be interpreted as minimizing the difference from requested states as well as the amplitude of the input signal. The model setup for the LQR is

The optimal linear state feedback controller, assuming known states x, is given by

where L is given by

The controller was implemented in Matlab/Simulink, as can be seen below. The central part is the matrix multiplication of the gain matrix L and the control error. The other crucial element is the feed-forward block that derives the input signals for maintaining the current attitude and depth of the ROV. The difference in result between the LQR and the PID control system can be seen in the picture below, although it is hard to visualize a 3D-path on paper.

Interested to know more about the project, contact us. You can also find more information and videos here: http://www.isy.liu.se/edu/projekt/tsrt10/2019/combine/