1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00

make the accZ lpf used for althold configurable

set the variable accz_lpf_cutoff to the desired cutoff frequency
this can help to make althold smoother on copters with lots of
vibrations

Conflicts:

	src/cli.c
	src/config.c
	src/imu.c
	src/mw.h
This commit is contained in:
luggi 2014-06-03 16:32:18 +02:00 committed by Dominic Clifton
parent c53268b7be
commit 1bf806f54c
5 changed files with 13 additions and 5 deletions

View file

@ -61,6 +61,7 @@ int32_t errorAltitudeI = 0;
int32_t vario = 0; // variometer in cm/s
float throttleAngleScale;
float fc_acc;
int32_t BaroPID = 0;
@ -103,6 +104,11 @@ void calculateThrottleAngleScale(uint16_t throttle_correction_angle)
throttleAngleScale = (1800.0f / M_PI) * (900.0f / throttle_correction_angle);
}
void calculateAccZLowPassFilterRCTimeConstant(float accz_lpf_cutoff)
{
fc_acc = 0.5f / (M_PI * accz_lpf_cutoff); // calculate RC time constant used in the accZ lpf
}
void computeIMU(rollAndPitchTrims_t *accelerometerTrims, uint8_t mixerConfiguration)
{
static int16_t gyroYawSmooth = 0;
@ -207,9 +213,6 @@ int32_t applyDeadband(int32_t value, int32_t deadband)
return value;
}
#define F_CUT_ACCZ 10.0f // 10Hz should still be fast enough
static const float fc_acc = 0.5f / (M_PI * F_CUT_ACCZ);
// rotate acc into Earth frame and calculate acceleration in it
void acc_calc(uint32_t deltaT)
{