This commit is contained in:
parent
297edc758e
commit
713a23dc8d
|
@ -58,8 +58,11 @@ static msg_t auxPidThread(int param) {
|
|||
int dt = maxI(10, engineConfiguration->auxPidDT[0]);
|
||||
chThdSleepMilliseconds(dt);
|
||||
|
||||
if (parametersVersion.isOld())
|
||||
if (parametersVersion.isOld()) {
|
||||
auxPid.reset();
|
||||
auxPid.minResult = engineConfiguration->aux1PidMin;
|
||||
auxPid.maxResult = engineConfiguration->aux1PidMax;
|
||||
}
|
||||
|
||||
float rpm = engine->rpmCalculator.rpmValue;
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ static msg_t AltCtrlThread(int param) {
|
|||
if (shouldResetPid) {
|
||||
alternatorPidResetCounter++;
|
||||
altPid.reset();
|
||||
altPid.minResult = engineConfiguration->bc.alternatorPidMin;
|
||||
altPid.maxResult = engineConfiguration->bc.alternatorPidMax;
|
||||
shouldResetPid = false;
|
||||
}
|
||||
#endif
|
||||
|
@ -154,7 +156,9 @@ void setDefaultAlternatorParameters(void) {
|
|||
}
|
||||
|
||||
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration) {
|
||||
shouldResetPid = !altPid.isSame(&previousConfiguration->alternatorControl);
|
||||
shouldResetPid = !altPid.isSame(&previousConfiguration->alternatorControl) ||
|
||||
engineConfiguration->bc.alternatorPidMin != previousConfiguration->bc.alternatorPidMin ||
|
||||
engineConfiguration->bc.alternatorPidMax != previousConfiguration->bc.alternatorPidMax;
|
||||
}
|
||||
|
||||
void initAlternatorCtrl(Logging *sharedLogger) {
|
||||
|
|
|
@ -35,10 +35,10 @@ public:
|
|||
#if EFI_PROD_CODE || EFI_SIMULATOR
|
||||
void postState(TunerStudioOutputChannels *tsOutputChannels);
|
||||
#endif
|
||||
private:
|
||||
pid_s *pid;
|
||||
float minResult;
|
||||
float maxResult;
|
||||
private:
|
||||
pid_s *pid;
|
||||
|
||||
float iTerm;
|
||||
float dTerm; // we are remembering this only for debugging purposes
|
||||
|
|
Loading…
Reference in New Issue