mirror of https://github.com/rusefi/rusefi-1.git
#4 progress
This commit is contained in:
parent
a1dcc5292b
commit
f45e5757b4
|
@ -385,7 +385,17 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
|
||||
// enable auto_idle
|
||||
// enable verbose_idle
|
||||
engineConfiguration->isVerboseIAC = false;
|
||||
// set idle_p 0.01
|
||||
// set idle_i 0
|
||||
// set idle_d 0
|
||||
// set debug_mode 3
|
||||
// set idle_rpm 1700
|
||||
|
||||
//set idle_offset 30
|
||||
engineConfiguration->idleRpmPid.offset = 30;
|
||||
}
|
||||
|
||||
void setMazdaMiata2003EngineConfigurationNewBoard(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
|
|
|
@ -50,6 +50,8 @@ static SimplePwm idleSolenoid;
|
|||
|
||||
static StepperMotor iacMotor;
|
||||
|
||||
static int adjustedTargetRpm;
|
||||
|
||||
/**
|
||||
* that's the position with CLT and IAT corrections
|
||||
*/
|
||||
|
@ -59,6 +61,17 @@ void idleDebug(const char *msg, percent_t value) {
|
|||
scheduleMsg(logger, "idle debug: %s%f", msg, value);
|
||||
}
|
||||
|
||||
static void showPidSettings(const char*msg, pid_s *pid) {
|
||||
scheduleMsg(logger, "%s o=%f P=%.5f I=%.5f D=%.5f dT=%d",
|
||||
msg,
|
||||
pid->offset,
|
||||
pid->pFactor,
|
||||
pid->iFactor,
|
||||
pid->dFactor,
|
||||
engineConfiguration->idleDT);
|
||||
|
||||
}
|
||||
|
||||
static void showIdleInfo(void) {
|
||||
const char * idleModeStr = getIdle_mode_e(engineConfiguration->idleMode);
|
||||
scheduleMsg(logger, "idleMode=%s position=%f isStepper=%s", idleModeStr,
|
||||
|
@ -78,10 +91,7 @@ static void showIdleInfo(void) {
|
|||
|
||||
|
||||
if (engineConfiguration->idleMode == IM_AUTO) {
|
||||
scheduleMsg(logger, "idle P=%f I=%f D=%f dT=%d", engineConfiguration->idleRpmPid.pFactor,
|
||||
engineConfiguration->idleRpmPid.iFactor,
|
||||
engineConfiguration->idleRpmPid.dFactor,
|
||||
engineConfiguration->idleDT);
|
||||
showPidSettings("idle", &engineConfiguration->idleRpmPid);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,9 +170,9 @@ percent_t getIdlePosition(void) {
|
|||
|
||||
static float autoIdle(float cltCorrection) {
|
||||
|
||||
int targetRpm = engineConfiguration->targetIdleRpm * cltCorrection;
|
||||
adjustedTargetRpm = engineConfiguration->targetIdleRpm * cltCorrection;
|
||||
|
||||
percent_t newValue = idlePid.getValue(targetRpm, getRpmE(engine));
|
||||
percent_t newValue = idlePid.getValue(adjustedTargetRpm, getRpmE(engine));
|
||||
|
||||
return newValue;
|
||||
}
|
||||
|
@ -225,8 +235,13 @@ static msg_t ivThread(int param) {
|
|||
#endif
|
||||
}
|
||||
|
||||
if (engineConfiguration->isVerboseIAC) {
|
||||
scheduleMsg(logger, "rpm=%d position=%f", getRpmE(engine), iacPosition);
|
||||
if (engineConfiguration->isVerboseIAC && engineConfiguration->idleMode == IM_AUTO) {
|
||||
showPidSettings("idle", &engineConfiguration->idleRpmPid);
|
||||
scheduleMsg(logger, "rpm=%d/%d position=%f iTerm=%.5f dTerm=%.5f",
|
||||
getRpmE(engine),
|
||||
adjustedTargetRpm,
|
||||
iacPosition,
|
||||
idlePid.iTerm, idlePid.dTerm);
|
||||
}
|
||||
|
||||
actualIdlePosition = iacPosition;
|
||||
|
@ -241,10 +256,16 @@ static msg_t ivThread(int param) {
|
|||
void setTargetIdleRpm(int value) {
|
||||
engineConfiguration->targetIdleRpm = value;
|
||||
scheduleMsg(logger, "target idle RPM %d", value);
|
||||
showIdleInfo();
|
||||
}
|
||||
|
||||
static void apply(void) {
|
||||
// idleMath.updateFactors(engineConfiguration->idlePFactor, engineConfiguration->idleIFactor, engineConfiguration->idleDFactor, engineConfiguration->idleDT);
|
||||
idlePid.updateFactors(engineConfiguration->idleRpmPid.pFactor, engineConfiguration->idleRpmPid.iFactor, engineConfiguration->idleRpmPid.dFactor);
|
||||
}
|
||||
|
||||
void setIdleOffset(float value) {
|
||||
engineConfiguration->idleRpmPid.offset = value;
|
||||
showIdleInfo();
|
||||
}
|
||||
|
||||
void setIdlePFactor(float value) {
|
||||
|
|
|
@ -17,6 +17,7 @@ void startIdleThread(Logging*sharedLogger);
|
|||
void setDefaultIdleParameters(void);
|
||||
void startIdleBench(void);
|
||||
void setIdleDT(int value);
|
||||
void setIdleOffset(float value);
|
||||
void setIdlePFactor(float value);
|
||||
void setIdleIFactor(float value);
|
||||
void setIdleDFactor(float value);
|
||||
|
|
|
@ -862,7 +862,7 @@ static void enableOrDisable(const char *param, bool isEnabled) {
|
|||
boardConfiguration->enabledStep1Limiter = isEnabled;
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
} else if (strEqualCaseInsensitive(param, "auto_idle")) {
|
||||
setIdleMode(isEnabled ? IM_AUTO : IM_MANUAL);
|
||||
setIdleMode(isEnabled ? IM_MANUAL : IM_AUTO);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
} else if (strEqualCaseInsensitive(param, "serial")) {
|
||||
boardConfiguration->useSerialPort = isEnabled;
|
||||
|
@ -1109,6 +1109,7 @@ command_f_s commandsF[] = {{"mock_iat_voltage", setIatVoltage},
|
|||
{"engine_decel_multiplier", setDecelMult},
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
{"mock_vehicle_speed", setMockVehicleSpeed},
|
||||
{"idle_offset", setIdleOffset},
|
||||
{"idle_p", setIdlePFactor},
|
||||
{"idle_i", setIdleIFactor},
|
||||
{"idle_d", setIdleDFactor},
|
||||
|
|
|
@ -631,7 +631,7 @@ custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "false", "true"
|
|||
uint32_t engineChartSize;;"count", 1, 0, 0, 300, 0
|
||||
|
||||
|
||||
int targetIdleRpm;;"RPM", 1, 0, 0, 7000, 0
|
||||
int targetIdleRpm;set idle_rpm X;"RPM", 1, 0, 0, 7000, 0
|
||||
|
||||
adc_channel_e acSwitchAdc;A/C button input handled as analog input
|
||||
|
||||
|
|
Loading…
Reference in New Issue