mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
constdT for gyro fliter
dTGyro
This commit is contained in:
parent
6f13859345
commit
00ae128e3d
2 changed files with 6 additions and 2 deletions
|
@ -689,10 +689,15 @@ void processRx(void)
|
|||
// Gyro Low Pass
|
||||
void filterGyro(void) {
|
||||
int axis;
|
||||
static float dTGyro;
|
||||
static filterStatePt1_t gyroADCState[XYZ_AXIS_COUNT];
|
||||
|
||||
if (!dTGyro) {
|
||||
dTGyro = (float)targetLooptime * 0.000001f;
|
||||
}
|
||||
|
||||
for (axis = 0; axis < XYZ_AXIS_COUNT; axis++) {
|
||||
gyroADC[axis] = filterApplyPt1(gyroADC[axis], &gyroADCState[axis], currentProfile->pidProfile.gyro_cut_hz, dT);
|
||||
gyroADC[axis] = filterApplyPt1(gyroADC[axis], &gyroADCState[axis], currentProfile->pidProfile.gyro_cut_hz, dTGyro);
|
||||
}
|
||||
}
|
||||
void getArmingChannel(modeActivationCondition_t *modeActivationConditions, uint8_t *armingChannel) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue