SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
 
Thread Tools
Old Mar 28, 2003, 09:02 AM
Miem Chan
Guest
n/a Posts
Reading and measuring R/C pulse train with AVR

As most of you may know that R/C servo motors receive 1-2ms pulses repeated
25-50 times per second. Duration of the pulse defines the R/C servo position
ie.1.5ms long pulse moves the R/C servo motor in to center position. Multi
channnel R/C transmitters send the each channel data one ofter another
followed by a short break and repeats the sequence.


Ch1 Ch2 Ch1 Ch2
---- ---- ---- ---
-
| | | | | |
| |
---- --------- ---------------- ----------- ----...


I want to build an AVR based unit to read in above mentioned R/C servo
control stream and display/record the pulse duration of each channel with
8-10 bit resolution.

Would anyone comment on how to solve this problem ?

Thanks.

Miem Chan
miemchan@yahoo.com



Old Mar 28, 2003, 10:22 AM
John Morley
Guest
n/a Posts
Re: Reading and measuring R/C pulse train with AVR

Miem,

I've done a similar thing using a PIC processor and just a few channels.
It was pretty trivial to scan the individual servo inputs to detect
level transitions, and use counters to determine the pulse widths for
each channel. Specifically, what information do you need? Also, I've
found that the repetition or "frame" interval for a given channel is
about 20mS.

John



Miem Chan wrote:
> As most of you may know that R/C servo motors receive 1-2ms pulses repeated
> 25-50 times per second. Duration of the pulse defines the R/C servo position
> ie.1.5ms long pulse moves the R/C servo motor in to center position. Multi
> channnel R/C transmitters send the each channel data one ofter another
> followed by a short break and repeats the sequence.
>
>
> Ch1 Ch2 Ch1 Ch2
> ---- ---- ---- ---
> -
> | | | | | |
> | |
> ---- --------- ---------------- ----------- ----...
>
>
> I want to build an AVR based unit to read in above mentioned R/C servo
> control stream and display/record the pulse duration of each channel with
> 8-10 bit resolution.
>
> Would anyone comment on how to solve this problem ?
>
> Thanks.
>
> Miem Chan
> miemchan@yahoo.com
>
>
>


Old Mar 28, 2003, 10:52 AM
Miem Chan
Guest
n/a Posts
Re: Reading and measuring R/C pulse train with AVR


I have AVR controllers and BASCOM compiler. And I'm investigating different
ways measuring pulse durations. I'm not sure how to measure (with or without
timer) 1ms long pulse (max) with 10bit accuracy (1ms/1024).

Miem Chan
miemchan@yahoo.com

"John Morley" <jmorley@nospamanalysistech.com> wrote in message
news:3E846666.6020704@nospamanalysistech.com...
> Miem,
>
> I've done a similar thing using a PIC processor and just a few channels.
> It was pretty trivial to scan the individual servo inputs to detect
> level transitions, and use counters to determine the pulse widths for
> each channel. Specifically, what information do you need? Also, I've
> found that the repetition or "frame" interval for a given channel is
> about 20mS.
>
> John
>
>
>
> Miem Chan wrote:
> > As most of you may know that R/C servo motors receive 1-2ms pulses

repeated
> > 25-50 times per second. Duration of the pulse defines the R/C servo

position
> > ie.1.5ms long pulse moves the R/C servo motor in to center position.

Multi
> > channnel R/C transmitters send the each channel data one ofter another
> > followed by a short break and repeats the sequence.
> >
> >
> > Ch1 Ch2 Ch1 Ch2

>

---- ---- ---
> > -
> > | | | | | |
> > | |

>

--------- ---------------- ----------- ----...
> >
> >
> > I want to build an AVR based unit to read in above mentioned R/C servo
> > control stream and display/record the pulse duration of each channel

with
> > 8-10 bit resolution.
> >
> > Would anyone comment on how to solve this problem ?
> >
> > Thanks.
> >
> > Miem Chan
> > miemchan@yahoo.com
> >
> >
> >

>



