Nano FPV Race Course in a Box

Introduction

During the winter my local RC club has an indoor session once a month a bowls hall.  This is crown bowls, rather than 10-pin.  Small quadcopters are popular at these meetings and post Christmas, there are now three Blade Nano QX FPV quads.  Now obviously whenever you have two or more FPV quads in one place there will be a desire for racing or at least some close proximity flying.  So an idea was born for a nano size FPV course, that would fold up small for easy transportation.  Additionally, it had to be cheap, preferably using materials I already had.

While the final package is a little bigger than I had originally hoped, it was cheap, quick to erect and still easily transportable in an 1/8 scale car carry bag.

Components

I found some 12mm pine shelf and some orange ripstop nylon.  To this I added a pair of telescopic magnetic pickups for about £2 each.  These extend from 133mm to 645mm and are rated to lift 3.5kg.  The board was cut into trapezoids to maximize its use and a 10mm hole drilled near the back edge to accept the pickup, once I had removed the pen clip.  Some velco was added to the front edge and I got a sleeve cut out and sewn up, to form a mini corner pennant.

I had though to string a ribbon between two pennants to form a gate, but by the time the ribbon was deep enough to be clearly visible through a nano FPV camera, combined with it’s droop, there was only a small gap to fly under.

I found some bigger telescopic pickups at CPC Farnell that extend from 165 to 838mm.  The original base was not thick enough for the bigger pickup as it was 16mm diameter with a domed end.  I had some 1¾” x 5/8″ (45mm x 16mm) timber which I used to extend the mounting hole, however, I felt the base was not wide enough for stability.  I had plenty of the 1¾” x 5/8″ so I cut it into two 8″ (200mm) lengths and a 1¾” (45mm) square.  These were glued and nailed together and drilled through until the point just started to show.

Three generations of base.

Three generations of base.

Size comparison.

Size comparison.

Transportation size.

Transportation size.

As you can see these pennants fold down really small.  I couldn’t find a good solution to make the new bigger pennants into a gate, but one of the solutions I did considered was to use foam board as a beam between the pickups and this gave me an idea.

I had a stock of 5mm foam board that was too heavy for making into aircraft, but which was idea for FPV gates.  It was A1 size (840 x 597mm) which produced a nice size gate.  They are a lot bigger for transportation, but still very light.  I used red and yellow parcel tape to  make them highly visible.

For a start/finish gate I printed some A3 chequered pattern sheets that I glued onto the foam board and then covered with clear packing tape.

The foam board was cut to the sizes shown below which can be adjusted to suit your available foam board and timber.  The 50% score cuts were folded back to form a hinge which was reinforced with clear tape on both sides.  Small 20mm x 80mm rectangles of foam where added to give a bigger mounting point for the cross members.  These were covered with tape and then more tape was used to fix them in place.

Bases for these gates where made from the same 1¾” x 5/8″ (45mm x 16mm) timber.  One 10″ (250mm) length and three 1¾” (45mm) blocks.  The 20mm dimension on the foam board can be adjusted to suit your timber thickness.  It can be a little bigger than your timber but not smaller.   Once it’s assembled give it a good sanding to smooth off the edges.

Base

Foam board column base

Start/Finish Gate
IMG_20150209_224111 IMG_20150209_225814

High Gate
IMG_20150209_223326 IMG_20150209_222755 IMG_20150209_223010 IMG_20150209_223056

Low Gate
IMG_20150209_224426 IMG_20150209_225040

The Plans

TallGate HighGateFill LowGate

Analogue FPV First Flight

I set up a small quad with a contemporary FPV system.  In this case an 25mW ImmersionRC video transmitter using my GoPro 3 Black as the camera.  I had wanted to compare the latency of this system against that of the Raspberry Pi.  The problem is that I can’t use the GoPro to measure the latency of itself.  I need to see if I can borrow another one.  For now it was just nice to get out and fly.

The quad is a Quadrixette 30 from http://www.eyefly.info.  It’s quite an old design now, but I like it because it is small (300mm), but still bale to carry some weight.  The flight controller is a OpenPilot CC3D and I’m using a Spektrum AR8000 receiver with telemetry module to report the flight battery voltage.

IMG_20150223_230817 IMG_20150223_230827

One of my club mates was also at the field with his Tricopter so we had some proximity flying.

Comparison of 2.4 GHz WiFi, 5 GHz WiFi and 100 MBit LAN

Extract

Up to now I have been using an Edimax EW-7812UAn V2 USB WiFi Dongle.  This has been very reliable and reasonably simple to install and configure.  The only problem is that it operates on the 2.4 GHz frequency band, which means it will interfere with the majority of modern radio control systems.  Up to now I have been using a 35 MHz RC system which was fine as long as I was flying on my own.  However, I’d like to fly with others who will be using 2.4 GHz systems.

There are now a number of Dual Band Wifi Dongles that operate in the 5 GHz band as well as at 2.4 GHz. This provides a solution so long as they work with the Raspberry Pi.  A couple of candidates were obtained, configured and tested on my Model B Raspberry Pi.  For an extra comparison I also ran a test over the wired LAN interface.

The results were interesting in that there was no clear winner in the speed stakes, there was however a clear loser.  What is clear is that useable 5 Ghz WiFi is possible but for now it’s not plug and play.

Setup

For these tests I used the following network devices.

  1. Raspberry Pi Model B Ethernet (100 Mbit/s)
  2. Tenga W522U Dual Band (2.4 GHz & 5 GHz)
  3. Edimax EW-7612UAn V2 (2.4 GHz)
  4. Edimax AC600 Dual Band (2.4 GHz & 5 GHz)

