I was wondering about PPM decoder for a while. I liked to have receiver on edge of the wing, but routing of all servo cables there is nonsense. My idea to build one came from accident when I damaged my one of APM1’s main MCU I2C pins. I replaced it with new one and then I get idea to reuse damaged MCU for PPM decoder (I2c wont be needed) They are not cheap (ATMEGA2560 are 18$ in mouser) and it's a pity to throw it away. I realized that APM uses sum PPM signal and can drive 8 servos by hardware timers and has libraries for it so software can’t be too hard. I fired up Eagle and started to draw....
I peeked in schematic of APM1 and duplicated servo and PPM pinout. Basically, you can use APM1 without oilpan to do the same! Then I realized it would be a good idea to do galvanic isolation of receiver to suppress any interference coming through the wires. This is really simple, just isolated 1W DC/DC 5V/5V converter to power receiver side and ADUM1301 isolator IC. Simple optocoupler would do the job well, but I was too lazy as ADUM’s are really simple to work with. It is quick and dirty design at all, board is autorouted with some hand corrections. Parts are chosen to be obtainable in local store here in Czech.
I soldered all stuff on board, powered it up and arduino bootloader was not answering :) Long story short, failed crystal. With new one, everything goes well. I still haven't ADUM1301 IC, so there is a piece of wire instead. But receiver has its own power via DC/DC.
This was easies part. I just compiled \ArduPlane-2.32\libraries\APM_RC\examples\APM1_radio\APM1_radio.pde it was all I needed to do! This example is doing exactly what I needed. Decode PPM signal and send it to servos. Well I commented out serial debug messages and added blinking of LED.
Real life tests
I was really brave (or stupid) to put this to my greatest, most expensive and most labour intensive plane ever, UltraMaxiSwift (will show it in another blog post) and even together with my own OpenLRS clone. Everything is working well, it has about one hour in the air.
When I fix my APM completely, it will replace this decoder. Maybe I will use it in other plane.
But one thing worth to be experimented. If I add second PPM receiver, Decoder can do a sort of diversity. It would choose valid PPM signal from second receiver if first goes to failsafe or vanishes completely.
Is ATMEGA2560 (or 1280) able to decode second PPM stream? I offer piece of hardware to someone who will write software for it :)
Pros and Cons
+ Place receiver freely in airframe
+ Galvanic isolation to help avoid interference
+ Possibility to alter RC signal (mixer, complex failsafe...)
-When this thing fails your plane is doomed
-Not need when APM onboard as it has PPM input
-ATMEGA2560 (or 1280) is expensive overkill for such simple task
If you like this, send my board design to your favourite fab house and DIY. Probably not needed by most of you. I wanted to thank all APM community for such great project.