From b7db7024b49a37feda3855e1ff65df1ca1dce670 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 30 Aug 2023 12:21:18 -0700 Subject: [PATCH] msm --- firmware/config/engines/mazda_miata_vvt.cpp | 26 +++++++++++++++++++-- firmware/config/engines/mazda_miata_vvt.h | 5 +--- firmware/controllers/algo/engine_types.h | 2 +- firmware/tunerstudio/rusefi.input | 3 ++- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index 6868bdd51d..3893119332 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -252,7 +252,6 @@ static void setCommonMazdaNB() { engineConfiguration->trigger.type = trigger_type_e::TT_MIATA_VVT; engineConfiguration->globalTriggerAngleOffset = 10; engineConfiguration->vvtMode[0] = VVT_MIATA_NB; - engineConfiguration->vvtOffsets[0] = 95; // Cranking engineConfiguration->ignitionDwellForCrankingMs = 4; @@ -405,6 +404,8 @@ static void setMazdaMiataEngineNB2Defaults() { copyArray(config->vvtTable1LoadBins, vvt18fsioLoadBins); copyTable(config->vvtTable1, SCRIPT_TABLE_vvt_target); + engineConfiguration->vvtOffsets[0] = 95; + // VVT closed loop engineConfiguration->auxPid[0].pFactor = 2; engineConfiguration->auxPid[0].iFactor = 0.005; @@ -801,7 +802,28 @@ void setMiataNB2_Polygonus() { engineConfiguration->mainRelayPin = PROTEUS_LS_16; engineConfiguration->acSwitch = getAdcChannelBrainPin("", PROTEUS_IN_ANALOG_VOLT_6); -#endif // EFI_PROD_CODE +} + +void setMiataNB_MSM_Polygonus() { + setMazdaMiataEngineNB1Defaults(); + setMiataNbPolygonusCommon(); + + strcpy(engineConfiguration->engineCode, "NB1"); + engineConfiguration->compressionRatio = 9.5; + engineConfiguration->isForcedInduction = true; + + engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_1; + + engineConfiguration->tpsMin = 92; + engineConfiguration->tpsMax = 872; + + // NB2 has a main relay output, unlike NB1 + engineConfiguration->mainRelayPin = PROTEUS_LS_16; + + engineConfiguration->acSwitch = getAdcChannelBrainPin("", PROTEUS_IN_ANALOG_VOLT_6); + + // MSM has boost control! + engineConfiguration->boostControlPin = PROTEUS_HS_3; } #endif // HW_PROTEUS diff --git a/firmware/config/engines/mazda_miata_vvt.h b/firmware/config/engines/mazda_miata_vvt.h index c97c56fefb..c24c505dee 100644 --- a/firmware/config/engines/mazda_miata_vvt.h +++ b/firmware/config/engines/mazda_miata_vvt.h @@ -30,11 +30,8 @@ void setMazdaMiata2003EngineConfigurationBoardTest(); void setMiataNB2_Proteus_TCU(); void setMiataNB1_Polygonus(); - -/** - * set engine_type 67 - */ void setMiataNB2_Polygonus(); +void setMiataNB_MSM_Polygonus(); /** * set engine_type 69 diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index 921f7c508e..716178dfe0 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -200,11 +200,11 @@ enum class engine_type_e : uint32_t { POLYGONUS_MIATA_NA6 = 4, POLYGONUS_MIATA_NB1 = 11, POLYGONUS_MIATA_NB2 = 67, + POLYGONUS_MIATA_MSM = 12, ET_UNUSED_97 = 97, ET_UNUSED_98 = 98, ET_UNUSED_17 = 17, - ET_UNUSED_12 = 12, ET_UNUSED_13 = 13, ET_UNUSED_15 = 15, ET_UNUSED_33 = 33, diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index f0225da625..44d37fe3fa 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -2104,6 +2104,7 @@ cmd_set_engine_type_PROTEUS_HARLEY = "@@TS_IO_TEST_COMMAND_char@@@@ts_comma cmd_set_engine_type_POLYGONUS_MIATA_NA6 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_POLYGONUS_MIATA_NA6_16_hex@@" cmd_set_engine_type_POLYGONUS_MIATA_NB1 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_POLYGONUS_MIATA_NB1_16_hex@@" cmd_set_engine_type_POLYGONUS_MIATA_NB2 = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_POLYGONUS_MIATA_NB2_16_hex@@" +cmd_set_engine_type_POLYGONUS_MIATA_MSM = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_SET_ENGINE_TYPE_16_hex@@@@engine_type_e_POLYGONUS_MIATA_MSM_16_hex@@" ; ETB_BENCH_ENGINE = 58 @@ -4162,7 +4163,7 @@ dialog = tcuControls, "Transmission Settings" ; commandButton = "FOME PnP Miata NA8 96", cmd_set_engine_type_POLYGONUS_MIATA_NA6@@if_show_Proteus_presets commandButton = "FOME PnP Miata NB1", cmd_set_engine_type_POLYGONUS_MIATA_NB1@@if_show_Proteus_presets commandButton = "FOME PnP Miata NB2 VVT", cmd_set_engine_type_POLYGONUS_MIATA_NB2@@if_show_Proteus_presets - ; commandButton = "FOME PnP Miata MSM", cmd_set_engine_type_POLYGONUS_MIATA_NA6@@if_show_Proteus_presets + commandButton = "FOME PnP Miata MSM", cmd_set_engine_type_POLYGONUS_MIATA_MSM@@if_show_Proteus_presets commandButton = "Proteus M73 v12", cmd_set_engine_type_Proteus_M73@@if_show_Proteus_presets commandButton = "Proteus GDI VAG B6 test", cmd_set_engine_type_PROTEUS_VW_B6@@if_show_Proteus_presets