Shop OBEX P1 Docs P2 Docs Learn Events
Using Prop as RC interpreter — Parallax Forums

Using Prop as RC interpreter

PhilldapillPhilldapill Posts: 1,283
edited 2008-11-17 22:12 in Propeller 1
I'm involved with the Robotics Team at my university and we are just getting things off the ground. I'm one of the lead electronics people on the team and will be responsible for most of the electronic components of the robot. This is a fighting robot, btw, for BattleBots.

We need a quick and dirty Radio controlled setup for testing ideas, and what I had in mind(for now) is using an old RC helicopter reciever and remote control. The only problem is, this thing only controlled 2 motors(1 for each part of the main rotor), and two servos(to control the pitch and angles of the rotors). What I want to do, is instead of having the RC controller directly control our robot, I'd like to use the output from the controller and input that into a Prop. This way, I can take the output from the servos and control something that is totally non-related to servos, i.e. control another DC motor and use the servo output signal to control the speed/direction. This interpretation would be done in the prop.

Does anyone have any pointers or a better way of going about doing this? Any ready-made objects for converting a servo signal into something else like a variable duty cycle PWM signal?

Comments

  • LeonLeon Posts: 7,620
    edited 2008-11-17 20:29
    Older servos used PWM. You should be able to measure the pulse width.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • John AbshierJohn Abshier Posts: 1,116
    edited 2008-11-17 21:26
    If this is a standard RC setup you should have 4 sets of 3 pins on the reciever. Each signal pin will output a servo pulse every 20 milliseconds. The BS2_Functions object has a Pulsein method to measure the width of the pulse. My first step would be to use an oscilloscope to see what the receiver produces for various positions of the control sticks.

    John Abshier
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-11-17 21:41
    My thinking too, John. I looked at the servo on the scope, and yes, I see pulses. When the throttle is "neutral", the duty looks to be around 20%, and when I push the throttle "down", the duty goes to about 15%, and when it is "up" the duty looks about 25%. That's pretty good. The remote has two throttles - one has a spring loaded x-y motion, while the other throttle is a simple Y holding stick. I think I can use the x-y throttle for controlling the wheels of this robot, and the other "holding" throttle to control the spin speed of the weapon on it. This is going to be awesome...
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-11-17 22:09
    Take a look at the QuadRover's example code, particularly QuadRoverRadioNavigation_v1.0.spin. It is a well commented example of doing exactly what you are trying to do.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-11-17 22:12
    Great! Thanks alot, Paul. I'll be looking into that...
Sign In or Register to comment.