PDA

View Full Version : joystick and servo test set



stamptrol
04-05-2007, 05:12 AM
· Hi folks,

··· Just to follow up on a thread in the Basic Stamp forum, here are couple of pics and program
of my r/c radio simulator for testing motor control systems. I hesitate to call this a Completed
Project because it changes week by week!

··· The program takes the signals from the joysticks and measures them with RCTIME.
Then, the values are converted to something the servo can understand and sends the
pulses out another set of pins.

·· The generated pulses are the same as if they were received by r/c radio. More or less 750 uS to 1500 uS, I think.

·· In the pics, N-S movement of the joystick talks to the HB-25 motor driver module and
operates the big gearmotor in the middle. Gives 0 to full speed in both directions.

··· E-W movement talks to the other motors through the EnT board to drive the other
·two motors which were simulating the two drive fans from the research barge I
worked with last year.



' {$STAMP BS2}
' {$PBASIC 2.5}
pot1 VAR Word
pot2 VAR Word
main:
HIGH 12
HIGH 13
PAUSE 1
RCTIME 12,1,pot1 'N-S joystick pot
RCTIME 13,1,pot2 'E-W joystick pot
'DEBUG DEC5 pot1 MAX 6000," ",DEC5 pot2 MAX 6000,CR,LF
pot1=((pot1*7)/100)+500 MAX 1000
pot2=((pot2*7)/100)+500 MAX 1000
PULSOUT 6,pot1 ' servo-type output to HB-25 motor drive
PULSOUT 7,pot2 ' servo-type output to EnT for dual motor drive
'DEBUG DEC5 pot1," ",DEC5 pot2,HOME
GOTO main


·· The joystick is an old PC game port joystick from a yardsale. They are a bit light duty, but
have really smooth action and 10K to 50K pots which work well with RCTIME. I took the old game· port
connector off in favor of a DB-9.

·Cheers,

···

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com

Dave M
04-05-2007, 08:30 AM
Thanks Tom.· I've got it saved.

Dave M.