Where’s Bunga? Tracking Orangutans with Drones and Gnu-Radio (v2.0)

TL;DR

I has taken 8 months to complete this writeup, but better late than never. It’s been a mixture of life and things going (too) well at Oxbotica.

Anyway, the TL;DR is that this is a summary of my trip to Borneo in May this year with v2.0 of my drone based orangutan tracking system, developed in partnership with International Animal Rescue (IAR). The story of v1.0 and why one would uberhaupt need to track orangutan’s in the jungle, and why using a drone is useful can be found in this post.

As an interesting aside, the v1.0 system got lost in a tree somewhere last time. But a few months after my return somebody randomly stumbled across the drone bits in the jungle (see top right picture in the collage below).

The Prep

Compared to my last visit, the v2.0 system was a lot better integrated. There was a dedicated payload box, cleaner wiring and a much larger and more capable drone (very kindly provided at reduced cost by Alex @ Vulcan UAV) with a Pixhawk2/APM fight controller. On the radio side I was still using a square loop but switched to an airspy mini & pre-amp combo instead of the RTL-SDR I was using originally.

The signal processing logic was completely re-written using GnuRadio (with helpful guidance from the community) and now featured three approaches for deciding if an implant pulse was detected or not: peak detection in the power spectrum, cross correlation with the known template in the time domain, and using a phase locked loop (PLL).

The gnu-radio code was wrapped in python and a set of heuristics was used to filter the output of each of the approaches and generate a series of plots to report back to the user. This was done through a react.js web application (which also was largely rewritten) served through Flask and the drone’s own wifi hotspot. All of this running on an x86 UDoo board instead of the Odroid UX4 I had used previously.

drone-collage

The amount of effort that went into this over evenings and weekends is hard to overstate. Countless hours of testing, coding, debugging, and above all, cursing when something would behave erratically, break, or when the drone would flyaway & plough itself into the mud, or the ground station laptop would die halfway through a flight because of the cold.

pixlog

There were some demotivating moments when I found myself, 10mins into the test, trudging back to the car with a collection of broken bits after spending all night painstakingly mounting and testing everything.

20180516_171905However, in the end the work came together and I learned many new things. After almost 2 years, 3 drones, and countless payload iterations I had a system that seemed to do what it needed to. I reached the detection range I was aiming for, packed everything into 60kg worth of luggage and set off for Borneo.

On Site

20180521_172804Arrived at the IAR site in Ketapang, quickly unpacked and assembled the drone with the aim of doing a quick test to ensure all was ok. Both flights crashed within 30 seconds due to a mixture of invalid parameters and pilot error. The second crash was the more painful one and needless to say I failed to impress the two locals I was set to train. So as night fell, surrounded by mosquitos, dripping with sweat due to the heat, I found myself cutting and replacing carbon spars, props, and wires, to get everything running again properly.

Woke up early the next day with a fresh head, prepared the batteries (don’t even ask about trying to get hold of high capacity 6S lipo’s in Borneo) and started a series of more organised tests. No accidents this time luckily and by the afternoon I reached the point where we could try finding an animal (Bunga) that was on the pre-release island nearby. Triple checked everything, set the flight path, flicked to auto mode and watched the drone fly away.

Hopped onto a scooter with the aim of following it. Unfortunately we lost track of the drone and after some driving around failed to see it anywhere. My heart sank as we drove back to the launch site, fearing I’d lost the drone, 1 day into the trip. We returned to base and to my surprise, found the drone sitting exactly on its launch spot. On only three legs. Turned out it had completed its mission normally but one of the undercarriage legs had come loose in flight. However, it auto-landed just fine. Phew.

Quickly checked the data and I could not have wished for a clearer detection. A very clear series of signals were detected from Bunga in a localised area. Radioing with the keeper confirmed the estimated location was indeed correct.

Feeling I’d pushed my luck enough for the day and in the spirit of quitting while ahead I packed up everything and we set off to the release site in Bukit Baka the next day. This involved 2 domestic flights on successively smaller aircraft, 2 long 4×4 drives, a 2 hour boat ride, and a 4 hour trek through the jungle. Needless to say I felt privileged to be able to venture this far into the forest. Though there was the worry in the back of my mind that something would go wrong early on and this cumbersome logistical exercise would have been in vain.

Arrived at the camp, unpacked, and synched up with the local staff. Turned out we were lucky and there were a couple of animals close by. One was chosen for the first flight. I set to work to assemble everything and noticed to my horror that Id brought the wrong antenna by mistake. I had two loops, one of which turned out to be noisier than the other, and of course I’d left the good one at base camp and taken the more noisier one into the jungle. Bugger. Going back was out of the question so I flew with what I had, taking great care to get the flight plan and altitude correct, given what happened to the v1.0 system 2 years earlier.

