Wrote up a wind estimator today. It is based off of a simple model which requires very little inputs from sensors.

psi - true heading (not course over ground)

theta - pitch

airspeed

GPS lat and long

It is a simple model. The wind model has no dynamics which helps simplify the solution. This asusmption is mostly true beings the wind direction and velocity doesn't change all that much for a given flight. The filter starts off by assuming the soltion is a zero wind scenario and then moves towards reality. It takes about 2-3 seconds to converge.

The non-linear state update equations are as follows:

Pn_dot = Vair*cos(psi)*cos(theta) - Wn

Pe_dot = Vair*sin(psi)*cos(theta) - We

Wn_dot = 0

We_dot = 0

Notice the filter resolves on a wind velocity of 15 ft/s and 090 deg heading.

Pretty slick how quickly it finds a solution.

Views: 75

Rana Comment by Rana on February 8, 2010 at 1:53am
Nice Ryan ! where is the code ?
Paul Bizard Comment by Paul Bizard on February 8, 2010 at 7:09am
Nice one Ryan. EKF is powerful.

It is my understanding that the UAVDevBoard team are developping a wind estimator in order (mainly) to correct the airplane true heading (they rely today on course over ground, they don't have a magnetometer).

But in your case the input to your wind estimator is the true heading (I suppose you have a magnetometer), so why did you need a wind estimator for ? (Excuse me for being so narrow minded). :)

Paul
Ryan Beall Comment by Ryan Beall on February 8, 2010 at 7:18am
If you have a decent wind estimate you can dead reckon for short GPS outages and it's just extra information to the user to help tune upwind and downwind heading controller gains. More or less I just wanted to see if I could do it. Haha
Ryan Beall Comment by Ryan Beall on February 8, 2010 at 7:20am
And yes I have a magnetometer.
Paul Bizard Comment by Paul Bizard on February 8, 2010 at 7:33am
I wonder if an EKF to estimate position and speed would be interesting ? Fusion of GPS position and speed, airspeed, accelerometers, barometric altitude, attitude (from the attitude filter) ? With extra states such as accelerometer offsets and more ? Would be complex for sure.
Ryan Beall Comment by Ryan Beall on February 8, 2010 at 7:59am
Yeah multiple states would be fun to work on but impractical on an 8bit processor. Need something like a blackfin.
Ryan Beall Comment by Ryan Beall on February 8, 2010 at 11:57am
Here is the stripped out matlab code. Got to love matlab! Its awesome for matrix math!

wind EKF.txt
VoiceOfReason Comment by VoiceOfReason on February 8, 2010 at 3:19pm
Good stuff Ryan...even with magnetometers, wind estimation is important for better path following and auto landings.

Since you have all this information however, is the EKF possibly a little overkill? Since most GPS give you NED velocity (Ublox does at least), then the velocity of the plane in NE space is:

Vplane,N = Vair,N + Vwind,N
or
Vplane,N = Vair*cos(psi)cos(theta) + Vwind,N

Likewise,

Vplane,E = Vair*sin(psi)cos(theta) + Vwind,E

You know Vplane,N and Vplane,E from your GPS NED output velocity.
You know Vair from some pitot tube or lookup table against throttle
You know psi from your magnetometer (assume know pitch from IMU)

The only remaining unknowns are Vwind N, E, which are just solved as:
Vwind,N = Vplane,N - Vair*cos(psi)cos(theta)
Vwind,E = Vplane,E - Vair*sin(psi)cos(theta)

You can filter these with a low pass if they are too noisy, but that would be less computationally taxing then the EKF.

Or, I could've missed something...thanks for posting the matlab code BTW...
William Premerlani Comment by William Premerlani on February 8, 2010 at 4:19pm
Hi Ryan,

Nice work.

Regarding Paul Bizard's comment, the UAV DevBoard team has developed and successfully tested a 3D wind estimator that works without an airspeed sensor, magnetometer, or true heading. Inputs are GPS course and speed over ground, and the direction cosine matrix.

In our case, we developed a DCM based algorithm, because the UAV DevBoard takes a minimalist approach, it does not have an airspeed sensor or a magnetometer. All we have are accelerometers, gyros, and a GPS. So, we squeeze everything we can out of the direction cosines.

We estimate all three components of the wind, including the Z (or lift) component, which will be helpful for sailplane pilots.

Here is a link to the theory.

Here is a cross link to our posting.

Best regards,
Bill
Ryan Beall Comment by Ryan Beall on February 8, 2010 at 4:30pm
Yeah it is overkill, but I just wanted to see if I could matlab it up. The real reason it sparked my intrest is because even though it is a full EKF, a lot of the nonlinearity drops out in all of the zeros. So I just wanted to see how the full working model worked and then see if it was worth doing all of the stream lining. It probably is fairly easy to take all of the matrix math out beings everything is mostly zeros. However with that being said, I'm already working on a much more streamlined observation filter sort of like you described. Instead of being low passed, it is smoothed and has an integral affect to it. Kind of hard to describe but I will write it up soon. Much easier! I just like the EKF because of its elegance!

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

© 2012   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service