Skip to content

Commit

Permalink
MRE for Miata does not exist, also Frankenso method inline
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Jan 16, 2024
1 parent f5ca8b2 commit 5ef42e6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 108 deletions.
97 changes: 5 additions & 92 deletions firmware/config/engines/mazda_miata_1_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,6 @@ void miataNAcommonEngineSettings() {
engineConfiguration->stft.cellCfgs[3] = { 5, -5, 30 };
}

static void miataNAcommon() {
engineConfiguration->idle.solenoidPin = Gpio::B9; // this W61 <> W61 jumper, pin 3W

engineConfiguration->ignitionPins[0] = Gpio::E14; // Frankenso high side - pin 1G
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
engineConfiguration->ignitionPins[2] = Gpio::C7; // Frankenso high side - pin 1H
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
}

/**
* MIATA_NA6_MAP
*/
Expand Down Expand Up @@ -271,90 +262,12 @@ void setMiataNA6_MAP_Frankenso() {
// W58 PE4 A/C fan relay out
#endif /* EFI_UNIT_TEST */

miataNAcommon();
}


/**
* set engine_type 66
*/
void setMiataNA6_MAP_MRE() {
miataNAcommonEngineSettings();

engineConfiguration->triggerInputPins[0] = Gpio::A5;
engineConfiguration->triggerInputPins[1] = Gpio::C6;
engineConfiguration->camInputs[0] = Gpio::Unassigned;

engineConfiguration->fuelPumpPin = Gpio::Unassigned;

engineConfiguration->useIacTableForCoasting = true;
engineConfiguration->idlePidDeactivationTpsThreshold = 90;

engineConfiguration->idleRpmPid.pFactor = 0.01;
engineConfiguration->idleRpmPid.iFactor = 0.02;
engineConfiguration->idle_derivativeFilterLoss = 0.1;
engineConfiguration->idle_antiwindupFreq = 0.1;
engineConfiguration->idleRpmPid.dFactor = 0.002;
engineConfiguration->acIdleExtraOffset = 14;
engineConfiguration->idleRpmPid.minValue = -7;
engineConfiguration->idleRpmPid.maxValue = 35;
engineConfiguration->idleRpmPid.periodMs = 40;
engineConfiguration->idlerpmpid_iTermMin = -6;
engineConfiguration->idlerpmpid_iTermMax = 30;
engineConfiguration->pidExtraForLowRpm = 25;
engineConfiguration->idlePidRpmDeadZone = 25;
engineConfiguration->idlePidRpmUpperLimit = 1000;

engineConfiguration->useIdleTimingPidControl = true;
engineConfiguration->idleTimingPid.pFactor = 0.05;
engineConfiguration->idleTimingPid.iFactor = 0.0;
engineConfiguration->idleTimingPid.dFactor = 0.0;
engineConfiguration->idleTimingPid.minValue = -13;
engineConfiguration->idleTimingPid.maxValue = 13;

// EFI_ADC_3: "22 - AN temp 4"
engineConfiguration->acSwitch = Gpio::A3;

#if HW_MICRO_RUSEFI
// todo: ask Stefan to clarify this
engineConfiguration->tps1_1AdcChannel = MRE_IN_ANALOG_VOLT_2; // "26 - AN volt 2"
engineConfiguration->tpsMin = 0;
engineConfiguration->tpsMax = 982;

engineConfiguration->map.sensor.hwChannel = MRE_IN_ANALOG_VOLT_5; // "20 - AN volt 5"

engineConfiguration->mafAdcChannel = MRE_IN_ANALOG_VOLT_9; // "40 - AN volt 9"
#endif // HW_MICRO_RUSEFI


#if (BOARD_TLE8888_COUNT > 0)
// Gpio::G1: "Clutch Switch"
engineConfiguration->clutchDownPin = Gpio::G1;

engineConfiguration->fanPin = Gpio::Unassigned;


// Gpio::TLE8888_PIN_23: "33 - GP Out 3"
engineConfiguration->malfunctionIndicatorPin = Gpio::TLE8888_PIN_23;

#endif /* BOARD_TLE8888_COUNT */
}

void setMiata94_MAP_MRE() {
setMiataNA6_MAP_MRE();

#if (BOARD_TLE8888_COUNT > 0)
// "35 - GP Out 1"
engineConfiguration->fuelPumpPin = Gpio::TLE8888_PIN_21;
#endif /* BOARD_TLE8888_COUNT */

engineConfiguration->injectionMode = IM_SEQUENTIAL;
engineConfiguration->displacement = 1.8;
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_MAZDA);
strcpy(engineConfiguration->engineCode, "94");

