Help for readinh radio control input pulses

RocketRod

New Member
I purchased a couple of axe-08's a couple of weeks ago together with a serial cable, proto board and battery box.
I was able to program realistically double blinking leds for my r/c model aircraft wings -much easier than using LM556.
However.... my knowledge of electronics is zilch ... I would like to further my association with these little powerhouses with another project. I have not got a clue what a pulldown resistor does, nore do Iunderstand all the electronic acronyms bandied about in these excellent forums...
I have a JR transmitter/receiver that can operate on PPM, or PCM (SPCM or ZPCM) and would like to determine the position of the throttle stick and also maybe later, the aileron stick. The JR destruction book says "Output Pulse - 1000-2000 (1500 Neutral)"
I found Hippy's excellent post 14-01-2008, 19:01 that details some great code that I think is relevent to my problem.

This is what I would like some help with...
How do I hook up the receiver to the the proto board, and also later, to a stand alone picaxe (diagram would be great)
Can I power both the proto board and the receiver with their own independent batteries and hook up the receiver's output signal wire to one of the picaxe input pins?
Some simple code to determine the stick position.

Like many novices I am doing it tough in this area - have been confused with pin/leg numbers as opposed to those numbers used in code.(think I have it now though)

Any help would be appreciated
Cheers,
Rocket
 

Rickharris

Senior Member
IF all you need is flashing lights why not use a flashing LED and save a lot of weight and complexity. Or have I missed something vital from your needs?
 

RocketRod

New Member
Well no, Flashing leds are sorted.. I want to understand both the physical and programming methodology associated with radio control (ppm and pcm).. From all my web searching on this subject it seems that there are many more people that would also like this information.
 

Wrenow

Senior Member
There are several threads on this area (reading Hobby RC Radio signals, and outputting servo signals), including one from when I got started on a similar problem http://www.picaxeforum.co.uk/showthread.php?t=5968

There is code to read the stick position in that thread and others.

Basically it is using the pulsin command to get a reading from about 100-200, 150 being the stick's middle position. Some radios may go as far as 75-225, but 150 is still usually neutral (depending on your trim, of course). 150 = 1.5ms or the 1500 number given in your spec - pretty common RC stuff.

You will probably want to pick up an AXE 024 - three servo controller board. You can use one or two of the servo outputs as inputs instead, and a lot of the filtering, etc. is already on the board. It is also quite compact.

Doing a search on the list may not only answer your questions, but give you additional food for thought. Highly recommended.

There are many sources of the information on RC Hobby radio signals, many of which have been linked on this list. It is a pretty mature technology. There are even some articles in the NTXBG knowledgebase as I recall, and on http://rcwarships.org in the Naval War College.

Cheers,

Wreno
 
Last edited:

alband

Senior Member
"How do I hook up the receiver to the the proto board, and also later, to a stand alone picaxe (diagram would be great)"

There are three wires for each servo, black = 0v/GND, red = +V/VCC, the other one (normally yellow or white) is the signal. You need to attach the signal to one of your PICAXE's inputs. You will also need to connect the 0v/GND to the 0v/GND on the protoboard.

"Can I power both the proto board and the receiver with their own independent batteries"

Perhaps. Some receivers use 6v, which is over the limit for a PICAXE. measure the voltage between the red and black, if it is between 4.5-5.5V then you can use it to power the protoboard. If not, then you can use separate power supplies, but will need to connect the power supplies (as said above).

"Some simple code to determine the stick position."

It will end up being easier for you if, you right your own code, as you will understand it much better from the start, making changed a lot easier. You will need to use the "pulsin" command to measure the lengths of the pulses on the pin you connected the white or yellow wire to. While you're testing, you will probably want to see what numbers it gets, so have a look at the "debug" command.
Basically have a look in "manual 2" for "servo" (you wont be using it yet, but it will provied some information you need), then "pulsin" then debug.

Hope that helps. You should be able to get to the stage where you move the stick on the Tx up and down, and watch a number on your computer screen rise and fall. :)
 

RocketRod

New Member
The receiver is powered by 4.8 volt (Typical)
Seems my problem is related to how I hook up the receiver to the proto board..

-alband's info has confirmed that I have to tie the grounds together. Now I might get a result with the Pulsin commands.. - thanks for that.

The thread pointer from Wrenow is also important to me also, I will research that now.

