auto-sync

This commit is contained in:
rusEfi 2017-01-23 00:06:44 -05:00
parent 422b3a475a
commit 52801e6acc
9 changed files with 50 additions and 35 deletions

View File

@ -11,7 +11,7 @@
#include "mazda_miata_vvt.h" #include "mazda_miata_vvt.h"
#include "custom_engine.h" #include "custom_engine.h"
#include "fsio_impl.h" #include "fsio_impl.h"
#include "ego.h"
EXTERN_ENGINE; EXTERN_ENGINE;
@ -204,6 +204,15 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) {
boardConfiguration->malfunctionIndicatorPin = GPIOD_9; boardConfiguration->malfunctionIndicatorPin = GPIOD_9;
// boardConfiguration->malfunctionIndicatorPinMode = OM_INVERTED; // boardConfiguration->malfunctionIndicatorPinMode = OM_INVERTED;
/**
* PA4 Wideband O2 Sensor
*/
// todo: re-wire the board to use default input channel!
engineConfiguration->afr.hwChannel = EFI_ADC_4;
setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER);
} }

View File

@ -143,6 +143,7 @@ EngineState::EngineState() {
runningFuel = baseFuel = currentVE = 0; runningFuel = baseFuel = currentVE = 0;
timeOfPreviousWarning = -10; timeOfPreviousWarning = -10;
baseTableFuel = iat = iatFuelCorrection = 0; baseTableFuel = iat = iatFuelCorrection = 0;
fuelPidCorrection = 0;
clt = cltFuelCorrection = postCrankingFuelCorrection = 0; clt = cltFuelCorrection = postCrankingFuelCorrection = 0;
warmupTargetAfr = airMass = 0; warmupTargetAfr = airMass = 0;
baroCorrection = timingAdvance = fuelTankGauge = 0; baroCorrection = timingAdvance = fuelTankGauge = 0;

View File

@ -563,6 +563,9 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->fuelClosedLoopCltThreshold = 70; engineConfiguration->fuelClosedLoopCltThreshold = 70;
engineConfiguration->fuelClosedLoopRpmThreshold = 900; engineConfiguration->fuelClosedLoopRpmThreshold = 900;
engineConfiguration->fuelClosedLoopTpsThreshold = 80; engineConfiguration->fuelClosedLoopTpsThreshold = 80;
engineConfiguration->fuelClosedLoopAfrLowThreshold = 10.3;
engineConfiguration->fuelClosedLoopAfrHighThreshold = 19.8;
engineConfiguration->fuelClosedLoopPid.pFactor = -0.1;
engineConfiguration->cranking.baseFuel = 5; engineConfiguration->cranking.baseFuel = 5;

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 17:18:49 EST 2017 // this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 23:36:11 EST 2017
// begin // begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_ #ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_
@ -1803,7 +1803,7 @@ typedef struct {
/** /**
* offset 2738 * offset 2738
*/ */
int16_t fuelClosedLoopAfrLowThreshold; int16_t unusedShort;
/** /**
* offset 2740 * offset 2740
*/ */
@ -1811,15 +1811,15 @@ typedef struct {
/** /**
* offset 2756 * offset 2756
*/ */
int16_t fuelClosedLoopAfrHighThreshold; float fuelClosedLoopAfrLowThreshold;
/**
* offset 2758
*/
int16_t unusedShort;
/** /**
* offset 2760 * offset 2760
*/ */
int unused[72]; float fuelClosedLoopAfrHighThreshold;
/**
* offset 2764
*/
int unused[71];
/** total size 3048*/ /** total size 3048*/
} engine_configuration_s; } engine_configuration_s;
@ -2034,4 +2034,4 @@ typedef struct {
#endif #endif
// end // end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 17:18:49 EST 2017 // this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 23:36:11 EST 2017

View File

@ -920,15 +920,15 @@
#define fuelClosedLoopCltThreshold_offset 2732 #define fuelClosedLoopCltThreshold_offset 2732
#define fuelClosedLoopTpsThreshold_offset 2734 #define fuelClosedLoopTpsThreshold_offset 2734
#define fuelClosedLoopRpmThreshold_offset 2736 #define fuelClosedLoopRpmThreshold_offset 2736
#define fuelClosedLoopAfrLowThreshold_offset 2738 #define unusedShort_offset 2738
#define fuelClosedLoopPid_offset 2740 #define fuelClosedLoopPid_offset 2740
#define fuelClosedLoopPid_pFactor_offset 2740 #define fuelClosedLoopPid_pFactor_offset 2740
#define fuelClosedLoopPid_iFactor_offset 2744 #define fuelClosedLoopPid_iFactor_offset 2744
#define fuelClosedLoopPid_dFactor_offset 2748 #define fuelClosedLoopPid_dFactor_offset 2748
#define fuelClosedLoopPid_offset_offset 2752 #define fuelClosedLoopPid_offset_offset 2752
#define fuelClosedLoopAfrHighThreshold_offset 2756 #define fuelClosedLoopAfrLowThreshold_offset 2756
#define unusedShort_offset 2758 #define fuelClosedLoopAfrHighThreshold_offset 2760
#define unused_offset 2760 #define unused_offset 2764
#define le_formulas1_offset 3048 #define le_formulas1_offset 3048
#define le_formulas2_offset 3248 #define le_formulas2_offset 3248
#define le_formulas3_offset 3448 #define le_formulas3_offset 3448

View File

@ -372,17 +372,17 @@ static void scheduleOutput2(OutputSignalPair *pair, efitimeus_t nowUs, float del
} }
static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_F) { static void fuelClosedLoopCorrection(DECLARE_ENGINE_PARAMETER_F) {
if (ENGINE(rpmCalculator.rpmValue) < CONFIG(fuelClosedLoopRpmThreshold)) { #if ! EFI_UNIT_TEST
return; if (ENGINE(rpmCalculator.rpmValue) < CONFIG(fuelClosedLoopRpmThreshold) ||
} ENGINE(engineState.clt) < CONFIG(fuelClosedLoopCltThreshold) ||
if (ENGINE(engineState.clt) < CONFIG(fuelClosedLoopCltThreshold)) { getTPS(PASS_ENGINE_PARAMETER_F) > CONFIG(fuelClosedLoopTpsThreshold) ||
return; ENGINE(engineState.currentAfr) < 10 ||
} ENGINE(engineState.currentAfr) > 20) {
if (getTPS(PASS_ENGINE_PARAMETER_F) > CONFIG(fuelClosedLoopTpsThreshold)) { engine->engineState.fuelPidCorrection = 0;
fuelPid.reset();
return; return;
} }
#if ! EFI_UNIT_TEST
engine->engineState.fuelPidCorrection = fuelPid.getValue(ENGINE(engineState.targetAFR), ENGINE(engineState.currentAfr), 1); engine->engineState.fuelPidCorrection = fuelPid.getValue(ENGINE(engineState.targetAFR), ENGINE(engineState.currentAfr), 1);
if (engineConfiguration->debugMode == DBG_FUEL_PID_CORRECTION) { if (engineConfiguration->debugMode == DBG_FUEL_PID_CORRECTION) {
tsOutputChannels.debugFloatField1 = engine->engineState.fuelPidCorrection; tsOutputChannels.debugFloatField1 = engine->engineState.fuelPidCorrection;

View File

@ -765,11 +765,11 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300,
int16_t fuelClosedLoopCltThreshold;;"C", 1, 0, 0, 100, 0 int16_t fuelClosedLoopCltThreshold;;"C", 1, 0, 0, 100, 0
int16_t fuelClosedLoopTpsThreshold;;"%", 1, 0, 0, 100, 0 int16_t fuelClosedLoopTpsThreshold;;"%", 1, 0, 0, 100, 0
int16_t fuelClosedLoopRpmThreshold;;"rpm", 1, 0, 0, 5000, 0 int16_t fuelClosedLoopRpmThreshold;;"rpm", 1, 0, 0, 5000, 0
int16_t fuelClosedLoopAfrLowThreshold;;"ratio", 1, 0, 0, 100, 1
pid_s fuelClosedLoopPid;
int16_t fuelClosedLoopAfrHighThreshold;;"ratio", 1, 0, 0, 100, 1
int16_t unusedShort int16_t unusedShort
int[72] unused; pid_s fuelClosedLoopPid;
float fuelClosedLoopAfrLowThreshold;;"ratio", 1, 0, 0, 100, 1
float fuelClosedLoopAfrHighThreshold;;"ratio", 1, 0, 0, 100, 1
int[71] unused;
end_struct end_struct

View File

@ -1127,7 +1127,7 @@ fileVersion = { 20161225 }
pulseWidthGauge = pulseWidth, "fuel final squirt, per injection", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 pulseWidthGauge = pulseWidth, "fuel final squirt, per injection", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
baseFuelGauge = baseFuel, "fuel: base duration, before corr", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 baseFuelGauge = baseFuel, "fuel: base duration, before corr", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
fuelPidCorrectionGauge = fuelPidCorrection, "fuel: closed loop correction", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 fuelPidCorrectionGauge = fuelPidCorrection, "fuel: closed loop correction", "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1
crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1 crankingFuelGauge = crankingFuel, "fuel: crank Width", "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
iatCorrectionGauge = iatCorrection, "fuel: IAT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2 iatCorrectionGauge = iatCorrection, "fuel: IAT correction", "mult", 0, 3, 0, 0, 3, 3, 2, 2
@ -1797,6 +1797,8 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01"
field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1} field = "CLT - low threshod", fuelClosedLoopCltThreshold, {fuelClosedLoopCorrectionEnabled == 1}
field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1} field = "RPM - low threshod", fuelClosedLoopRpmThreshold, {fuelClosedLoopCorrectionEnabled == 1}
field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1} field = "TPS - high threshod", fuelClosedLoopTpsThreshold, {fuelClosedLoopCorrectionEnabled == 1}
field = "EGO - low threshod", fuelClosedLoopAfrLowThreshold, {fuelClosedLoopCorrectionEnabled == 1}
field = "EGO - high threshod", fuelClosedLoopAfrHighThreshold, {fuelClosedLoopCorrectionEnabled == 1}
field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1} field = "P factor", fuelClosedLoopPid_pFactor, {fuelClosedLoopCorrectionEnabled == 1}
field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1} field = "I factor", fuelClosedLoopPid_iFactor, {fuelClosedLoopCorrectionEnabled == 1}
field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1} field = "D factor", fuelClosedLoopPid_dFactor, {fuelClosedLoopCorrectionEnabled == 1}

