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.

Sunday 22 November 2015

It's all in the application: Recon Instruments Snow 2 vs Paragliding.


Over the summer an online dealer in Utah for the Recon Instruments family of devices had the Snow2 + Scott googles on sale for over 50% off. Even with the exchange rate, it was a phenomenal deal compared to the price local dealers were charging. The Snow2 is a pseudo HUD in that it does not directly overlay ones view, but instead sits on a small display in the lower right field of view.

An image of what the HUD looks like within the goggles, from Necessary Coolness.



Here is a link to Recons info page.

The HUD software is geared almost exclusively towards snow sports (thus the name Snow2 and likely why I got it so cheap mid summer). But it runs on Android, and strangely enough yours truly has a decent amount of experience with Android fairly close to the metal.

Trivial to repurpose this device towards a more paragliding centric application. Grab the Recon SDK, the sample app, and a hacking we will go.

The result:



Fairly simplistic. It autostarts on boot, precluding the need for the all-too-easy-to-lose remote. The compass rotates in line with heading, the green arrow indicates bearing. If the user has a sufficient change in bearing or a climb rate above 0 m/s, the centre display will show climb rate, otherwise it shows glide ratio. Climb and glide are averaged.

Next up will be determination of wind direction and speed (a blue arrow on the compass?). After that, maybe speed to fly, maybe BLE connectivity (if Recon has finally updated the OS for the device with proper SDK support) to a PGing GPS such as the XC Tracer.

In any case, it and the laptop will follow me to Brazil for further testing/dev.

Continued in Part 2.

...Or skip ahead to the current refactor.

Saturday 21 November 2015

Club Care

It's been a while since haunting this blog.

Since the last posting, I managed to get the Gin Carrera Plus up in the air a couple of times at Bridal Falls. Really like the improvement in 'feeling' over the base Carrera - feedback from the wing tips is spot on.

Health took another nose dive Sept/Oct bringing the flying season to an end (it has since started improving with an increase in dosage of the med cocktail).

AND....I'm no longer on the Board of Directors for our local club - the President, Tom, let me off the hook at the AGM (I think he realized I don't have enough left in me to give the role the attention it needs). When agreeing to run again last year, I wasn't counting on further health issues or ending up back in the games industry - balancing the needs of the club against real life has proved a bit much. But everything worked out in the end and new, eager blood has stepped in to take over.  Looking forward to seeing what new ideas they roll out over the next year.

Being on the Board for the largest paragliding/hang gliding club in the country certainly provided for an education in the legal and regulatory considerations that go into free flying and clubs in general.

Two big ones:

  1. The club must be incorporated. Being otherwise opens the entire membership to the risk of being named parties in litigation. Consult a lawyer if you need more info on the risks of joining an unincorporated club (as they will vary by juristiction).
  2. If you are asked to serve on the Board of a club, make sure they have Directors and Officers Insurance. It basically helps cover you as a Board member in the event of a lawsuit for a perceived mistake or omission in carrying out your role, but typically does not include willful illegal acts. Talk to an insurance provider more info on D&O insurance.
Small things to consider that could have a huge impact on you as a member and as a Director if you are asked to 'step up'.