throttle model runs a little bit
This commit is contained in:
parent
cffc8e851f
commit
2ba3881ba0
|
@ -93,8 +93,12 @@ float ThrottleModelBase::estimateThrottleFlow(float tip, float tps, float map, f
|
||||||
|
|
||||||
// What throttle position gives us that flow at 0.95 PR?
|
// What throttle position gives us that flow at 0.95 PR?
|
||||||
float throttleAngle95Pr = throttlePositionForFlow(p95Flow, crossoverPr, tip, iat);
|
float throttleAngle95Pr = throttlePositionForFlow(p95Flow, crossoverPr, tip, iat);
|
||||||
|
throttleModelCrossoverAngle = throttleAngle95Pr;
|
||||||
|
|
||||||
if (tps > throttleAngle95Pr) {
|
bool useWotModel = tps > throttleAngle95Pr;
|
||||||
|
throttleUseWotModel = useWotModel;
|
||||||
|
|
||||||
|
if (useWotModel) {
|
||||||
// "WOT" model
|
// "WOT" model
|
||||||
|
|
||||||
// Maximum flow if the throttle was removed
|
// Maximum flow if the throttle was removed
|
||||||
|
@ -128,6 +132,10 @@ expected<float> ThrottleModelBase::estimateThrottleFlow(float map, float tps) {
|
||||||
return estimateThrottleFlow(tip.Value, tps, map, iat.Value);
|
return estimateThrottleFlow(tip.Value, tps, map, iat.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThrottleModelBase::onSlowCallback() {
|
||||||
|
throttleEstimatedFlow = estimateThrottleFlow(Sensor::getOrZero(SensorType::Map), Sensor::getOrZero(SensorType::Tps1)).value_or(0);
|
||||||
|
}
|
||||||
|
|
||||||
float ThrottleModel::effectiveArea(float tps) const {
|
float ThrottleModel::effectiveArea(float tps) const {
|
||||||
return interpolate2d(tps, config->throttleEstimateEffectiveAreaBins, config->throttleEstimateEffectiveAreaValues);
|
return interpolate2d(tps, config->throttleEstimateEffectiveAreaBins, config->throttleEstimateEffectiveAreaValues);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
#include "throttle_model_generated.h"
|
#include "throttle_model_generated.h"
|
||||||
|
|
||||||
struct ThrottleModelBase : public throttle_model_s {
|
struct ThrottleModelBase : public throttle_model_s, public EngineModule {
|
||||||
public:
|
public:
|
||||||
|
void onSlowCallback() override;
|
||||||
|
|
||||||
float estimateThrottleFlow(float tip, float tps, float map, float iat);
|
float estimateThrottleFlow(float tip, float tps, float map, float iat);
|
||||||
expected<float> estimateThrottleFlow(float map, float tps);
|
expected<float> estimateThrottleFlow(float map, float tps);
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
struct_no_prefix throttle_model_s
|
struct_no_prefix throttle_model_s
|
||||||
|
bit throttleUseWotModel
|
||||||
|
|
||||||
|
int16_t autoscale throttleModelCrossoverAngle;;"%", 0.01, 0, 0, 100, 1
|
||||||
|
|
||||||
|
float throttleEstimatedFlow;;"kg/s", 1, 0, 0, 5, 4
|
||||||
end_struct
|
end_struct
|
||||||
|
|
Loading…
Reference in New Issue