9static const float pressureRatioCorrectionBins[] = { 0.53125, 0.546875, 0.5625, 0.578125, 0.59375, 0.609375, 0.625, 0.640625, 0.65625, 0.671875, 0.6875, 0.703125, 0.71875, 0.734375, 0.750, 0.765625, 0.78125, 0.796875, 0.8125, 0.828125, 0.84375, 0.859375, 0.875, 0.890625, 0.90625, 0.921875, 0.9375, 0.953125 };
10static const float pressureRatioCorrectionValues[] = { 1, 0.9993, 0.998, 0.995, 0.991, 0.986, 0.979, 0.972, 0.963, 0.953, 0.942, 0.930, 0.916, 0.901, 0.884, 0.866, 0.845, 0.824, 0.800, 0.774, 0.745, 0.714, 0.679, 0.642, 0.600, 0.553, 0.449, 0.449 };
33 float tempCorrection = sqrt(C_K_OFFSET / (
iat + C_K_OFFSET));
34 float pressureCorrection = p_up / STD_ATMOSPHERE;
35 float densityCorrection = tempCorrection * pressureCorrection;
37 return prCorrectionFactor * densityCorrection;
59 const float m_flowCorrection;
62 float fx(
float x)
override {
67 float dfx(
float x)
override {
72 return (fx(x + 0.1) - fx(x - 0.1)) / 0.2;
84 if (flow > wideOpenFlow) {
89 return solver.solve(50, 0.1).value_or(0);
95 constexpr float crossoverPr = 0.95f;
102 bool useWotModel = tps > throttleAngle95Pr;
virtual bool hasSensor() const
virtual SensorResult get() const =0
static float getOrZero(SensorType type)
float maxEngineFlow(float map) const override
float effectiveArea(float tps) const override
float interpolateClamped(float x1, float y1, float x2, float y2, float x)
static constexpr persistent_config_s * config
float getMaxAirflowAtMap(float map)
static CCM_OPTIONAL FunctionalSensor iat(SensorType::Iat, MS2NT(10))
expected< float > SensorResult
pressureRatio("Fuel: Injector pressure ratio", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1188, 1.0, 0.0, 100.0, "")
virtual float maxEngineFlow(float map) const =0
virtual float effectiveArea(float tps) const =0
float estimateThrottleFlow(float tip, float tps, float map, float iat)
void onSlowCallback() override
float partThrottleFlow(float tps, float flowCorrection) const
float throttlePositionForFlow(float flow, float pressureRatio, float p_up, float iat) const
scaled_channel< uint16_t, 10, 1 > throttleEstimateEffectiveAreaValues[THR_EST_SIZE]
scaled_channel< uint16_t, 10, 1 > throttleEstimateEffectiveAreaBins[THR_EST_SIZE]
float throttleEstimatedFlow
scaled_channel< int16_t, 100, 1 > throttleModelCrossoverAngle
float getThrottlePressureRatio(float map)
expected< float > getThrottleInletPressure()
static float pressureRatioFlowCorrection(float pr)
static const float pressureRatioCorrectionBins[]
static float flowCorrections(float pressureRatio, float p_up, float iat)
static const float pressureRatioCorrectionValues[]
expected< float > getThrottleInletPressure()