diff --git a/fw/motor_position.h b/fw/motor_position.h index 97b45cbf..c6da393c 100644 --- a/fw/motor_position.h +++ b/fw/motor_position.h @@ -470,6 +470,12 @@ class MotorPosition { } else if (mode == M::kCuiAmt21) { source_config.cpr = 16384; } + const float source_rate_hz = + 1000000.0f / + aux_config->uart.poll_rate_us; + const float max_pll_hz = source_rate_hz / 10.0f; + source_config.pll_filter_hz = + std::min(source_config.pll_filter_hz, max_pll_hz); break; } case SourceConfig::kSpi: {