Monday 23 May 2011

Testing the alpha prototype

To test the prototype I had to write and tweak a small Java desktop application. I used the bluecove library so I could use JSR-082 bluetooth calls for the desktop. This is much more reliable than connecting via a virtual COM port, an much more like I will do for the Android app. 

The desktop application simply reads the stream of pressure data and displays it as text fields with an added graphical interface for the vario. The purpose of the test app is to work out what parameters are best for smoothing the incoming pressure stream for the vario while minimising lag, what damping factor to use for the altitude. The app you see in the youtube video below is set up with one altimeter with a damping factor of 0.01, and two variometers. 

As it turned out I not only performed a linear regression on a window of the pressure data, but also then subsequently smoothed the result with an IIR filter. The parameters for the two varios shown in the app are:
Var 1: Window (50 measurements - about 2.5s), damping factor 0.3
Var 2: Window (60 measurements), damping factor 0.05

Note that both 'varios' use the same incoming pressure data stream. They just analyse it differently.

The graphical display of the vario data was an accident. I just wanted to be able to visualise the response lag. Having stumbled upon this display I reckon I will use it in the Android app. I will tweak it a bit to include Var 1 and Var 2 bars on the left and will probably add an altitude graph below it and allow the user to vary the timescale. At the end of the video you can see how the auto range scaling works. 

In this test I managed to determine there is a bit more lag than I would like in the vario, but it should still be usable. With the MS5611, I should be able to get more resolution and less lag.