diydrones/PX4Firmware — pull request #14 by Slatye (2014-09-10 06:06:04+00:00)
Title: PWM encoder input

This commit allows the PX4FMU to capture inputs from a US Digital MA3 encoder connected to the FMU USART2 RTS (used because it's not broken out on the PX4IO so there's no risk of it being used for communications). This encoder is suitable for a vane-style angle of attack or sideslip sensor.

Pulse data (width and period) is transmitted via uORB using pwm_input messages.

Currently this is only implemented for the PX4v1, because I don't have a PixHawk to determine which pins are easily accessible and unused. Adding support for that should be easy, assuming that there are suitable pins available. Support for other PWM-based encoders should also be very straightforward; just a matter of changing the timing limits.

APM code to receive the uORB messages and convert them to an angle of attack is coming, but this code has to go first (the modified APM firmware won't compile without the modified PX4 firmware).