auto-sync
This commit is contained in:
parent
d6aa81acd7
commit
11c7edefcb
|
@ -16,11 +16,15 @@ EXTERN_ENGINE;
|
|||
void setVwAba(DECLARE_ENGINE_PARAMETER_F) {
|
||||
setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F);
|
||||
|
||||
// setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
||||
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
||||
|
||||
//Base engine setting
|
||||
engineConfiguration->specs.cylindersCount = 4;
|
||||
engineConfiguration->specs.displacement = 2.5;
|
||||
engineConfiguration->injector.flow = 320; // 30lb/h
|
||||
// engineConfiguration->algorithm = LM_SPEED_DENSITY;
|
||||
engineConfiguration->map.sensor.type = MT_GM_3_BAR;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
||||
|
||||
|
|
|
@ -574,6 +574,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->baroCorrection = engine->engineState.baroCorrection;
|
||||
tsOutputChannels->pedalPosition = getPedalPosition(PASS_ENGINE_PARAMETER_F);
|
||||
tsOutputChannels->knockCount = engine->knockCount;
|
||||
tsOutputChannels->injectorDutyCycle = getInjectorDutyCycle(rpm PASS_ENGINE_PARAMETER);
|
||||
|
||||
tsOutputChannels->checkEngine = hasErrorCodes();
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
|
|
|
@ -606,6 +606,8 @@ case MT_MPX4250:
|
|||
return "MT_MPX4250";
|
||||
case MT_SUBY_DENSO:
|
||||
return "MT_SUBY_DENSO";
|
||||
case MT_GM_3_BAR:
|
||||
return "MT_GM_3_BAR";
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ float getInjectionAngle(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
/**
|
||||
* Number of injections into each cylinder per engine cycle
|
||||
*/
|
||||
static int getNumberOfInjections(engine_configuration_s const *engineConfiguration, injection_mode_e mode) {
|
||||
static int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_S) {
|
||||
switch (mode) {
|
||||
case IM_SIMULTANEOUS:
|
||||
return engineConfiguration->specs.cylindersCount;
|
||||
|
@ -108,6 +108,11 @@ static int getNumberOfInjections(engine_configuration_s const *engineConfigurati
|
|||
}
|
||||
}
|
||||
|
||||
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
||||
// float totalPerCycle = getFuelMs(rpm) * getNumberOfInjections()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns Length of fuel injection, in milliseconds
|
||||
*/
|
||||
|
@ -115,12 +120,12 @@ floatms_t getFuelMs(int rpm DECLARE_ENGINE_PARAMETER_S) {
|
|||
float theoreticalInjectionLength;
|
||||
if (isCrankingR(rpm)) {
|
||||
theoreticalInjectionLength = getCrankingFuel(PASS_ENGINE_PARAMETER_F)
|
||||
/ getNumberOfInjections(engineConfiguration, engineConfiguration->crankingInjectionMode);
|
||||
/ getNumberOfInjections(engineConfiguration->crankingInjectionMode PASS_ENGINE_PARAMETER);
|
||||
} else {
|
||||
float baseFuel = getBaseFuel(rpm PASS_ENGINE_PARAMETER);
|
||||
float fuelPerCycle = getRunningFuel(baseFuel, rpm PASS_ENGINE_PARAMETER);
|
||||
theoreticalInjectionLength = fuelPerCycle
|
||||
/ getNumberOfInjections(engineConfiguration, engineConfiguration->injectionMode);
|
||||
/ getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER);
|
||||
}
|
||||
return theoreticalInjectionLength + ENGINE(injectorLagMs);
|
||||
}
|
||||
|
|
|
@ -34,5 +34,6 @@ float getCltCorrection(float clt DECLARE_ENGINE_PARAMETER_S);
|
|||
floatms_t getCrankingFuel(DECLARE_ENGINE_PARAMETER_F);
|
||||
floatms_t getCrankingFuel3(float coolantTemperature, uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_S);
|
||||
floatms_t getFuelMs(int rpm DECLARE_ENGINE_PARAMETER_S);
|
||||
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_S);
|
||||
|
||||
#endif /* FUEL_MAP_H_ */
|
||||
|
|
|
@ -532,7 +532,14 @@ typedef enum {
|
|||
MT_MPX4250 = 2,
|
||||
MT_HONDA3BAR = 3,
|
||||
MT_DODGE_NEON_2003 = 4,
|
||||
/**
|
||||
* 22012AA090
|
||||
*/
|
||||
MT_SUBY_DENSO = 5,
|
||||
/**
|
||||
* 16040749
|
||||
*/
|
||||
MT_GM_3_BAR = 6,
|
||||
|
||||
Force_4b_cranking_map_type = ENUM_32_BITS,
|
||||
} air_pressure_sensor_type_e;
|
||||
|
|
|
@ -36,6 +36,8 @@ static FastInterpolation honda3bar(0.5, 91.422, 3.0, 0);
|
|||
|
||||
static FastInterpolation subyDenso(0, 0, 5, 200);
|
||||
|
||||
static FastInterpolation gm3bar(0.631, 40, 4.914, 304);
|
||||
|
||||
static FastInterpolation mpx4250(0, 8, 5, 260);
|
||||
|
||||
static FastInterpolation dodgeNeon2003(0.5, 0, 4.5, 100);
|
||||
|
@ -61,6 +63,8 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * config) {
|
|||
return dodgeNeon2003.getValue(voltage);
|
||||
case MT_SUBY_DENSO:
|
||||
return subyDenso.getValue(voltage);
|
||||
case MT_GM_3_BAR:
|
||||
return gm3bar.getValue(voltage);
|
||||
default:
|
||||
firmwareError("Unknown MAP type: %d", config->type);
|
||||
return NAN;
|
||||
|
@ -108,6 +112,8 @@ static FastInterpolation *getDecoder(air_pressure_sensor_type_e type) {
|
|||
return &dodgeNeon2003;
|
||||
case MT_SUBY_DENSO:
|
||||
return &subyDenso;
|
||||
case MT_GM_3_BAR:
|
||||
return &gm3bar;
|
||||
default:
|
||||
firmwareError("Unknown MAP type: %d", type);
|
||||
return &customMap;
|
||||
|
|
|
@ -82,7 +82,7 @@ custom brain_input_pin_e 4 bits, U32, @OFFSET@, [0:6], @@brain_input_pin_en
|
|||
custom brain_pin_e 4 bits, U32, @OFFSET@, [0:6], @@brain_pin_enum@@
|
||||
custom pin_output_mode_e 4 bits, U32, @OFFSET@, [0:1], "default", "default inverted", "open", "open inverted"
|
||||
|
||||
custom air_pressure_sensor_type_e 4 bits, U32, @OFFSET@, [0:2] "Custom", "DENSO183", "MPX4250", "HONDA3BAR", "NEON_2003", "22012AA090", "INVALID", "INVALID"
|
||||
custom air_pressure_sensor_type_e 4 bits, U32, @OFFSET@, [0:2] "Custom", "DENSO183", "MPX4250", "HONDA3BAR", "NEON_2003", "22012AA090", "3 Bar", "INVALID"
|
||||
custom adc_channel_e 4 bits, U32, @OFFSET@, [0:3] "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PB0", "PB1", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5"
|
||||
|
||||
struct air_pressure_sensor_config_s
|
||||
|
|
|
@ -67,7 +67,7 @@ static void testDodgeNeonDecoder(void) {
|
|||
|
||||
assertFalseM("1 shaft_is_synchronized", state.shaft_is_synchronized);
|
||||
|
||||
int r = 0;
|
||||
// int r = 0;
|
||||
// processTriggerEvent(&state, shape, &ec->triggerConfig, SHAFT_PRIMARY_UP, r + 60);
|
||||
// assertFalseM("2 shaft_is_synchronized", state.shaft_is_synchronized); // still no synchronization
|
||||
|
||||
|
@ -543,7 +543,7 @@ void testTriggerDecoder(void) {
|
|||
testTriggerDecoder3("neon NGC", DODGE_NEON_2003, 0, 0.4786, 0.0, CHRYSLER_NGC_GAP);
|
||||
testTriggerDecoder2("sachs", SACHS, 0, 0.4800, 0.000);
|
||||
|
||||
testTriggerDecoder2("vw ABA", VW_ABA, 0, 0.7500, 0.25);
|
||||
testTriggerDecoder2("vw ABA", VW_ABA, 0, 0.4833, 0.0);
|
||||
|
||||
testMazda323();
|
||||
|
||||
|
|
Loading…
Reference in New Issue