Skip to content

Commit

Permalink
msm
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Aug 30, 2023
1 parent 8c33ea8 commit b7db702
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
26 changes: 24 additions & 2 deletions firmware/config/engines/mazda_miata_vvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down
5 changes: 1 addition & 4 deletions firmware/config/engines/mazda_miata_vvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion firmware/controllers/algo/engine_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion firmware/tunerstudio/rusefi.input
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b7db702

Please sign in to comment.