Thursday, 3 September 2015

Raspberry Pi soars to new heights with Skycademy

This is Lego Space Marine Bob.

Bob

He may look like just another lego Minifig. You may even have one that looks just like him.

But Bob is rather special. He flew up to 28km above the Earth and made it back...

View from the onboard Pi camera from the Cirrus flight


...in a styrofoam box with a Raspberry Pi.

This is the payload we sent to 28km

Although I've been back a week now, it has taken a while for just how awesome Skycademy was to sink in. 

As soon as I saw it advertised, I literally dropped everything I was doing and typed up my application straight away. Launching a high altitude weather balloon with a Raspberry Pi payload and then chasing it when it returns from the stratosphere... that sounded like something I had to do. I was over the moon when I found out I'd managed to get a place and so a week ago last Sunday I headed up to Cambridge full of excitement and with a carefully selected Lego mini-figure (Bob) hoping to take a ride high above the Earth.

Day One.

First of all, let's be clear. Sending stuff up to the stratosphere is actually quite easy. Attach whatever you want to launch to a weather balloon filled with helium, let it go and... well that's it. Done.

Getting it back, that's a little harder. And that's where the Raspberry Pi comes in. So before we launched our own balloons, we got to learn about predicting and tracking trajectory from veteran of over 50 launches (and all-round HAB guru), Dave Akerman.

Dave Akerman telling us all about GPS

The tech to monitor the progress of your flight is deviously clever, but here's the simple version. The payload contains a Raspberry Pi with some additional hardware that lets it work out where it is (a GPS module) and transmit those coordinates back to Earth via radio. 

PITS+ board 

Of course, being able to see that your balloon's payload has ended up in the sea is very informative but ultimately doesn't make recovery any easier. The best plan is to work out when to launch the ballon so that the weather conditions (mainly wind) keep your flight and descent over accessible land. You can also tweak things  (the amount of gas with which you fill the balloon, the weight of the payload) to optimise the chances of recovery and there are some super-useful online tools to do the calculations for you.

We also covered the all-important permissions from the CAA that you need to obtain before making a flight. Being able to ask stupid questions about this whole process was invaluable and will probably save me hours of hassle and research.

I'd read about a lot of High Altitude Ballooning before coming on Skycademy but hearing about it from people who'd actually done it had the effect I'd been hoping for and really joined everything up in my head - and made it feel like an achievable goal. My own kite-mapping experiments have really been a poor man's version of HAB because I wasn't brave enough to attempt a balloon launch on my own!

Pi A+ plus LPRA board plus camera

Don't think that Skycademy was just sitting around listening to other people. Day one was full of hands-on activities; we split into 4 teams and constructed our payload containers; ensured the Raspberry Pi cameras had a clear view; assembled, configured and tested both our primary RTTY radio system and the backup LORA equipment and finally (and most importantly), decorated the container. Ours was quickly named the 'Dragon Toaster'.

Dragon Toaster

A lot of the hardware and software is still in active development so there was lots of tinkering and optimisation which was brilliant fun and really helped with understanding how everything fits and works together.

It's worth mentioning the weather at this stage. In the week before Skycademy we'd all been studying the forecast and hoping for good, calm weather to allow us to launch our balloons. The predictions just before the weekend were not at all promising, with strong wind, rain and lots of cloud promised for Tuesday. At one point it looked almost certain that even if we could safely get the balloons aloft, they'd end up in the ocean. 

However, as the new week began, the forecast became less gloomy and by the end of Monday (which was a very unsettled day), we all left Pi Towers feeling cautiously optimistic that we'd at least attempt some launches early the next morning. 

The uncertainty of the weather was itself a good learning point. the big thing I took away was that while you might like to make a definite plan to launch on a certain day, you really shouldn't bank on it. 

Day Two

The forecast was for strengthening winds all day, with rain arriving mid-afternoon. So we had an early start (08:00 at Pi Towers) and then headed straight off to the launch site just west of Cambridge. As our merry convoy of vehicles scooted along the concrete track through the fields to our final location, we certainly drew some curious looks from the local dog-walkers.

Arriving at the launch site

