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
}

December 19, 2007

vexplorer hacking

Filed under: Robotics — profmason @ 8:53 pm

vexplorer.jpgI finally obtained a vexplorer. (I hung around ebay for about 3 weeks.) The day I picked it up Amazon had them for $99 and then $60! (It seems like the $60 price was a mistake). It came well packed and I spent about 90 minutes putting the pieces together with my daughter.

After driving it around for about 10 minutes I decided to test the camera. The camera works immediately with my 2.4 Ghz Wireless to USB box. The channels that Vex assigned are non standard 1=4 etc! However with a bit of fiddling it works. Unfortunately the camera included on the Vexplorer is about the worst quality I have ever seen. Terrible low light performance, lots of interference etc. I have bought inexpensive cameras, but never had a NTSC camera this bad. Still it should be workable in Roborealm.

Here are some snaps that I took from Roborealm:

vexcam.jpgvexcam2.jpg

Now on to hacking the remote. Here is a picture of the backside of the remote. There are two structures that have circles in the middle. These are the backsides of the joysticks. The large surface mount chip is the microprocessor.

vexplorer-remote.jpg

The remote operates at 27 Mhz. There are four analog channels and two digital channels. Each pair of analog channels is fed by a very nice joystick which controls a two ~1K pots. When the joystick is moved, the resistance between the central terminal and one of the outlying terminals decreases. This is hooked up with a voltage divider network. The microprocessor uses an ADC to measure this elan75p458.JPGvoltage and encode the appropriate signal to transmit. I removed one of the joysticks and wired into it. I am not sure what I did (I think I just shorted power to ground) but the remote stopped working for about 20 minutes. It did eventually recover after I soldered the pot back in (Phew!) It seems like interfacing to the remote this way will be tricky!

The microprocessor outputs some kind of modulated pulse on one of its PWM outputs. I left my oscilloscope probes at work, and all I have are a pair of alligator clips soldered to a BNC connector. Needless to say all I see on the PWM output is noise right now. When I go into work next, I will bring the probes home so I can look at generating the appropriate PWM output.

The microprocessor on both the transmitter and RX is an ELAN 78P458. Here is the data sheet for this microprocessor. elan78p458.pdf  Unfortunately, it doesn’t support rewritable memory, so we can’t get at the toy that way!

For now I will breadboard up a Picaxe controlling a set of 4 hbridges to drive the robot. I will use an XBee module to provide serial communication with the PC. This is an expensive way to do this, but it will work for now. I would prefer to just use a Picaxe on the transmitter side and use all the vex electronics on the bot.

Converting RC car using on board HBridge

Filed under: Electronics, PicAXE, Robotics — Tags: , , , — profmason @ 4:39 pm

rcplatform2.jpgI picked up several RC vehicles at the 2nd hand store a week or so ago. I wrote up the results of the first experiment previously. This time I picked a vehicle that had differential drive and would thus be ideal for a robotic platform. Differential drive gives the ability to turn within the vehicles own footprint which is handy for a robotic platform. Instead of using my own motor drivers I decided to use the ones built into the RC vehicle. This vehicle did not come with a remote control, so I couldn’t do the same hack I did by just hacking into the remote. I disassembled the vehicle and hooked up power and ground. I then started probing the different pins of the RC chip with a five volt signal through a 220 Ohm resistor. rcboard.jpg

Sure enough there were two pins that controlled each motor. Now interfacing was dead simple. De-solder the RC chip. rcchip.jpg

