GDI/HPFP: Don't take P term into account when clamping I. (#3732)

This commit is contained in:
Scott Smith 2022-01-02 15:45:31 -08:00 committed by GitHub
parent 00e4304a70
commit efd59d6cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,10 @@ float HpfpQuantity::calcPI(int rpm, float calc_fuel_percent) {
(FAST_CALLBACK_PERIOD_MS / // (% * revs * ms) / (kPa * min * cycles)
i_factor_divisor); // % / kPa
float i_control_percent = m_I_sum_percent + pressureError_kPa * i_factor;
calc_fuel_percent += p_control_percent;
// Clamp the output so that calc_fuel_percent+i_control_percent is within 0% to 100%
// That way the I term can override any fuel calculations over the long term.
// The P term is still allowed to drive the total output over 100% or under 0% to react to
// short term errors.
i_control_percent = clampF(-calc_fuel_percent, i_control_percent,
100.f - calc_fuel_percent);
m_I_sum_percent = i_control_percent;