Skip to content

Commit dd820af

Browse files
mbald1barafael
authored andcommitted
Add detailed LPF specs to DigitalLowPassFilter enum docs
1 parent 3473785 commit dd820af

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

src/config.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
/// - Bandwidth (Hz): How much high-frequency data passes through
1818
/// - Delay (ms): How long it takes for changes to be reflected
1919
/// - Noise reduction: How much sensor noise is filtered out
20+
///
21+
/// Based on values from the official register map [RM-MPU-6000A](https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Register-Map1.pdf).
2022
#[derive(Copy, Clone, Debug)]
2123
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
2224
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -25,40 +27,83 @@ pub enum DigitalLowPassFilter {
2527
/// - Fastest response
2628
/// - Highest bandwidth
2729
/// - Least noise reduction
30+
/// - Only option that allows for 8kHz gyro sampling
31+
/// # LPF Specs
32+
/// ***
33+
/// - Accel Bandwidth: 260Hz
34+
/// - Accel Delay: ~0ms
35+
/// - Gyro Bandwidth: 256Hz
36+
/// - Gyro Delay: 0.98ms
2837
Filter0 = 0,
2938

3039
/// Light filtering
3140
/// - Good balance for most uses
3241
/// - Quick response
3342
/// - Moderate noise reduction
43+
/// # LPF Specs
44+
/// ***
45+
/// - Accel Bandwidth: 184Hz
46+
/// - Accel Delay: 2ms
47+
/// - Gyro Bandwidth: 188Hz
48+
/// - Gyro Delay: 1.9ms
3449
Filter1 = 1,
3550

3651
/// Moderate filtering
3752
/// - Balanced response/filtering
3853
/// - Good for general motion
54+
/// # LPF Specs
55+
/// ***
56+
/// - Accel Bandwidth: 94Hz
57+
/// - Accel Delay: 3.0ms
58+
/// - Gyro Bandwidth: 98Hz
59+
/// - Gyro Delay: 2.8ms
3960
Filter2 = 2,
4061

4162
/// Strong filtering
4263
/// - Better noise reduction
4364
/// - Slower response
4465
/// - Good for stable readings
66+
/// # LPF Specs
67+
/// ***
68+
/// - Accel Bandwidth: 44Hz
69+
/// - Accel Delay: 4.9ms
70+
/// - Gyro Bandwidth: 42Hz
71+
/// - Gyro Delay: 4.8ms
4572
Filter3 = 3,
4673

4774
/// Very strong filtering
4875
/// - High noise reduction
4976
/// - Significant delay
5077
/// - Good for slow movements
78+
/// # LPF Specs
79+
/// ***
80+
/// - Accel Bandwidth: 21Hz
81+
/// - Accel Delay: 8.5ms
82+
/// - Gyro Bandwidth: 20Hz
83+
/// - Gyro Delay: 8.3ms
5184
Filter4 = 4,
5285

5386
/// Heavy filtering
5487
/// - Very high noise reduction
5588
/// - Long delay
5689
/// - Best for very slow changes
90+
/// # LPF Specs
91+
/// ***
92+
/// - Accel Bandwidth: 10Hz
93+
/// - Accel Delay: 13.8ms
94+
/// - Gyro Bandwidth: 10Hz
95+
/// - Gyro Delay: 13.4ms
5796
Filter5 = 5,
5897

5998
/// Maximum filtering
6099
/// - Maximum noise reduction
61100
/// - Longest delay
62101
/// - Use only for nearly static measurements
102+
/// # LPF Specs
103+
/// ***
104+
/// - Accel Bandwidth: 5Hz
105+
/// - Accel Delay: 19.0ms
106+
/// - Gyro Bandwidth: 5Hz
107+
/// - Gyro Delay: 18.6ms
63108
Filter6 = 6,
64109
}

0 commit comments

Comments
 (0)