1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

OP-1317 Low-pass filter parameters added to airpeedSettings: IMUBasedEstimationLowPassPeriod1 pre-filter period in seconds, IMUBasedEstimationLowPassPeriod2 filter period in seconds. Oscillations with shorter periods than these, are filtered. If airspeed has too much noise increase IMUBasedEstimationLowPassPeriod2, else if it is too smooth descrease it.

This commit is contained in:
Andres 2014-05-23 11:55:06 +02:00
parent 822b067d98
commit 9e80c4da9c
2 changed files with 5 additions and 7 deletions

View File

@ -181,12 +181,9 @@ void imu_airspeedInitialize()
void imu_airspeedGet(AirspeedSensorData *airspeedData, AirspeedSettingsData *airspeedSettings)
{
// pre-filter frequency rate
// corresponds to a cut-off frequency of 0.04 Hz or a period of 25 sec
const float ff = 0.04f * airspeedSettings->SamplePeriod / 1000.0f;
// good values for turbulent situation: cut-off 0.01 Hz or a period of 100 sec
const float ffV = 0.01f * airspeedSettings->SamplePeriod / 1000.0f;
// good values for steady situation: cut-off 0.05 Hz or a period of 20 sec
// const float ffV=0.05 * 1000.0f/airspeedSettings->SamplePeriod;
const float ff = (float)(airspeedSettings->SamplePeriod) / 1000.0f / airspeedSettings->IMUBasedEstimationLowPassPeriod1;
// filter frequency rate
const float ffV = (float)(airspeedSettings->SamplePeriod) / 1000.0f / airspeedSettings->IMUBasedEstimationLowPassPeriod2;
float normVel2;
float normDiffAttitude2;

View File

@ -5,7 +5,8 @@
<field name="ZeroPoint" units="raw" type="uint16" elements="1" defaultvalue="0"/>
<field name="Scale" units="raw" type="float" elements="1" defaultvalue="1.0"/>
<field name="AirspeedSensorType" units="" type="enum" elements="1" options="PixHawkAirspeedMS4525DO,EagleTreeAirspeedV3,DIYDronesMPXV5004,DIYDronesMPXV7002,GroundSpeedBasedWindEstimation,None" defaultvalue="None"/>
<field name="GroundSpeedBasedEstimationLowPassAlpha" units="" type="float" elements="1" defaultvalue="0.08" />
<field name="IMUBasedEstimationLowPassPeriod1" units="s" type="uint8" elements="1" defaultvalue="25" />
<field name="IMUBasedEstimationLowPassPeriod2" units="s" type="uint8" elements="1" defaultvalue="100" />
<access gcs="readwrite" flight="readwrite"/>
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
<telemetryflight acked="true" updatemode="onchange" period="0"/>