Mar 28, 2003, 08:02 AM Miem Chan 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
 Mar 28, 2003, 09:22 AM John Morley 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 > > >
 Mar 28, 2003, 09:52 AM Miem Chan 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" 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 > > > > > > >
 Mar 28, 2003, 10:12 AM Tramm Hudson Tramm Hudson Guest n/a Posts Re: Reading and measuring R/C pulse train with AVR Miem Chan 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
 Mar 29, 2003, 01:22 PM The Natural Philosopher 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" 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 >>> >>> >>> >>> > >