The sun broke through the clouds and as we started unpacking our kits the temperature rose rapidly. Although it was quite gusty already, there was a line of tall trees which provided some good ground level shelter. Local knowledge of the launch site is clearly very useful. 

As the teams carried out final assembly and testing, there was much to-ing and fro-ing back and forth to the cars. Like all reasonably complex tasks, there is definitely an optimal order in which to carry out the various component tasks. Having experienced HAB launchers present was a huge advantage and while many of pro-tips I picked up may seem obvious now, they only appear that way once you've spotted them. 

It was also clear that working as a team of 6 was a big help. There were many instances where having a whole bunch of people who knew what they were doing meant that problems could be easily and swiftly corrected (like when we attached the payload to the parachute using the wrong ratio of line lengths). If these issues cropped up while you were attempting a solo launch and potentially demonstrating to, and looking after a group of children, it would be very easy to get flustered and make mistakes. 

Finally everything was ready and Dave kicked things off with inflating his own hydrogen balloon and launching it. As it quickly sailed into the blue sky I was struck by how graceful and elegant the launch seemed. It was odd to think that this relatively leisurely ascent would continue until the balloon burst at in excess of 30km altitude. 

Dave's balloon

Next it was our turn.   Filling the balloon with helium was actually very easy, although sealing off the neck with cable-ties and ensuring there were no sharp edges took a steady hand.

Windier than it looks

Both teams Cirrus and Nimbus were ready at the same time so decided to launch simultaneously. 

Simultaneous launch

This almost turned into a disaster as despite being released several metres apart, the two balloons' paths converged and their payload lines nearly tangled around each other. Fortunately Nimbus gained altitude more rapidly and they had soon separated.

Watch out!

For a few minutes we stood around watching them disappear into the sky. Then we realised that we needed to get chasing and quickly packed up our gear and headed to the cars.  Two of our team were heading back to Pi Towers to monitor things from there while the remaining four of us went off in the car towards Norwich. 

We immediately found that both the RTTY and LORA receivers were working and our balloon was reporting back its coordinates and other telemetry. I know we'd tested everything and discussed the technology in lots of detail the day before, but actually experiencing it working was very satisfying. The idea that we were tracking a balloon from a moving vehicle using Raspberry Pis as the core platform was amazing.

One thing we noticed straight away was that our ascent rate was lower than we'd intended. For the burst predictor calculations we'd been using a figure of 5m/s. Our balloon was only making 3.5m/s. When we plugged those numbers into the flight predictor, our final landing point was a couple of kilometres off the coast. Not good. 

There was nothing we could do at this point, and it wasn't our only concern. Unlike all the other teams, our balloon was not showing up on the live tracking map. This didn't make any sense as we could clearly see the data in the car, and the first images from the Pi camera were starting to appear on the other HubHub sub-site. Our team-mates back at Pi Towers confirmed that there was a problem and started to investigate. 

But where is team Cirrus?

Meanwhile, our balloon had started to climb more rapidly and our ascent rate was getting close to 5m/s at times.  It was still nerve-wracking - would the initial slow speed have already put an onshore landing out of the question?  The results from the predictor were very close.

Not looking good

However, looking at our actual flight path it seemed that the Cirrus balloon was travelling further south than the predicted one, so we gave up trying to refine the estimated landing point and just kept a close eye on the altitude. 

As we approached the outskirts of Norwich it looked like the ballon was not going to make it North of the city so we headed South towards Gillingham instead. This turned out to be a good call. 
Image from the onboard camera just before burst

At half past 12, the balloon reached 28000m... and burst. Cirrus' Dragon Toaster was heading back to Earth. But would it descend quickly enough to avoid a watery grave?  After the burst, we could see from the telemetry that the balloon was spiralling around as it plummeted rapidly. This was good! The less time it spent heading east, the better.  We'd pretty much caught up with the balloon by now and so decided to stop and enjoy a picnic at a nice scenic location while we waited to see where it would end up. 

Picnic

The packed lunch pudding was (of course) a Raspberry Pi. Yummy.

A Raspberry Pie

