Sunday, 20 July 2014

1000 BlueFlyVarios

We now have over 1000 BlueFly Varios in the hands of paragliding, hang gliding and sailplane pilots around the world! This milestone was passed a few weeks ago. I was pretty excited and let a few friends know; but only now do I get to blog about it. In this post I am going to reflect a little on what the BlueFly project has achieved, where it is at, and what I am planning for the future.

Achievements

Have a look back at this early blog post from 2011. I have pretty much did what I said I was going to do. Notice I mentioned 10 prototypes, in a later blog post I mentioned 50. I never thought that we would make over 1000, nor did I think early on that could just be the start.

The chart below shows how production has continued to increase. This chart starts in May 2013 when the version 6 prototype was released. That was the first one with an onboard audio speaker which proved to be something that pilots really wanted. Notice the rapid increase around the start of the European flying season, then again when the device to integrate with the Kobo was released. It does not include every vario produced, only those ordered over the internet. Quite a few have also been sold directly to pilots in Australia. It was early July when the 1000 milestone was passed and there is no sign that interest is slowing.


Another achievement has been the ability to share pretty much everything. This is 64th blog post, the Facebook page helps pilots collaborate, GitHub allows the Android code to be shared, and more recently I have uploaded 3d printable case designs to Thingverse (as I am writing this the 3d printer is whirring in the background on a new case design). I intend to continue to share the designs as the BlueFly adventure continues.

All of those achievements are really about me, but the thing I am most happy about are some of the great flights that pilots of all experience have reported. Some of the world's top pilots are regularly doing awesome flights with the vario. I got a kick out of the vario helping in the 2013 X-Alps, and more than one top pilot will be using it in the next one. However, some of the best stories come from new pilots. Most of us can remember that first great flight with the help of a vario. For some BlueFly users their first flight using a vario is with one of my little devices that beep, and the stories of smiling faces are an awesome source of motivation.

What is the current status of the project?

Perhaps the biggest news is that I have had to start a company in Australia to manage this hobby. There are a lot of things to do to keep up with the current rate of production and many payments to make. So to manage the tax affairs properly a company was the obvious choice. The project was never about making money, and it still isn't, but unless I group up all of the activities in a company then I could get myself in trouble. Operating as a company in Australia also means I separate it from my personal affairs.

I am currently focusing on production of the Bluetooth and the TTL_GPS prototypes. I recently shipped the last of the BlueFlyVario_TTL version 8. There was some interest, but most pilots wanted to integrate that older version onto their Kobo and the TTL_GPS is more suitable for that.

With increasing orders I want more time to do development instead of the simple assembly work.  A fabrication house in China is now doing some of the component assembly. They are the same guys used for PCB manufacture for some time, and now they are soldering on many of the components as well. It does not add much to the cost (they can source some parts cheaper), and their soldering quality is better than can be done by hand at home. I soldered every component for over 900 of the first 1000 varios in my little home workshop. In hindsight, I should have got this assembly done earlier, but I did learn a lot and the vario design got better because I was assembling it. I am still planning to program and test each one.

The future

There are many plans for future devices which perform better, are easier for non technical people to use, and offer additional features. I have listed below some of the of the things I am working on when I get time. It is unlikely that they will all end up in a future device, but I am sure you will see some of these things plus some additional surprises.

  • I am still planning to continue the development for the airspeed sensor using a pitot tube. I have not developed this much since the last blog post about it.  
  • I would like to offer an onboard memory and flight logging capability. Other than just going beep I think many pilots really want their device to log their flights. I think this should be possible with a microSD card. I would probably change the processor if I went down this path. 
  • User update-able firmware would allow me to roll out little tweaks. This means a bootloader needs to be developed. I am testing a few of them. 
  • Soft power on and off will allow the use of a tact switch. That should be more reliable than the current slide switch. 
  • I intend to change the battery connector on future versions to a Molex connector. That should save a little time in assembly and make it easier for exchanging the battery. 

I think the future is looking pretty good for home-brew flight instruments. I don't think you will see the end of the BlueFly project for a while yet.


Sunday, 6 July 2014

BlueFlyVario_TTL_GPS Simple Case

Minimalist Install

