Robostix RC input

From GumstixDocsWiki

Jump to: navigation, search

Contents

Overview

RC (Radio Control) receivers decode a stream of pulses and split the pulses into individual channels which can be delivered to a servo. If you want to control a robot, rather than servos, then it is sometimes inconvenient to require one input on the microcontroller for each channel from the receiver.

This page (click on Technical Notes) has a 3 part article titled "How it Works: The PPM Radio Control System", which provides considerable insight into the inner workings of the radio receiver. The Radio Control System Operation page and the R/C Servo Pulse, PPM and PCM coding pages also provide the same information in a simpler form.

Source code

The core source files are called RCInput.h and RCInput.c and are available from the robostix/Common directory in SVN.

There is also a sample application in the robostix/RCInput directory. This code measures the pulses from two channels and displays them on an LCD screen.

Theory of operation

The sample code configures RCInput to use Timer 3. It captures the rising edges. First of all it needs to find a sync pulse, which is defined as a pulse which has more than 3 msec between edges. It then measures the distance between subsequent edges.

Two consequtive overflows of Timer 3 (32-64 msec) is defined to be missing pulses.

The main application performs some averaging of pulse widths and displays the results on the LCD.

Photos

LCD display with transmitter off

LCD display with transmitter on

Connections from the RC receiver

Hacking an RC receiver

The Hacking an RC Receiver page describes the modifications made to the RC receiver.

Personal tools