engineConfiguration->map.sensor.type = MT_MPX4250;
engineConfiguration->idle.solenoidPin = Gpio::B9; // this W61 <> W61 jumper, pin 3W

engineConfiguration->ignitionPins[0] = Gpio::E14; // Frankenso high side - pin 1G
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
engineConfiguration->ignitionPins[2] = Gpio::C7; // Frankenso high side - pin 1H
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
}

void setHellenNA94() {
Expand Down
4 changes: 0 additions & 4 deletions firmware/config/engines/mazda_miata_1_6.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ void setMiataNA6_MAP_Frankenso();

void setMiataNA6_MAP_MRE();

/**
* set engine_type 20
*/
void setMiata94_MAP_MRE();
void miataNAcommonEngineSettings();

/**
Expand Down
6 changes: 2 additions & 4 deletions firmware/controllers/algo/engine_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,10 +683,8 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e
case engine_type_e::BMW_M73_MRE_SLAVE:
setEngineBMW_M73_microRusEfi();
break;
case engine_type_e::MRE_MIATA_94_MAP:
setMiata94_MAP_MRE();
break;
case engine_type_e::MRE_MIATA_NA6_MAP:
case engine_type_e::ET_UNUSED_20:
case engine_type_e::ET_UNUSED_66:
setMiataNA6_MAP_MRE();
break;
case engine_type_e::MRE_BODY_CONTROL:
Expand Down
4 changes: 2 additions & 2 deletions firmware/controllers/algo/engine_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ enum class engine_type_e : uint32_t {

PROTEUS_E65_6H_MAN_IN_THE_MIDDLE = 9,
HELLEN_NA8_96 = 10,
MRE_MIATA_NA6_MAP = 66,
ET_UNUSED_66 = 66,

TEST_ROTARY = 19,
// Frankenso board
FRANKENSO_MIATA_NA6_MAP = 41,
MRE_MIATA_94_MAP = 20,
ET_UNUSED_20 = 20,
MIATA_1996 = 21,

FORD_ESCORT_GT = 14,
Expand Down
6 changes: 0 additions & 6 deletions firmware/tunerstudio/rusefi.input
Original file line number Diff line number Diff line change
Expand Up @@ -2069,10 +2069,6 @@ cmd_openblt = "@@TS_IO_TEST_COMMAND_char@@\x00\xbc\x00\x00"
cmd_set_engine_type_microRusEFI_VW_B6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_VW_B6_16_hex@@"
cmd_set_engine_type_microRusEFI_MRE_BODY_CONTROL = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_BODY_CONTROL_16_hex@@"

cmd_set_engine_type_microRusEFI_Miata_NA6_MAP = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_MIATA_NA6_MAP_16_hex@@"

cmd_set_engine_type_microRusEFI_Miata_94_MAP = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_MIATA_94_MAP_16_hex@@"

cmd_set_engine_type_MRE_SUBARU_EJ18 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_SUBARU_EJ18_16_hex@@"

cmd_set_engine_type_MRE_M111 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_MRE_M111_16_hex@@"
Expand Down Expand Up @@ -4250,8 +4246,6 @@ dialog = tcuControls, "Transmission Settings"
commandButton = "Frankenso Miata NA6 Stage 1", cmd_set_engine_type_Frankenso_Miata_NA6_MAP@@if_show_Frankenso_presets
commandButton = "Frankenso Miata NB2 MAP", cmd_set_engine_type_Frankenso_Miata_NB2@@if_show_Frankenso_presets

commandButton = "microRusEFI Miata NA6 MAP", cmd_set_engine_type_microRusEFI_Miata_NA6_MAP@@if_show_microRusEFI_presets
commandButton = "microRusEFI Miata 94/95 MAP", cmd_set_engine_type_microRusEFI_Miata_94_MAP@@if_show_microRusEFI_presets
commandButton = "microRusEFI GDI VAG B6 test", cmd_set_engine_type_microRusEFI_VW_B6@@if_show_microRusEFI_presets
commandButton = "microRusEFI BCM", cmd_set_engine_type_microRusEFI_MRE_BODY_CONTROL@@if_show_microRusEFI_presets
commandButton = "microRusEFI Subaru EJ18", cmd_set_engine_type_MRE_SUBARU_EJ18@@if_show_microRusEFI_presets
Expand Down

0 comments on commit 5ef42e6

Please sign in to comment.