Using RC Transmitter & Receiver SBUS with Teensy

Remote control of hardware can be tackled with over a dozen different methods. XBEE serial radios are a popular option but require custom built hardware, complete custom code and have a mediocre range. WiFi & Bluetooth are also popular but for something that requires a level of ruggedness on signals and fail-safe behavior they would not suit the development needs of the robot.

Instead I want to use a standard RC model controller. They have great range, rugged signals, ergonomic controllers and are almost completely ready to go off the shelf. Historically RC receivers output a PWM signal, interpreting this over multiple channels is tedious and ties up significant timer resources on the micro controller. Thankfully Futaba developed and released the SBUS protocol some time around 2010, this is a serial stream that contains an 11 bit value for every channel the receiver and transmitter can handle (16 in my case). This provides a fast accurate digital signal that will allow me to adjust 16 channels with a high degree of precision.

My transmitter is the FrSky Tarranis (it even talks to you…) with the bundled X8R receiver. Decoding these signals is a teensy 3.2.

Taranis FrSky Transmitter

SBUS is not without its quirks, it is a 100k Baud  with 8 bit, even parity and two stop bits signal. I cannot understand their reasoning for this very atypical baud rate, the parity & stop bits may be to protect against long daisy chained loops in noisy environments, electric motors, drive controllers and other model plane paraphernalia. The final quirk is the inverted serial signal. This is the one hardware modification required for the Teensy, potentially using the newSoftSerial library could be a work around here but I had an inverter IC handy. Passing the SBUS signal through this cleans it up fine.

There is even a great pre-written arduino library for decoding SBUS signals. https://github.com/zendes/SBUS thanks Zendes! However there is one small challenge the Teensy does not support SERIAL_8E2, however because the teensy is only receving the SBUS stream SERIAL_8E1 is sufficient which is achieved with a small modification to line 30 of SBUS.cpp.

With that configured you now have 16 channels for configuring and controlling a robot as well as a failsafe signal in the event of radio loss. The next step is to have the FRSky SPORT send telemetry signals back to the transmitter.

Leave a Reply

Your email address will not be published. Required fields are marked *