boost control runs in fast callback
This commit is contained in:
parent
cc63b38149
commit
ee513cf452
|
@ -147,7 +147,7 @@ percent_t BoostController::getClosedLoopImpl(float target, float manifoldPressur
|
||||||
return 0;
|
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) {
|
expected<percent_t> BoostController::getClosedLoop(float target, float manifoldPressure) {
|
||||||
|
@ -181,11 +181,11 @@ void BoostController::setOutput(expected<float> output) {
|
||||||
|
|
||||||
void BoostController::update() {
|
void BoostController::update() {
|
||||||
if (!hasInitBoost) {
|
if (!hasInitBoost) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pid.iTermMin = -50;
|
m_pid.iTermMin = -20;
|
||||||
m_pid.iTermMax = 50;
|
m_pid.iTermMax = 20;
|
||||||
|
|
||||||
rpmTooLow = Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->boostControlMinRpm;
|
rpmTooLow = Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->boostControlMinRpm;
|
||||||
tpsTooLow = Sensor::getOrZero(SensorType::Tps1) < engineConfiguration->boostControlMinTps;
|
tpsTooLow = Sensor::getOrZero(SensorType::Tps1) < engineConfiguration->boostControlMinTps;
|
||||||
|
|
|
@ -160,10 +160,6 @@ void Engine::periodicSlowCallback() {
|
||||||
|
|
||||||
updateFans(module<AcController>().unmock().isAcEnabled());
|
updateFans(module<AcController>().unmock().isAcEnabled());
|
||||||
|
|
||||||
#if EFI_BOOST_CONTROL
|
|
||||||
engine->boostController.update();
|
|
||||||
#endif // EFI_BOOST_CONTROL
|
|
||||||
|
|
||||||
#if (BOARD_TLE8888_COUNT > 0)
|
#if (BOARD_TLE8888_COUNT > 0)
|
||||||
tle8888startup();
|
tle8888startup();
|
||||||
#endif
|
#endif
|
||||||
|
@ -554,6 +550,10 @@ void Engine::periodicFastCallback() {
|
||||||
tachSignalCallback();
|
tachSignalCallback();
|
||||||
|
|
||||||
engine->engineModules.apply_all([](auto & m) { m.onFastCallback(); });
|
engine->engineModules.apply_all([](auto & m) { m.onFastCallback(); });
|
||||||
|
|
||||||
|
#if EFI_BOOST_CONTROL
|
||||||
|
engine->boostController.update();
|
||||||
|
#endif // EFI_BOOST_CONTROL
|
||||||
}
|
}
|
||||||
|
|
||||||
EngineRotationState * getEngineRotationState() {
|
EngineRotationState * getEngineRotationState() {
|
||||||
|
|
Loading…
Reference in New Issue