etb rev limit indicator (#4483)

This commit is contained in:
Matthew Kennedy 2022-08-25 17:49:21 -07:00 committed by GitHub
parent 80a1c25512
commit 65d7abc162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -332,8 +332,13 @@ expected<percent_t> EtbController::getSetpointEtb() {
auto etbRpmLimit = engineConfiguration->etbRevLimitStart;
if (etbRpmLimit != 0) {
auto fullyLimitedRpm = etbRpmLimit + engineConfiguration->etbRevLimitRange;
float targetPositionBefore = targetPosition;
// Linearly taper throttle to closed from the limit across the range
targetPosition = interpolateClamped(etbRpmLimit, targetPosition, fullyLimitedRpm, 0, rpm);
// rev limit active if the position was changed by rev limiter
etbRevLimitActive = absF(targetPosition - targetPositionBefore) > 0.1f;
}
float minPosition = engineConfiguration->etbMinimumPosition;

View File

@ -10,5 +10,6 @@ float luaAdjustment
float etbIntegralError;;"", 1, 0, -10000, 10000, 3
float etbCurrentTarget;;"%", 1, 0, -10000, 10000, 3
bit etbRevLimitActive
end_struct

View File

@ -1362,6 +1362,7 @@ gaugeCategory = Outputs
indicator = { sd_logging_internal }, "SD logging", "SD logging", white, black, green, black
indicator = { sd_msd }, "SD USB", "SD USB", white, black, green, black
indicator = { isPumpOn }, "No Pump", "Pump", white, black, green, black
indicator = { etbRevLimitActive }, "", "ETB RPM Limit", white, black, yellow, black
; looks like TS would append four system indicators below: Data Logging, ???, Not Connected, Protocol Error