mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-20 14:55:18 +03:00
Fix for control smoothness bug introduced in PR #6104
This commit is contained in:
parent
ab60dfb0e2
commit
a3ada125d6
1 changed files with 3 additions and 3 deletions
|
@ -76,16 +76,16 @@ static int8_t loiterDirYaw = 1;
|
||||||
static float getSmoothnessCutoffFreq(float baseFreq)
|
static float getSmoothnessCutoffFreq(float baseFreq)
|
||||||
{
|
{
|
||||||
uint16_t smoothness = 10 - navConfig()->fw.control_smoothness;
|
uint16_t smoothness = 10 - navConfig()->fw.control_smoothness;
|
||||||
return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.01f;
|
return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculates the cutoff frequency for smoothing out pitchToThrottleCorrection
|
// Calculates the cutoff frequency for smoothing out pitchToThrottleCorrection
|
||||||
// pitch_to_throttle_smooth valid range from 0 to 9
|
// pitch_to_throttle_smooth valid range from 0 to 9
|
||||||
// resulting cutoff_freq ranging from baseFreq downwards to ~0.11Hz
|
// resulting cutoff_freq ranging from baseFreq downwards to ~0.01Hz
|
||||||
static float getPitchToThrottleSmoothnessCutoffFreq(float baseFreq)
|
static float getPitchToThrottleSmoothnessCutoffFreq(float baseFreq)
|
||||||
{
|
{
|
||||||
uint16_t smoothness = 10 - navConfig()->fw.pitch_to_throttle_smooth;
|
uint16_t smoothness = 10 - navConfig()->fw.pitch_to_throttle_smooth;
|
||||||
return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.1f;
|
return 0.001f * baseFreq * (float)(smoothness*smoothness*smoothness) + 0.01f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue