fome-fw/firmware/controllers/math/throttle_model.h

26 lines
858 B
C
Raw Normal View History

2023-03-13 13:25:45 -07:00
#pragma once
struct ThrottleModelBase {
public:
float estimateThrottleFlow(float tip, float tps, float map, float iat);
expected<float> estimateThrottleFlow(float map, float tps);
float partThrottleFlow(float tps, float flowCorrection) const;
float partThrottleFlow(float tps, float pressureRatio, float p_up, float iat) const;
2023-03-13 15:43:39 -07:00
float throttlePositionForFlow(float flow, float pressureRatio, float p_up, float iat) const;
2023-03-13 13:25:45 -07:00
protected:
// Given some TPS, what is the normalized choked flow in kg/s?
virtual float effectiveArea(float tps) const = 0;
// Given some MAP, what is the most the engine can pull through a wide open throttle, in kg/s?
virtual float maxEngineFlow(float map) const = 0;
};
struct ThrottleModel : public ThrottleModelBase {
float effectiveArea(float tps) const override;
float maxEngineFlow(float map) const override;
};