(Easy to prove it considering a plane flying in a circle with a speed 100km/h relative to the air, and the wind is 100km/h too. Then the gps ground speed is 200km/h in wind direction and 0 km/h against the wind. So the compensation is double in one side of the circle and zero on the opposite side, while the centripetal acceleration is constant.)

The first idea is using the speed relative to the air instead of relative to ground. But it needs a Pitot sensor, or wind estimation based on gps data and some calibration circles etc.

I have a simple idea. (maybe I missed something important and it's just wrong?)

Here is it:

To keep the correct position of the horizont while flying in a circle, the algorithm needs the radial acceleration. Subtract the radial acceleration from the measured (g+a) value, get this way the correct g gravity vector and use that as the reference of vertical direction. So far the same as the the existing algorithm.

The difference is the way getting the radial acceleration value.

I think the algorithm needs the radial acceleration as a single scalar value, because it's supposedly perpendicular to the plane length axis. Let's calculate the scalar value from the gps data:

(dv(n)-dv(n-1))/dt etc.

(vector subtraction, but we use the length of the result only)

Calculating the acceleration this way has an inherent noise because of the gps speed noise, but it's averaged in the the slow drift elimination loop, so hopefully doesn't kill the process. (the current algorithm suffers from this too, so my proposed process hopefully not worse)

This algorithm is not sensitive to wind speed at all, because it uses the speed difference, so any additional constant speed eliminated.

Nor is it sensitive to the heading, so no problem if the real heading and the ground speed vector is not equival.

The algorithm is pretty simple as well.

What do you think?

You need to be a member of diydrones to add comments!

## Replies

You are correct, centripetal acceleration compensation should be based on airspeed, not ground speed. That is on my list of revisions to make to MatrixPilot, which currently uses ground speed. The present method based on groundspeed has flown thousands of missions, and works well enough, so it has not been a high priority for me to revise. For example, take a look at the attached photo of autonomous landings.

Paul Bizard did some simulations that showed the value of the speed used in the centripetal compensation is not critical, in any case. Paul did the simulations because several folks have asked for a GPS-less version of stabilization. In that case, you have to assume a value of airspeed. Paul found that the controls are stable, even if you use the wrong value of speed in the acceleration compensation. It was best to slightly overestimate.

The present version of MatrixPilot works well enough with ground speed. I think that is because, if you are flying in a circle, the upwind and downwind errors in using ground speed cancel, to a first approximation. If you are not flying in a circle, then it doesn't matter.

MatrixPilot uses both wind estimation and "dead-reckoning" (a method for integrating accelerometer and GPS data into a location estimate), so it has a reasonably accurate, high-bandwidth estimate of airspeed, without needing a pitot tube. See the attached picture showing wind vector estimates as yellow arrows.

Here is a link on estimating the wind.

I will write up the theory and implementation of "dead-reckoning" when I have some free time. Basically you do the following:

1. Use the direction cosine matrix to transform the acceleration vector from body frame to earth frame.

2. Integrate the earth frame acceleration to get earth frame velocity.

3. Integrate the earth frame velocity to get earth frame position.

4. Use the GPS data to compensate for drift.

When you integrate the dead-reckoning method with the wind estimation algorithm, you wind up with a 40 Hz airspeed estimator.

Best regards,

Bill Premerlani