Over the last few weeks I have shipped more than 100 BlueFlyVario's with GPS for installation on the Kobo Mini. I have shared a few of the install photos on the BlueFlyVario facebook page. If you have pictures and you want to share please let me know.

I have also refined my preferred install method. Instead of using the Dupont connector I prefer to wire the module directly to the Kobo. All of the steps I have previously blogged about still apply. This really just changes Step 4 in that process.

I start by placing the BlueFlyVario_TTL_GPS module on the front bezel of the kobo in the bottom right. Placement is pretty important, the holes in the board need to be in just the right position. In the image below you can see the bottom right corner of the module is just where the Kobo case starts to curve. The holes are about in the middle of the right bezel, and the bottom of the module is flush with the bottom of the Kobo.


After marking the hole locations I drill five 1.5mm holes from the front of the case (very carefully). Take care to avoid the plastic bits getting stuck in the Kobo. Five wires are soldered on to the module from the bottom and passed through the holes. If you plan to wire in VBACKUP for the GPS then make sure that wire is long enough to reach the test point near the positive terminal of the Kobo battery.


Simple Case

If you have left the heat shrink on, the module should work just fine if you glue it to the front of the bezel. However, some people wanted a more robust case so I designed a basic one in solidworks which is suitable for 3d printing.



I have uploaded the design to Thingverse where you can download the STL file and use the 3d viewer to visualize the part. I printed this using blue PLA with a 0.35mm nozzle and 0.2mm layer height. The screws are M3 x 6mm countersunk with M3 Hexagon nuts. I place the case on top of the GPS on the bezel to mark the screw holes then drill with a 3mm bit. The hexagon nuts fit neatly in the inner part of the Kobo with a little plastic removal around the USB connector.


The final install is shown below. You can't see that the little piece of neoprene is still on the pressure sensor. It is important and you should not forget it. The case has a few internal parts to hold that neoprene in place.

I think it feels best when the XCSoar display is reverse portrait. The LED's are visible through the case. If you are a 3d printer person you will be a little critical of how well my first layer height is tuned. I will get better for future prints...




Friday, 20 June 2014

Backorders Shipped

For the first time in over eight weeks I have all backorders ready for shipping first thing on Monday morning. It took way too long to wait for components. Since they all arrived on Thursday and Friday I have been working non stop to make about 100 varios and they are all now tested and packaged up. The post will probably take two to three weeks for most European destinations. If you ordered and did not get a shipping notification email please let me know.

TTL_GPS_v9 (rev 2)

After selling out of the first batch quickly I have got a new batch of PCBs for the BlueFlyVario_TTL_GPS_v9. The rev 2 board has a few minor changes:

  • I removed the pcb pads for the switch. 
  • It is now about 1mm less wide. This makes it fit more neatly on the Kobo bezel. 
  • I have exposed the VBACKUP pin of the GPS next to the V+ pin of the TTL connection. If you attach this to a power supply (like the battery in the Kobo) the GPS will get a fix much quicker between power cycles. It consumes very little power. See the PA6H datasheet for more information. 
See below for updated schmatics and pcb layout:



New Sleep Command

The sleep command included in the first v9 firmware ($SLP*) allows the BlueFlyVario to be woken up just by sending a character over the serial port. In rev 2 I added a command $SLX*. This puts the BlueFlyVario fully to sleep, it can then only be waked with a power cycle.  

Kobo Nickel Patch

This is for advanced users. I am sure there is a better way to do it but I am not sure how. To make these changes you can telnet in to your Kobo via Putty and edit files using vi. I posted most of this to the XCSoar dev forum but have yet to commit the changes. Once again, many of these ideas come from my power user friend Steve.

During the ongoing development of the BlueFly vario I have found it might be useful to run some additional commands when switching from the KoboMenu to Nickel. I have used it to send the new sleep command to the connected BlueFly vario so it does not consume power when using Nickel. The sole patch for XCSoar is to include this in /kobo/rcS

# launch user script before nickel start
if [ -f /mnt/onboard/XCSoarData/kobo/init_nickel.sh ]; then
source /mnt/onboard/XCSoarData/kobo/init_nickel.sh
fi

just just prior to the call:

