VEX Remote Control

MurrayJ

Senior Member
The Vex system has a very cheap radio control transmitter and receiver combination for $30. Even cheaper on Ebay. The problem is that the receiver does not split the channels. But this could be an advantage for Picaxe connection because only 1 input used.

I found a PDF file which has a Parallax Program to split the 6 channels, but how would I go about converting it to Picaxe? Just a simple program to split channels and then a debug to see if it works. Can someone help me out?
 

Tom2000

Senior Member
Murray,

There's another thread around here dealing with the Vex transmitter. In that thread, I posted some specimen code for the 18X that will fan out the Vex PPM train into four servo and two switch outputs.

It needs some more error handling, but it forms the basis of something that might become useful.

Good luck!

Tom
 

MurrayJ

Senior Member
Tom2000, I tried a search before I posted on Vex Transmitter etc and came up empty. I tried again after your post and still couldnt find it so I did a user post search and still cant find it.

Can you give me a hint where it might be located, it sounds like just what I need.
 

Wrenow

Senior Member
A knowledgebase article on the Vex from the R/C point of view (not the microcontroller view) is also at https://ntxbg.org/KnowledgeBase/?category_id=45&menuaction=phpbrain.uikb.view_article&art_id=22

Since we are working with microcontrollers here, the big "bug" of the system Vex, that the RX outputs a non-decoded pulse stream, may actually be a feature.

There are several articles in this knowledgebase that might prove interesting, including such topics as ESCs (Electronic Speed Controllers) and insulating your garage doors, as well as radio basics, rejuvenating drowned/corroded electronics, etc.

As for programs to decode (written for other platforms) which give you the basis of what to do:
http://forums.parallax.com/forums/default.aspx?f=7&m=175498
and http://www.allelectronics.com/spec/JS-6.pdf

Cheers,

Wreno
 

Tom2000

Senior Member
Tom2000, I tried a search before I posted on Vex Transmitter etc and came up empty. I tried again after your post and still couldnt find it so I did a user post search and still cant find it.

Can you give me a hint where it might be located, it sounds like just what I need.
I came up empty using the search feature, too, using any keywords I could think of. Then I used search to find all of my posts, looking for one or more of the several posts I made in that thread. No luck.

It seems to have disappeared off the face of the earth.

So I'm reposting my code specimen, minus the thread context. For the life of me, I don't remember what its context might have been.

Since you have a Vex, though, and I don't, perhaps you can use it as a starting point for your experiments. Then you can provide us with the requisite context. :)

Good luck!

Tom

Code:
#rem

   PPM Servo Decoder - tjl 10/4/07
   
   Picaxe 18X, driven by Vex R/C receiver
   
   Input from receiver on pin1
   
   Servo outputs on out0 through out3
   
   Switch outputs on out4 and out5
   
   This is just an idea; I don't have an R/C receiver
   available to test this concept.
   
#endrem 


  symbol PPM        = pin1
  symbol Servo0     = 0
  symbol Servo1     = 1
  symbol Servo2     = 2
  symbol Servo3     = 3
  symbol Sw1        = 4
  symbol Sw2        = 5

  symbol sync_count = 50
  
  symbol sync_ctr   = b4
  symbol servo_ctr  = b5
  
  


Main:

   setfreq m8
   
	low Servo0
	low Servo1
	low Servo2
	low Servo3
	low Sw1
	low Sw2
   

	do
	
	
	   ; wait for sync:  5 mSec of steady space on PPM input
	
		sync_ctr = 0
		
		do
		
		  pulsout 7,20				; pause 100 uSec
		  if PPM = 0 then
		    inc sync_ctr
		  else
		    sync_ctr = 0
		  endif
		  
	   loop until sync_ctr = sync_count
	   
	   
	   
	   ; set the servos
	   
	   servo_ctr = 0
	   
	   do
	   
	   	; wait for next servo command
	   	do
	   	loop until PPM = 1
	   
	   	on servo_ctr gosub DoServo0,DoServo1,DoServo2,DoServo3
	   	
	   	; wait for end of marker pulse
	   	do 
	   	loop until PPM = 0

	   	inc servo_ctr
	   
	   loop until servo_ctr = 4
	   
	   
	   ; switch 1
	   
	   do
	   loop until PPM = 1
	   
	   low Servo3
	   
	   pause 2
	   
	   if PPM = 1 then
	     high Sw1
	   else
	     low Sw1
	   endif
	   
	   do
	   loop until PPM = 0
	   
	   
	   
	   ; switch 2
	   
	   do
	   loop until PPM = 1
	   
	   pause 2
	   
	   if PPM = 1 then
	     high Sw2
	   else
	     low Sw2
	   endif
	   
	   do
	   loop until PPM = 0
	   
  loop
  
end



DoServo0:

  high Servo1
  
return



DoServo1:

  low Servo0
  high Servo1
  
return



DoServo2:

  low Servo1
  high Servo2

