adjust boost (#1975)

This commit is contained in:
Matthew Kennedy 2020-11-22 15:30:19 -08:00 committed by GitHub
parent f8a6462967
commit 866038900f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 4 deletions

View File

@ -159,7 +159,6 @@ void BoostController::PeriodicTask() {
BoostController boostController;
void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->isBoostControlEnabled = true;
engineConfiguration->boostPwmFrequency = 55;
engineConfiguration->boostPid.offset = 0;
engineConfiguration->boostPid.pFactor = 0.5;
@ -179,10 +178,16 @@ void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
config->boostTableClosedLoop[loadIndex][rpmIndex] = config->boostTpsBins[loadIndex];
}
}
// Defaults for ETB-style wastegate actuator
CONFIG(etbWastegatePid).pFactor = 1;
CONFIG(etbWastegatePid).minValue = -60;
CONFIG(etbWastegatePid).maxValue = 60;
}
void startBoostPin() {
#if !EFI_UNIT_TEST
// Only init if a pin is set, no need to start PWM without a pin
if (CONFIG(boostControlPin) == GPIO_UNASSIGNED){
return;
}
@ -209,11 +214,21 @@ void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfigur
}
void initBoostCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
#if !EFI_UNIT_TEST
if (CONFIG(boostControlPin) == GPIO_UNASSIGNED){
if (!CONFIG(isBoostControlEnabled)) {
return;
}
bool hasAnyEtbWastegate = false;
for (size_t i = 0; i < efi::size(CONFIG(etbFunctions)); i++) {
hasAnyEtbWastegate |= CONFIG(etbFunctions)[i] == ETB_Wastegate;
}
// If we have neither a boost PWM pin nor ETB wastegate, nothing more to do
if ((CONFIG(boostControlPin) == GPIO_UNASSIGNED)
&& !hasAnyEtbWastegate) {
return;
}
#endif
logger = sharedLogger;