Close

Navigation System Development

A project log for Roverling Mk II

Autonomous robot with GPS + IMU navigation, waypoint execution, PID control, RC + LoRa + Wi-Fi comms and real-time telemetry.

mark-makiesMark Makies 06/12/2025 at 06:250 Comments

Roverling’s first level of navigation control uses a magnetometer. It’s initially calibrated offline using all three axes (for spherical remapping), and then recalibrated on Roverling itself with a figure-of-eight manoeuvre to correct for hard and soft iron effects.

However, the magnetometer is only accurate when the device is level. That becomes a problem when Roverling drives up, down, or across slopes. To compensate, tilt correction is applied using pitch and roll, which are calculated from a three-axis accelerometer.

Unfortunately, this solution is limited: the accelerometer provides reliable pitch and roll data only when stationary. On rough terrain, movement-induced spikes render the data unreliable.

The next level of control comes from GPS. While useful, it has its own limitations:

The first chart below (1 m/div) shows Roverling’s position during a fully autonomous (very slow) run:

That’s probably accurate enough to return to a previously detected object (e.g., a buried treasure).

The second chart tracks internal PID parameters as the vehicle drives back and forth.


So far, so good. For the next test, I suspended a string line overhead to check drift. Roverling ran autonomously using only the magnetometer for navigation.  Still good.

To test the complete system in a real-world scenario, I ran Roverling on a sloping, slightly rough paddock - typical of our bush block. This was a fully autonomous run, executing a predefined grid search pattern.

To support this, I developed:

Once everything was configured, I loaded the playlist, positioned Roverling at the start point, and let it go.

I was hoping for so much more.   This test was conducted across a slope, which affected both GPS and compass data. The next chart shows the same path as before.  The heading arrows are derived from the magnetometer.

Observations:

Solution:

Enter the Madgwick Filter: a lightweight, efficient sensor fusion algorithm that can run in real-time on an RP2040. I implemented it in Python to combine data from:

to estimate orientation (pitch, roll, yaw [aka heading]) in full 3D.

It was not easy to code - but it works brilliantly.

The final chart shows Roverling executing a straight-line autonomous path using the Madgwick-derived heading. Early signs are very promising.

Now, once the weather fines up, back to testing

Discussions