Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize throttle-based dynamic filter cutoff updates
Current logic produces excessive load because it updates the filter cutoffs every PID loop based on the throttle value. The throttle values only change based on receive RX packets so they change relatively infrequently compared to the PID loop. However with rc smoothing on throttle the value can change every PID loop. But in reality we don't really need to adjust the filter cutoffs for every tiny change to the floating point throttle value. This change quantizes the throttle in to 100 steps and uses that to compare to the previous value to decide if the filter cutoffs need to be updated. While this reduces the resolution of the filter cutoffs it in turn dramatically reduces the processing overhead. IF needed the quantization steps can be increased for more resolution but at the cost of some performance.
- Loading branch information