PX4/Firmware — pull request #212 by LorenzMeier (2013-02-26 08:52:55+00:00)
Title: Make PX4IO rates configurable

This branch is merged with px4io-i2c (which in turn is merged with px4io-i2c-memory-squeeze) and enables rate control on two levels: It allows to set the rate limit for FMU to IO updates (so how often actuator values are sent via I2C), and it allows to configure the PWM rate of IO (so how many PWM pulses happen per second).

The first one is required to enable 200 Hz updates on Multirotors (which seems to work fine, according to Julians testing), the second one is required for bogus ESCs with input filtering, and it cuts down the worst-case latency to 2.5 ms if we choose to not sync the PWM generation to when actual control updates happen.

Based on scope measurements this means that we have an average delay of 0.8 ms (I2C) + 1.25 ms (sync to PWM generation) + 2 ms (length of PWM pulse) from controller output to motor output.

Compared to e.g. current APM this is considerable faster (since sensor fusion and control output calculation is much faster), and on an absolute scale it means one prop at 100 Hz (typical quadrotor hover prop speed) just can make 0.4 revolutions during the full latency. Given prop inertia and efficiency considerations, this latency is perfectly fine, even for high-performance and agile systems there should be no effects on the control response.