This commit is contained in:
2026-10-23 03:00:20 +02:00
parent 589d22aa5e
commit 7a5c77c1c8
31 changed files with 1196 additions and 44 deletions

View File

@@ -17,6 +17,12 @@ public:
float overrun_cut_rpm{3500.0f}, overrun_resume_rpm{2400.0f};
float idle_spark_gain{0.0f}, idle_minimum_advance{-5.0f}; // degrees/RPM, degrees BTDC
float stoichiometric_afr{14.7f}, power_afr{12.8f};
bool boost_control_enabled{false};
float maximum_boost{45000}; // Pa gauge, estimated low-pressure B205 calibration
float boost_kp{1e-5f}, boost_ki{4e-6f};
void control_boost(float dt, float pedal, float rpm, float manifold, float charge, float ambient = 101325);
float boost_target() const { return boost_target_; }
float wastegate_duty() const { return boost_duty_; }
void step(float dt, float pedal, float rpm);
float fuel_for_air(float trapped_air_mass) const;
@@ -24,12 +30,14 @@ public:
float throttle_target() const { return target_; }
float target_afr() const { return afr_; }
float spark_advance() const { return spark_; }
bool fuel_cut() const { return limiter_ || overrun_ || fault_; }
bool fuel_cut() const { return limiter_ || overrun_ || fault_ || boost_cut_; }
bool rev_limited() const { return limiter_; }
bool idle_active() const { return idle_; }
bool sensor_fault() const { return fault_; }
private:
float boost_target_{}, boost_duty_{}, boost_integral_{}, filtered_boost_{};
bool boost_cut_{};
float filtered_rpm_{};
bool initialized_{};
float opening_{}, target_{}, integral_{}, afr_{14.7f}, spark_{10.0f};