Detailed How To Posts - Reading From An RC Receiver

Hi,

I am putting up a few posts outlining the development of a real world application that uses Arduino to interface between an RC Car receiver and the electronic speed controller. Its not the most advanced application, its not the most highly optimised code, but judging by the traffic I get it is something that is of interest to a large number of people.

The first post is an entry level look at the receiver signal and some simple code to read it. I have followed this with a closer look at the signal as we receive it in the realworld.

The final post will be a the full implementation of my previously outlined 'child mode' project.

Click here for the first post RCArduino: How To Read an RC Receiver With A Microcontroller - Part 1

Follow up post RCArduino: How To Read an RC Receiver With A Microcontroller - Part 2

and here for the previously posted project outline RCArduino: Traction Control Part 1.3 - Childs Play.

If anyone would be interested in following my technique for plotting the receiver signal but using more updated equipment than my 27Mhz AM Radio gear I would be interested to post the results especially if there is a marked difference in signal quality at a distance.

Duane B

Hi,

I have updated a post on my blog with the results of testing a simple signal 'damping' algorithm to reduce the variation in a signal read from an RC Receiver in a very noisy electronic environment.

Have a look if your interested

Duane B

I'm using your ideas to allow my quadcopter to control one of it's channels. For example height. I will let it control it's height starting just above ground then going up using the air pressure sensor to stay in one place. I will control the other functions with the radio, and have the ability to override the altitude.

Then I will try letting it control it's horizontal x,y location using GPS, while I control height only. Couldn't have done it without your help!
You should buy one! Less than $100. Was $500.

Swarm of flying Quadcopters

Quadcopter frame and 4 powerful 12A motors $27:
That's like $7 a motor and get the Frame Free!
Mother Nature's carbon fiber...
http://www.hobbyking.com/buddy.asp?code=58B98C0B-D898-47B7-B1BF-53FD26C5EA64

Props $0.45:
http://www.hobbyking.com/buddy.asp?code=BEDABFD0-7044-436C-B598-43D4CE7C7DF5

Controller board $12:
http://www.hobbyking.com/buddy.asp?code=FA6ED6C2-AC46-4FDF-AA24-2B952D8AA395

Tiny LiPoly batteries $1.09 only 5.0g:
http://www.hobbyking.com/buddy.asp?code=3B2ED0B9-9D14-48A4-BD3B-9318391DA1FD

You will also need these to completely finish your flying craft:
http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=9368
http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=21321
http://www.hobbyking.com/buddy.asp?code=7EC920B8-5B6C-4ADA-928E-AEF18E503FAA

Thanks for this thread and your blog posts. It gives me a few ideas to try and work with in setting my Arduino Mega 2560 to work as a programmable RC control relay (of sorts).

I just got my Arduino last night and have been having fun playing around with it setting up a few small programs/sketches on it (flashing Morse code or moving a servo). This is my first time using a microcontroller in this way or programming in a C like language since the one semester of C++ programming I took over a decade ago, and it's all very exciting and promising.

Anyway, as I was saying, my main goal in getting the Arduino is to use it as a programmable RC "robot" between my receiver channel outputs and servo/speed controller inputs. The receiver I'd like to use it with has 14 servo channels which I'd like input into the Arduino to use as programming triggers or optionally just passed through, and I'd like the Arduino to output 14 PWM channels.

Signal quality from the transmitter to the receiver and it's outputs most likely won't be much of an issue since I use encoded and self checking and correcting frequency agile spread spectrum 2.4GHz radio equipment, but I was intrigued by your methods for correcting for undesirable channel signal deviations.

Anyway, thanks again for your contributions, and if you have any additional pointers or suggestions to help me along to my goals, I'd appreciate them, and if I come up with anything of interest that's relevant I'd be happy to share it here too (though of course I'm not anywhere near as knowledgeable and proficient as you guys are when it comes to programming these things yet).

Very cool robot heli video too, by the way.

Hi,

Thanks for the feedback.

I had to look up 14 channel transmitters, I guess it is the Futaba one you have ?

What is is that you are building with so many channels ?

I have a post about a sneaky way to add on/off toggle channels here -

Not that you are going to be running out of channels any time soon.

Duane B

rcarduino.blogspot.com

Hi Duane

I have tried your scketch for plotting receiver signals.
My setup is Spektum 2,5 Ghz DX7, receiver Orange receiver from HobbyKing.

My readings wouldn't say much iff I plotted them, there is only 3 different messurements for the pulselenght:

Out of 540 readings

TX besides receiver:

