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

View File

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

View File

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