umount -l /mnt/onboard
exec /etc/init.d/rcS


My init_nickel.sh has one command:

sh /mnt/onboad/XCSoarData/kobo/bfvsleep &

This kicks off bfvsleep in the new thread that runs as Nickel is starting up. bfvsleep contains the following commands.

sleep 10
stty ospeed 57600 ispeed 57600 -F /dev/ttymxc0
stty -F /dev/ttymxc0 raw
echo '$SLX*'>/dev/ttymxc0



This kicks off bfvsleep in the new thread that runs as Nickel is starting up. bfvsleep contains the following commands. 

Friday, 23 May 2014

BlueFlyVario_TTL_GPS_v9 Released

The BlueFlyVario_TTL_v8 has proven to be very popular to use with the Kobo. I think that most people who have ordered one want to use it with a GPS, so today I am happy to release the next version with an included GPS and upgraded firmware - the BlueFlyVario_TTL_GPS_v9.

GPS Selection

I chose the Global Top PA6H GPS for a few reasons:
  • It is pretty cheap.
  • It has good performance for low power consumption. 
  • It is small.
  • It has a sleep mode. 
  • Many people have used it (or the Adafruit Ultimate one, which is pretty much the same with slightly tweaked firmware). 
Description

The new device is shown in the image below. From a hardware perspective the only key addition was the GPS and associated LED, resistor and capacitor. 



I initially added a small switch in near the ttl serial to switch the voltage, but discovered that the Tx and Rx lines keep the device powered and sucking power. So I did not include the switch, and instead have added some firmware settings to reduce power. The device includes a neoprene cover over the pressure sensor and the device is encased in heatshrink. Also note that the TTL_GPS_v9 is shipped with the 1x4P 2.54mm header and the 4 pin dupont connector

Kobo Installation

This device is specifically targeted at installing on the Kobo. The directions in my previous blog post are all still applicable. Some users will want to solder wires directly to the device (from the back) then drill 4 x 1mm holes into the Kobo at an appropriate spot, put the wires through, then solder them to the circuit board. Others will want to solder on the 4x1P header and use the dupont connector. Post your installation pictures on the Facebook page

Firmware Updates

The v9 firmware has some important updates to hardware settings and commands:


Settings:
  • uart2BRG - $BR2 xxx* - where xxx is used for altering the baud rate of U2 (the main output). This should really only be used with extreme care, but there are a few cases where it is the only way to communicate with the GPS via the micro. 
  • uartPassthrough - $BPT x* - where x is a boolean used for passing characters received on U2 through the micro to U1. Due to different baud rates (U2 > U1) the characters are stored in a FIFO buffer of length 100. This length allows for normal NMEA commands when the baud rates are different. 
  • uart1Raw - $BUR x* - where x is a boolean used to indicate if characters received at U1 are should passed straight through to U2 or recorded line by line (i.e. $...<LF>) and then multiplexed with pressure output. This is used to allow bulk transfer of information that is sent by GPS other than standard NMEA sentences. 
  • greenLED - $BLD x* - where x is a boolean to indicate if the green LED is lighted for each lift beep.
  • outputMode - I added a new outputMode = 4, which essentially stops the pressure output. 
Commands:
  • $RST* to reset the module, essentially a hot reboot. 
  • $RSX* to reset the module and reset all of the hardware settings to factory defaults, an extended hot reboot equivalent to start up with programming pads 2 and 4 shorted. 
  • $SLP* to send the module to sleep mode. Note it also sends the PA6H GPS to sleep mode using the PMTK standby command. The micro plus pressure sensor consumes about 0.05mA in sleep mode, but the GPS still consumes about 1.5mA. To wake from sleep mode without a power cycle you just send any character to the module on U2. This will then force a hot reboot, and you are back to the power on state, including the GPS. 
I should get around to updating the hardware settings manual and BFVDesktop app for these new settings by the time shipments arrive. 

The TTL_v8 and v8(Bluetooth versions)

I will be shipping future BlueFlyVario_TTL_v8 and BlueFlyVario_v8 (Bluetooth) with the new V9 firmware from today.

However, note that the BlueFlyVario_v8 (Bluetooth) are currently on back order. I am still waiting on components (sorry). I should be able to ship in a few weeks. 

