Saturday 28 November 2015

It's all in the application: Recon Instruments Snow 2 vs Paragliding (Part 2)

While it has been hectic week as we try to roll out a new toolset to the content creators, things are under control to the point that I get to have my weekend. To be honest, I'm pleasantly surprised at how little OT this return trip to the games industry juggernaut EA has involved (compared to my last stint a decade ago). *knock on virtual wood*

In any case, free time => back to the repurposing of a Recon Snow2 HUD for paragliding.

In the last post, I managed to get the device to show heading, altitude, ground speed, glide ratio, and climb rate. Now time for something a little more meaty - wind drift.

Wind drift is a rather useful morsel of info. It can be 'back of the hand' calculated by eyeing the ground speed while performing a complete turn - note the heading and degree with which ground speed drops off to its lowest value. That method works just fine if there are no obstacles (such as other pilots) nearby.

But I am lazy. Also when there are airborne obstacles nearby, my line of sight intersects the screen of my Flymaster with a frequency of about....oh....zero.

So having the digital navigator compute and display the value for perusal at my leisure is a big plus.

Before beginning: a big hat tip to Alistair Dickie @ BlueFlyVario and Dr. Micheal Doube @ the Royal Veterinary College. Without the prior works of these two gents, I'd be stuck doing the back of the hand method.

The baseline assumption: A paraglider has a very narrow range of speed compared to almost every other form of aircraft => the delta between trim and stall can be as narrow as 15 kph. This means we can treat airspeed as near constant.

An aircraft at a constant speed and at a constant bank will fly in a near perfect circle absent any outside influence (such as the wind). If one were to take the tangental ground speed velocities (constant in magnitude, varying in direction) and plop them down such that they share a common base - we could draw a circle connecting the tips of these ground velocity vectors. The radius of the circle would be the airspeed and in the case of zero wind it would match our ground speed.

In otherwords, if our PG has an airspeed of 30 kph and there is nil wind, our groundspeed will be 30 kph. Likewise, where we are facing is were we are going (no drift).

If we were to introduce wind, we know our ground speed will vary (facing into the wind will reduce our ground speed, running with the wind will increase it). But our airspeed will not change.

Back to our PG. 30 kph airspeed. 10 kph straight on headwind. Ground Speed? 20 kph. Likewise, 30 kph airspeed. 10 kph straight behind tailwind. 40 kph ground speed.

The simplest of vector addition.

What about crosswind? It is still vector math (but will not involve a little trig to determine direction).

Airspeed is still 30. Crosswind is perfectly square on to our side (90 degrees off our heading) and 10 kph.

What is our ground speed (and direction)?

Treat the heading as the Y component, treat the wind as the X component.
Y = 30 kph.
X = 10 kph.

The magnitude of a vector is the square root of the sum of the squares of its components.
Huh?

This: square root ( 30 * 30 + 10 * 10) => square root (900 + 100) => square root (1000) => 31.62 kph.

Our ground speed will be 31.62 kph. But not in the direction we are facing.

How do we find the direction?

We know from high school that the sine of an angle in a triangle is the ratio of opposite over hypotenuse. The cross wind (10 kph) is the opposite edge, the hypotenuse is our just computed ground speed (31.62 kph).

sin angle = 10/31.62 => 0.3162.
Inverse sin (arcsin) 0.3162 and we have our angle (in radians) => .31172129 rads.
In degrees: rads / PI * 180 => 18.4 degrees.

Because of the wind: we will travel @ 31.62 kph, 18.4 degrees off our heading.

A long winded way to say that the wind impacts not only the speed but also our direction of travel in the air.

That is all fine and dandy, but what if we don't know the wind component and only know the end result (only ground speed and a bearing). How do we determine the wind component?

Circular regression.

Huh?

Given a constant airspeed and bank angle (rate of turn), one can create a circle that best fits the tips of the ground speed vectors that share a common origin. The vectors will vary in magnitude due to the wind. This variation will mean the common point of original for the velocity vectors will not be the centre of the circle. This is very important, as it is this delta that we want.

A picture would help immensely here, but that will likely have to wait. Trust me.

One method of finding the best fit circle to a trio or more of non-colinear points is the Taubin-Newton Circular Regression algorithm. This is what we will use.

The regression gives us the centre and radius of the best fit circle. The radius will be our airspeed. The centre will be offset from the common point of origin. The magnitude of the vector joining the centre of our newly computed circle and the common origin of the wind drift influenced ground speed vectors will be the wind strength. The direction of this end vector will be line of wind travel.

We now have a wind direction and speed. Easy peasy in the words of a certain Brit SIV instructor.

In testing, I assume a 30 kph airspeed with a 10 kph straight south wind. The Y axis is North/South with North being positive. The X axis is East/West with East being positive.

The velocity vectors (X, Y) fed in look like:
(0, 40)
(0, -20)
(30, 10)
(-30, 10)

The output vector indicates wind out of the south @ 10 kph.

The result:



The blue arrow represents wind direction. I have yet to add a strength value above it. The bearing indicator (green) is being obscured as the line of travel is in direct opposition to the wind (there a pixel thick line of green just to the left of the blue wind direction indicator).

Next steps involve retaining the wind values over time, applying an exponential weighted average over these retained values to smooth out any sudden changes (and give more weight to more recent data), and optimizations.

Continued in Part 3.

1 comment:

  1. holy s!! batman!
    where can I begin to understand how to repurpose my snow2 for tactical navigation only? Using the already installed programming im hoping it functions as intended.. Just purchased one for really cheap and replacing battery before beginning down the programming rabbit hole. then upgrading to a more substantial processor for AR

    ReplyDelete