Glider simulation using Unity3d

A project log for OSUG: Open-Source Underwater Glider

A versatile autonomous environmental drone using a buoyancy engine

Oliver WilliamsOliver Williams 07/22/2017 at 21:577 Comments

We want to develop the control software for the glider in a way that will allow testing. In theory, with an accurate glider model, this allows you to develop the software independent of hardware, reducing the cost/time of PID optimisation.

The control software sets the buoyancy and trim and requests the angle and depth. Therefore, the Arduino code is written so that it either controls real or simulated hardware. A compiler flag is used to switch between real or simulated hardware.

Using Unity3d I created a simulation of the glider ascending/descending. The movement through the "water" is modelled using the buoyancy engine, Realistic Water Physics. The glider is modelled as a number of elements, the main body, a volume at the front that changes buoyancy and a mass that moves on the underside of the body that trims the angle. 

Unity provides an Arduino with depth/gyroscope readings which are then used by the Arduino to calculate motor movements and these are passed back to Unity. Using these motor movements, Unity models the simulated glider.

The below GIF shows a screen capture of the glider simulation ascending and then descending.

Over the coming weeks I will optimise the simulation model to accurately reflect experimental data from the glider.


hqbashir wrote 02/27/2018 at 09:46 point

Hi Oliver. Do you have the files for this simulation publicly accessible ?

  Are you sure? yes | no

shashankrayaprolu wrote 08/21/2017 at 05:54 point


I am stuck at MATLAB simulation of the spiral path using Zhang et. al. 2013. Any guidance there? are you using any similar research work for underwater motion simulation?

  Are you sure? yes | no

Jarrett wrote 07/24/2017 at 18:43 point

Have you checked out Bowler Studio? I have not looked into it in detail, but it might help you avoid reinventing the wheel for a lot of the simulation/real life control stuff

  Are you sure? yes | no

Oliver Williams wrote 07/24/2017 at 19:17 point

Thanks for the pointer to Bowler Studio.  Our current plan is to migrate the control system to use as it has a lot of the elements that will make mission planning and management easier.  It has linkage to external simulators that may also be useful.  The obvious issue is that it is aimed at motorised subs so we will have to graft in the glider behaviour.

  Are you sure? yes | no

jlbrian7 wrote 07/24/2017 at 02:18 point

that's cool.  I'm looking forward to seeing this develop!

  Are you sure? yes | no

jlbrian7 wrote 07/23/2017 at 01:57 point

will the controls account for various surface and submerged currents, and how will those affect the glider?

  Are you sure? yes | no

Oliver Williams wrote 07/23/2017 at 21:03 point

Not yet. Initially, the aim is to get the Arduino to control the glider (real or simulated) in still water. 

There are a number of things which we plan do next:
* characterise the gliding behaviour
* validate the simulation against the real data
* simple mission descriptions, glide angles with turn depths 

At the moment the glider doesn't have a GPS so the absolute position isn't known but the IMU may be able to identify underwater currents when the motion doesn't match the expected gliding behaviour.

  Are you sure? yes | no