1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-352 Increase expo effect like 'superExpo'

This commit is contained in:
Laurent Lalanne 2016-07-01 15:30:19 +02:00
parent 5ca24b6d25
commit 273fa60c84
2 changed files with 3 additions and 3 deletions

View File

@ -51,14 +51,14 @@ static float sinAngle = 0.0f;
static float applyExpo(float value, float expo)
{
// note: fastPow makes a small error, therefore result needs to be bound
float exp = boundf(fastPow(1.00695f, expo), 0.5f, 2.0f);
float exp = boundf(fastPow(1.01395948f, expo), 0.25f, 4.0f);
// magic number scales expo
// so that
// expo=100 yields value**10
// expo=0 yields value**1
// expo=-100 yields value**(1/10)
// (pow(2.0,1/100)~=1.00695)
// (pow(4.0,1/100)~=1.01395948)
if (value > 0.0f) {
return boundf(fastPow(value, exp), 0.0f, 1.0f);
} else if (value < -0.0f) {

View File

@ -63,7 +63,7 @@ private:
static const int AUTOMATIC_UPDATE_RATE = 500;
static const int EXPO_CURVE_POINTS_COUNT = 100;
constexpr static const double EXPO_CURVE_CONSTANT = 1.00695;
constexpr static const double EXPO_CURVE_CONSTANT = 1.01395948;
int boardModel;
int m_stabSettingsBankCount;