As I mentioned in my post, I do not know enough about electronics (even though over the years I have designed and written many large business computer systems - but not good enough here without simple electronic knowledge) - getting there though :)
Possibly the code Hippy provided in one of his posts may be more than enough to get me going.
Cheers and thanks
 

RocketRod

New Member
Still struggling... Reading output from a JR receiver as advised directly into a standard commercial proto-board does not enable me to read debug values.
I am using simple code to just get a reasonable and stable reading for a selected throttle stick setting ....
main:
pulsin 4,1,w1
debug w1
Pause 500
goto main
Receiver output signal is connected to ADC 4/Out 4 /In 4.. neutral to 0v/GND
Test Servo works OK on this receiver channel, so receiver is transmitting signal to selected output channel.
I am either not connecting to the board correctly or the board design inhibits this kind of test?
Any ideas?
_____________________________________________________
Always simple when you know how
 

alband

Senior Member
Try using a smaller pause. There should be a pulse ever 20ms that varies in length. Try just 15. currently during your pause 25 pulses are bing missed.
It might actually be ok withiugh any pause at all because the debug command takes up quite a bit of time.
 

eclectic

Moderator
Still struggling... Reading output from a JR receiver as advised directly into a standard commercial proto-board does not enable me to read debug values.
I am using simple code to just get a reasonable and stable reading for a selected throttle stick setting ....
main:
pulsin 4,1,w1
debug w1
Pause 500
goto main
Receiver output signal is connected to ADC 4/Out 4 /In 4.. neutral to 0v/GND
Test Servo works OK on this receiver channel, so receiver is transmitting signal to selected output channel.
I am either not connecting to the board correctly or the board design inhibits this kind of test?
Any ideas?
_____________________________________________________
Always simple when you know how
RR
Can you post some photos of your boards please?

e
 

RocketRod

New Member
Removed the pause - no change
* with signal wire disconnected only..(no ground and no power to receiver) the debug variable is static at zero
* with only the signal wire from receiver connected..(no ground and no power to receiver but power to proto board) the debug variable records random numbers zero to 600 ( some above)
* with the signal wire connected to pin 4 and receiver battery ground connected..( and power on to receiver and also power on to proto board via it's own supply) the debug variable records random numbers zero to 600 ( some above)

Heres the crunch... If I connect the signal wire to ground and and the ground to pin 4, I get debug response numbers.. stick at low b2 =49, b3 = 8, w1 =2097, stick at high b2 =229, b3 = 7, w1 =2016 - these are with receiver battery connected and proto boards own supply connected.
Now you know why I am confused :)
______________________________________________
It's easy when you know how
 

alband

Senior Member
with the signal wire connected to pin 4 and receiver battery ground connected..( and power on to receiver and also power on to proto board via it's own supply) the debug variable records random numbers zero to 600 ( some above)
I really wouldn't to that if I were you. Sure it's bad for something but not sure what.

There is no need to try different combinations of wires. Set up you RC gear so that it is working by itself (with a Rx plug to spare). Then set up your PICAXE with the following code:
Code:
main: 
pulsin 4,1,w1
debug w1
goto main
Let it run, disconnected. It should give you 0. Then once this is happening (if not, tell us) connect the negative of the PICAXE's power supply with the negative of the RC's power supply. Then connect the signal wire of your spare plug in the Rx to pin4 on the PICAXE (leg 3). Then see what numbers it gives you.
 

lanternfish

Senior Member
Have you metered the Red and Brown leads to ensure you have the correct polarity. A quick Google search servo leads.htmrevealed JR servos have the following lead colours - Red = +ve, Orange = signal, Brown = 0V. Therefore you have the positive lead from the receiver to PICAXE 0V. Not Good!!! You may have damaged the receiver.
 

RocketRod

New Member
:eek:
Thanks for your patience - such a basic mistake, think I AM getting too old for this. For some reason I related the difference in signal output between JR and Futaba to the power supplied. -Stupid... :mad:
Low stick gives 110, High gives 190.
Anyway I guess that this is what these forums are about. - Hope I can help someone with a programming problem someday. :)

Thanks everyone, I am now up running.

_________________________________
Always simple when you get help from the forum
 

RocketRod

New Member
For all those interested, I have posted a picture of the correct proto board receiver connection setup at http://rod.hutchins.googlepages.com/picaxe
Cheers


______________________________________________________________
Albert Einstein
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.
 
Top