auto-sync

This commit is contained in:
rusEfi 2015-08-23 23:02:37 -04:00
parent b0a1b3831f
commit db7e2e6591
8 changed files with 38 additions and 18 deletions

View File

@ -438,6 +438,9 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->tpsAccelEnrichmentThreshold = 10;
engineConfiguration->tpsAccelEnrichmentMultiplier = 0.15;
// engineConfiguration->suckedOffCoef = 0.05;
// engineConfiguration->addedToWallCoef = 0.40;
}
#endif /* EFI_SUPPORT_DODGE_NEON */

View File

@ -198,7 +198,6 @@ static void printSensors(Logging *log, bool fileFormat) {
if (fileFormat) {
reportSensorF(log, fileFormat, "tpsacc", "ms", engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F), 2);
reportSensorF(log, fileFormat, "advance", "deg", engine->tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F), 2);
reportSensorF(log, fileFormat, "advance", "deg", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2);
}
if (engineConfiguration->hasCltSensor) {
@ -261,7 +260,7 @@ static void printState(void) {
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
debugFloat(&logger, "fuel_lag", engine->injectorLagMs, 2);
debugFloat(&logger, "fuel", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2);
debugFloat(&logger, "fuel", ENGINE(actualLastInjection), 2);
debugFloat(&logger, "timing", engine->engineState.timingAdvance, 2);
@ -600,7 +599,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->fuelLevel = engine->engineState.fuelLevel;
tsOutputChannels->hasFatalError = hasFirmwareError();
tsOutputChannels->totalTriggerErrorCounter = triggerCentral.triggerState.totalTriggerErrorCounter;
tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel();
tsOutputChannels->wallFuelAmount = wallFuel.getWallFuel(0);
tsOutputChannels->checkEngine = hasErrorCodes();
#if EFI_PROD_CODE || defined(__DOXYGEN__)
@ -642,7 +641,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->ignitionAdvance = timing > 360 ? timing - 720 : timing;
tsOutputChannels->sparkDwell = ENGINE(engineState.sparkDwell);
tsOutputChannels->baseFuel = baseFuelMs;
tsOutputChannels->pulseWidthMs = getFuelMs(rpm PASS_ENGINE_PARAMETER);
tsOutputChannels->pulseWidthMs = ENGINE(actualLastInjection);
tsOutputChannels->crankingFuelMs = getCrankingFuel(PASS_ENGINE_PARAMETER_F);
}

View File

@ -35,24 +35,23 @@ static Logging *logger;
WallFuel wallFuel;
WallFuel::WallFuel() {
wallFuel = 0;
memset(wallFuel, 0, sizeof(wallFuel));
}
floatms_t WallFuel::adjust(floatms_t target DECLARE_ENGINE_PARAMETER_S) {
float suckedOffCoef = 0;
float addedToWallCoef = 0;
floatms_t WallFuel::adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S) {
float addedToWallCoef = engineConfiguration->addedToWallCoef;
floatms_t suckedOffWallsAmount = wallFuel * suckedOffCoef;
floatms_t suckedOffWallsAmount = wallFuel[injectorIndex] * engineConfiguration->suckedOffCoef;
floatms_t result = (target - suckedOffWallsAmount) / (1 - addedToWallCoef);
float addedToWallsAmount = result * addedToWallCoef;
wallFuel = wallFuel + addedToWallsAmount - suckedOffWallsAmount;
wallFuel[injectorIndex] = wallFuel[injectorIndex] + addedToWallsAmount - suckedOffWallsAmount;
return result;
}
floatms_t WallFuel::getWallFuel() {
return wallFuel;
floatms_t WallFuel::getWallFuel(int injectorIndex) {
return wallFuel[injectorIndex];
}
float AccelEnrichmemnt::getDelta() {

View File

@ -43,14 +43,14 @@ private:
class WallFuel {
public:
WallFuel();
floatms_t adjust(floatms_t target DECLARE_ENGINE_PARAMETER_S);
floatms_t getWallFuel();
floatms_t adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_S);
floatms_t getWallFuel(int injectorIndex);
private:
/**
* Amount of fuel on the wall, in injector open time scale
* Amount of fuel on the wall, in injector open time scale, for specific injector.
*/
floatms_t wallFuel;
floatms_t wallFuel[INJECTION_PIN_COUNT];
};
void initAccelEnrichment(Logging *sharedLogger);

View File

@ -89,6 +89,9 @@ public:
float iat;
float clt;
/**
* that's fuel in tank - just a gauge
*/
percent_t fuelLevel;
ThermistorMath iatCurve;
@ -185,10 +188,15 @@ public:
AccelEnrichmemnt tpsAccelEnrichment;
/**
* Fuel injection duration for current engine cycle
* Fuel injection duration for current engine cycle, without wall wetting
*/
floatms_t fuelMs;
/**
* This one with wall wetting accounted for, used for logging.
*/
floatms_t actualLastInjection;
void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F);

View File

@ -36,6 +36,7 @@ public:
InjectionEvent();
event_trigger_position_s injectionStart;
OutputSignal actuator;
int injectorIndex;
/**
* This is a performance optimization - it's more efficient to handle all
* injectors together if that's the case

View File

@ -128,6 +128,7 @@ void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle,
return;
}
ev->injectorIndex = injectorIndex;
ev->actuator.output = output;
ev->isSimultanious = isSimultanious;

View File

@ -101,8 +101,17 @@ static void endSimultaniousInjection(Engine *engine) {
}
}
extern WallFuel wallFuel;
static ALWAYS_INLINE void handleFuelInjectionEvent(InjectionEvent *event, int rpm DECLARE_ENGINE_PARAMETER_S) {
floatms_t injectionDuration = ENGINE(fuelMs);
/**
* todo: this is a bit tricky with batched injection. is it? Does the same
* wetting coefficient works the same way for any injection mode, or is something
* x2 or /2?
*/
floatms_t injectionDuration = ENGINE(fuelMs);//wallFuel.adjust(event->injectorIndex, ENGINE(fuelMs));
ENGINE(actualLastInjection) = injectionDuration;
if (cisnan(injectionDuration)) {
warning(OBD_PCM_Processor_Fault, "NaN injection pulse");
return;