auto-sync
This commit is contained in:
parent
8ad500fcec
commit
b1c1b5ba1b
|
@ -107,3 +107,43 @@ void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F) {
|
||||||
iatAdvanceCorrectionMap.init(config->ignitionIatCorrTable, config->ignitionIatCorrLoadBins,
|
iatAdvanceCorrectionMap.init(config->ignitionIatCorrTable, config->ignitionIatCorrLoadBins,
|
||||||
config->ignitionIatCorrRpmBins);
|
config->ignitionIatCorrRpmBins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param octane gas octane number
|
||||||
|
* @param bore in mm
|
||||||
|
*/
|
||||||
|
float getTopAdvanceForBore(chamber_style_e style, int octane, double compression, double bore) {
|
||||||
|
int octaneCorrection;
|
||||||
|
if ( octane <= 90) {
|
||||||
|
octaneCorrection = -2;
|
||||||
|
} else if (octane < 94) {
|
||||||
|
octaneCorrection = -1;
|
||||||
|
} else {
|
||||||
|
octaneCorrection = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int compressionCorrection;
|
||||||
|
if (compression <= 9) {
|
||||||
|
compressionCorrection = 2;
|
||||||
|
} else if (compression <= 10) {
|
||||||
|
compressionCorrection = 1;
|
||||||
|
} else if (compression <= 11) {
|
||||||
|
compressionCorrection = 0;
|
||||||
|
} else {
|
||||||
|
// compression ratio above 11
|
||||||
|
compressionCorrection = -2;
|
||||||
|
}
|
||||||
|
int base;
|
||||||
|
if (style == CS_OPEN) {
|
||||||
|
base = 33;
|
||||||
|
} else if (style == CS_CLOSED) {
|
||||||
|
base = 28;
|
||||||
|
} else {
|
||||||
|
// CS_SWIRL_TUMBLE
|
||||||
|
base = 22;
|
||||||
|
}
|
||||||
|
|
||||||
|
float boreCorrection = (bore - 4 * 25.4) / 25.4 * 6;
|
||||||
|
float result = base + octaneCorrection + compressionCorrection + boreCorrection;
|
||||||
|
return ((int)(result * 10)) / 10.0;
|
||||||
|
}
|
||||||
|
|
|
@ -13,5 +13,6 @@
|
||||||
angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S);
|
angle_t getAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAMETER_S);
|
||||||
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_F);
|
void setDefaultIatTimingCorrection(DECLARE_ENGINE_PARAMETER_F);
|
||||||
void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F);
|
void prepareTimingMap(DECLARE_ENGINE_PARAMETER_F);
|
||||||
|
float getTopAdvanceForBore(chamber_style_e style, int octane, double compression, double bore);
|
||||||
|
|
||||||
#endif /* ADVANCE_H_ */
|
#endif /* ADVANCE_H_ */
|
||||||
|
|
|
@ -628,4 +628,13 @@ typedef enum {
|
||||||
Internal_ForceMyEnumIntSize_timing_mode = ENUM_32_BITS,
|
Internal_ForceMyEnumIntSize_timing_mode = ENUM_32_BITS,
|
||||||
} timing_mode_e;
|
} timing_mode_e;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CS_OPEN = 0,
|
||||||
|
CS_CLOSED = 1,
|
||||||
|
CS_SWIRL_TUMBLE = 2,
|
||||||
|
|
||||||
|
Internal_ForceMyEnumIntSize_chamber_stype = ENUM_32_BITS,
|
||||||
|
} chamber_style_e;
|
||||||
|
|
||||||
|
|
||||||
#endif /* RUSEFI_ENUMS_H_ */
|
#endif /* RUSEFI_ENUMS_H_ */
|
||||||
|
|
|
@ -275,5 +275,5 @@ int getRusEfiVersion(void) {
|
||||||
return 123; // this is here to make the compiler happy about the unused array
|
return 123; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
if (UNUSED_CCM_SIZE[0] * 0 != 0)
|
||||||
return 3211; // this is here to make the compiler happy about the unused array
|
return 3211; // this is here to make the compiler happy about the unused array
|
||||||
return 20151218;
|
return 20151224;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class IgnitionMapBuilder {
|
||||||
public enum ChamberStyle {
|
public enum ChamberStyle {
|
||||||
OPEN_CHAMBER(33),
|
OPEN_CHAMBER(33),
|
||||||
CLOSED_CHAMBER(28),
|
CLOSED_CHAMBER(28),
|
||||||
SWITL_TUMBLE(22);
|
SWIRL_TUMBLE(22);
|
||||||
|
|
||||||
|
|
||||||
private final int advance;
|
private final int advance;
|
||||||
|
@ -16,10 +16,6 @@ public class IgnitionMapBuilder {
|
||||||
ChamberStyle(int advance) {
|
ChamberStyle(int advance) {
|
||||||
this.advance = advance;
|
this.advance = advance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAdvance() {
|
|
||||||
return advance;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class IgnitionMapBuilderTest {
|
||||||
assertEquals(35.0, getTopAdvanceForBore(OPEN_CHAMBER, 98, 8, 101.6));
|
assertEquals(35.0, getTopAdvanceForBore(OPEN_CHAMBER, 98, 8, 101.6));
|
||||||
assertEquals(33.0, getTopAdvanceForBore(OPEN_CHAMBER, 98, 11, 101.6));
|
assertEquals(33.0, getTopAdvanceForBore(OPEN_CHAMBER, 98, 11, 101.6));
|
||||||
|
|
||||||
assertEquals(22.0, getTopAdvanceForBore(SWITL_TUMBLE, 89, 9, 101.6));
|
assertEquals(22.0, getTopAdvanceForBore(SWIRL_TUMBLE, 89, 9, 101.6));
|
||||||
assertEquals(32.2, getTopAdvanceForBore(SWITL_TUMBLE, 89, 9, 145));
|
assertEquals(32.2, getTopAdvanceForBore(SWIRL_TUMBLE, 89, 9, 145));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,6 +140,7 @@ int main(void) {
|
||||||
|
|
||||||
testMenuTree();
|
testMenuTree();
|
||||||
testMafLookup();
|
testMafLookup();
|
||||||
|
testIgnitionMapGenerator();
|
||||||
testMafFuelMath();
|
testMafFuelMath();
|
||||||
|
|
||||||
testPidController();
|
testPidController();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "speed_density.h"
|
#include "speed_density.h"
|
||||||
#include "engine_test_helper.h"
|
#include "engine_test_helper.h"
|
||||||
#include "maf.h"
|
#include "maf.h"
|
||||||
|
#include "advance_map.h"
|
||||||
|
|
||||||
void testIgnitionPlanning(void) {
|
void testIgnitionPlanning(void) {
|
||||||
printf("*************************************************** testIgnitionPlanning\r\n");
|
printf("*************************************************** testIgnitionPlanning\r\n");
|
||||||
|
@ -45,6 +46,17 @@ void testEngineMath(void) {
|
||||||
assertEquals(327.6667, getTCharge(4000, 100, 300, 350));
|
assertEquals(327.6667, getTCharge(4000, 100, 300, 350));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testIgnitionMapGenerator(void) {
|
||||||
|
printf("*************************************************** testIgnitionMapGenerator\r\n");
|
||||||
|
|
||||||
|
assertEquals(35, getTopAdvanceForBore(CS_OPEN, 98, 8, 101.6));
|
||||||
|
assertEquals(33, getTopAdvanceForBore(CS_OPEN, 98, 11, 101.6));
|
||||||
|
|
||||||
|
assertEquals(22.0, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 101.6));
|
||||||
|
assertEquals(32.2, getTopAdvanceForBore(CS_SWIRL_TUMBLE, 89, 9, 145));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void testMafLookup(void) {
|
void testMafLookup(void) {
|
||||||
printf("*************************************************** testMafLookup\r\n");
|
printf("*************************************************** testMafLookup\r\n");
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,6 @@
|
||||||
void testEngineMath(void);
|
void testEngineMath(void);
|
||||||
void testIgnitionPlanning(void);
|
void testIgnitionPlanning(void);
|
||||||
void testMafLookup(void);
|
void testMafLookup(void);
|
||||||
|
void testIgnitionMapGenerator(void);
|
||||||
|
|
||||||
#endif /* TEST_ENGINE_MATH_H_ */
|
#endif /* TEST_ENGINE_MATH_H_ */
|
||||||
|
|
Loading…
Reference in New Issue