Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GoBalloon: Automating a High Altitude Balloon Payload with Go

GoBalloon: Automating a High Altitude Balloon Payload with Go

GoBalloon is a flight controller for a high altitude balloon payload that I wrote in the Go programming language. Go's easy-to-use concurrency made it easy to build powerful software that can still operate efficiently on a battery-powered embedded computer.

Christopher Snell

October 23, 2014
Tweet

More Decks by Christopher Snell

Other Decks in Technology

Transcript

  1. This Chris guy. • Live + work in Tacoma, WA

    • Lead the Technical Operations team @ San Francisco-based Revinate (we’re SaaS for hotel industry) • 20 years working w/ Linux systems • 1 year writing Go • My blerg:
 http://output.chrissnell.com
  2. Balloons? • Reach 100,000+ Feet 
 (near-space) • Carry up

    to a 12 lb. payload * • High-altitude photography • Wide-area communications
  3. Is this legal? • Yes, with a few stipulations. •

    < 6 lbs (single payload) • < 12 lbs (double payload) • 50+ lb test rope • Radar-reflective device • Cut-down device • NOTAM
  4. Construction • Weather Balloon
 (Hwoyee, Kaymont) • Dacron cord •

    Parachute • Dacron cord • Payload box
 (styrofoam, foamcore, soda bottle, etc.) • Antenna
  5. Flight Controller Hardware • BeagleBone Black • TNCBlack
 http://tnc-x.com/TNCBlack.htm •

    GPIO interfaces • Cut-down • Buzzer • Strobe • Temperature/Barometer
  6. Communications • APRS over 2-meter ham radio • 500mW radio

    • J-pole antenna made from 300Ω twin-lead TV cable • Relayed to interwebs by a network of volunteer ground stations Radio footprint at 95,000’: 800 miles in diameter!
  7. APRS Amateur Position Reporting System • A protocol and a

    network • 1200bps modem over 2m radio • Built on top of AX.25 
 (Layer 2 protocol) • Position+Altitude • Telemetry • 1:1 messaging
  8. APRS ↔ Internet • Digipeaters • Mountaintops/Towers • iGates •

    Somewhere with Internet access (typically, a home) • APRS-IS • aprs.fi
  9. The Flight Controller ./GoBalloon • APRS comms • GPS •

    Logging • Cut-down • Telemetry • Serial/GPIO • Low-powered • Lots of concurrency
  10. The First Iteration • Written in Perl • One big

    loop • Poor handling of unexpected blocking • Used a lot of CPU (= battery) • Perl has excellent and very mature APRS library
  11. The Second Iteration • Written in Go! • My first

    real Go project • ~3000 lines of code • Flight processes handled in separate goroutines • Very efficient on low- powered SBC • Little/no pre-existing APRS library support
  12. Computers are hard. • Had to implement AX.25 and APRS

    libraries • AX.25 is ancient • APRS protocol is insane • 32 years of development • Mostly backwards-compatible • Wants to be everything to everybody • Sacrifices simplicity for efficiency • See http://www.aprs.org/doc/ APRS101.PDF
  13. What I’ve built so far. • APRS library that decodes/

    encodes (most) APRS packets • APRS controller - tx/rx position reports, cutdown command • GPS integration • Burst detection w/ strobe +buzzer activation • Geospatial calculations (Great Circle Distance, etc) • Chase console
  14. ʕ◔ϖ◔ʔ GopherTrak http://github.com/chrissnell/gophertrak • Chase console for all chasers and

    home viewers • Leverages termbox-go • Track the balloon • Monitor telemetry • Track other chasers • Issue cutdown command* • Send messages to other chasers*
 * Not yet complete
  15. Next Steps • Assemble the balloon • Write proper test

    code • Real-world testing • Race condition detection • Launch the damned thing