how to connect a R/C plane reciever to a BS2
Hi
How would you connect a R/C plane reciever to a BS2 so that servos connected to the BS2 would work with an airplane remote control?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
BOB55
How would you connect a R/C plane reciever to a BS2 so that servos connected to the BS2 would work with an airplane remote control?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
BOB55
Comments
The BS2 can 'read' these signals if you wire them to an I/O pin, and use "PULSIN" to read the pins. I believe the pulses are 'interleaved' on the signal, so they come out first one, then a 1 mSec delay, then the next, then a 1 mSec delay, etc. So, if you read them 'in-order', in the order the R/C reciever is putting them out, you should be able to read an entire sequence of them in 20 mSec. Then use the next 20 mSec to output them to a second set of I/O pins, which are connected to the Servo's.
Depending on your system, the signal lead may also need a pull-up resistor. In some cases, I've had to feed the servo signal into a mosfet (gate) , which then switches the Stamp input signal. Apparently some of the receiver output lines are very high impedance.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback
-Robots are my friends-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
BOB55
I downloaded your source code, thank you it helps a lot to see how it look. One question though. What·is the reason for this code
R_Target = drive - 1875 + steer
L_Target = 1875 - drive + steer
The reason I ask is it might help·me for what I am building. I am building a 4 rotor counter rotating helicopter. I am using 4 brushless outrunner motors with 2 pusher and 2 puller propellors to counteract adverse torque. I want to be able to control all 4 equally with the throttle channel for lift, and also be able to input with the other 3 channels for forward and back, left and right and rotation. Here's the kicker, I also want to have an accelerameter hooked in to help balance the unit with the controls left untouched but then allow me to control it when I want. I have been playing with the accelerameter a little and have a good idea·of how it works. My thoughts on it are that·I would turn the pulse signals into something that I could easily add to, say·like 0-100% or 1 to 255, that way I can use the info from the accelerameter which·I already have code that will give me angle in degrees when the accelrameter is tilted and add it to the appropriate channel on top of whatever my throttle is set at to maintain level. If I'm not on the right track let me know. Sometimes trial and error is the best way to leran. Wasn't it Edison that said he didn't have 100 failures but 100 ways not to make a lightbulb. Sorry off track a little, anyway·if you have any tips that would help me I would greatly appreciate it. Thanks in advance. Mike
The reason for the ··“ R_Target = drive - 1875 + steer
································ ··L_Target = 1875 - drive + steer”
is to that a RC servo moves from full CW to full CCW with a signal of 1 to ms. The Stamps measures “PULSIN and PULOUT” in us. Also 1us is not measured as variable value of 1 us ( See Parallax manuals ). Different Stamps have different variable value amounts. 1875 us is mid point from CW and CCW using a BSX Stamp. This part of the program take this value in to account. It also takes the up or down (forward or reverse) on one handle (channel) of the RC transmitter and the right or left of this same handle (different channel) and gives a values to drive the two servos on a robot. The servo on the right side of the robot must rotate opposite that the left servo to move the robot straight.
This math is not perfectly correct, but runs faster than the exact math and works good enough for RC servos.
Hope this helps, if not give me a post.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback
-Robots are my friends-
It works
Mike
So, each time you send a "PULSOUT", you need a 20 mSec delay. Well, that's not completely true. What is true is that for each SET of PULSOUT, you need ONE 20 mSec delay.
So from the symptom you describe, I'm assuming you have a 20 mSec delay for EACH pulsout you do. The third pulsout then gives you a total delay of 60 mSec, and so the servo's "relax" and move in fits and starts.
To fix this, update all three servo's with a PULSOUT, and THEN issue a SINGLE 20 mSec delay before updating again. That should fix your problem.
Here are·couple other things to try. First, true you need a·20ms between each PULSOUT to a servo. But if after you send a PULSOUT to a servo you do some thing else with the program before the next PULSOUT to that servo,··you may not need a PAUSE. The reason is that doing something else with the program takes time. This run time gives the pause needed.
Second, something not often mentioned, is using the Parallax "ServoPAL". Each one can control two different servo. Send one PULSOUT to the ServoPAL and it will keep sending pulses each 20 ms till you tell it to do something else. The ServoPAL greatly smoothes out movements.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback
-Robots are my friends-