I setup my Model B, with the latest release of Raspbian (2015-01-31) and the current scripts.

5 GHz WiFi Prerequisites

To get 5GHz WiFi working you need to install the Central Regulatory Domain Agent (crda).  Basically, the 5 GHz band is more tightly regulated worldwide and you need to specify your regulatory domain so that hostapd knows which channels are available.

To install the necessary packages use:

sudo apt-get install hostapd crda iw

Then edit /etc/default/crda and set the REGDOMAIN variable to match your region.  Examples are US, JP, EU and in my case UK.

crda

Devices

The amount of work needed to setup networking varied by device.  I’m not going to give a detailed description of configuring each device.  I’ll do that in separate posts.

1. LAN

This simply required plugging the Pi and the Laptop into a switch and running ipconfig on the receiving device to get its IP address.  This was then used in remote.conf to direct the UDP stream.

2. Tenga W522U

The W522U is nl80211 compatible.  This means it works with a standard install of hostapd.  No special configuration is needed.

3. Edimax EW-7612UAn V2 (2.4 GHz)

The EW-7612UAn V2 uses the RTL8191SU chipset.  The kernel supports this chipset for client networking, but not for AP mode.  However, Realtek provide a custom version of hostapd that needs to be downloaded, compiled and installed which does work.

4. Edimax AC600 Dual Band (2.4 GHz & 5 GHz)

The AC600 is not supported by the latest kernel.  All is not lost, it just takes a little more work.  You need to download the kernel source code and the code for a Realtek 8812U driver.  Then you need to install the latest version of GCC from the Jessie repository.  This lets you build the kernel module.  Finally you need the same hostapd build as for the Edimax EW-7612UAn V2 device.

Hostapd Configuration

There are four combinations of hostapd.conf depending on the driver and band.  I’ve set them out in the table below.

Hostapd Version 2.4 GHz 5 GHz
nl80211
interface=wlan0
driver=nl80211
ssid=Pi_AP

hw_mode=g
channel=13
macaddr_acl=0 
auth_algs=1 
ignore_broadcast_ssid=0 
wpa=2 
wpa_passphrase=Raspberry 
wpa_key_mgmt=WPA-PSK 
wpa_pairwise=TKIP 
rsn_pairwise=CCMP
interface=wlan0
driver=nl80211
ssid=Pi_AP

hw_mode=a
channel=44
ht_capab=[HT40+]
ieee80211n=1
macaddr_acl=0 
auth_algs=1 
ignore_broadcast_ssid=0 
wpa=2 
wpa_passphrase=Raspberry 
wpa_key_mgmt=WPA-PSK 
wpa_pairwise=TKIP 
rsn_pairwise=CCMP
Realtek
interface=wlan0 
driver=rtl871xdrv
ctrl_interface=/var/run/hostapd

ssid=Pi_AP
channel=13

beacon_int=100
hw_mode=g
ieee80211n=1
wme_enabled=1
wpa=2
wpa_passphrase=Raspberry
wpa_key_mgmt=WPA-PSK 
wpa_pairwise=CCMP 
max_num_sta=8 
wpa_group_rekey=86400
interface=wlan0
driver=rtl871xdrv 
ctrl_interface=/var/run/hostapd
ssid=Pi_AP
channel=44
beacon_int=100 
hw_mode=a 
ieee80211n=1 
wme_enabled=1 
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa=2
wpa_passphrase=Raspberry

wpa_key_mgmt=WPA-PSK 
wpa_pairwise=CCMP 
max_num_sta=8 
wpa_group_rekey=86400

Procedure

These tests were a straight comparison between the four devices using the same settings and the same testing methodology as previously.  The resolution was 1280 x 720 pixels with a 6Mbps bit rate.

Results

The table below shows the resulting latency by device.

Device Latency
Edimax EW-7612UAn V2 – 2.4 Ghz 132 ms
Tenga W522U – 2.4 GHz & 5 GHz > 10 s
Edimax AC600 – 2.4 GHz 122 ms
Edimax AC600 – 5 GHz 126 ms
LAN 124 ms

Here they are as a graph.

WiFiAdapters

Analysis

The big surprise is how bad the Tenga W522U adapter was.  The latency was not just two or three times higher, it was two order of magnitudes higher.  There are a number of threads on various forums where other people have found similar issues, although not to this extent, but then they are probably not swamping the feed with a continuous video stream.  Whether this is just a compatibility issue with the Pi remains to be seen.

The Edimax AC600 was 10 ms faster than the previously used Edimax 7612UAn V2 at 2.4 GHz.  At 5GHz it was still faster, but only by 6ms.  Interestingly, the LAN connection was not any faster than the AC600.  On the Pi the LAN connection is 100 MBit/s as is the USB bus, so although the AC600 is theoretically capable of 433 Mbit/s it is never going to manage more than 100.

Conclusion

What we can take away from this test is that there is a limit to how much the latency can be reduced by changing the WiFi adapter.  It is a shame that to get a 5 GHz WiFi link requires a lot of compiling and configuration.  Hopefully this will improve with time.  For now we have another small reduction in the video latency to add to the current optimisations.

Adendum

Just as these tests were being done, the new Raspberry Pi 2 was released promising a x1.5 to x6 speed increase.  As I had used the latest release of Raspbian, I swapped the microSD card from from the Model B to the Model 2B.  What I found was that the Edimax AC600 was no longer detected and I couldn’t find a way to compile the module so that it would.  So that’s my next task.  I may run a quick comparison of the B versus the 2B with the Edimax 7612UAn V2 to see how much improvement the new processor has made.