From c662cc463d6c8f64e82cc623917d953c9fefd945 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 15 Sep 2024 14:45:38 -0400 Subject: [PATCH] MAP sync improvements #6920 only:uaefi --- firmware/controllers/trigger/trigger_central.cpp | 2 +- firmware/integration/rusefi_config.txt | 3 ++- firmware/tunerstudio/tunerstudio.template.ini | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index d63a209b51..845b7a76c2 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -671,7 +671,7 @@ void TriggerCentral::decodeMapCam(efitick_t timestamp, float currentPhase) { float instantMapDiffBetweenReadoutAngles = map - mapCamPrevCycleValue; mapCamPrevCycleValue = map; - if (instantMapDiffBetweenReadoutAngles > 0) { + if (instantMapDiffBetweenReadoutAngles > engineConfiguration->mapSyncThreshold) { mapVvt_sync_counter++; int revolutionCounter = getTriggerCentral()->triggerState.getCrankSynchronizationCounter(); mapVvt_MAP_AT_CYCLE_COUNT = revolutionCounter - prevChangeAtCycle; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index dcfb97d120..beb9b691f0 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -564,7 +564,8 @@ uint32_t cylindersCount;Number of cylinder the engine has.;"", 1, 0, 1, @@MAX_CY custom firing_order_e 1 bits, U08, @OFFSET@, [0:6], "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 Mustang", "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", "1-3-7-2-6-5-4-8 HO", "1-2-3-4-5-6-7-8-9", "INVALID", "1-2-3-4-5-6-7-8-9-10-11-12", "1-3-2", "1-2-3-4-5-6-7-8", "1-5-4-8-6-3-7-2", "1-4-3-6-2-5", "1-8-7-3-6-5-4-2", "1-6-2-4-3-5", "1-6-5-4-3-2", "1-4-5-2-3-6", "1-5-4-8-3-7-2-6 Voodoo", "1-6-5-10-2-7-3-8-4-9", "1-8-6-2-7-3-4-5 F136", "fo35", "fo36", "fo37" firing_order_e firingOrder; uint8_t justATempTest -uint16_t unused2bytesHere +uint8_t mapSyncThreshold;Delta kPa for MAP sync;"kPa", 1, 0, 0, 50, 0 +uint8_t unusedByteHere #define CYLINDER_BORE_UNITS "mm" #define CYLINDER_BORE_TOOLTIP "Cylinder diameter in mm" diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index 520c817ddc..6dfb24b1f0 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -2605,6 +2605,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ field = "Require cam/VVT sync for ignition", isPhaseSyncRequiredForIgnition field = "Maximum cam/VVT sync RPM", maxCamPhaseResolveRpm field = "MAP readout angle", mapCamDetectionAnglePosition, 1, { vvtMode1 == @@vvt_mode_e_VVT_MAP_V_TWIN@@ } + field = "MAP delta threshold", mapSyncThreshold, 1, { vvtMode1 == @@vvt_mode_e_VVT_MAP_V_TWIN@@ } field = "Print verbose VVT sync details to console",verboseVVTDecoding field = "Print verbose trigger sync to console", verboseTriggerSynchDetails field = "Display logic signals", displayLogicLevelsInEngineSniffer