Controlling an Arduino with a standard RC transmitter/receiver

RC_servo_v_3_4.txt (1759Bytes)

 

 

Controlling an Arduino with a standard RC transmitter/receiver

There are many ways to remote control an Arduino, Xbee, RF link, IR…

I decided to try and use something I had laying around and that is common among large group of hobbyist : RC transmitter and receiver pair

 

I will be using this 2 channel transmitter and receiver pair:

2012-07-26_15_34_30.jpg

 

 

From what I have found there are 3 ways of getting the signals to the Arduino and making them useful.  (If I am missing one tell me)

-Method 1 involves poking around inside the receiver looking for a pin that is outputting all the channels together and then separating the pulses to get the values of each channel.

-Method 2, use interrupt to read the pulses coming from each individual channel, very efficent but needs more coding, will be used for version 2.

-Method 3, use Pulsein, inneficent but I have chosen this methos since I am not great at coding and it is fairly simple to use.

 

For now I will be controlling this guy: 

2012-04-18_00_14_59.jpg

 

He is driven by 2 continuous rotating servos.    

So far reading the pulses and getting the bot to turn on the spot have been fairly easy, but now comes the hard bit(s).

 

To do list:

-Get robot to go straight ahead.Somehow I need to “revers” the signal coming from the RC receiver since both servos are going in opposite direction for the bot to go forwards.   

-Make values smooth for low speed control .The value coming from the receiver tends to jump around a bit, so maybe take the average of 5 values and send that to the servo?

 

-How to make the servos stop totally and not slowly turn when stopped.Usually to make these servos stop, you send the centre position. Well with these particular ones, they don’t seem to have a centre position, no matter how close to the centre position, it still slowly turns to one side.  

-Use two pots to adjust centre/trip the servos.  So when the stick is at rest on the remote the servo will be stopped.This is still a work in progress so it might be some time before I declare it complete.

 

I might even post a forum topic as I am struggling with coding.

 

 

 

My suggestion to you would be …

since you have two channels, and, your transmitter has a stick that moves front to back and one that moves side to side, just read the outputs of the receiver, and, decide based on those outputs what the arduino should do relative to control of the servos. To explain better, if the left/right stick is centered, but, the forward/reverse stick is sending forward, then send signals to the servos to move forward dependent on stick position. If the left/right stick is off center, but, the forward/reverse stick is centered, then rotate in place. If both sticks are off center, then move the servos in proportion to the stick placement. If the sticks are both centered, then don’t send any signal to the servos, or, send a zero pulse to the servos (I would think that should keep them from moving.).

** Yes that would work and**

 

Yes that would work and would be fairly easy to do. 

I was hoping to keep the proportional control. Push the stick a bit and the robot moves slowly, push more and it goes faster.I might write one as you suggested for the practice and to get a basic one written.

When you say send a zero pulse, do you mean literally 0 ? As in servotwo.write(0); 

I have no real experience, just what I have read.

So, my suggestion to send a 0 was only a guess. Maybe, if the stick(s) are centered, you don’t need to send anything and the servos won’t move. Someone with actual experience will have to help you there.

As far as proportional, I would hope that what I suggest will in fact give you proportional control, if you write it correctly.

Here are some links that can get your started quickly

 

Links -

http://rcarduino.blogspot.com/2012/01/how-to-read-rc-receiver-with.html

http://rcarduino.blogspot.com/2012/04/how-to-read-multiple-rc-channels-draft.html

Duane B

http://rcarduino.blogspot.com