From 4edbcbae82e63d8f455e79c0a00f91419b247c90 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Fri, 17 Jun 2016 00:01:42 -0400 Subject: [PATCH] auto-sync --- firmware/config/engines/mazda_miata_1_6.cpp | 34 ++++++++++++++++--- .../runConfigurations/TS2C_fuelTable.xml | 22 ++++++++++++ unit_tests/test_idle_controller.cpp | 4 +-- unit_tests/test_sensors.cpp | 8 ++--- unit_tests/test_trigger_decoder.cpp | 4 +-- 5 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 java_console/.idea/runConfigurations/TS2C_fuelTable.xml diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index b378dec01c..d7e702878a 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -36,6 +36,26 @@ static const ignition_table_t mapBased16IgnitionTable = { }; +static const fuel_table_t mafBased16FuelTable = { + /* Generated by TS2C on Thu Jun 16 22:54:32 EDT 2016*/ + {/* 0 1.200 *//* 0 800.0*/9.000, /* 1 1213.33*/10.846, /* 2 1626.6599*/11.574, /* 3 2040.0*/11.420, /* 4 2453.3298*/8.813, /* 5 2866.66*/6.000, /* 6 3280.0*/6.000, /* 7 3693.3298*/6.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 1 1.410 *//* 0 800.0*/8.276, /* 1 1213.33*/10.727, /* 2 1626.6599*/9.000, /* 3 2040.0*/6.118, /* 4 2453.3298*/5.913, /* 5 2866.66*/6.000, /* 6 3280.0*/6.000, /* 7 3693.3298*/6.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 2 1.620 *//* 0 800.0*/4.888, /* 1 1213.33*/5.283, /* 2 1626.6599*/3.780, /* 3 2040.0*/3.454, /* 4 2453.3298*/3.936, /* 5 2866.66*/4.466, /* 6 3280.0*/6.000, /* 7 3693.3298*/6.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 3 1.840 *//* 0 800.0*/6.811, /* 1 1213.33*/4.178, /* 2 1626.6599*/3.294, /* 3 2040.0*/2.941, /* 4 2453.3298*/3.266, /* 5 2866.66*/6.000, /* 6 3280.0*/6.000, /* 7 3693.3298*/6.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 4 2.050 *//* 0 800.0*/5.569, /* 1 1213.33*/3.145, /* 2 1626.6599*/2.130, /* 3 2040.0*/1.965, /* 4 2453.3298*/2.307, /* 5 2866.66*/6.000, /* 6 3280.0*/6.000, /* 7 3693.3298*/6.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 5 2.260 *//* 0 800.0*/4.499, /* 1 1213.33*/2.668, /* 2 1626.6599*/2.167, /* 3 2040.0*/2.135, /* 4 2453.3298*/2.418, /* 5 2866.66*/3.000, /* 6 3280.0*/3.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 6 2.480 *//* 0 800.0*/2.967, /* 1 1213.33*/1.951, /* 2 1626.6599*/2.439, /* 3 2040.0*/4.185, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 7 2.690 *//* 0 800.0*/2.645, /* 1 1213.33*/1.764, /* 2 1626.6599*/1.819, /* 3 2040.0*/2.000, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 8 2.900 *//* 0 800.0*/3.000, /* 1 1213.33*/2.012, /* 2 1626.6599*/1.957, /* 3 2040.0*/3.000, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 9 3.120 *//* 0 800.0*/3.000, /* 1 1213.33*/3.000, /* 2 1626.6599*/3.000, /* 3 2040.0*/3.000, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 10 3.330 *//* 0 800.0*/3.000, /* 1 1213.33*/3.000, /* 2 1626.6599*/3.000, /* 3 2040.0*/3.000, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 11 3.540 *//* 0 800.0*/3.000, /* 1 1213.33*/3.000, /* 2 1626.6599*/3.000, /* 3 2040.0*/3.000, /* 4 2453.3298*/3.000, /* 5 2866.66*/4.000, /* 6 3280.0*/4.000, /* 7 3693.3298*/4.000, /* 8 4106.6597*/4.000, /* 9 4520.0*/4.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 12 3.760 *//* 0 800.0*/7.672, /* 1 1213.33*/7.000, /* 2 1626.6599*/7.000, /* 3 2040.0*/7.000, /* 4 2453.3298*/7.000, /* 5 2866.66*/7.000, /* 6 3280.0*/7.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 13 3.970 *//* 0 800.0*/7.858, /* 1 1213.33*/7.000, /* 2 1626.6599*/7.000, /* 3 2040.0*/7.000, /* 4 2453.3298*/7.000, /* 5 2866.66*/7.000, /* 6 3280.0*/7.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 14 4.180 *//* 0 800.0*/7.000, /* 1 1213.33*/7.000, /* 2 1626.6599*/7.000, /* 3 2040.0*/7.000, /* 4 2453.3298*/7.000, /* 5 2866.66*/7.000, /* 6 3280.0*/7.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, + {/* 15 4.400 *//* 0 800.0*/7.000, /* 1 1213.33*/7.000, /* 2 1626.6599*/7.000, /* 3 2040.0*/7.000, /* 4 2453.3298*/7.000, /* 5 2866.66*/7.000, /* 6 3280.0*/7.000, /* 7 3693.3298*/7.000, /* 8 4106.6597*/6.000, /* 9 4520.0*/6.000, /* 10 4933.33*/6.000, /* 11 5346.6597*/6.000, /* 12 5760.0*/6.000, /* 13 6173.33*/6.000, /* 14 6586.6597*/6.000, /* 15 7000.0*/6.000, }, +}; + void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) { setCustomEngineConfiguration(PASS_ENGINE_PARAMETER_F); @@ -70,7 +90,7 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->vbattDividerCoeff = 9.75;// ((float) (8.2 + 33)) / 8.2 * 2; boardConfiguration->idle.solenoidFrequency = 160; - boardConfiguration->idle.solenoidPin = GPIO_UNASSIGNED; + boardConfiguration->idle.solenoidPin = GPIOB_9; setCommonNTCSensor(&engineConfiguration->clt); engineConfiguration->clt.config.bias_resistor = 2700; @@ -79,6 +99,10 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->isSdCardEnabled = true; + // my car was originally a manual so proper TPS + engineConfiguration->tpsMin = 93; // convert 12to10 bit (ADC/4) + engineConfiguration->tpsMax = 656; // convert 12to10 bit (ADC/4) + /** * oil pressure line @@ -110,10 +134,10 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->ignitionMode = IM_WASTED_SPARK; - boardConfiguration->injectionPins[0] = GPIOB_9; // #1 - boardConfiguration->injectionPins[1] = GPIOE_2; // #2 - boardConfiguration->injectionPins[2] = GPIOB_8; // #3 - boardConfiguration->injectionPins[3] = GPIOB_7; // #4 + boardConfiguration->injectionPins[0] = GPIOD_3; // #1&3 + boardConfiguration->injectionPins[1] = GPIOE_2; // #2&4 + boardConfiguration->injectionPins[2] = GPIO_UNASSIGNED; + boardConfiguration->injectionPins[3] = GPIO_UNASSIGNED; engineConfiguration->injectionMode = IM_BATCH; diff --git a/java_console/.idea/runConfigurations/TS2C_fuelTable.xml b/java_console/.idea/runConfigurations/TS2C_fuelTable.xml new file mode 100644 index 0000000000..f238b45da5 --- /dev/null +++ b/java_console/.idea/runConfigurations/TS2C_fuelTable.xml @@ -0,0 +1,22 @@ + + + + + + + + \ No newline at end of file diff --git a/unit_tests/test_idle_controller.cpp b/unit_tests/test_idle_controller.cpp index b8e504fb26..96ed87962a 100644 --- a/unit_tests/test_idle_controller.cpp +++ b/unit_tests/test_idle_controller.cpp @@ -31,10 +31,10 @@ void testIdleController(void) { assertEqualsM("#1", 60.0, is.getIdle(900, time PASS_ENGINE_PARAMETER)); time += 2000; - assertEqualsM("2", 60.0, is.getIdle(900, time PASS_ENGINE_PARAMETER)); + assertEqualsM("#2", 60.5, is.getIdle(900, time PASS_ENGINE_PARAMETER)); time += 2000; - assertEquals(60.0, is.getIdle(1050, time PASS_ENGINE_PARAMETER)); + assertEqualsM("#3", 60.6, is.getIdle(1050, time PASS_ENGINE_PARAMETER)); } void testPidController(void) { diff --git a/unit_tests/test_sensors.cpp b/unit_tests/test_sensors.cpp index 89eb17af0c..34b028b586 100644 --- a/unit_tests/test_sensors.cpp +++ b/unit_tests/test_sensors.cpp @@ -32,14 +32,14 @@ void testTps(void) { EngineTestHelper eth(DODGE_RAM); EXPAND_EngineTestHelper; - engineConfiguration->tpsMax = 43; - engineConfiguration->tpsMin = 193; + engineConfiguration->tpsMax = 193; + engineConfiguration->tpsMin = 43; assertEquals(49.3333, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER)); - engineConfiguration->tpsMax = 193; - engineConfiguration->tpsMin = 43; + engineConfiguration->tpsMax = 43; + engineConfiguration->tpsMin = 193; assertEqualsM("test#2", 50.6667, getTpsValue(4 * 117 PASS_ENGINE_PARAMETER)); } diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 2333d6d9c0..8bde361ec3 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -250,8 +250,8 @@ static void testStartupFuelPumping(void) { engine->rpmCalculator.mockRpm = 0; - engine->engineConfiguration->tpsMin = 10; - engine->engineConfiguration->tpsMax = 0; + engine->engineConfiguration->tpsMin = 0; + engine->engineConfiguration->tpsMax = 10; mockTps = TPS_TS_CONVERSION * 6; sf.update(PASS_ENGINE_PARAMETER_F);