remove useETBforIdleControl (#5054)

* remove useETBforIdleControl

* etb integrated

* jni weirdness
This commit is contained in:
Matthew Kennedy 2023-02-12 13:49:12 -08:00 committed by GitHub
parent 9f1d4c4bdd
commit aaa3ea2d3e
14 changed files with 17 additions and 50 deletions

View File

@ -50,7 +50,6 @@ static void setupDefaultSensorInputs() {
engineConfiguration->vehicleSpeedSensorInputPin = H144_IN_VSS;
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;
engineConfiguration->useETBforIdleControl = false;
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
engineConfiguration->map.sensor.hwChannel = H144_IN_MAP1;

View File

@ -127,7 +127,6 @@ void setBoardDefaultConfiguration() {
engineConfiguration->fanOnTemperature = 85;
engineConfiguration->fanOffTemperature = 81;
engineConfiguration->useETBforIdleControl = true;
engineConfiguration->etbIdleThrottleRange = 10;
engineConfiguration->cutFuelOnHardLimit = false;
engineConfiguration->idlePidRpmUpperLimit = 300;

View File

@ -53,7 +53,6 @@ static void setupDefaultSensorInputs() {
engineConfiguration->vehicleSpeedSensorInputPin = H144_IN_VSS;
setTPS1Inputs(H144_IN_TPS, H144_IN_AUX1);
engineConfiguration->useETBforIdleControl = true;
setPPSCalibration(0.73, 4.0, 0.34, 1.86);

View File

@ -279,7 +279,5 @@ void setEngineBMW_M73_Proteus() {
// tps and pps
setProteusHitachiEtbDefaults();
engineConfiguration->useETBforIdleControl = true;
}
#endif // HW_PROTEUS

View File

@ -24,7 +24,6 @@ void setGmLs4() {
engineConfiguration->specs.firingOrder = FO_1_8_7_2_6_5_4_3;
engineConfiguration->specs.displacement = 6.2;
engineConfiguration->useETBforIdleControl = true;
engineConfiguration->etbIdleThrottleRange = 15;
engineConfiguration->tChargeAirIncrLimit = 5;

View File

@ -631,7 +631,6 @@ static void setMiataNB2_MRE_common() {
void setMiataNB2_MRE_ETB() {
setMiataNB2_MRE_common();
engineConfiguration->useETBforIdleControl = true;
engineConfiguration->throttlePedalUpVoltage = 1;
// WAT? that's an interesting value, how come it's above 5v?
engineConfiguration->throttlePedalWOTVoltage = 5.47;

View File

@ -127,7 +127,6 @@ static void commonPassatB6() {
engineConfiguration->idle.solenoidPin = Gpio::Unassigned;
engineConfiguration->fanPin = Gpio::Unassigned;
engineConfiguration->useETBforIdleControl = true;
engineConfiguration->injectionMode = IM_SEQUENTIAL;
engineConfiguration->crankingInjectionMode = IM_SEQUENTIAL;
}

View File

@ -306,11 +306,7 @@ expected<percent_t> EtbController::getSetpointEtb() {
float rpm = Sensor::getOrZero(SensorType::Rpm);
etbCurrentTarget = m_pedalMap->getValue(rpm, sanitizedPedal);
percent_t etbIdlePosition = clampF(
0,
engineConfiguration->useETBforIdleControl ? m_idlePosition : 0,
100
);
percent_t etbIdlePosition = clampF(0, m_idlePosition, 100);
percent_t etbIdleAddition = PERCENT_DIV * engineConfiguration->etbIdleThrottleRange * etbIdlePosition;
// Interpolate so that the idle adder just "compresses" the throttle's range upward.
@ -1122,11 +1118,6 @@ void initElectronicThrottle() {
}
void setEtbIdlePosition(percent_t pos) {
if (!Sensor::hasSensor(SensorType::AcceleratorPedal)) {
firmwareError(CUSTOM_NO_ETB_FOR_IDLE, "ETB idle does not work with unhappy accelerator pedal.");
return;
}
for (int i = 0; i < ETB_COUNT; i++) {
if (auto etb = engine->etbControllers[i]) {
etb->setIdlePosition(pos);

View File

@ -34,12 +34,16 @@ void applyIACposition(percent_t position) {
*/
float duty = PERCENT_TO_DUTY(position);
if (engineConfiguration->useETBforIdleControl) {
#if EFI_ELECTRONIC_THROTTLE_BODY
setEtbIdlePosition(position);
setEtbIdlePosition(position);
#endif // EFI_ELECTRONIC_THROTTLE_BODY
#if EFI_UNIT_TEST
if (false) {
#endif // EFI_UNIT_TEST
#if ! EFI_UNIT_TEST
} else if (engineConfiguration->useStepperIdle) {
if (engineConfiguration->useStepperIdle) {
iacMotor.setTargetPosition(duty * engineConfiguration->idleStepperTotalSteps);
#endif /* EFI_UNIT_TEST */
} else {
@ -76,7 +80,6 @@ bool isIdleHardwareRestartNeeded() {
isConfigurationChanged(idle.stepperStepPin) ||
isConfigurationChanged(idle.solenoidFrequency) ||
isConfigurationChanged(useStepperIdle) ||
isConfigurationChanged(useETBforIdleControl) ||
isConfigurationChanged(idle.solenoidPin) ||
isConfigurationChanged(secondSolenoidPin) ||
isConfigurationChanged(useRawOutputToDriveIdleStepper) ||
@ -138,9 +141,7 @@ void initIdleHardware() {
}
iacMotor.initialize(hw, engineConfiguration->idleStepperTotalSteps);
} else if (engineConfiguration->useETBforIdleControl || !isBrainPinValid(engineConfiguration->idle.solenoidPin)) {
// here we do nothing for ETB idle and for no idle
} else {
} else if (isBrainPinValid(engineConfiguration->idle.solenoidPin)) {
// we are here for single or double solenoid idle
/**

View File

@ -782,7 +782,7 @@ bit is_enabled_spi_2
bit is_enabled_spi_4
bit pauseEtbControl;Disable the electronic throttle motor and DC idle motor for testing.\nThis mode is for testing ETB/DC idle position sensors, etc without actually driving the throttle.
bit alignEngineSnifferAtTDC
bit useETBforIdleControl;This setting allows the ETB to act as the idle air control valve and move to regulate the airflow at idle.
bit unused764b29;
bit idleIncrementalPidCic
bit enableAemXSeries;AEM X-Series or rusEFI Wideband
! 'enableAemXSeries' is the 32nd bit here, you would need another bit region if more bits are desired

View File

@ -280,7 +280,6 @@ enable2ndByteCanID = false
maintainConstantValue = throttlePedalWOTVoltage, { (calibrationMode == @@TsCalMode_PedalMax@@ ) ? calibrationValue : throttlePedalWOTVoltage }
maintainConstantValue = throttlePedalSecondaryWOTVoltage, { (calibrationMode == @@TsCalMode_PedalMax@@ ) ? calibrationValue2 : throttlePedalSecondaryWOTVoltage }
requiresPowerCycle = useETBforIdleControl
requiresPowerCycle = warningLedPin
requiresPowerCycle = runningLedPin
requiresPowerCycle = binarySerialTxPin
@ -3141,8 +3140,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "!ECU reboot needed to apply these settings"
field = "Use Stepper", useStepperIdle
field = "Double Solenoid Mode", isDoubleSolenoidIdle
field = "Use electronic throttle for idle", useETBforIdleControl, { useETBforIdleControl == 1 || throttlePedalPositionAdcChannel != @@ADC_CHANNEL_NONE@@ }
field = "Electronic throttle idle range", etbIdleThrottleRange, { useETBforIdleControl == 1 }
field = "Electronic throttle idle range", etbIdleThrottleRange
panel = idleHwType
dialog = idlePidSettings, "Closed Loop Idle"
@ -4011,7 +4009,6 @@ dialog = tcuControls, "Transmission Settings"
field = "iTermMax", etb_iTermMax
dialog = etbIdleDialog, "ETB Idle"
field = "use ETB for idle", useETBforIdleControl
field = "ETB idle maximum angle", etbIdleThrottleRange
dialog = etbDialogLeft
@ -4255,8 +4252,8 @@ dialog = tcuControls, "Transmission Settings"
field = "Max RPM", ALSMaxRPM, {antiLagEnabled == 1}
field = "Min CLT", ALSMinCLT, {antiLagEnabled == 1}
field = "Max CLT", ALSMaxCLT, {antiLagEnabled == 1}
field = "Idle Air Add", ALSIdleAdd, {useETBforIdleControl != 1 && antiLagEnabled == 1}
field = "ETB Air Add", ALSEtbAdd, {useETBforIdleControl == 1 && antiLagEnabled == 1}
field = "Idle Air Add", ALSIdleAdd, {antiLagEnabled == 1}
field = "ETB Air Add", ALSEtbAdd, {antiLagEnabled == 1}
field = "Spark Skip Ratio", ALSSkipRatio, {antiLagEnabled == 1}
panel = FuelAdderTableALS
panel = IgnRetardTableALS

View File

@ -73,7 +73,7 @@ public class JniUnitTest {
System.out.println("engineLogic.invokeEtbCycle");
engineLogic.invokeEtbCycle();
assertEquals(120.36, getValue(engineLogic.getOutputs(), Sensor.etb1DutyCycle));
assertEquals(120.38, getValue(engineLogic.getOutputs(), Sensor.etb1DutyCycle));
}
private double getField(EngineLogic engineLogic, Field field) {

View File

@ -242,7 +242,6 @@ TEST(etb, idlePlumbing) {
StrictMock<MockEtb> mocks[ETB_COUNT];
EngineTestHelper eth(TEST_ENGINE);
engineConfiguration->useETBforIdleControl = true;
Sensor::setMockValue(SensorType::AcceleratorPedal, 50.0f, true);
@ -258,9 +257,6 @@ TEST(etb, idlePlumbing) {
TEST(etb, testSetpointOnlyPedal) {
EngineTestHelper eth(TEST_ENGINE);
// Don't use ETB for idle, we aren't testing that yet - just pedal table for now
engineConfiguration->useETBforIdleControl = false;
EtbController etb;
// Mock pedal map that's just passthru pedal -> target
@ -300,13 +296,6 @@ TEST(etb, testSetpointOnlyPedal) {
Sensor::setMockValue(SensorType::AcceleratorPedal, 105, true);
EXPECT_EQ(100, etb.getSetpoint().value_or(-1));
// Check that ETB idle does NOT work - it's disabled
etb.setIdlePosition(50);
Sensor::setMockValue(SensorType::AcceleratorPedal, 0, true);
EXPECT_EQ(1, etb.getSetpoint().value_or(-1));
Sensor::setMockValue(SensorType::AcceleratorPedal, 20, true);
EXPECT_EQ(20, etb.getSetpoint().value_or(-1));
// Test invalid pedal position - should give 0 position
Sensor::resetMockValue(SensorType::AcceleratorPedal);
EXPECT_EQ(1, etb.getSetpoint().value_or(-1));
@ -327,10 +316,6 @@ TEST(etb, testSetpointOnlyPedal) {
TEST(etb, setpointSecondThrottleTrim) {
EngineTestHelper eth(TEST_ENGINE);
// Don't use ETB for idle, we aren't testing that yet - just pedal table for now
engineConfiguration->useETBforIdleControl = false;
// Mock pedal map that's just passthru pedal -> target
StrictMock<MockVp3d> pedalMap;
EXPECT_CALL(pedalMap, getValue(_, _))
@ -359,7 +344,6 @@ TEST(etb, setpointIdle) {
EngineTestHelper eth(TEST_ENGINE);
// Use ETB for idle, but don't give it any range (yet)
engineConfiguration->useETBforIdleControl = true;
engineConfiguration->etbIdleThrottleRange = 0;
// Must have TPS & PPS initialized for ETB setup

View File

@ -18,6 +18,8 @@ static EtbController * initEtbIntegratedTest() {
initTps();
doInitElectronicThrottle();
engine->etbControllers[0]->setIdlePosition(0);
return (EtbController*)engine->etbControllers[0];
}