I am working on a quadrotor and am trying to solve the problems described here. In attempts to bring the refresh rate to 100 Hz, I did an analysis of the functions and most of the time 35+ ms is being taken by the RC receiver input function. To tackle this, I have decided on two solutions:
- Use interrupts (
PinChangeInt
library) instead ofpulseIn
- Reduce the frequency of pilot input
The second solution which is much simpler is to simply read the pilot input once in $(n+1)$ PID updates. So, for $n$ times, we have a update time of $8\;ms$, and for the $(n+1)^{th}$ time, we have an update time of T ms. $n$ will be around $10$.
This will create a system that will run on average in $(n*8 + T)/(n+1)\; ms$.
Now, how does a dual/variable frequency affect the PID system? Does the system behave as if working at the effective frequency? I have been searching for some time but I cannot find anything that discusses such a situation.