firing order 1-2-7-8-4-5-6-3

This commit is contained in:
rusefi 2019-09-28 10:25:57 -04:00
parent d520e0734f
commit 8e3912e6b1
10 changed files with 42 additions and 22 deletions

View File

@ -39,6 +39,7 @@ typedef enum {
FO_1_8_4_3_6_5_7_2 = 5,
FO_1_8_7_2_6_5_4_3 = 11,
FO_1_5_4_2_6_3_7_8 = 12,
FO_1_2_7_8_4_5_6_3 = 19,
// 10 cylinder
FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10
@ -48,7 +49,7 @@ typedef enum {
FO_1_7_4_10_2_8_6_12_3_9_5_11 = 16, // lamborghini, typical rusEfi use-case
FO_1_12_5_8_3_10_6_7_2_11_4_9 = 18, // VAG W12
// max used = 18
// max used = 19
Force_4b_firing_order = ENUM_32_BITS,
} firing_order_e;

View File

@ -832,6 +832,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20190927;
return 20190928;
}
#endif /* EFI_UNIT_TEST */

View File

@ -289,9 +289,9 @@ static const int order_1_6_3_2_5_4[] = {1, 6, 3, 2, 5, 4};
// 8 cylinder
static const int order_1_8_4_3_6_5_7_2[] = { 1, 8, 4, 3, 6, 5, 7, 2 };
static const int order_1_8_7_2_6_5_4_3[] = { 1, 8, 7, 2, 6, 5, 4, 3 };
static const int order_1_5_4_2_6_3_7_8[] = { 1, 5, 4, 2, 6, 3, 7, 8 };
static const int order_1_2_7_8_4_5_6_3[] = { 1, 2, 7, 8, 4, 5, 6, 3 };
// 10 cylinder
static const int order_1_10_9_4_3_6_5_8_7_2[] = {1, 10, 9, 4, 3, 6, 5, 8, 7, 2};
@ -333,6 +333,7 @@ static int getFiringOrderLength(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
case FO_1_8_4_3_6_5_7_2:
case FO_1_8_7_2_6_5_4_3:
case FO_1_5_4_2_6_3_7_8:
case FO_1_2_7_8_4_5_6_3:
return 8;
// 10 cylinder
@ -414,6 +415,8 @@ int getCylinderId(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
return order_1_8_7_2_6_5_4_3[index];
case FO_1_5_4_2_6_3_7_8:
return order_1_5_4_2_6_3_7_8[index];
case FO_1_2_7_8_4_5_6_3:
return order_1_2_7_8_4_5_6_3[index];
// 10 cylinder
case FO_1_10_9_4_3_6_5_8_7_2:

View File

@ -353,7 +353,7 @@ cylinders_count_t cylindersCount;
! FO_1_8_4_3_6_5_7_2 = 5
! FO_1_2_4_5_3 = 6
custom firing_order_e 4 bits, U32, @OFFSET@, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "fo18", "fo19", "fo20", "INVALID"
custom firing_order_e 4 bits, U32, @OFFSET@, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "fo20", "fo21", "fo22", "INVALID"
firing_order_e firingOrder;
end_struct

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 25 22:46:02 EDT 2019
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Sep 28 10:24:19 EDT 2019
pageSize = 20000
page = 1
@ -167,7 +167,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "fo18", "fo19", "fo20", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "fo20", "fo21", "fo22", "INVALID"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 25 22:46:10 EDT 2019
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Sep 28 10:24:24 EDT 2019
pageSize = 20000
page = 1
@ -167,7 +167,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "fo18", "fo19", "fo20", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "fo20", "fo21", "fo22", "INVALID"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 25 22:46:06 EDT 2019
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Sep 28 10:24:22 EDT 2019
pageSize = 20000
page = 1
@ -167,7 +167,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "fo18", "fo19", "fo20", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "fo20", "fo21", "fo22", "INVALID"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -82,7 +82,7 @@ enable2ndByteCanID = false
; see PAGE_0_SIZE in C source code
; CONFIG_DEFINITION_START
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Wed Sep 25 22:46:14 EDT 2019
; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sat Sep 28 10:24:27 EDT 2019
pageSize = 20000
page = 1
@ -167,7 +167,7 @@ page = 1
sparkDwellValues = array, F32, 364, [8], "ms", 1, 0.0, 0.0, 30.0, 2
displacement = scalar, F32, 396, "L", 1, 0, 0, 1000.0, 2
cylindersCount = bits, U32, 400, [0:3], "INVALID", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, "INVALID", "INVALID", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "fo18", "fo19", "fo20", "INVALID"
firingOrder = bits, U32, 404, [0:4], "One Cylinder", "1-3-4-2", "1-2-4-3", "1-3-2-4", "1-5-3-6-2-4", "1-8-4-3-6-5-7-2", "1-2-4-5-3", "1-4-2-5-3-6", "1-2", "1_2_3_4_5_6", "1-2-3", "1-8-7-2-6-5-4-3", "1-5-4-2-6-3-7-8", "1-6-3-2-5-4", "1-10-9-4-3-6-5-8-7_2", "1-7-5-11-3-9-6-12-2-8-4-10", "1-7-4-10-2-8-6-12-3-9-5-11", "1-4-3-2", "1-12-5-8-3-10-6-7-2-11-4-9", "1-2-7-8-4-5-6-3", "fo20", "fo21", "fo22", "INVALID"
cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2
sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0
rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2

View File

@ -35,19 +35,24 @@ public class FiringOrderTSLogic {
continue;
}
line = line.substring(index + FIRING_ORDER_PREFIX.length());
line = line.replaceAll("[\\s\\,]", "");
System.out.println("Processing " + line);
String s[] = line.split("\\=");
String order[] = s[0].split("_");
int ordinal = Integer.parseInt(s[1]);
System.out.println("order " + Arrays.toString(order) + ": " + ordinal);
ordinal2order.put(ordinal, order);
parseLine(line);
}
}
public static void parseLine(String line) {
line = line.replaceAll("[\\s]*\\,.*", "");
line = line.replaceAll("[\\s\\,]", "");
System.out.println("Processing " + line);
String s[] = line.split("\\=");
String order[] = s[0].split("_");
int ordinal = Integer.parseInt(s[1]);
System.out.println("order " + Arrays.toString(order) + ": " + ordinal);
ordinal2order.put(ordinal, order);
}
private static void processId(int cylinderId) {
StringBuilder logic = new StringBuilder();

View File

@ -0,0 +1,11 @@
package com.rusefi.test;
import com.rusefi.FiringOrderTSLogic;
import org.junit.Test;
public class FiringOrderTSLogicTest {
@Test
public void parseFiringOrderLine() {
FiringOrderTSLogic.parseLine("FO_1_3_4_2 = 1, // typical inline 4");
}
}