profmason.com

August 26, 2008

VEX RC Controller Decoded:

Filed under: Robotics — profmason @ 9:47 pm

The VEX RC Controller is available directly from VEX or surplus from All Electronics. (A great provider of discount electronics.) This is a six channel PPM controller that has the added advantage for microcontroller work that all of the outputs are on a single line.  There is also a spec sheet from All Electronics which I will mirror here:VEX reciever how to

Here is an image of the output from the receiver. NOTE: The receiver really wants 5 Volts, but I am running it at 3.7 Volts at the moment(a single lithium battery) It works at 3.7V but has a considerably shorter range.

The nice this about this, is that all of the channels are on a single line. This makes it very easy to interface with a microprocessor. A quick review of the PPM format:

  • 20 ms total before repeat.
  • Each channel is sent as a high signal followed by a 1 ms low. The width of the high signal determines the value sent. A zeroed channel has a width of 1ms. A full positive channel is 1.5ms and a full negative channel is 0.5 ms.
  • On the Vex there are six channel (The six peaks that you see) for a total of about 12ms buffered by approximately 8 ms.

To interface with a microprocessor, simply plug the output of the receiver into your microprocessor. Send 5V to Vdd and Ground to Vss.  Tie the output of the receiver to 5V over about a 10K resistor.  Start measuring pulses on that channel. If you measure at least a 6ms low(The buffer) start recording pulses. (These are your data pulses.) Record all six channels and then decode the length of each pulse.

Here is some Arduino code to do just this:

#define channumber 6 //How many channels on the radio???
int channel[channumber]; //Channel values
int output[channumber];
int PPMin = 4;

void setup()
{
Serial.begin(9600); //Initialize Serial/
pinMode(PPMin, INPUT); // Pin 4 as input
}

void loop()
{
//waits until synchronize arrives > 6 miliseconds
if(pulseIn(PPMin , HIGH) > 6000); //If pulse > 6 miliseconds, continues
{
for(int i = 1; i <= channumber; i++) //Read the pulses of the remaining channels
{
channel[i-1]=pulseIn(PPMin, LOW);
}
for(int i = 1; i <= channumber; i++) // Process the input
{
//enter output processing here
}

1 Comment »

  1. [...] Check it out. Looks very straightforward and is probably very similar to what Scott is doing on the Jedi system to decode the signal. [...]

    Pingback by ARTOO-DETOO DOT NET - R2-D2 Building Blog » Blog Archive » VEX RC Controller Decoded — August 27, 2008 @ 3:03 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress