antilag: TPS vs APS/PPS vs driver intent #4917

This commit is contained in:
rusefillc 2022-12-27 19:37:33 -05:00
parent 2d586729ab
commit f685713a19
3 changed files with 15 additions and 13 deletions

View File

@ -54,10 +54,10 @@ bool AntilagSystemBase::isALSMaxCLTCondition() const {
return engineConfiguration->ALSMaxCLT > clt; return engineConfiguration->ALSMaxCLT > clt;
} }
bool AntilagSystemBase::isALSMaxTPSCondition() const { bool AntilagSystemBase::isALSMaxThrottleIntentCondition() const {
int tps = Sensor::getOrZero(SensorType::Tps1); int throttleIntent = Sensor::getOrZero(SensorType::DriverThrottleIntent);
return engineConfiguration->ALSMaxTPS > tps; return engineConfiguration->ALSMaxTPS > throttleIntent;
} }
bool AntilagSystemBase::isAntilagConditionMet() { bool AntilagSystemBase::isAntilagConditionMet() {
@ -66,18 +66,19 @@ bool AntilagSystemBase::isAntilagConditionMet() {
ALSMaxRPMCondition = isALSMaxRPMCondition(); ALSMaxRPMCondition = isALSMaxRPMCondition();
ALSMinCLTCondition = isALSMinCLTCondition(); ALSMinCLTCondition = isALSMinCLTCondition();
ALSMaxCLTCondition = isALSMaxCLTCondition(); ALSMaxCLTCondition = isALSMaxCLTCondition();
ALSMaxTPSCondition = isALSMaxTPSCondition(); ALSMaxThrottleIntentCondition = isALSMaxThrottleIntentCondition();
ALSSwitchCondition = isInsideALSSwitchCondition(); ALSSwitchCondition = isInsideALSSwitchCondition();
return ALSMinRPMCondition && ALSMaxRPMCondition && ALSMinCLTCondition && ALSMaxCLTCondition && ALSMaxTPSCondition && ALSSwitchCondition; return ALSMinRPMCondition &&
ALSMaxRPMCondition &&
ALSMinCLTCondition &&
ALSMaxCLTCondition &&
ALSMaxThrottleIntentCondition &&
ALSSwitchCondition;
} }
void AntilagSystemBase::update() { void AntilagSystemBase::update() {
if (!engineConfiguration->antiLagEnabled) { isAntilagCondition = engineConfiguration->antiLagEnabled && isAntilagConditionMet();
return;
}
isAntilagCondition = isAntilagConditionMet();
} }
#endif /* EFI_ANTILAG_SYSTEM */ #endif /* EFI_ANTILAG_SYSTEM */

View File

@ -20,7 +20,8 @@ public:
bool isALSMaxRPMCondition() const; bool isALSMaxRPMCondition() const;
bool isALSMinCLTCondition() const; bool isALSMinCLTCondition() const;
bool isALSMaxCLTCondition() const; bool isALSMaxCLTCondition() const;
bool isALSMaxTPSCondition() const; bool isALSMaxThrottleIntentCondition() const;
bool isAntilagConditionMet();
bool isInsideALSSwitchCondition(); bool isInsideALSSwitchCondition();
/* enabled and all conditions above */
bool isAntilagConditionMet();
}; };

View File

@ -5,7 +5,7 @@ bit ALSMinRPMCondition
bit ALSMaxRPMCondition bit ALSMaxRPMCondition
bit ALSMinCLTCondition bit ALSMinCLTCondition
bit ALSMaxCLTCondition bit ALSMaxCLTCondition
bit ALSMaxTPSCondition bit ALSMaxThrottleIntentCondition
bit isALSSwitchActivated bit isALSSwitchActivated
bit ALSActivatePinState bit ALSActivatePinState
bit ALSSwitchCondition bit ALSSwitchCondition