Despite the pleasant surroundings and tasty grub, we didn't hang around for long, because the balloon was descending quickly. We were heartened to see that although it was definitely heading east again, it seemed to occasionally pick up an onshore breeze and head west for short bursts. It passed almost directly over head (although we couldn't see it) and so we got back in the car to continue the chase. Not long after that, we lost the signal. The transmitters on the payload are very low power (mW) so our receivers will only get a decent signal when there is nothing in the way. Once the Pi is on the ground, the range is severely reduced.  We decided to head for the last reported coordinates, which were a sent when the balloon was a few tens of metres up.

Coordinates of last position before we lost contact

As we approached the area, the receiver started picking up packets again and we were able to get an updated location - the payload must have landed with the GPS antenna still able to see the sky. It looked like it had landed close to that final airborne transmission, but on the other side of the water. Phew. We pulled up in a lay-by (after asking some puzzled blackberry pickers if they'd seen a parachute) and headed into the field. We ran around like headless chickens for a few minuets before I realised I still had 3G signal on my tablet. I typed the precise coordinates now reported by the balloon into Google maps and we were able to go directly to the landing site.

Actual landing site

There it was. Mission success!

As it landed

Dragon Toaster recovered!

Hurrah

We realised that our balloon had had a very fortunate landing. We were so close to a row of  trees and a  number of watery areas and roads. Not to mention, on a larger scale, the sea!

Close to the sea

Elated, we packed things up and started the journey back to Pi Towers. Dave had warned us that the balloons were very smelly - like a condom factory - so we sealed that up in a plastic bag.

We waited until we were back together as a full team before cracking the payload container and recovering Bob. This meant we continued to transmit pictures from the boot  all the way back (and caused interference with the car's alarm).

Once back at Pi Towers we discovered why our balloon was not being displayed on the tracker page - a single character typo meant that its call-sign did not match the expected string and so packets were not being registered even though we were seeing them in the car. Oh well, something to remember to double-check for next time.

It was an incredibly successful day. Of the 5 Skycademy balloons launched, 4 were recovered. Unfortunately one seemed to have been under-filled with helium and never attained sufficient velocity to enable it reach burst altitude in time to descend before the land ran out.

All at sea

After some initial assessment of the recovered images taken by the payload cameras, we all retired to a local hostelry for some well-earned refreshments and sustenance. 

Day Three

This was all about reflection and planning for future flights. The prime objective of Skycademy is to build a network of HAB launchers working with children across the country. 

It's easy to see how HAB is a great activity for engaging kids in STEM subjects. There is a whole bunch of science involved that can easily be tailored to the age of the pupil; the physics of gases and pressure;  aerodynamics; radio wave propagation and antenna design; plus a whole load of mathematics around flight prediction. To get the whole school involved there are also plenty of non-STEM activities that can really engage the entire community through imagining and describing the flight through art and writing. 

Skycademy attendees work with a range of different age groups from Primary to 6th form and nobody had problems coming up with ideas of how to integrate launching a balloon into their relevant areas of curriculum.  

The Raspberry Pi Foundation has been incredibly generous and everyone who attended Skycademy has access to almost everything we'll need to launch at least one balloon in the next 12 months. Plus we all have the equipment to create a permanent tracking station so that we'll be able to monitor other HAB flights too.

Great views from up here

Of course organising your own flight sounds easy and possible when you're surrounded by supportive and like-minded enthusiasts at Pi Towers. How will that enthusiasm survive when we're all immersed back in our day jobs and all the challenges of a new term? The biggest obstacles I see are finding a suitable launch location (those of us the South East have a lot of airports to dodge) and the logistical difficulties of planning an event that is so weather dependent. School fairs and football matches can still go ahead if its wet and windy. HAB flights generally cannot!  

Personally I'm confident that we will be able to maintain the momentum. In our final team presentations at the end of Skcademy, everyone appeared to have a good idea about how they'd take things forward. Those of us attending this year's PyCon already have a plan for a couple of launches there. 

Summary 

There is only one word for Skycademy: AwEsOmE. I can honestly say it was one of the most memorable experiences of my life. If I can have so much fun while learning so much, it seems like a no-brainer than any kids who get involved with HAB will be just as engaged and excited!

No comments:

Post a Comment