View File

@ -1,6 +1,6 @@
package com.rusefi.config; package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 17:18:49 EST 2017 // this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 22 23:36:11 EST 2017
public class Fields { public class Fields {
public static final int LE_COMMAND_LENGTH = 200; public static final int LE_COMMAND_LENGTH = 200;
public static final int FSIO_ADC_COUNT = 4; public static final int FSIO_ADC_COUNT = 4;
@ -924,15 +924,15 @@ public class Fields {
public static final int fuelClosedLoopCltThreshold_offset = 2732; public static final int fuelClosedLoopCltThreshold_offset = 2732;
public static final int fuelClosedLoopTpsThreshold_offset = 2734; public static final int fuelClosedLoopTpsThreshold_offset = 2734;
public static final int fuelClosedLoopRpmThreshold_offset = 2736; public static final int fuelClosedLoopRpmThreshold_offset = 2736;
public static final int fuelClosedLoopAfrLowThreshold_offset = 2738; public static final int unusedShort_offset = 2738;
public static final int fuelClosedLoopPid_offset = 2740; public static final int fuelClosedLoopPid_offset = 2740;
public static final int fuelClosedLoopPid_pFactor_offset = 2740; public static final int fuelClosedLoopPid_pFactor_offset = 2740;
public static final int fuelClosedLoopPid_iFactor_offset = 2744; public static final int fuelClosedLoopPid_iFactor_offset = 2744;
public static final int fuelClosedLoopPid_dFactor_offset = 2748; public static final int fuelClosedLoopPid_dFactor_offset = 2748;
public static final int fuelClosedLoopPid_offset_offset = 2752; public static final int fuelClosedLoopPid_offset_offset = 2752;
public static final int fuelClosedLoopAfrHighThreshold_offset = 2756; public static final int fuelClosedLoopAfrLowThreshold_offset = 2756;
public static final int unusedShort_offset = 2758; public static final int fuelClosedLoopAfrHighThreshold_offset = 2760;
public static final int unused_offset = 2760; public static final int unused_offset = 2764;
public static final int le_formulas1_offset = 3048; public static final int le_formulas1_offset = 3048;
public static final int le_formulas2_offset = 3248; public static final int le_formulas2_offset = 3248;
public static final int le_formulas3_offset = 3448; public static final int le_formulas3_offset = 3448;
@ -1595,13 +1595,13 @@ public class Fields {
public static final Field FUELCLOSEDLOOPCLTTHRESHOLD = Field.create("FUELCLOSEDLOOPCLTTHRESHOLD", 2732, FieldType.INT); public static final Field FUELCLOSEDLOOPCLTTHRESHOLD = Field.create("FUELCLOSEDLOOPCLTTHRESHOLD", 2732, FieldType.INT);
public static final Field FUELCLOSEDLOOPTPSTHRESHOLD = Field.create("FUELCLOSEDLOOPTPSTHRESHOLD", 2734, FieldType.INT); public static final Field FUELCLOSEDLOOPTPSTHRESHOLD = Field.create("FUELCLOSEDLOOPTPSTHRESHOLD", 2734, FieldType.INT);
public static final Field FUELCLOSEDLOOPRPMTHRESHOLD = Field.create("FUELCLOSEDLOOPRPMTHRESHOLD", 2736, FieldType.INT); public static final Field FUELCLOSEDLOOPRPMTHRESHOLD = Field.create("FUELCLOSEDLOOPRPMTHRESHOLD", 2736, FieldType.INT);
public static final Field FUELCLOSEDLOOPAFRLOWTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRLOWTHRESHOLD", 2738, FieldType.INT); public static final Field UNUSEDSHORT = Field.create("UNUSEDSHORT", 2738, FieldType.INT);
public static final Field FUELCLOSEDLOOPPID_PFACTOR = Field.create("FUELCLOSEDLOOPPID_PFACTOR", 2740, FieldType.FLOAT); public static final Field FUELCLOSEDLOOPPID_PFACTOR = Field.create("FUELCLOSEDLOOPPID_PFACTOR", 2740, FieldType.FLOAT);
public static final Field FUELCLOSEDLOOPPID_IFACTOR = Field.create("FUELCLOSEDLOOPPID_IFACTOR", 2744, FieldType.FLOAT); public static final Field FUELCLOSEDLOOPPID_IFACTOR = Field.create("FUELCLOSEDLOOPPID_IFACTOR", 2744, FieldType.FLOAT);
public static final Field FUELCLOSEDLOOPPID_DFACTOR = Field.create("FUELCLOSEDLOOPPID_DFACTOR", 2748, FieldType.FLOAT); public static final Field FUELCLOSEDLOOPPID_DFACTOR = Field.create("FUELCLOSEDLOOPPID_DFACTOR", 2748, FieldType.FLOAT);
public static final Field FUELCLOSEDLOOPPID_OFFSET = Field.create("FUELCLOSEDLOOPPID_OFFSET", 2752, FieldType.FLOAT); public static final Field FUELCLOSEDLOOPPID_OFFSET = Field.create("FUELCLOSEDLOOPPID_OFFSET", 2752, FieldType.FLOAT);
public static final Field FUELCLOSEDLOOPAFRHIGHTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRHIGHTHRESHOLD", 2756, FieldType.INT); public static final Field FUELCLOSEDLOOPAFRLOWTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRLOWTHRESHOLD", 2756, FieldType.FLOAT);
public static final Field UNUSEDSHORT = Field.create("UNUSEDSHORT", 2758, FieldType.INT); public static final Field FUELCLOSEDLOOPAFRHIGHTHRESHOLD = Field.create("FUELCLOSEDLOOPAFRHIGHTHRESHOLD", 2760, FieldType.FLOAT);
public static final Field LE_FORMULAS1 = Field.create("LE_FORMULAS1", 3048, FieldType.INT); public static final Field LE_FORMULAS1 = Field.create("LE_FORMULAS1", 3048, FieldType.INT);
public static final Field LE_FORMULAS2 = Field.create("LE_FORMULAS2", 3248, FieldType.INT); public static final Field LE_FORMULAS2 = Field.create("LE_FORMULAS2", 3248, FieldType.INT);
public static final Field LE_FORMULAS3 = Field.create("LE_FORMULAS3", 3448, FieldType.INT); public static final Field LE_FORMULAS3 = Field.create("LE_FORMULAS3", 3448, FieldType.INT);