The above flight track highlights the performance of the latest version of the navigation algorithms in MatrixPilot. Flight tracks are from a flight that Peter Hollands conducted. (Thank you, Peter.) The red and the green tracks represent flight segments in opposite directions between the same pair of waypoints. The tracks are nearly perfect straight lines 243 meters long, with deviation between the two tracks of no more than 3 meters, in heavy winds. You will have to look closely at the picture, the two tracks are nearly on top of each other.

Winds are shown in the following picture.

This precision navigation is the result of several recent innovations in the MatrixPilot algorithms. The main innovation is from Paul Bizard, and has to do with using IMU course over ground instead of heading for navigation. (Thank you Paul.) Paul has taken us full circle on this:

1. The first version of MatrixPilot used GPS course over ground for navigation. This had the advantage of not needing wind information, but suffered from GPS latency.

2. The next version of MatrixPilot used IMU heading for navigation. This eliminated GPS latency effects, but required wind to be included in navigation computations.

3. The next version of MatrixPilot used IMU for position estimation.

4. Recently, Paul pointed out that the MatrixPilot IMU furnishes course over ground, and that would be much better than heading for navigation. So we went full circle, we are back to course over ground. But now it comes from the IMU, not GPS, so there are no latency effects.

We also made several other improvements to the navigation algorithms:

1. We totally eliminated the use of angles in the navigation computations, everything is now based on vectors or matrices.

2. We are using 32 bit integer arithmetic in several places. This combines ultra-fine resolution with wide range.

3. We added a cross-track velocity damping term. This allows the cross tracking gains to be turned up without inducing a "dutch roll".

For more information on MatrixPilot, see its diydrones page, or its website.

Best regards,

Bill Premerlani

## Comments

cheers Bill,

will look further into it

Hi Robert,

The change we made (using course over ground instead of heading) was trivial to make, so I do not have any documentation. The change was enabled by some previous work on using the IMU to compute position. This solved a problem we had run into earlier when trying to use GPS course over ground for navigation: the latency of the GPS created feedback instability.

As far as the navigation algorithm itself is concerned, what we now do is to compare the course over ground needed to get to the desired location with the actual course over ground, and turn accordingly (using your favorite PID control loop.) By using course over ground, you eliminate the need to know the wind vector.

Here is a link to the MatrixPilot navigation code.

Best regards,

Bill

Bill can you provide the new course over ground algorithm in terms of pseudo code, flow charts, drawings to understand the physics of it ? Cheers.

Absolutely geniuses at work!

Curved approaches will add that scale effect to Spitfire landings marvelous. Putting the platform back into wind at the bottom of the circle would of course be first prize.

Hi Bill,

Fantastic result of a teamwork! Thank you all guys!

Best regards

Nick

Thanks for all the links Bill! Lots to think about. We don't have an equivalent to your LOGO scripting yet, but Kevin Hester is working on adding Squirrel to PX4 to fix that (currently codenamed "FlyingSquirrel").

We haven't done anything with 4D waypoints yet, apart from some vague thoughts about adjusting the target airspeed based on predicted time to the next waypoint. Nothing implemented yet.

Cheers, Tridge

Hi Tridge,

Have you done anything yet with 4D waypoints?

Bill

Hi Tridge,

The basic altitude/speed control in MatrixPilot is an integrated throttle/elevator control that is based on total energy, with user specified limits on maximum pitch. The controls attempt to fly the plane along the 3D line defined by the waypoints, at the specified speed. It works quite nicely, even if you ask the plane to climb faster than it can. The controls will arrange for the plane to climb as fast as it can manage, without stalling.

Matt Coleman has gone way beyond that, with a rather sophisticated speed/altitude control that is especially suited to sailplanes

Best regards,

Bill

Hi Tridge,

I almost forgot, MatrixPilot has an option that both provides 3D waypoints (spirals) and smooth turns: Ben Levitt's LOGO impelementation!!

So, if you want to define a 3D landing spiral with MatrixPilot, use the LOGO editor. The controls will guide the plane along the spiral, adjusting throttle and pitch to maintain actual height to match the height defined by the location of the plane along the spiral.

Here is Ben's posting on the subject in 2011.

Best regards,

Bill

Next