return



DoServo3:

  low Servo2
  high Servo3
  
return
 

Tom2000

Senior Member
And, while hunting for the fanout code specimen, I ran across the following code for the 08M that simulates a Vex transmitter by generating PPM frames. Apparently, I was intending to test the fanout code, but never got around to it.

Maybe it will help someone.

Like the 18X code above, it's untested.

Have fun!

Tom

Code:
#rem

  VexSim.bas:  for the 08M at 4 MHz
  
  Simulates the 4 servo/2 switch PPM frame of the Vex transmitter
  
  Servos start at neutral position.  One by one, they move from 
  lock to lock, then back to neutral.
  
  The switch outputs alternate between min and max at each servo change.
  
  Normal polarity frame on out2 (leg 5)
  Inverted polarity frame on out4 (leg 3)
  
                                          tjl  Oct 14 07

#endrem

  symbol Sync     = w6
  symbol Phase    = b0
  symbol Active   = b1
  symbol ServLen  = b2
  symbol Sw1      = b3
  symbol Sw2      = b4
  symbol Length   = b5
  symbol ServNum  = b6
  
  symbol NormPin  = 2
  symbol InvPin   = 4
  

Main:

  setfreq m4

  dirs = %00010100
  ServLen = 100
  Sw1 = 50
  Sw2 = 150
  Active = 0 
  Phase = 0
  ServNum = 0
  
  do
  
    ; Send sync pulse: length set to make total frame time 20 mSec
    Sync = 1150 - ServLen
    pulsout InvPin,Sync
    
    for ServNum = 0 to 3
      gosub PulseServos
    next
    
    ; Switch 1
    pulsout NormPin,50
    pulsout InvPin,Sw1
    
    ; Switch 2
    pulsout NormPin,50
    pulsout InvPin,Sw2
    
    ; End pulse
    pulsout NormPin,50
    
    gosub AdjServo
    
  loop 
  
end


PulseServos:

  pulsout NormPin,50
  if Active = ServNum then
    Length = ServLen
  else
    Length = 100
  endif
  pulsout InvPin,Length
    
return


AdjServo:

  ; Servo starts at neutral, moves to min, 
  ; moves to max, then to back to neutral

  if Phase = 0 then
    if ServLen > 50 then
      dec ServLen
    else
      Phase = 1
      inc ServLen
    endif
  elseif Phase = 1 then
    if ServLen < 150 then
      inc ServLen
    else
      Phase = 2
      dec ServLen
    endif
  else      ; Phase = 2
    if ServLen > 100 then
      dec ServLen
    else
      Phase = 0
      Sw1 = 200 - Sw1
	   Sw2 = 200 - Sw2
	   Active = Active + 1 % 4
	 endif
  endif
	
return

Edited to add: I just noticed the dates on the two programs. Could this project have only been about five weeks ago? Seems like it's been months.

"Out of sight, out of mind." I've put projects on the back burner before, but never as far on the back burner as this one apparently went. I don't think I've ever had a project go as far "out of mind" as this has in such a short time!

It's been a busy month, both for hobby projects and for stuff that puts a crust of bread and a bowl of gruel on the table. :)
 
Last edited:

KMoffett

Senior Member
Tom,

Did you try a search using: VEX* ? The wildcard "*" gets by the problem with three-letter search words. I found 6 threads.

Ken
 

Tom2000

Senior Member
No, Ken, I didn't. I didn't even know there *was* a limit on search sizes. Thanks for the info and the workaround.

Happy Thanksgiving!

Tom
 

Fletch

Member
Tom you posted this code in response to a thread I'd started about buying small qualities of bare PIC chips from Microchip direct (I needed them because I was planning to use a bare PIC as a VEX decoder.)

http://www.picaxeforum.co.uk/showthread.php?t=7891

I did try your code and had no luck, however I came to suspect that my method of connecting the VEX receiver to my breadboard might have been the problem. I came up with a better connection method but have been busy the last 4 weekends. I had intended to revisit it this weekend (Turkey willing.)
 
Last edited:

Tom2000

Senior Member
Thanks, Fletch. And maybe that explains why I couldn't find the thread while searching my own posts. I was looking for topics pertaining to the Vex transmitter or some sort of R/C system.

If I'm able to help when you get back to working with your system, please let me know.

Best,

Tom
 

MurrayJ

Senior Member
Thanks Tom looks like just what I want. I dont have the Vex yet, just looking if it were possible to use with the Picaxe.
 

Wrenow

Senior Member
The answer to that question is easy - yes, it is possible to use the Vex system with the Picaxe. However, the devil, as always, is in the details.

It also depends on if you want the Picaxe to decode the pulse stream, or just want to R/C something. The RF stage for the Vex is rather bulky as hobby R/C receivers go, and there are several inexpensive alternative receivers that work just fine.

Also, do remember that this is a surface only transmitter per FCC rules.


Cheers,

Wreno
 
Top