Positioning under water without GPS

Under water there is no GPS. The vehicle has to work out where it is from its own sensors, and the error grows with every metre. Davide wrote a simulator for this, a world model of P8N with its real sensors: fly with GPS, dive, lose it. Each sensor has errors per unit, per power-up and during a run. An 18-state filter estimates the position.
The simulator alone already showed useful things. Calibrating the sensors in flight halves the dive error, and the airspeed tube is the most important sensor under water. It also found three design problems: the pressure sensor saturates at about 1.9 m, the GPS antenna is awash when floating, and the IMU heater can't hold its temperature in water.
What I built on top
Learning and map layers that use the simulator without changing it:
- A float constraint. Floating at the surface with the motors off, GPS velocity is the current. One line of physics.
- A learned guess of how the current fades with depth.
- A compass that knows the local magnetic map.
- A particle filter that matches magnetic-anomaly and seabed-depth maps.
Results (simulation only)
- The brief assumed the leftover error was the current field. It wasn't: with no current at all, the error stayed at 20–60 m. The real cause was the current estimate the filter had picked up while floating.
- The float constraint alone took the three worst cases from 57 m to 8 m.
- On dives and sensor units the model had never seen, the final error fell from 38.2 m to 6.6 m.
The platform (Martin Behrmann)
Martin turned the simulator into an app: draw a mission on a map (fly out, land on the water, dive, take off again), run it, and replay it in 3D. He also built a training workbench for a small neural network, and added waves, tailsitter transitions and an autopilot that flies the whole mission.

Planning and running a fly-and-dive mission
- The network looks at 2 s of IMU, pitot and power data and estimates the speed through the water. Its error is 0.046 m/s, against 0.086 m/s for the pitot alone.
- On 16 random routes, the median final error fell from 43 m to 29 m. On a fixed square route it did not help, because there the pitot's error cancels out between the outbound and return legs.
- Waves changed the picture. With 0.4–0.5 m waves, the 10 cm GPS mast is awash almost the whole time the vehicle floats, so it starts the dive without knowing the current. The fix is hardware: an antenna at least 25–30 cm high.
- The pitot clips at 3.6 m/s in water. Either a 2 psi sensor, or dive slower.
On the run in the screenshot, the network halved the error after 820 m under water (13.7 m vs 27.3 m).
Nothing has been measured in water.
What I learned
Before trying a cleverer filter, take the error apart and find where it actually comes from. Here one physical effect was most of it, and the brief had it wrong.