Skip to content

Commit

Permalink
Mitsubishi 3A92 Support - 3 cylinder #4011
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Mar 20, 2022
1 parent 921aed3 commit 402f36a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
3 changes: 3 additions & 0 deletions firmware/controllers/algo/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ trigger_type_e getVvtTriggerType(vvt_mode_e vvtMode) {
return TT_VVT_BARRA_3_PLUS_1;
case VVT_NISSAN_VQ:
return TT_VVT_NISSAN_VQ35;
case VVT_MITSUBISHI_3A92:
return TT_VVT_MITSUBISHI_3A92;
case VVT_MITSUBISHI_6G75:
case VVT_NISSAN_MR:
return TT_NISSAN_MR18_CAM_VVT;
default:
Expand Down
4 changes: 3 additions & 1 deletion firmware/controllers/algo/rusefi_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ typedef enum __attribute__ ((__packed__)) {

VVT_NISSAN_MR = 11,

VVT_12 = 12,
VVT_MITSUBISHI_3A92 = 12,

VVT_MAP_V_TWIN_ANOTHER = 13,

VVT_MITSUBISHI_6G75 = 14,

} vvt_mode_e;

/**
Expand Down
22 changes: 19 additions & 3 deletions firmware/controllers/trigger/decoders/trigger_mitsubishi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,26 @@ void initialize36_2_1_1(TriggerWaveform *s) {
}

void initializeVvt3A92(TriggerWaveform *s) {
// s->shapeWithoutTdc = true;
// s->isSynchronizationNeeded = false;
s->initialize(FOUR_STROKE_CRANK_SENSOR);

int w = 5;
s->addEvent360(120 - w, T_PRIMARY, TV_RISE);
s->addEvent360(120, T_PRIMARY, TV_FALL);

s->addEvent360(12 + 120 - w, T_PRIMARY, TV_RISE);
s->addEvent360(12 + 120, T_PRIMARY, TV_FALL);

s->addEvent360(240 - w, T_PRIMARY, TV_RISE);
s->addEvent360(240, T_PRIMARY, TV_FALL);

s->addEvent360(360 - w, T_PRIMARY, TV_RISE);
s->addEvent360(360, T_PRIMARY, TV_FALL);

s->setTriggerSynchronizationGap(9);
s->setSecondTriggerSynchronizationGap(0.11); // redundancy
}

void initializeVvt6G75(TriggerWaveform *s) {

// s->shapeWithoutTdc = true;
// s->isSynchronizationNeeded = false;
}
5 changes: 4 additions & 1 deletion firmware/controllers/trigger/decoders/trigger_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,11 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e ambiguousOperat
initializeNissanVQvvt(this);
break;

case TT_VVT_MITSUBISHI_6G75:
case TT_VVT_MITSUBISHI_3A92:
initializeVvt3A92(this);
break;

case TT_VVT_MITSUBISHI_6G75:
case TT_NISSAN_QR25:
initializeNissanQR25crank(this);
break;
Expand Down
4 changes: 2 additions & 2 deletions firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ custom debug_mode_e 4 bits, U32, @OFFSET@, [0:5], @@debug_mode_e_enum@@

#define VM_VVT_INACTIVE 0

#define vvt_mode_e_enum "Inactive", "Single Tooth Second Half", "2GZ", "Miata NB2", "Single Tooth First Half", "Bosch Quick Start", "4/1", "ST 170", "Ford Barra 3+1", "Nissan VQ", "Honda K 4+1", "Nissan MR18", "INVALID", "VTwin by MAP", "vvt14", "vvt15"
custom vvt_mode_e 1 bits, U08, @OFFSET@, [0:3], @@vvt_mode_e_enum@@
#define vvt_mode_e_enum "Inactive", "Single Tooth Second Half", "2GZ", "Miata NB2", "Single Tooth First Half", "Bosch Quick Start", "4/1", "ST 170", "Ford Barra 3+1", "Nissan VQ", "Honda K 4+1", "Nissan MR18", "Mitsu 3A92", "VTwin by MAP", "Mitsu 6G75", "vvt15", "vvt16", "vvt17"
custom vvt_mode_e 1 bits, U08, @OFFSET@, [0:4], @@vvt_mode_e_enum@@

! At the moment TIM1, TIM2, TIM3 and TIM9 are configured as ICU
! todo: as of ChibiOS3, only channels 1 & 2 are allowed to capture input, that's a ChibiOS driver limitation
Expand Down

0 comments on commit 402f36a

Please sign in to comment.