Nissan VVT trigger decoder #2887

This commit is contained in:
Andrey 2021-07-01 21:48:14 -04:00
parent d5ae3e5492
commit fccd13247b
8 changed files with 52 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "rusefi_enums.h"
#include "rusefi_hw_enums.h"
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 17:26:03 EDT 2021
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 19:48:33 EDT 2021
// see also gen_config_and_enums.bat
@ -1478,6 +1478,8 @@ case TT_VVT_JZ:
return "TT_VVT_JZ";
case TT_VVT_MIATA_NB2:
return "TT_VVT_MIATA_NB2";
case TT_VVT_NISSAN_VQ:
return "TT_VVT_NISSAN_VQ";
}
return NULL;
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "rusefi_enums.h"
#include "rusefi_hw_enums.h"
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 17:26:02 EDT 2021
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 19:48:33 EDT 2021
// see also gen_config_and_enums.bat
@ -1274,6 +1274,8 @@ case TT_VVT_JZ:
return "TT_VVT_JZ";
case TT_VVT_MIATA_NB2:
return "TT_VVT_MIATA_NB2";
case TT_VVT_NISSAN_VQ:
return "TT_VVT_NISSAN_VQ";
}
return NULL;
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "rusefi_enums.h"
#include "rusefi_hw_enums.h"
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 17:26:03 EDT 2021
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 19:48:34 EDT 2021
// see also gen_config_and_enums.bat
@ -1474,6 +1474,8 @@ case TT_VVT_JZ:
return "TT_VVT_JZ";
case TT_VVT_MIATA_NB2:
return "TT_VVT_MIATA_NB2";
case TT_VVT_NISSAN_VQ:
return "TT_VVT_NISSAN_VQ";
}
return NULL;
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "rusefi_enums.h"
#include "rusefi_hw_enums.h"
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 17:26:01 EDT 2021
// was generated automatically by rusEFI tool from rusefi_hw_enums.h // was generated automatically by rusEFI tool from rusefi_enums.h // by enum2string.jar tool on Thu Jul 01 19:48:33 EDT 2021
// see also gen_config_and_enums.bat
@ -1450,6 +1450,8 @@ case TT_VVT_JZ:
return "TT_VVT_JZ";
case TT_VVT_MIATA_NB2:
return "TT_VVT_MIATA_NB2";
case TT_VVT_NISSAN_VQ:
return "TT_VVT_NISSAN_VQ";
}
return NULL;
}

View File

@ -396,13 +396,15 @@ typedef enum {
TT_NISSAN_VQ = TT_TT_NISSAN_VQ,
TT_VVT_NISSAN_VQ = TT_TT_VVT_NISSAN_VQ,
// do not forget to edit "#define trigger_type_e_enum" line in integration/rusefi_config.txt file to propogate new value to rusefi.ini TS project
// do not forget to invoke "gen_config.bat" once you make changes to integration/rusefi_config.txt
// todo: one day a hero would integrate some of these things into Makefile in order to reduce manual magic
//
// Another point: once you add a new trigger, run get_trigger_images.bat which would run rusefi_test.exe from unit_tests
//
TT_UNUSED = 59, // this is used if we want to iterate over all trigger types
TT_UNUSED = 60, // this is used if we want to iterate over all trigger types
Force_4_bytes_size_trigger_type = ENUM_32_BITS,
} trigger_type_e; // TriggerProcessor.java has this "trigger_type_e" name hard-coded!

View File

@ -105,3 +105,33 @@ void initializeNissanSR20VE_4(TriggerWaveform *s) {
void initializeNissanSR20VE_4_360(TriggerWaveform *s) {
initializeNissanSR20VE_4_optional_360(s, true);
}
static void addPrimaryToothEndingAt(TriggerWaveform *s, float fallAngle) {
int vvtWidth = 20;
s->addEventAngle(fallAngle - vvtWidth, T_PRIMARY, TV_RISE);
s->addEventAngle(fallAngle, T_PRIMARY, TV_FALL);
}
void initializeNissanVQvvt(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
int offset = 720 - 520;
addPrimaryToothEndingAt(s, offset + 40);
addPrimaryToothEndingAt(s, offset + 160);
addPrimaryToothEndingAt(s, offset + 200);
addPrimaryToothEndingAt(s, offset + 280);
addPrimaryToothEndingAt(s, offset + 320);
addPrimaryToothEndingAt(s, offset + 520);
}

View File

@ -11,3 +11,6 @@
void initializeNissanSR20VE_4(TriggerWaveform *s);
void initializeNissanSR20VE_4_360(TriggerWaveform *s);
void initializeNissanVQvvt(TriggerWaveform *s);
void initializeNissanVQcrank(TriggerWaveform *s);

View File

@ -545,6 +545,10 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
configureFordAspireTriggerWaveform(this);
break;
case TT_VVT_NISSAN_VQ:
initializeNissanVQvvt(this);
break;
case TT_TT_NISSAN_VQ:
case TT_KAWA_KX450F:
configureKawaKX450F(this);