Schematics

The schematic and pcb layout for the new device is shown below. 




Friday, 25 April 2014

BlueFlyVario_TTL integration with the Kobo

Since I released the BlueFlyVario_TTL a few weeks ago many people have purchased one to integrate with the Kobo for use with XCSoar. The purpose of this post is to provide a few tips. It is by no means a complete tutorial for beginners. Integration with the Kobo requires careful soldering and software manipulation shills.

Step 1 - Get your Kobo

The Kobo mini is currently being sold for around $50. I understand they are no longer being produced and most stockists are getting rid of them at cost. Other devices such as the Kobo Touch can be used in a similar manner. At some stage these devices will be hard to find.

Step 2 - Make sure it works as a standard eReader

After purchasing the Kobo you should configure it like a normal eReader as per the instructions that came with it. This is important to do prior to installing XCSoar.

Step 3 - Back up the SD Card

The device has an SD card inside which includes the operating system and applications. Open up the Kobo and put the SD card into a reader. Create an image of it with win32DiskImager or your favourite sd card imaging software. Save the backup image somewhere where you will not loose it. Make sure to turn off the kobo prior to the next step.

Step 4 - Solder wires to the internal serial port

Take off the back covers and identify the serial port in the bottom left of the circuit board. The images below shows a good location for the wires and holes if you want your BlueFlyVario_TTL mounted on the front of the device. I have used a 4 port 2.54mm pitch dupont housing to plug the BlueFlyVario_TTL into. I drilled the holes from the rear and matched each size hole with the diameter of the wires. Note that the Rx from the Kobo needs to match to the Tx from the BlueFlyVario_TTL, and the Tx from the Kobo needs to match to the Rx from the BlueFlyVario TTL.


The holes were drilled from the rear. The solder residue on the serial port is from a previous installation.


The holes look pretty small from the front.

Push the wires through from the front prior to soldering.


Soldering the wires is a little tricky. I started with a dab of solder on each solder hole, tinned the trimmed wire with solder, then angled each one into the hole after reheating it with the iron. Note that the ground is much more difficult to solder as the heat is rapidly drawn away by the larger copper pour on the Kobo PCB.

Step 5 - Install XCSoar

The Kobo XCSoar image and instructions can be found here: http://www.xcsoar.org/download/.  I will not cover how to do this in great detail; there is heaps of information on the XCSoar forums and other internet resources to help you out.

Step 6 - Test the BlueFlyVario_TTL is working

After you have XCSoar working, and the Kobo is on, plug in the TTL to the front of the device. You should here it's startup beep. Next:

  • Double tap on the screen to bring up the Menu.
  • Go Config|Config 1/3|Devices
  • Ensure device A is selected and tap Edit
  • Change the following settings:
    • Port: ttymxc0
    • Baud rate: 57600
    • Driver: BlueFly Vario
    • Ignore checksum: On
  • Click ok, then Monitor to see the incoming data stream. 
Step 7 - Attach a GPS to the BlueFlyVario_TTL U1 port

Incoming GPS data (NMEA sentences) will be streamed via U1 on the BlueFlyVario_TTL and multiplexed with the BlueFlyVario output stream. XCSoar can read the combined stream from the single port. The image below shows a cheap NEO-6M module connected directly to the BlueFlyVario_TTL. The BlueFlyVario expects a 96008N1 serial input from the GPS. Read the section of the BlueFlyVario Hardware Settings Manual for more information about the second serial port. 



Step 8 - Configure the BlueFlyVario_TTL Hardware Settings

This bit was pretty tricky to work out. Thanks to Steve Nagle for his help. In fact, it was pretty much all worked out by him.

