auto-sync
This commit is contained in:
parent
bdf8c9ea8e
commit
2a443b18a7
|
@ -593,7 +593,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->manifold_air_pressure = getMap();
|
||||
tsOutputChannels->engineLoad = engineLoad;
|
||||
tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration();
|
||||
tsOutputChannels->currentEngineLoadAccelDelta = engine->engineLoadAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap();
|
||||
tsOutputChannels->currentEngineLoadAccelDelta = engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F) * 100 / getMap();
|
||||
tsOutputChannels->tpsAccelFuel = engine->engineState.tpsAccelEnrich;
|
||||
tsOutputChannels->deltaTps = engine->tpsAccelEnrichment.getDelta();
|
||||
tsOutputChannels->triggerErrorsCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
|
||||
|
|
|
@ -66,22 +66,26 @@ float AccelEnrichmemnt::getDelta() {
|
|||
return cb.maxValue(cb.getSize());
|
||||
}
|
||||
|
||||
// todo: eliminate code duplication between these two methods! Some pointer magic would help.
|
||||
floatms_t AccelEnrichmemnt::getTpsEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float d = getDelta();
|
||||
if (d > engineConfiguration->tpsAccelEnrichmentThreshold) {
|
||||
return d * engineConfiguration->tpsAccelEnrichmentMultiplier;
|
||||
}
|
||||
if (d < -engineConfiguration->tpsDecelEnleanmentThreshold) {
|
||||
return d * engineConfiguration->tpsDecelEnleanmentMultiplier;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
float AccelEnrichmemnt::getMapEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float AccelEnrichmemnt::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F) {
|
||||
float d = getDelta();
|
||||
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
|
||||
return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier;
|
||||
}
|
||||
// if (d < engineConfiguration->deaccelEnrichmentThreshold) {
|
||||
// return d * engineConfiguration->deaccelEnrichmentMultiplier;
|
||||
// }
|
||||
if (d < -engineConfiguration->engineLoadDecelEnleanmentThreshold) {
|
||||
return d * engineConfiguration->engineLoadAccelEnrichmentMultiplier;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,9 +20,9 @@ class AccelEnrichmemnt {
|
|||
public:
|
||||
AccelEnrichmemnt();
|
||||
/**
|
||||
* @return Extra MAP value for Speed Density calculation
|
||||
* @return Extra engine load value for fuel logic calculation
|
||||
*/
|
||||
float getMapEnrichment(DECLARE_ENGINE_PARAMETER_F);
|
||||
float getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_F);
|
||||
/**
|
||||
* @return Extra fuel squirt duration for TPS acceleration
|
||||
*/
|
||||
|
|
|
@ -77,7 +77,7 @@ floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
if (CONFIG(algorithm) == LM_SPEED_DENSITY) {
|
||||
engine->engineState.baseFuel = getSpeedDensityFuel(rpm PASS_ENGINE_PARAMETER);
|
||||
} else if (engineConfiguration->algorithm == LM_REAL_MAF) {
|
||||
float maf = getRealMaf(PASS_ENGINE_PARAMETER_F) + engine->engineLoadAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
float maf = getRealMaf(PASS_ENGINE_PARAMETER_F) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
engine->engineState.baseFuel = getRealMafFuel(maf, rpm PASS_ENGINE_PARAMETER);
|
||||
} else {
|
||||
engine->engineState.baseFuel = engine->engineState.baseTableFuel;
|
||||
|
|
|
@ -87,7 +87,7 @@ float getSpeedDensityFuel(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
float tChargeK = ENGINE(engineState.tChargeK);
|
||||
float map = getMap();
|
||||
|
||||
float adjustedMap = map + engine->engineLoadAccelEnrichment.getMapEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
float adjustedMap = map + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
engine->engineState.airMass = getAirMass(engineConfiguration, ENGINE(engineState.currentVE), adjustedMap, tChargeK);
|
||||
|
||||
|
|
Loading…
Reference in New Issue