actually remove FSIO idle stuff (#3150)
* debug mode * pid cleanup * more dead * more dead * wow more dead * much dead many death wow
This commit is contained in:
parent
e445d9724e
commit
2ad4a9df1e
|
@ -799,10 +799,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->debugFloatField6 = getFsioOutputValue(12 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
tsOutputChannels->debugFloatField7 = getFsioOutputValue(13 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
break;
|
||||
case DBG_FSIO_SPECIAL:
|
||||
tsOutputChannels->debugFloatField1 = ENGINE(fsioState.fsioIdleOffset);
|
||||
tsOutputChannels->debugFloatField2 = ENGINE(fsioState.fsioIdleMinValue);
|
||||
break;
|
||||
#endif /* EFI_FSIO */
|
||||
case DBG_VEHICLE_SPEED_SENSOR:
|
||||
tsOutputChannels->debugIntField1 = engine->engineState.vssEventCounter;
|
||||
|
|
|
@ -56,31 +56,7 @@ static bool wasResetPid = false;
|
|||
static bool mustResetPid = false;
|
||||
static efitimeus_t restoreAfterPidResetTimeUs = 0;
|
||||
|
||||
|
||||
class PidWithOverrides : public PidIndustrial {
|
||||
public:
|
||||
float getOffset() const override {
|
||||
#if EFI_UNIT_TEST
|
||||
EXPAND_Engine;
|
||||
#endif
|
||||
return parameters->offset;
|
||||
}
|
||||
|
||||
float getMinValue() const override {
|
||||
#if EFI_UNIT_TEST
|
||||
EXPAND_Engine;
|
||||
#endif
|
||||
float result = parameters->minValue;
|
||||
#if EFI_FSIO
|
||||
if (engineConfiguration->useFSIO13ForIdleMinValue) {
|
||||
return result + ENGINE(fsioState.fsioIdleMinValue);
|
||||
}
|
||||
#endif /* EFI_FSIO */
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
static PidWithOverrides industrialWithOverrideIdlePid;
|
||||
static PidIndustrial industrialWithOverrideIdlePid;
|
||||
|
||||
#if EFI_IDLE_PID_CIC
|
||||
// Use PID with CIC integrator
|
||||
|
@ -96,14 +72,6 @@ Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
return &industrialWithOverrideIdlePid;
|
||||
}
|
||||
|
||||
float getIdlePidOffset(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->getOffset();
|
||||
}
|
||||
|
||||
float getIdlePidMinValue(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
return getIdlePid(PASS_ENGINE_PARAMETER_SIGNATURE)->getMinValue();
|
||||
}
|
||||
|
||||
static uint32_t lastCrankingCyclesCounter = 0;
|
||||
static float lastCrankingIacPosition;
|
||||
|
||||
|
@ -188,9 +156,6 @@ int IdleController::getTargetRpm(float clt) const {
|
|||
// Bump for AC
|
||||
target += engine->acSwitchState ? CONFIG(acIdleRpmBump) : 0;
|
||||
|
||||
// Bump by FSIO
|
||||
target += engine->fsioState.fsioIdleTargetRPMAdjustment;
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,9 +94,7 @@ void setIdleDFactor(float value);
|
|||
void setIdleMode(idle_mode_e value DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void setTargetIdleRpm(int value);
|
||||
void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration);
|
||||
float getIdlePidOffset(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
Pid * getIdlePid(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
float getIdlePidMinValue(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void stopPedalPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
|
|
|
@ -256,8 +256,8 @@ case DBG_FSIO_EXPRESSION_1_7:
|
|||
return "DBG_FSIO_EXPRESSION_1_7";
|
||||
case DBG_FSIO_EXPRESSION_8_14:
|
||||
return "DBG_FSIO_EXPRESSION_8_14";
|
||||
case DBG_FSIO_SPECIAL:
|
||||
return "DBG_FSIO_SPECIAL";
|
||||
case DBG_UNUSED_42:
|
||||
return "DBG_UNUSED_42";
|
||||
case DBG_FUEL_PID_CORRECTION:
|
||||
return "DBG_FUEL_PID_CORRECTION";
|
||||
case DBG_GPPWM:
|
||||
|
|
|
@ -74,13 +74,9 @@ class FsioState {
|
|||
public:
|
||||
FsioState();
|
||||
float fsioTimingAdjustment = 0;
|
||||
float fsioIdleTargetRPMAdjustment = 0;
|
||||
float servoValues[SERVO_COUNT];
|
||||
float fsioLastValue[FSIO_COMMAND_COUNT];
|
||||
|
||||
float fsioIdleOffset = 0;
|
||||
float fsioIdleMinValue = 0;
|
||||
|
||||
float fsioRpmHardLimit;
|
||||
|
||||
#if EFI_UNIT_TEST
|
||||
|
|
|
@ -814,7 +814,7 @@ typedef enum {
|
|||
DBG_ETB_AUTOTUNE = 39,
|
||||
DBG_COMPOSITE_LOG = 40,
|
||||
DBG_FSIO_EXPRESSION_8_14 = 41,
|
||||
DBG_FSIO_SPECIAL = 42,
|
||||
DBG_UNUSED_42 = 42,
|
||||
DBG_INJECTOR_COMPENSATION = 43,
|
||||
DBG_DYNO_VIEW = 44,
|
||||
// todo: because of getEnumOptionsForTunerStudio 'getEnumOptionsForTunerStudio' would not work here
|
||||
|
|
|
@ -289,7 +289,7 @@ float baseFuel;+Base mass of the per-cylinder fuel injected during cranking. Thi
|
|||
int16_t rpm;+This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm. \nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0
|
||||
end_struct
|
||||
|
||||
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "GPPWM", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "VVT1 PID", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "mode16", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION_1_7", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "ETB Logic", "Boost Control", "Start/Stop", "Launch", "ETB Autotune", "FSIO_COMPOSITE_LOG", "FSIO_EXPRESSION_8_14", "FSIO_SPECIAL", "Injector Compensation", "Dyno_View", "Logic_Analyzer", "rusEFI Wideband", "TCU", "Lua", "VVT2 PID", "VVT3 PID", "VVT4 PID", "mode 52", "mode 53"
|
||||
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "GPPWM", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "VVT1 PID", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "mode16", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION_1_7", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "ETB Logic", "Boost Control", "Start/Stop", "Launch", "ETB Autotune", "FSIO_COMPOSITE_LOG", "FSIO_EXPRESSION_8_14", "INVALID", "Injector Compensation", "Dyno_View", "Logic_Analyzer", "rusEFI Wideband", "TCU", "Lua", "VVT2 PID", "VVT3 PID", "VVT4 PID", "mode 52", "mode 53"
|
||||
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:5], @@debug_mode_e_enum@@
|
||||
|
||||
#define VM_VVT_INACTIVE 0
|
||||
|
@ -898,7 +898,7 @@ pin_output_mode_e hip9011IntHoldPinMode;
|
|||
uint32_t verboseCanBaseAddress;;"", 1, 0, 0, 536870911, 0
|
||||
|
||||
uint8_t mc33_hvolt;;"v", 1, 0, 40, 70, 0
|
||||
uint8_t fsio_visible acIdleExtraMin;+Additional idle PID minValue while A/C is active;"Percent", 1, 0, 0, 255, 0
|
||||
uint8_t unused761;;"", 1, 0, 0, 255, 0
|
||||
|
||||
output_pin_e acFanPin;+Optional Radiator Fan used with A/C
|
||||
pin_output_mode_e acFanPinMode;
|
||||
|
|
|
@ -2690,9 +2690,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
|||
field = "antiwindupFreq", idle_antiwindupFreq
|
||||
field = "D-factor", idleRpmPid_dFactor
|
||||
field = "Offset", idleRpmPid_offset
|
||||
field = "A/C Offset extra", acIdleExtraOffset
|
||||
field = "Min", idleRpmPid_minValue
|
||||
field = "A/C Min extra", acIdleExtraMin
|
||||
field = "Max", idleRpmPid_maxValue
|
||||
field = "iTerm Min", idlerpmpid_iTermMin
|
||||
field = "iTerm Max", idlerpmpid_iTermMax
|
||||
|
|
|
@ -52,8 +52,8 @@ public:
|
|||
float getP(void) const;
|
||||
float getI(void) const;
|
||||
float getD(void) const;
|
||||
virtual float getOffset(void) const;
|
||||
virtual float getMinValue(void) const;
|
||||
float getOffset() const;
|
||||
float getMinValue() const;
|
||||
float getIntegration(void) const;
|
||||
float getPrevError(void) const;
|
||||
void setErrorAmplification(float coef);
|
||||
|
|
|
@ -12,45 +12,10 @@
|
|||
#include "fsio_impl.h"
|
||||
#include "idle_thread.h"
|
||||
#include "electronic_throttle.h"
|
||||
#include "vehicle_speed.h"
|
||||
|
||||
using ::testing::StrictMock;
|
||||
using ::testing::_;
|
||||
|
||||
extern IdleController idleControllerInstance;
|
||||
extern int timeNowUs;
|
||||
|
||||
TEST(idle, fsioPidParameters) {
|
||||
WITH_ENGINE_TEST_HELPER(MIATA_NA6_MAP);
|
||||
|
||||
engineConfiguration->idleRpmPid.offset = 40;
|
||||
engineConfiguration->acIdleExtraOffset = 10;
|
||||
|
||||
engineConfiguration->idleRpmPid.minValue = 30;
|
||||
engineConfiguration->acIdleExtraMin = 30;
|
||||
|
||||
ASSERT_EQ(1, hasAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
setMockState(engineConfiguration->acSwitch, true);
|
||||
timeNowUs += MS2US(15);
|
||||
ASSERT_TRUE(getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
eth.engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
ASSERT_EQ(40, getIdlePidOffset(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
ASSERT_EQ(30, getIdlePidMinValue(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
setMockState(engineConfiguration->acSwitch, false);
|
||||
timeNowUs += MS2US(15);
|
||||
ASSERT_FALSE(getAcToggle(PASS_ENGINE_PARAMETER_SIGNATURE));
|
||||
|
||||
eth.engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// todo finish this unit test!
|
||||
// timeNowUs = MS2US(700);
|
||||
idleControllerInstance.update();
|
||||
// ASSERT_EQ(0, engine->acSwitchLastChangeTime);
|
||||
// ASSERT_EQ(1, engine->acSwitchState);
|
||||
}
|
||||
|
||||
using ICP = IIdleController::Phase;
|
||||
|
||||
TEST(idle_v2, timingPid) {
|
||||
|
|
Loading…
Reference in New Issue