The drone took off and landed ~15min later in one piece. Inspected the data and while the noise induced by the poor antenna was obvious there were some definite detections from the animal in question. A second flight confirmed this. Feeling relieved, testing continued over the next couple days across different areas, for different animals with known locations.

The results were generally good. If the animal was present it was always detected, albeit hard to pick out due to the noisy antenna and confounded by odly behaving implants. Some implants seemed to transmit much longer and stronger than the 10ms pulse they should be transmitting. The pulse would also be mirrored in the spectrum at times and together this would break my heuristics, making the downstream data harder to interpret.

weird-pulse

Unfortunately there was not enough time to investigate this properly but it could be a clue for why some implants seem to fail prematurely.

No crashes or big failures throughout the rest of the week, all flights went smoothly. Some headaches though, the main one being that charging 20,000 maH worth of batteries from a single solar panel in a cloud forest was a right pain, taking more than a day. This severely limited testing and meant we had to be very efficient in our flights. While the camp had a generator its power output was not to be trusted, swinging happily from 100V to 300V. In all it meant that we couldn’t do systematic tests to properly assess detection ranges, heights, speeds, signal noise, etc. While waiting for the batteries to charge we’d pass the time going through training, chatting, or watching the rain.

The other annoyance was that the LW20 range finder was only useful to 40m and didn’t seem to work properly above the canopy. So any real time terrain following was out of the question and we had to rely on offline SRTM data (thank you QGroundControl) and a very conservative relative altitude of 100-110m (reducing detection performance). Similarly, the long range telemetry modules I was using also proved hopeless beyond ~1km, so most of the flight was conducted blind. Less problematic but still annoying was the fickleness of the wifi hotspot, which only decided to turn on (for some unknown reason) about 40% of the time. Luckily I had counted on this and ensured an ethernet backup.

Headaches aside, overall things went well I think and there was nothing that outright worried or concerned me. Definitely a major step forward since v1.0. Yes the antenna was noisy and interpretation of the results needs to be made more intuitive, but the needle was definitely in the haystack. Similarly, while the overall system was a lot better integrated than the previous one it could still use some polish and a slicker payload integration. I got to the point where two (skilled) IAR staff were able to plan and fly a mission independently. This was non trivial to do correctly given the uncertainty in the terrain and canopy. So a great achievement, but the training would not suffice if something went wrong or something non trivial would break. Even setting aside breakages, there is still a way to go to get it to the state where a couple of the local “boys” would be able to operate the system safely. Not impossible but requires another dedicated effort.

20180527_084812

Which brings me to the last section.

The Future

implantThe purpose of the drone is to detect orangutans with an implant so they can be located when lost. However, for the drone to have any purpose you need a reliable source of reliable implants. This is however not the case unfortunately. The original implants are expensive, unreliable, and have been shown to break & leak once inside the animal. Not good.

Hence, as a parallel thread over the past two years I engaged with a friendly RF engineering company who, long story short, have designed and manufactured a new implant. The new implant is functionally similar to the original one but to a more professional standard and safer once implanted. The first batch is undergoing testing as I type this. If all goes well, all orangutan rescue centres will now have a reliable and sustainable source of implants, and associated product roadmap.

With the implant situation stable this then allows focus to shift back to the drone and the road to v3.0.

Thanks

While this project has taken a lot of blood, sweat, and tears of the past few years it would not have been possible for the support of many different people and organisations.

First and foremost an absolutely massive thank you to IAR for their support and (above all) patience in this project. Both Alan, Gavin and the team in the UK as well as Karmele, Heri, Muhadi, and the rest of the team in Indonesia. Even after the many interactions I have had with IAR, I continue to be absolutely humbled by the passion, commitment, grit, and openness the IAR staff show every day in their endeavour to make the world a better place and preserve a wonderful species and its unique habitat. You can support them by donating here. Thank you putting up with me.

Secondly, thank you to my employer, Oxbotica, for allowing me to take time off work to trek through the Jungle at such a busy time in the company.

On the technical side, big thank you to Alex and Vulcan UAV for providing a discounted drone and general drone related support. It would not have been possible without you. Thank you to Badland for support on antennas, ASH for support on RF things, Marc Gunderson for design work, brainstorming, and generally being a wonderful friend, Joonas Melin for CAD work and helpful discussions, Donald Gagne for the wonderful tool that is QGroundControl and the useful insights, Alan Walls and the GnuRadio community for support on the signal processing side, and the rest of the open source community for being there and developing the amazing tools and libraries that I was able to use.

Apologies if I forgot somebody, it was not intentional, just let me know.

–Dirk

2 thoughts on “Where’s Bunga? Tracking Orangutans with Drones and Gnu-Radio (v2.0)

  1. Pingback: Tracking Orangutans with Drones and Gnu-Radio #Conservation « Adafruit Industries – Makers, hackers, artists, designers and engineers!

  2. Pingback: OTA: LimeSCAN Demo, GRCon18 Videos, Google Assistant via Ham, and More – MyriadRF

Leave a comment