mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-22 07:45:24 +03:00
Fixed initialization bug
This commit is contained in:
parent
d6d6127310
commit
103bed8b46
1 changed files with 3 additions and 1 deletions
|
@ -465,7 +465,9 @@ int16_t fixedWingPitchToThrottleCorrection(int16_t pitch)
|
||||||
{
|
{
|
||||||
// Calculate base throttle correction from pitch moving average
|
// Calculate base throttle correction from pitch moving average
|
||||||
const int16_t movingAverageCycles = 128; //Number of main loop cycles for average calculation
|
const int16_t movingAverageCycles = 128; //Number of main loop cycles for average calculation
|
||||||
static int16_t averagePitch = (averagePitch * movingAverageCycles + pitch - averagePitch) / movingAverageCycles;
|
static int16_t averagePitch = 0;
|
||||||
|
|
||||||
|
averagePitch = (averagePitch * movingAverageCycles + pitch - averagePitch) / movingAverageCycles;
|
||||||
const int16_t baseThrottleCorrection = DECIDEGREES_TO_DEGREES(averagePitch) * navConfig()->fw.pitch_to_throttle;
|
const int16_t baseThrottleCorrection = DECIDEGREES_TO_DEGREES(averagePitch) * navConfig()->fw.pitch_to_throttle;
|
||||||
|
|
||||||
// Calculate final throttle correction
|
// Calculate final throttle correction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue