Make ETB low limit configurable fix #4119

This commit is contained in:
rusefillc 2022-05-02 05:24:50 -04:00
parent b2ea4928aa
commit 3b3f62b24f
3 changed files with 9 additions and 7 deletions

View File

@ -330,6 +330,12 @@ expected<percent_t> EtbController::getSetpointEtb() {
targetPosition = interpolateClamped(etbRpmLimit, targetPosition, fullyLimitedRpm, 0, rpm);
}
float minPosition = engineConfiguration->etbMinimumPosition;
if (minPosition < 0.01) {
// compatibility with legacy tunes, todo: remove in Nov of 2022
minPosition = 1;
}
// Keep the throttle just barely off the lower stop, and less than the user-configured maximum
float maxPosition = engineConfiguration->etbMaximumPosition;
@ -341,7 +347,7 @@ expected<percent_t> EtbController::getSetpointEtb() {
maxPosition = minF(maxPosition, 100);
}
targetPosition = clampF(1, targetPosition, maxPosition);
targetPosition = clampF(minPosition, targetPosition, maxPosition);
#if EFI_TUNER_STUDIO
if (m_function == ETB_Throttle1) {

View File

@ -66,6 +66,8 @@ void setDefaultBaseEngine() {
engineConfiguration->tachPulseDuractionMs = 0.5;
engineConfiguration->tachPulsePerRev = 1;
engineConfiguration->etbMinimumPosition = 1;
engineConfiguration->etbMaximumPosition = 100;
engineConfiguration->tcuInputSpeedSensorTeeth = 1;
engineConfiguration->issFilterReciprocal = 2;

View File

@ -108,12 +108,6 @@ struct_no_prefix engine_configuration_s
! see 'blockingFactor' in rusefi.ini
#define BLOCKING_FACTOR 256
! Back in the day we wanted enums to be 32 bit integers.
! as of 2020 preference is with ' __attribute__ ((__packed__))' allowing one-byte enums
! todo: Technical debt: ENUM_32_BITS #3874
#define ENUM_16_BITS 60000
#define ENUM_32_BITS 2000000000
#define AUX_ANALOG_INPUT_COUNT 8
#define LUA_PWM_COUNT 8