Pulselenght/#readings

1520 192
1524 344
1516 4

Walking around (behind a cocrete wall)

1520 251
1524 289
1516 0

So it seemes my equipment are more stable than your 27Mhz

Hi Erni,

Thanks for taking the effort to check the performance of a 2.4 System, I expected that they would be better, but from your data its a lot better than i expected. Maybe I should not be so suprised after all my equipment uses technology that hasn't really changed since 1980.

I keep using the excuse that I am as fast around the track as anyone else as a reason not to upgrade, but just this weekend I was testing my Arduino based lap timer in a regular spot and someone somewhere unseen was interfering with my car. Maybe now that there are so many toy cars, helicopters and 'walky talkies' around that use 27 and 40 MHz It might finally be time for me to enter the 21st century and get a 2.4 system.

For anyone that does not have an existing collection of 27 or 40 MHz equipment your results would suggest there is no excuse to buy the older technologies.

Duane B

rcarduino.blogspot.com

Hi Duane

I just tried it using Futaba FF9 on 35Mhz with a pcm receiver, and got similar results as with the DX7 on 2,4 Ghz.

I think the measurement should be performed in real world conditions before I can conclude something.
In my situation that would be an electric model airplane, flying near the limits of the range

Here in Denmark and I think the rest of Eourope, the 35Mhz band are only allowed for use with model airplanes, so the situation are different from 27Mhz, where you are strugling with all kinds of toys, walkie talkies etc.

Anyway the 2,4Ghz equipment has solved a lot of problems with electrical noise from motors etc., that we had on 35Mhz, although some kind of ignition noise from petrol engins are still a problem. But one thing is sure, it is not so easy anymore to blame your last crash on radiofailure and interference XD

Your blog is very interesting, I will dig further into it

DuaneB:
...

I had to look up 14 channel transmitters, I guess it is the Futaba one you have ?

What is is that you are building with so many channels ?

...

Yes, I am using a Futaba FASST transmitter, the 8FG with firmware 5.0. This radio has been updated several times since its initial release, adding in additional capabilities; one of them making it capable of transmitting 12 proportional control channels and 2 switching/digital channels. The main receiver I'd like to use in conjunction with the Arduino is the R6014HS (likely in normal speed mode).

I have several ideas of what to use the Arduino for, including building a semi-autonomous scout type robot (dual tread or dual drive three or four wheel platform with stereoscopic pan, tilt, focus cameras using FPV radio equipment and lower power, possibly infrared, lasers for ranging nearer objects and to aid in focusing, mounted on an extendable pivoting arm with GPS), and perhaps as an autopilot for less potentially dangerous and costly helis and planes, or general servo control programming. I'd like to be able to program in and use the full 14 channels so that I'm not limited in what my options are in these regards. The channels could be used for any number of things including gyros for gain control and feedback into the Arduino, servo positioning, and adjusting speed controllers for motors.

It looks like you're using the digital inputs on the board to read the receiver channels, so I might also use the analog inputs on the board for other sensor type inputs for more situational awareness.

This is all for fun and learning, and I realize I'm only just getting started and have a long way to go, but if anything more useful comes of it and I'm able to get things up an running, I'll likely share the "sketches" with other RC hobbyists to aid in programming their models while of course crediting others with their contributions.

The 8FG has enough internal programming to suit my needs for the more mainstream RC model programming, but doesn't offer enough for everything that I'd like to use it in conjunction with, and of course the receivers aren't semi-autonomous except for perhaps in their lost signal reception and low battery channel positioning fail safes.

First step is getting the Arduino to read the output values of the receiver channels and output 14 channels of its own, then adding in programming to use these values to trigger different channel output mixing values, positioning, and speed for the servos and speed controllers. Oh yeah, and I need to learn how to sufficiently program the Arduino microcontroller (of course).

Wish me luck... XD

Hi,
I have finally overcome my resistance to spending money and bought a 2.4Ghz radio partly due to the results posted by Erni, partly due to a new race track opening in Dubai and finally down to getting a good price.

I have posted an update here -

In the next few days I plan to post some options for interfacing with multiple inputs, in my case I need to read three channels and four RPM sensors, 7 sensors in total, the sensors update 50 times a second for the RC Channels and upto 70 Times a second for the RPM Sensors.

Duane B.

rcarduino.blogspot.com

Duane B,
Not sure if your still around.
I read your stuff on RCarduino and posted a comment under the RC receiver with arduino Due.
can you help me with the this code and a teensy 3.1. should it work?
thanks
Webzter30