Skip to content

Commit

Permalink
Prevent flex boost adjustment being added multiple times to boost target
Browse files Browse the repository at this point in the history
  • Loading branch information
noisymime committed May 29, 2024
1 parent aa0a7b7 commit 478e16c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions speeduino/auxiliaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,20 +702,22 @@ void boostControl(void)
{
if ( (configPage9.boostByGearEnabled > 0) && (configPage2.vssMode > 1) ){ boostByGear(); }
else{ currentStatus.boostTarget = get3DTableValue(&boostTable, (currentStatus.TPS * 2), currentStatus.RPM) << 1; } //Boost target table is in kpa and divided by 2
}
if(((configPage15.boostControlEnable == EN_BOOST_CONTROL_BARO) && (currentStatus.MAP >= currentStatus.baro)) || ((configPage15.boostControlEnable == EN_BOOST_CONTROL_FIXED) && (currentStatus.MAP >= configPage15.boostControlEnableThreshold))) //Only enables boost control above baro pressure or above user defined threshold (User defined level is usually set to boost with wastegate actuator only boost level)
{

//If flex fuel is enabled, there can be an adder to the boost target based on ethanol content
if( configPage2.flexEnabled == 1 )
{
currentStatus.flexBoostCorrection = table2D_getValue(&flexBoostTable, currentStatus.ethanolPct);
currentStatus.boostTarget += currentStatus.flexBoostCorrection;
currentStatus.boostTarget = constrain(currentStatus.boostTarget, 0, 511);
}
else
{
currentStatus.flexBoostCorrection = 0;
}
}

if(((configPage15.boostControlEnable == EN_BOOST_CONTROL_BARO) && (currentStatus.MAP >= currentStatus.baro)) || ((configPage15.boostControlEnable == EN_BOOST_CONTROL_FIXED) && (currentStatus.MAP >= configPage15.boostControlEnableThreshold))) //Only enables boost control above baro pressure or above user defined threshold (User defined level is usually set to boost with wastegate actuator only boost level)
{
if(currentStatus.boostTarget > 0)
{
//This only needs to be run very infrequently, once every 16 calls to boostControl(). This is approx. once per second
Expand Down

0 comments on commit 478e16c

Please sign in to comment.