Solder 4 wires to the holes identified earlier. (Sorry about the quality of the picture. You can see where the chip was removed. The wires are potted in hotglue to provide stress relief. Run those wires to the PicAXE outputs with 4.7 K resistors to limit the current. Program the PicAXE, add batteries and wallah instant robotic platform! I did add a piece of expanded PVC as a top platform.

rcplatform.jpg

December 12, 2007

RC Car interface

Filed under: Electronics, PicAXE, Robotics — profmason @ 6:04 pm

rccar.jpgI visited the local second hand store and purchased several RC vehicles. As usual most of them did not come with the associated remote control. However as luck had it, I was able to pick up a Tyco/RC car with controller for $3. This Tyco product was remarkably good quality inside and out(Compared to many other RC products I have taken apart.)

The car has a dc motor connected to a two speed switchable gear train that drives the rear wheels. There is basically a solenoid up front that shoves the front wheels hard right or hard left. There is no ratiometric control on this car. One final feature is the two curving metal pieces connecting the front of the chassis to the rear. These not only act as giant bumpers and strengthen the chassis, but one of them acts as the RX antenna.

The remote control operates at 27Mhz and appears to use an amplitude modulation scheme. I decided to interface the remote control to the PC.

After some false starts here is what works. There are a set of metallic contacts that the switches on the RC controller make and break. This controller is not ratiometric, so I just drilled a hole inrctransmitter.jpg the middle of each contact and wired into it. The middle is tied to ground on the microcontroller board and each of the outside contacts is tied to the output of a ULN2803 darlington array. The strategy is that the microprocessor will have the darlington array connect each of the contacts to ground. You need four microprocessor outputs to do this. (With clever logic you could do it with three outputs, but that would increase the part count.)

Now the microprocessor receives serial commands and interprets those to turn on the appropriate channels on the RC car. The RC transmitter provides its own power which is isolated from the microprocessor. (This means that you need to keep batteries in the transmitter.)

The transmitter seems to have a range of about 10 meters.

symbol forw = 2
symbol back = 3
symbol right = 4

symbol left = 5
setfreq m8

main:’Get a value from the terminal

serin 4,N1200,b0
’serout 0,N1200,(#b0)
if b0 = 56 then goforward
if b0 = 57 then goforwardright
if b0 = 55 then goforwardleft
if b0 = 51 then gobackwardright
if b0 = 50 then gobackward
if b0 = 49 then gobackwardleft
if b0 = 53 then gostop
low backrctransmitterinterface.JPG
low right
low left
low forw

goto main

gostop:

low back
low right
low left
low forw

goto main

goforward:

low back
low right
low left
high forw

goto main

gobackward:

high back
low right
low left
low forw

goto main

goforwardright:

low back
high right
low left
high forw

rcpcbfront.jpg

goto main

goforwardleft:

low back
low right

high left
high forw

goto main

gobackwardleft:

high back
low right

high left
low forw

goto main

gobackwardright:

high back
low right
high left

low forw

goto main

Next a simple Roborealm interface was written to take keyboard commands as input and output the appropriate serial commands. The car can now be driven from Roborealm. Here is a picture of the picaxe based interface board. The process of making this board deserves a page of its own.

December 5, 2007

Voice Controlled RoboQuad

Filed under: PicAXE, Robotics — profmason @ 12:24 am

roboquad.jpgI adapted the Picaxe based Robosapien Control unit by just changing the IR header from 0011 to 0110. I finally found a set of Roboquad IR commands at AiboHack. Later that same day Robert from Robosapien Dance Machine emailed me an even more complete set of codes. roboquadircodes.txt

I initially got the RoboQuad responding to simple commands and then moved to interfacing it with RoboRealm. It turns out that the RoboQuad is a lousy platform for computer vision because it jerks around so much. I mounted a camera on the top of the RoboQuad and spent some unsuccessful time trying to do something useful with it.

Finally I decided to implement voice control for the RoboQuad. I used the microsoft speech SDK through roborealm to detect voice commands and then on those send IR commands through the PicAXE based IR transmitter to the robot. Right now the RoboQuad only understands Forward, Right, Left, Backward, Stop and Again. Here is a video of the RoboQuad walking around under voice command. roboquad.MOV It isn’t quite as smooth as what Robert achieved with his demonstration video, but I suspect that I need to mess with the timing in the speech recognition. There is about a second delay between recognition and sending out the command.

Here is a first stab at embedding a YouTube video:
Here is a video from the camera mounted on the RoboQuadA final video of the Roboquad navigating under voice control using “smoother” voice commands

Older Posts »

Powered by WordPress