self-stimulation RPM is wrong by 50% if switching from NA6 to NB2 configuration fix #1682

This commit is contained in:
rusefi 2020-08-08 17:00:14 -04:00
parent ae606a6380
commit 3c94ec8133
4 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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,

View File

@ -113,6 +113,7 @@ int TriggerWaveform::getTriggerWaveformSynchPointIndex() const {
/**
* physical primary trigger duration
* @see getEngineCycle
*/
angle_t TriggerWaveform::getCycleDuration() const {
switch (operationMode) {

View File

@ -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;
}