Skip to content
Discussion options

You must be logged in to vote

Yes. No filter assumes 4 kHz. Every filter's coefficients are computed at boot from the period it actually runs at. There are two time bases:

1. Gyro sampling rate (gyro task). gyroInit() asks the driver for TASK_GYRO_LOOPTIME (250 µs = 4 kHz). The driver's initFn writes back the rate the IMU really delivers into sampleRateIntervalUs, and that becomes gyro.targetLooptime:

gyroDev[0].requestedSampleIntervalUs = TASK_GYRO_LOOPTIME;
gyroDev[0].initFn(&gyroDev[0]);
gyro.targetLooptime = gyroDev[0].sampleRateIntervalUs;

The gyro task is rescheduled to that period (rescheduleTask(TASK_GYRO, getGyroLooptime())). The first-stage anti-aliasing LPF (gyro_anti_aliasing_lpf_hz), which runs in gyroUpd…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@and-sh
Comment options

Answer selected by and-sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants