diff --git a/spinnyboy_rust/src/bin/dc_driver/dshot.rs b/spinnyboy_rust/src/bin/dc_driver/dshot.rs index c5e4a97..a5dbe53 100644 --- a/spinnyboy_rust/src/bin/dc_driver/dshot.rs +++ b/spinnyboy_rust/src/bin/dc_driver/dshot.rs @@ -16,6 +16,7 @@ fn calculate_crc(frame: u16) -> u16 { IFlight XING-E Pro 2207 2750KV */ const XING_EPRO_22_POLES: u32 = 4; +const XING_EPRO_22_MAGNETS: u32 = 14; #[allow(dead_code)] #[allow(non_camel_case_types)] @@ -322,8 +323,9 @@ impl<'a> DShot<'a> { let period_ms: u32 = (mantissa << exp).into(); let erpm = (60 * 1_000_000) / period_ms; - let rpm = erpm/XING_EPRO_22_POLES; - self.rpm.set(Some((rpm as f32 / 1.7) as _)) + let rpm = erpm/(XING_EPRO_22_MAGNETS/2); + // let rpm = erpm/7; + self.rpm.set(Some((rpm as f32) as _)) } } }