Hi
I was wondering if its possible to read the output of an rc-receiver (DSM2 AR6200 2,4 GHZ) With the Arduino Mega. I would just need the signal that goes to the servos attached to it. I tried using the ServoDecode library from the arduino forums. Somehow it can’t sync with my receiver.
I’m not sure if my receiver outputs a PPM signal. But wouldnt it be possible to read every channel of the receiver separatelly? doesn’t every receiver output the same type of signal to the servos?
Has anyone done this before?
I take that you are reading the servo signal that is output on one the DSM2 RX output (6 channel?) That should be similar to reading any other servo signal. A pulse whose width goes from 1ms - 2ms.
I don’t know about Arduino, but I do it in assembly with PIC and it was just a routine of waiting for the IO pin to be in logic 0. when the pin goes 1 then start counting or measuring time until the pin goes 0 again. You can do it by using interrupt & timer also.
largowinch:
I’m not sure if my receiver outputs a PPM signal.
In fact it's PWM, i.e. Pulse Width Modulation. PPM and PCM are modulations being used between your remote control and the receiver. Consider ThanhTran's suggestions.
largowinch:
But wouldnt it be possible to read every channel of the receiver separatelly?
Sure, re-check your wiring.
largowinch:
Doesn’t every receiver output the same type of signal to the servos?
Yes, the same kind, but not the exact same pulses. For example, JR, Futaba, and Multiplex differ quite a bit.
thank you both for your reply!
In order to measure the pulse, do i have to connect the receiver to the analog pins and do analogread() or is it a digital signal?
The pins that connect to the receiver can be digital pin. Analog pins are used when you want to read analog value (voltage) or compare values.
thank you all for your answers. I managed to read read the signals from the receiver using pulseIn() on the arduino. However, the signal is not measured accuratelly… i used a low-pass filter, this solves the jitter problem, but makes the whole thing slower and the servos less responsive.
Is there a way reading 4 channels from the receiver using interrupt or timers?
How bad is the jitter?
I don’t know the Arduino library, so I can’t answer. I guess you can find what you need from the code mentioned one one of the projects mentioned here:
http://www.rcgroups.com/forums/showthread.php?t=1066119
I’m pretty sure you can find some example from AVRFreaks to read pulse length using interrupt & timer.
You probably get better response from the AVR Programmer forum
viewforum.php?f=7
-Thanh