maybe #393 reset bugfix
This commit is contained in:
parent
713a23dc8d
commit
5e839b0880
|
@ -51,6 +51,12 @@ static bool isEnabled(int index) {
|
|||
}
|
||||
}
|
||||
|
||||
static void pidReset(void) {
|
||||
auxPid.reset();
|
||||
auxPid.minResult = engineConfiguration->aux1PidMin;
|
||||
auxPid.maxResult = engineConfiguration->aux1PidMax;
|
||||
}
|
||||
|
||||
static msg_t auxPidThread(int param) {
|
||||
UNUSED(param);
|
||||
chRegSetThreadName("AuxPidController");
|
||||
|
@ -59,9 +65,7 @@ static msg_t auxPidThread(int param) {
|
|||
chThdSleepMilliseconds(dt);
|
||||
|
||||
if (parametersVersion.isOld()) {
|
||||
auxPid.reset();
|
||||
auxPid.minResult = engineConfiguration->aux1PidMin;
|
||||
auxPid.maxResult = engineConfiguration->aux1PidMax;
|
||||
pidReset();
|
||||
}
|
||||
|
||||
float rpm = engine->rpmCalculator.rpmValue;
|
||||
|
@ -71,7 +75,7 @@ static msg_t auxPidThread(int param) {
|
|||
|
||||
if (!enabledAtCurrentRpm) {
|
||||
// we need to avoid accumulating iTerm while engine is not running
|
||||
auxPid.reset();
|
||||
pidReset();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,16 +43,20 @@ extern TunerStudioOutputChannels tsOutputChannels;
|
|||
static bool currentPlainOnOffState = false;
|
||||
static bool shouldResetPid = false;
|
||||
|
||||
static void pidReset(void) {
|
||||
altPid.reset();
|
||||
altPid.minResult = engineConfiguration->bc.alternatorPidMin;
|
||||
altPid.maxResult = engineConfiguration->bc.alternatorPidMax;
|
||||
}
|
||||
|
||||
static msg_t AltCtrlThread(int param) {
|
||||
UNUSED(param);
|
||||
chRegSetThreadName("AlternatorController");
|
||||
while (true) {
|
||||
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
||||
if (shouldResetPid) {
|
||||
pidReset();
|
||||
alternatorPidResetCounter++;
|
||||
altPid.reset();
|
||||
altPid.minResult = engineConfiguration->bc.alternatorPidMin;
|
||||
altPid.maxResult = engineConfiguration->bc.alternatorPidMax;
|
||||
shouldResetPid = false;
|
||||
}
|
||||
#endif
|
||||
|
@ -78,7 +82,7 @@ static msg_t AltCtrlThread(int param) {
|
|||
|
||||
if (!engine->isAlternatorControlEnabled) {
|
||||
// we need to avoid accumulating iTerm while engine is not running
|
||||
altPid.reset();
|
||||
pidReset();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -127,7 +131,7 @@ void showAltInfo(void) {
|
|||
void setAltPFactor(float p) {
|
||||
engineConfiguration->alternatorControl.pFactor = p;
|
||||
scheduleMsg(logger, "setAltPid: %f", p);
|
||||
altPid.reset();
|
||||
pidReset();
|
||||
showAltInfo();
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,8 @@ void Pid::postState(TunerStudioOutputChannels *tsOutputChannels) {
|
|||
tsOutputChannels->debugFloatField3 = getPrevError();
|
||||
tsOutputChannels->debugFloatField4 = getI();
|
||||
tsOutputChannels->debugFloatField5 = getD();
|
||||
tsOutputChannels->debugFloatField6 = minResult;
|
||||
tsOutputChannels->debugFloatField7 = maxResult;
|
||||
tsOutputChannels->debugIntField1 = getP();
|
||||
tsOutputChannels->debugIntField2 = getOffset();
|
||||
tsOutputChannels->debugFloatField6 = dTerm;
|
||||
|
|
|
@ -250,5 +250,5 @@ int getRusEfiVersion(void) {
|
|||
return 123; // this is here to make the compiler happy about the unused array
|
||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||
return 3211; // this is here to make the compiler happy about the unused array
|
||||
return 20170409;
|
||||
return 20170410;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue