#4 idle min/max
This commit is contained in:
parent
05f69db77e
commit
38171cd2bd
|
@ -166,6 +166,10 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
onConfigurationChangeElectronicThrottleCallback(&activeConfiguration);
|
||||
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
|
||||
|
||||
#if EFI_IDLE_CONTROL || defined(__DOXYGEN__)
|
||||
onConfigurationChangeIdleCallback(&activeConfiguration);
|
||||
#endif /* EFI_IDLE_CONTROL */
|
||||
|
||||
|
||||
rememberCurrentConfiguration();
|
||||
}
|
||||
|
@ -657,6 +661,10 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
|
||||
engineConfiguration->cranking.baseFuel = 5;
|
||||
|
||||
engineConfiguration->idleValvePidMin = 5;
|
||||
engineConfiguration->idleValvePidMax = 95;
|
||||
boardConfiguration->idlePidDeactivationTpsThreshold = 2;
|
||||
|
||||
engineConfiguration->analogInputDividerCoefficient = 2;
|
||||
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
|
|
|
@ -43,6 +43,7 @@ extern TunerStudioOutputChannels tsOutputChannels;
|
|||
EXTERN_ENGINE
|
||||
;
|
||||
|
||||
static bool shouldResetPid = false;
|
||||
|
||||
static Pid idlePid(&engineConfiguration->idleRpmPid, 1, 99);
|
||||
|
||||
|
@ -184,6 +185,14 @@ static msg_t ivThread(int param) {
|
|||
// todo: in auto mode, speel should be taken from idleDTe
|
||||
chThdSleepMilliseconds(boardConfiguration->idleThreadPeriod);
|
||||
|
||||
if (shouldResetPid) {
|
||||
idlePid.reset();
|
||||
// alternatorPidResetCounter++;
|
||||
shouldResetPid = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this value is not used yet
|
||||
if (boardConfiguration->clutchDownPin != GPIO_UNASSIGNED) {
|
||||
engine->clutchDownState = efiReadPin(boardConfiguration->clutchDownPin);
|
||||
|
@ -283,7 +292,9 @@ void setIdleDT(int value) {
|
|||
}
|
||||
|
||||
void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration) {
|
||||
|
||||
shouldResetPid = !idlePid.isSame(&previousConfiguration->idleRpmPid);
|
||||
idlePid.minResult = engineConfiguration->idleValvePidMin;
|
||||
idlePid.maxResult = engineConfiguration->idleValvePidMax;
|
||||
}
|
||||
|
||||
void startIdleBench(void) {
|
||||
|
|
|
@ -24,5 +24,6 @@ void setIdleDFactor(float value);
|
|||
void setIdleMode(idle_mode_e value);
|
||||
void setTargetIdleRpm(int value);
|
||||
void setIdleDT(int value);
|
||||
void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration);
|
||||
|
||||
#endif /* IDLE_THREAD_H_ */
|
||||
|
|
Loading…
Reference in New Issue