The aim is to alter the BlueFlyVario hardware settings directly from the Kobo (linux) command line without having to plug the vario into a windows PC. This is how you do it:
  • Restart the Kobo with XCSoar on it.
  • Press "Network" at bottom of screen. 
  • At top of screen press the button where it says "Wifi ON" (this turns the Wifi on - button then confusingly shows text "Wifi OFF" meaning that pressing it again will have that effect)
  • Press the button "Wifi" to select a Wifi network, connect to your network (The Kobo will display 'connected' next to network name on Wifi page).
  • Once connected press Close button on the wifi page
  • Use a pc and browser to log into your router to find out what network ip address it has allocated to your Kobo (my router is accessed by typing 192.168.1.1 into the browser address box - Google your router brand to find out what it's default internal ip address (and username / password is)
  • On the Kobo press the "Telnet server" button to start telnet on kobo
  • On your PC Telnet to the ip address you found with root as username, no password. In linux use the telnet command at the command prompt, or in windows download a program called Putty and use that. 
  • You should now have a command prompt on your PC. Your PC is now the screen and keyboard for your Kobo, which runs linux. (Type ls and hit return - you should get a directory listing).

Now communicate with the BlueFly over the serial port using commands as follows:
  • stty ospeed 57600 ispeed 57600 -F /dev/ttymxc0  'changes baud settings to match BlueFlyVario.
  • stty -F /dev/ttymxc0 raw  'makes sure the terminal program in linux sends off characters as they arrive.
If you want to see the BlueFly output do this (or skip it if you like)
  • cat /dev/ttymxc0  'test to display the output from BlueFlyVario
(here is a sample of output)
$GPGGA,025704.101,,,,,0,0,,,M,,M,,*4C
PRS 18681
PRS 18680
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
PRS 18680
PRS 18681
PRS 18680

Now press ctrl C to stop that. 

Now we will adjust some settings. These are just examples. See Annex A to the the Hardware Settings Manual for a detailed technical description of the settings. 

Type the following:
  • echo '$BVL 50*'>/dev/ttymxc0  'Sets the volume on the BlueFlyVario to 50.
  • echo '$BOF 10*'>/dev/ttymxc0 'This command changes the output rate to five sentences a second (from the normal 50 (i.e. 50/10)). I think this lessens the CPU workload on the Kobo to handle so many characters over the UART. 
  • echo '$BOM 2*'>/dev/ttymxc0 'This command changes the output format to the LX protocol. Again this lessens the workload on the Kobo as vario value (rather than raw pressure value) is read from the incoming stream. You need to also change the XCSoar driver from 'BlueFly Vario' to 'LX / Colibri' if you change this setting.
  • cat /dev/ttymxc0  'Again to test the display. 
Now press ctrl C to stop that. Type exit to quit. Turn Wifi off and reboot the Kobo. 

More Pictures

Below are some more pictures from Steve's install.






Next Steps

Installing the BlueFlyVario_TTL on the Kobo with XCSoar has proven pretty popular. I am working on another version of the BlueFlyVario_TTL which includes a GPS onboard so there is no need to do that step. I am thinking the PA6H will be a good fit. The board could end up looking like this:


Note the switch so you can continue to use it as a eReader without draining power. Before I get this working I need to add a new setting in the firmware which allows configuration of the GPS when it is attached. More work to do...


Saturday, 5 April 2014

BlueFlyVario_TTL version 8 released

I have spent many months working on the BlueFlyVario_TTL. This post announces a limited release. Anyone can purchase one, but it is ‘limited’ because you will need some electronics skill to make it work the way you want. I will release another version of this in the next few months with extra components, but I am still not sure what is the best configuration.

I made a deliberate decision to produce a simpler version of the BlueFlyVario, rather than pursue the standard approach taken by many developers to make something more complex. This is a lot harder than it sounds.

I initially decided to pursue something like the TTL in an effort to produce an audio only vario module with the same awesome audio which the standard BlueFlyVario provides. Wide interest in modifying the Kobo eReader pushed me towards exposing a TTL serial interface, but with only one port available on the simple eReaders I had to multiplex GPS information using the second serial port on the micro controller. Development of this lead to the change in the BlueFlyVario version 8 which I released in the previous blog post.

Description

Compared to the standard BlueFlyVario with Bluetooth, the baseline BlueFlyVario_TTL is simply just a populated PCB which is programmed with the BlueFlyVario firmware. There is no Bluetooth module, battery or case. The key specifications are summarized in the image below:

  • 1: Second serial interface. A serial port of the PIC microcontroller (UART1) is exposed with V+, Rx, Tx and GND (3.3v). By default it is configured at 9600 Baud to accept NMEA sentences from widely available GPS modules. Sentences starting with $ and ending with /n (carriage return character) are stored then immediately multiplexed with the information being sent out the primary TTL Interface. XCSoar is smart enough to interpret the multiplexed stream via a single device.
  • 2: Pressure sensor. The MS5611 pressure sensor is a super accurate little temperature compensated module with a digital interface. The surrounding components filter the power supply. When shipped this component is covered with neoprene to avoid light sensitivity (but do not press on it when active to avoid touch sensitivity). 
  • 3: Microcontroller. The PIC24F16KA301 is running at 8MHz. This is fast enough to provide advanced Kalman filtering of the pressure measurements (which is reads from the pressure sensor at 50 times a second). At this speed the micro controller can also handle reading and sending data over the two serial ports. 
  • 4: Speaker interface. Super keen experimental users might want to integrate the audio signal into a headset. 
  • 5: Solder jumper. If you want to disable the integrated transducer clear this solder jumper.
  • 6: Status LED. This lights up with every beep. 
  • 7: TTL Interface. The primary interface (which is actually UART 2 on the microcontroller) is used to provide power to the device and send and receive data via Tx and Rx (at 57600 kps). See the hardware settings manual for detailed information about the interface.
  • 8: Programming Pads. I program the firmware using a PICKIT 3 and this pads. Short pads 2 and 4 when turning on to reset the hardware settings (see the Hardware Settings Manual). 
  • 9: Voltage Regulator.  A Microchip TC1015 LDO voltage regulator outputs 3.0V to run the micro controller and pressure sensor. It works with input power between 3.3V and 6V. Below about 3.2 V it fails to provide a stable voltage to the pressure sensor. Standard 3.3V in from other low voltage TTL devices (such as the Kobo) work well. 
  • 10: Audio. An integrated small electromagnetic transducer provides the kind of pleasant sounding vario that is normally reserved for bigger devices. 

Use

To make the TTL work you will need to do the following:

  • Provide power. I have deliberately not included a battery and switch. There are so many options and everyone has a slightly different need. You might choose to power it with a 1S LiPo, 3 x AAA alkaline batteries, power from USB, or power it from a Kobo. Whatever you choose you need to do ensure you meet the following specs.
    • Voltage: The TTL needs between 3.3V and 6V at the V+ pin on the main TTL interface end (do not provide power to the other end).
    • Current: The device consumes 10mA when not making noise, and around 50-60mA when sounding. Assuming a duty cycle of silence:noise of about 4:1 the average current consumption is about 20mA.
  • Provide a programming interface. A USB to Serial connector provides the ideal programming interface. This is used to configure the hardware settings if you want to change the defaults. You can get cheap USB to TTL serial converters on ebay, at hobby king or electronics shops like Sparkfun. I am considering including one in future releases of the TTL. 
  • Provide a data interface for external applications. If you want the vario data to be sent to an external application you can use the aforementioned USB to Serial convertor (for devices that support such a converter). Other devices (such as the Kobo) can be wired directly to the Tx and Rx pins. 


I envisage that the TTL can be used in many ways once it has been configured via the programming interface. Some examples:

  • Audio only mode. In this mode you only need to provide power and it will work. Something like a 3 x AAA case with integrated switch should meet the needs of most people. I am considering including one of these in future releases with the baseline configuration.
  • Integrated Helmet vario. The board is small enough to be integrated into a helmet. In this configuration a small RC 1s LiPo of around 600mA provides heaps of juice. A switch in series allows it to be turned on and off in flight. 
  • Integration via USB to a Linux device. Some users in sailplanes might want to integrate the vario directly into a Linux device via a USB to serial interface. I understand a few people are going to try to encase the vario and connect it to the TE probe. I am keen to get feedback. 
  • Integration with a Kobo. The picture below shows how I have integrated it with the Kobo on my workbench. In this configuration the Kobo is providing power to both the BlueFlyVario_TTL and the attached GPS module. This type of GPS module, based on the NEO-6M chip, is widely available and the default settings should work for most users. 



Schematics

The images below show the schematic and PCB layout for the BlueFlyVario_TTL version 8 prototype.