auto-sync

This commit is contained in:
rusEfi 2016-02-10 17:01:44 -05:00
parent a66bcd23f1
commit 8a89f2723e
3 changed files with 21 additions and 2 deletions

View File

@ -62,8 +62,7 @@ void Engine::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold); isEngineChartEnabled = CONFIG(isEngineChartEnabled) && rpm < CONFIG(engineSnifferRpmThreshold);
sensorChartMode = rpm < CONFIG(sensorSnifferRpmThreshold) ? boardConfiguration->sensorChartMode : SC_OFF; sensorChartMode = rpm < CONFIG(sensorSnifferRpmThreshold) ? boardConfiguration->sensorChartMode : SC_OFF;
engineState.iat = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F); engineState.updateSlowSensors(PASS_ENGINE_PARAMETER_F);
engineState.clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
if (engineConfiguration->fuelLevelSensor != EFI_ADC_NONE) { if (engineConfiguration->fuelLevelSensor != EFI_ADC_NONE) {
float fuelLevelVoltage = getVoltageDivided("fuel", engineConfiguration->fuelLevelSensor); float fuelLevelVoltage = getVoltageDivided("fuel", engineConfiguration->fuelLevelSensor);
@ -132,6 +131,14 @@ EngineState::EngineState() {
injectorLag = 0; injectorLag = 0;
} }
void EngineState::updateSlowSensors(DECLARE_ENGINE_PARAMETER_F) {
iat = getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F);
clt = getCoolantTemperature(PASS_ENGINE_PARAMETER_F);
warmupTargetAfr = interpolate2d(clt, engineConfiguration->warmupTargetAfrBins,
engineConfiguration->warmupTargetAfr, WARMUP_TARGET_AFR_SIZE);
}
void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) { void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) {
int rpm = ENGINE(rpmCalculator.rpmValue); int rpm = ENGINE(rpmCalculator.rpmValue);

View File

@ -100,6 +100,7 @@ class EngineState {
public: public:
EngineState(); EngineState();
void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F); void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F);
void updateSlowSensors(DECLARE_ENGINE_PARAMETER_F);
/** /**
* Performance optimization: * Performance optimization:
@ -154,6 +155,7 @@ public:
* See useWarmupPidAfr * See useWarmupPidAfr
*/ */
Pid warmupAfrPid; Pid warmupAfrPid;
float warmupTargetAfr;
float baroCorrection; float baroCorrection;

View File

@ -430,6 +430,15 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
config->crankingCycleBins[7] = 77; config->crankingCycleBins[7] = 77;
engineConfiguration->warmupTargetAfrBins[0] = -12;
engineConfiguration->warmupTargetAfr[0] = 12.3;
engineConfiguration->warmupTargetAfrBins[1] = 0;
engineConfiguration->warmupTargetAfr[1] = 13;
engineConfiguration->warmupTargetAfrBins[2] = 30;
engineConfiguration->warmupTargetAfr[2] = 13.8;
engineConfiguration->warmupTargetAfrBins[3] = 60;
engineConfiguration->warmupTargetAfr[3] = 14.5;
// todo: set bins // todo: set bins
setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350); setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300); setTableValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
@ -703,6 +712,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->uartConsoleSerialSpeed = 115200; engineConfiguration->uartConsoleSerialSpeed = 115200;
engineConfiguration->warmupAfrPid.offset = 1; engineConfiguration->warmupAfrPid.offset = 1;
engineConfiguration->warmupAfrThreshold = 60;
engineConfiguration->engineLoadAccelLength = 6; engineConfiguration->engineLoadAccelLength = 6;
engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa engineConfiguration->engineLoadAccelEnrichmentThreshold = 5; // kPa