Prepare for TPS-based Advance and tCharge Modes + Fixes (#610)

* rusefi_config.txt

* rusefi.input for TPS-based Advance

* rusefi.input for tCharge

* Fix compilation for Prometheus config

* Fix CJ125 calibration & debug flood

* Fix EnumToString utility for main.h->global.h refactoring
This commit is contained in:
andreika-git 2018-09-25 22:45:17 +03:00 committed by rusefi
parent b24685ce65
commit d2569a1d11
5 changed files with 50 additions and 8 deletions

View File

@ -171,7 +171,7 @@ void setBoardConfigurationOverrides(void) {
engineConfiguration->communicationLedPin = GPIO_UNASSIGNED;// GPIOA_13; // yellow LED
engineConfiguration->runningLedPin = GPIOA_13; //GPIOA_13; // yellow LED
engineConfiguration->fatalErrorLedPin = GPIOA_13;
engineConfiguration->fatalErrorPin = GPIOA_13;
engineConfiguration->warninigLedPin = GPIO_UNASSIGNED;
engineConfiguration->configResetPin = GPIO_UNASSIGNED;

View File

@ -23,7 +23,7 @@
#include "backup_ram.h"
#define CJ125_DEBUG
//#define CJ125_DEBUG
//#define CJ125_DEBUG_SPI
EXTERN_ENGINE;
@ -525,7 +525,7 @@ static bool cjCheckConfig(void) {
static void cjStartCalibration(void) {
if (!cjCheckConfig())
return;
if (state != CJ125_IDLE) {
if (cjIsWorkingState()) {
// todo: change this later for the normal thread operation (auto pre-heating)
scheduleMsg(logger, "cj125: Cannot start calibration. Please restart the board and make sure that your sensor is not heating");
return;

View File

@ -89,6 +89,7 @@ struct_no_prefix engine_configuration_s
#define CRANKING_CURVE_SIZE 8
#define IGN_LOAD_COUNT 16
#define IGN_TPS_COUNT 16
#define IGN_RPM_COUNT 16
#define INJECTION_PIN_COUNT 12
@ -132,6 +133,7 @@ custom baro_corr_table_t 64 array, F32, @OFFSET@, [@@BARO_CORR_SIZE@@x@@BARO
! please note that 1024 here is 4 * IGN_LOAD_COUNT * IGN_RPM_COUNT
custom ignition_table_t 1024 array, F32, @OFFSET@, [16x16],"deg", 1, 0, -20, 90, 2
custom ignition_tps_table_t 512 array, S16, @OFFSET@, [16x16],"deg", 0.01, 0, -20, 90, 2
custom angle_table_t 1024 array, F32, @OFFSET@, [16x16],"deg", 1, 0, -720, 720, 2
@ -690,7 +692,7 @@ custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual"
bit useFixedBaroCorrFromMap
bit useSeparateAdvanceForCranking
bit useAdvanceCorrectionsForCranking
bit unused_1484_bit_19
bit useTPSAdvanceTable
bit unused_1484_bit_20
bit unused_1484_bit_21
@ -908,8 +910,21 @@ float[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvance ;Optional timing advance t
float[CLT_CURVE_SIZE] iacCoastingBins;CLT-based idle position for coasting (used in Auto-PID Idle mode);"C", 1, 0, -100.0, 250.0, 2
float[CLT_CURVE_SIZE] iacCoasting; CLT-based idle position for coasting (used in Auto-PID Idle mode);"%", 1, 0, 0.0, 100.0, 2
ignition_tps_table_t ignitionTpsTable;
float[IGN_TPS_COUNT] ignitionTpsBins;;"TPS", 1, 0.0, 0, 100.0, 2
float tChargeAirCoefMin;;"Min tCharge Coeff.", 1, 0, 0.0, 1.0, 4
float tChargeAirCoefMax;;"Max tCharge Coeff.", 1, 0, 0.0, 1.0, 4
float tChargeAirFlowMax;;"Max Air Flow, kg/h", 1, 0, 0.0, 1000.0, 1
float tChargeAirIncrLimit;;"tChange Increment Limit, deg/sec", 1, 0, 0.0, 100.0, 1
float tChargeAirDecrLimit;;"tChange Decrement Limit, deg/sec", 1, 0, 0.0, 100.0, 1
#define tChargeMode_e_enum "RPM+TPS (Default)", "Air Mass Interpolation"
custom tChargeMode_e 4 bits, U32, @OFFSET@, [0:0], @@tChargeMode_e_enum@@
tChargeMode_e tChargeMode;
int[741] unusedEnd;
int[591] unusedEnd;
end_struct

View File

@ -636,6 +636,15 @@ fileVersion = { 20171101 }
gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees.
upDownLabel = "(RICHER)", "(LEANER)"
table = ignitionTpsTableTbl, ignitionTableMap, "Ignition TPS Table", 1
; constant, variable
xBins = ignitionRpmBins, RPMValue
yBins = ignitionTpsBins, TPSValue
zBins = ignitionTpsTable
gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees.
upDownLabel = "(RICHER)", "(LEANER)"
table = ignitionIatCorrTableTbl, ignitionIatCorrTableMap, "Ignition Intake Air Temp correction", 1
; constant, variable
xBins = ignitionIatCorrRpmBins, RPMValue
@ -1009,7 +1018,8 @@ menuDialog = main
subMenu = dwellSettings, "Dwell time"
subMenu = ignitionCylExtra, "Ignition Cylinder Extra"
subMenu = std_separator
subMenu = ignitionTableTbl, "Ignition Advance Table"
subMenu = ignitionTableTbl, "Ignition Advance Table", 0, {useTPSAdvanceTable == 0}
subMenu = ignitionTpsTableTbl, "Ignition Advance TPS-based Table", 0, {useTPSAdvanceTable == 1}
subMenu = std_separator
subMenu = cltTimingCorrCurve, "Warmup timing correction"
subMenu = ignitionIatCorrTableTbl, "Ignition IAT correction Table"
@ -1181,7 +1191,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
panel = fuelTableGaugesPanel
panel = fuelTableRight
dialog = tChargeSettings, "tCharge Settings"
dialog = tChargeRpmTpsSettings, "RPM+TPS Mode Settings"
field = "We use these coefficients to approximate air/fuel charge temperate"
field = "based on CLT and IAT, depending on RPM and TPM"
field = "minRPM minTPS", tChargeMinRpmMinTps
@ -1189,6 +1199,22 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "maxRPM minTPS", tChargeMaxRpmMinTps
field = "maxRPM maxTPS", tChargeMaxRpmMaxTps
dialog = tChargeGeneralSettings, ""
field = "tCharge Mode", tChargeMode
field = "tChange Increment Limit, deg/sec", tChargeAirIncrLimit
field = "tChange Decrement Limit, deg/sec", tChargeAirDecrLimit
field = ""
dialog = tChargeAirInterpSettings, "Air Interpolation Mode Settings"
field = "Min tCharge Coeff.", tChargeAirCoefMin
field = "Max tCharge Coeff.", tChargeAirCoefMax
field = "Max Air Flow, kg/h", tChargeAirFlowMax
dialog = tChargeSettings, "tCharge Settings"
panel = tChargeGeneralSettings
panel = tChargeRpmTpsSettings, { tChargeMode == 0}
panel = tChargeAirInterpSettings, { tChargeMode == 1}
dialog = baseInjection, "General"
field = "Enabled", isInjectionEnabled
field = "Mode", injectionMode, {isInjectionEnabled == 1}
@ -1201,6 +1227,7 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "#Wasted spark with individual coils"
field = "Two wire wasted", twoWireBatchIgnition, {isIgnitionEnabled == 1 && ignitionMode == 2}
field = "Timing Mode", timingMode, {isIgnitionEnabled == 1}
field = "Use TPS-based Advance Table", useTPSAdvanceTable, {isIgnitionEnabled == 1 && fuelAlgorithm == LM_SPEED_DENSITY}
field = "#Use fixed timing while validating with a timing gun"
field = "Fixed Timinig", fixedTiming, {isIgnitionEnabled == 1 && timingMode == 1}

View File

@ -65,7 +65,7 @@ public class EnumToString {
System.out.println("Reading from " + inFileName);
String simpleFileName = f.getName();
result.append("#include \"main.h\"\r\n");
result.append("#include \"global.h\"\r\n");
result.append("#include \"" + simpleFileName + "\"\r\n");
EnumToString.header.append("#include \"" + simpleFileName + "\"\r\n");