Old Mar 28, 2003, 11:12 AM
Tramm Hudson
Guest
n/a Posts
Re: Reading and measuring R/C pulse train with AVR

Miem Chan <MiemChan@yahoo.com> wrote:
> [...] I want to build an AVR based unit to read in above mentioned R/C servo
> control stream and display/record the pulse duration of each channel with
> 8-10 bit resolution.


My autopilot board reads Futaba and JR PPM signals with 13 bit
resolution. I've also started adding support for Futaba PCM1024
decoding. And we're using the ATmega163 or ATmega16 MCUs.

GPLed source code for the PPM decoder is here:

http://autopilot.sf.net/cgi-bin/sour...ard/rev2/ppm.h

Rotomotion is selling kits based on these designs that includes
the PPM decoder, 10 normal servo drivers, 1 high speed servo driver,
engine tach and three axis inertial sensors:

http://www.rotomotion.com/prd_REV2.4.6DOFK.html

Good luck!
Trammell
--
-----|----- hudson@osresearch.net W 240-283-1700
*>=====[]L\ hudson@rotomotion.com M 505-463-1896
' -'-`- http://www.swcp.com/~hudson/ KC5RNF
Old Mar 29, 2003, 02:22 PM
The Natural Philosopher
Guest
n/a Posts
Re: Reading and measuring R/C pulse train with AVR

Miem Chan wrote:

> I have AVR controllers and BASCOM compiler. And I'm investigating different
> ways measuring pulse durations. I'm not sure how to measure (with or without
> timer) 1ms long pulse (max) with 10bit accuracy (1ms/1024).



That's easy - set up a counter at 1Mbps and gate it with teh servo pulse.

Then what it stops at is the pulse length in microseconds :-)

How you achieve that depends on the hardware/software you have
available. If it was pure hardware you would do something like use the
down part of teh pulse to rest the counter and hold it reset, then when
it goes up it statrs cvounting, then the transition to 'down' clocks the
output into a parallel latch, where you can read it.

On a PIC, I exepcet you could use interrupts on the edges to triger a
routine to do the same for the internal counters.



>
> Miem Chan
> miemchan@yahoo.com
>
> "John Morley" <jmorley@nospamanalysistech.com> wrote in message
> news:3E846666.6020704@nospamanalysistech.com...
>
>>Miem,
>>
>>I've done a similar thing using a PIC processor and just a few channels.
>> It was pretty trivial to scan the individual servo inputs to detect
>>level transitions, and use counters to determine the pulse widths for
>>each channel. Specifically, what information do you need? Also, I've
>>found that the repetition or "frame" interval for a given channel is
>>about 20mS.
>>
>>John
>>
>>
>>
>>Miem Chan wrote:
>>
>>>As most of you may know that R/C servo motors receive 1-2ms pulses
>>>

> repeated
>
>>>25-50 times per second. Duration of the pulse defines the R/C servo
>>>

> position
>
>>>ie.1.5ms long pulse moves the R/C servo motor in to center position.
>>>

> Multi
>
>>>channnel R/C transmitters send the each channel data one ofter another
>>>followed by a short break and repeats the sequence.
>>>
>>>
>>> Ch1 Ch2 Ch1 Ch2
>>>

> ---- ---- ---
>
>>>-
>>> | | | | | |
>>>| |
>>>

> --------- ---------------- ----------- ----...
>
>>>
>>>I want to build an AVR based unit to read in above mentioned R/C servo
>>>control stream and display/record the pulse duration of each channel
>>>

> with
>
>>>8-10 bit resolution.
>>>
>>>Would anyone comment on how to solve this problem ?
>>>
>>>Thanks.
>>>
>>>Miem Chan
>>>miemchan@yahoo.com
>>>
>>>
>>>
>>>

>
>



 


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion AVR based R/C Sim interface with transmitter diagnostics angmoh Simulators 1 Aug 01, 2006 04:35 AM
Rave I am back after a 15 year absence to R/C and need help with electric sa-woody Electric Plane Talk 14 Dec 30, 2004 11:00 PM