From 3c94ec81335e93328c4fd26b7c20f9c66e4022f6 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 8 Aug 2020 17:00:14 -0400 Subject: [PATCH] self-stimulation RPM is wrong by 50% if switching from NA6 to NB2 configuration fix #1682 --- firmware/controllers/algo/engine_configuration.cpp | 4 +++- firmware/controllers/algo/rusefi_enums.h | 6 +++++- firmware/controllers/trigger/decoders/trigger_structure.cpp | 1 + firmware/controllers/trigger/decoders/trigger_universal.cpp | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index a1ec20872f..9e82261c4a 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -1459,7 +1459,9 @@ void prepareShapes(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #endif float getRpmMultiplier(operation_mode_e mode) { - if (mode == FOUR_STROKE_CAM_SENSOR) { + if (mode == FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR) { + return 2; + } else if (mode == FOUR_STROKE_CAM_SENSOR) { return 0.5; } else if (mode == FOUR_STROKE_CRANK_SENSOR) { return 1; diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 32a0d97cc3..510cd2adc3 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -515,6 +515,10 @@ typedef enum __attribute__ ((__packed__)) { #define CRANK_MODE_MULTIPLIER 2.0f +/** + * @see getCycleDuration + * @see getEngineCycle + */ // todo: better enum name typedef enum { OM_NONE = 0, @@ -535,7 +539,7 @@ typedef enum { /** * 720 degree engine cycle but trigger is defined using a 180 cycle which is when repeated three more times - * In other words, same pattern is repeatet on the crank wheel twice. + * In other words, same pattern is repeated on the crank wheel twice. */ FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR = 4, diff --git a/firmware/controllers/trigger/decoders/trigger_structure.cpp b/firmware/controllers/trigger/decoders/trigger_structure.cpp index ba8d677eb7..7834f1e1b0 100644 --- a/firmware/controllers/trigger/decoders/trigger_structure.cpp +++ b/firmware/controllers/trigger/decoders/trigger_structure.cpp @@ -113,6 +113,7 @@ int TriggerWaveform::getTriggerWaveformSynchPointIndex() const { /** * physical primary trigger duration + * @see getEngineCycle */ angle_t TriggerWaveform::getCycleDuration() const { switch (operationMode) { diff --git a/firmware/controllers/trigger/decoders/trigger_universal.cpp b/firmware/controllers/trigger/decoders/trigger_universal.cpp index 17eae3d139..3ed37adec3 100644 --- a/firmware/controllers/trigger/decoders/trigger_universal.cpp +++ b/firmware/controllers/trigger/decoders/trigger_universal.cpp @@ -7,6 +7,9 @@ #include "trigger_universal.h" +/** + * @see getCycleDuration + */ angle_t getEngineCycle(operation_mode_e operationMode) { return operationMode == TWO_STROKE ? 360 : FOUR_STROKE_ENGINE_CYCLE; }