boost control runs in fast callback

This commit is contained in:
Matthew Kennedy 2023-09-07 15:32:21 -04:00 committed by rusefi
parent cc63b38149
commit ee513cf452
2 changed files with 8 additions and 8 deletions

View File

@ -147,7 +147,7 @@ percent_t BoostController::getClosedLoopImpl(float target, float manifoldPressur
return 0;
}
return m_pid.getOutput(target, manifoldPressure, SLOW_CALLBACK_PERIOD_MS / 1000.0f);
return m_pid.getOutput(target, manifoldPressure, FAST_CALLBACK_PERIOD_MS / 1000.0f);
}
expected<percent_t> BoostController::getClosedLoop(float target, float manifoldPressure) {
@ -181,11 +181,11 @@ void BoostController::setOutput(expected<float> output) {
void BoostController::update() {
if (!hasInitBoost) {
return;
return;
}
m_pid.iTermMin = -50;
m_pid.iTermMax = 50;
m_pid.iTermMin = -20;
m_pid.iTermMax = 20;
rpmTooLow = Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->boostControlMinRpm;
tpsTooLow = Sensor::getOrZero(SensorType::Tps1) < engineConfiguration->boostControlMinTps;

View File

@ -160,10 +160,6 @@ void Engine::periodicSlowCallback() {
updateFans(module<AcController>().unmock().isAcEnabled());
#if EFI_BOOST_CONTROL
engine->boostController.update();
#endif // EFI_BOOST_CONTROL
#if (BOARD_TLE8888_COUNT > 0)
tle8888startup();
#endif
@ -554,6 +550,10 @@ void Engine::periodicFastCallback() {
tachSignalCallback();
engine->engineModules.apply_all([](auto & m) { m.onFastCallback(); });
#if EFI_BOOST_CONTROL
engine->boostController.update();
#endif // EFI_BOOST_CONTROL
}
EngineRotationState * getEngineRotationState() {