From 4d3c99460e9803916820edba91921cc794b286e8 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 18 Sep 2023 13:15:20 -0400 Subject: [PATCH] that custom miata is sold only:kinetis --- firmware/config/engines/engines.mk | 1 - .../mazda/mazda_miata_custom_hunchback.cpp | 119 ------------------ .../config/engines/mazda/mazda_miata_vvt.h | 4 - .../controllers/algo/engine_configuration.cpp | 3 - firmware/controllers/algo/engine_types.h | 6 +- 5 files changed, 1 insertion(+), 132 deletions(-) delete mode 100644 firmware/config/engines/mazda/mazda_miata_custom_hunchback.cpp diff --git a/firmware/config/engines/engines.mk b/firmware/config/engines/engines.mk index 4a63530669..4f88501842 100644 --- a/firmware/config/engines/engines.mk +++ b/firmware/config/engines/engines.mk @@ -10,7 +10,6 @@ ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \ $(PROJECT_DIR)/config/engines/mazda/mazda_miata_1_6.cpp \ $(PROJECT_DIR)/config/engines/mazda/mazda_miata_na8.cpp \ $(PROJECT_DIR)/config/engines/mazda/mazda_miata_vvt.cpp \ - $(PROJECT_DIR)/config/engines/mazda/mazda_miata_custom_hunchback.cpp \ $(PROJECT_DIR)/config/engines/citroenBerlingoTU3JP.cpp \ $(PROJECT_DIR)/config/engines/dodge_neon.cpp \ $(PROJECT_DIR)/config/engines/ford_1995_inline_6.cpp \ diff --git a/firmware/config/engines/mazda/mazda_miata_custom_hunchback.cpp b/firmware/config/engines/mazda/mazda_miata_custom_hunchback.cpp deleted file mode 100644 index 20f24025b2..0000000000 --- a/firmware/config/engines/mazda/mazda_miata_custom_hunchback.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * @file mazda_miata_custom_hunchback.cpp - * - * rusEfi Green Race car - based on NA6 body with VVT swap - * - * Hunchback - VVT engine with NA fuel rail - * set engine_type 54 - * - * It's using ZM-DE 2000 protege 36/1 trigger wheel ZM 01-11-408 and there are some minor issues :( - * - * MAZDA_MIATA_2003_NA_RAIL - * - * @date Sep 20, 2019 - * @author Andrey Belomutskiy, (c) 2012-2020 - */ - -#include "pch.h" - -#include "mazda_miata_vvt.h" -#include "custom_engine.h" - -// todo: why would this not work? -//extern const float mazda_miata_nb2_RpmBins[FUEL_RPM_COUNT]; -//extern const float mazda_miata_nb2_LoadBins[FUEL_LOAD_COUNT]; - -const uint16_t mazda_miata_nb2_RpmBins[FUEL_RPM_COUNT] = {700, 820, 950, 1100, - 1300, 1550, 1800, 2150, - 2500, 3000, 3500, 4150, - 4900, 5800, 6800, 8000} -; - -const uint8_t mazda_miata_nb2_LoadBins[FUEL_LOAD_COUNT] = {20, 25, 30, 35, - 40, 46, 54, 63, - 73, 85, 99, 116, - 135, 158, 185, 220} -; - -static uint8_t const SCRIPT_TABLE_dyno[SCRIPT_TABLE_8][SCRIPT_TABLE_8] = { - /* Generated by TS2C on Sun May 07 09:35:13 EDT 2017*/ - {/* 0 30.000 *//* 0 700.0*/1, /* 1 1000.0*/3, /* 2 2000.0*/10, /* 3 3000.0*/20, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 1 40.000 *//* 0 700.0*/3, /* 1 1000.0*/10, /* 2 2000.0*/19, /* 3 3000.0*/26, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 2 50.000 *//* 0 700.0*/7, /* 1 1000.0*/16, /* 2 2000.0*/24, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 3 60.000 *//* 0 700.0*/11, /* 1 1000.0*/20, /* 2 2000.0*/27, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 4 70.000 *//* 0 700.0*/13, /* 1 1000.0*/24, /* 2 2000.0*/31, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 5 75.000 *//* 0 700.0*/15, /* 1 1000.0*/27, /* 2 2000.0*/33, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 6 82.000 *//* 0 700.0*/17, /* 1 1000.0*/28, /* 2 2000.0*/33, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, - {/* 7 85.000 *//* 0 700.0*/17, /* 1 1000.0*/28, /* 2 2000.0*/33, /* 3 3000.0*/28, /* 4 3500.0*/20, /* 5 4500.0*/16, /* 6 5500.0*/11, /* 7 6500.0*/10, }, -}; - -#if DEFAULT_FUEL_LOAD_COUNT == FUEL_LOAD_COUNT -static const uint8_t mapBased18vvtVeTable_NA_fuel_rail[16][16] = { - /* Generated by TS2C on Sun May 07 09:37:15 EDT 2017*/ - {/* 0 20.000 *//* 0 700.0*/35, /* 1 820.0*/36, /* 2 950.0*/37, /* 3 1100.0*/35, /* 4 1300.0*/36, /* 5 1550.0*/42, /* 6 1800.0*/45, /* 7 2150.0*/34, /* 8 2500.0*/26, /* 9 3000.0*/27, /* 10 3500.0*/29, /* 11 4150.0*/32, /* 12 4900.0*/36, /* 13 5800.0*/32, /* 14 6800.0*/34, /* 15 8000.0*/36, }, - {/* 1 25.000 *//* 0 700.0*/35, /* 1 820.0*/38, /* 2 950.0*/38, /* 3 1100.0*/44, /* 4 1300.0*/42, /* 5 1550.0*/51, /* 6 1800.0*/50, /* 7 2150.0*/45, /* 8 2500.0*/42, /* 9 3000.0*/41, /* 10 3500.0*/39, /* 11 4150.0*/43, /* 12 4900.0*/38, /* 13 5800.0*/36, /* 14 6800.0*/38, /* 15 8000.0*/40, }, - {/* 2 30.000 *//* 0 700.0*/37, /* 1 820.0*/41, /* 2 950.0*/51, /* 3 1100.0*/48, /* 4 1300.0*/47, /* 5 1550.0*/51, /* 6 1800.0*/49, /* 7 2150.0*/47, /* 8 2500.0*/56, /* 9 3000.0*/51, /* 10 3500.0*/52, /* 11 4150.0*/60, /* 12 4900.0*/59, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 3 35.000 *//* 0 700.0*/39, /* 1 820.0*/44, /* 2 950.0*/53, /* 3 1100.0*/50, /* 4 1300.0*/52, /* 5 1550.0*/55, /* 6 1800.0*/55, /* 7 2150.0*/64, /* 8 2500.0*/68, /* 9 3000.0*/57, /* 10 3500.0*/59, /* 11 4150.0*/68, /* 12 4900.0*/66, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 4 40.000 *//* 0 700.0*/45, /* 1 820.0*/57, /* 2 950.0*/53, /* 3 1100.0*/47, /* 4 1300.0*/62, /* 5 1550.0*/62, /* 6 1800.0*/63, /* 7 2150.0*/68, /* 8 2500.0*/72, /* 9 3000.0*/63, /* 10 3500.0*/74, /* 11 4150.0*/84, /* 12 4900.0*/75, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 5 46.000 *//* 0 700.0*/55, /* 1 820.0*/63, /* 2 950.0*/58, /* 3 1100.0*/53, /* 4 1300.0*/59, /* 5 1550.0*/64, /* 6 1800.0*/67, /* 7 2150.0*/73, /* 8 2500.0*/75, /* 9 3000.0*/82, /* 10 3500.0*/80, /* 11 4150.0*/86, /* 12 4900.0*/91, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 6 54.000 *//* 0 700.0*/62, /* 1 820.0*/69, /* 2 950.0*/67, /* 3 1100.0*/63, /* 4 1300.0*/67, /* 5 1550.0*/68, /* 6 1800.0*/77, /* 7 2150.0*/82, /* 8 2500.0*/90, /* 9 3000.0*/96, /* 10 3500.0*/94, /* 11 4150.0*/96, /* 12 4900.0*/92, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 7 63.000 *//* 0 700.0*/67, /* 1 820.0*/73, /* 2 950.0*/72, /* 3 1100.0*/73, /* 4 1300.0*/78, /* 5 1550.0*/73, /* 6 1800.0*/79, /* 7 2150.0*/92, /* 8 2500.0*/105, /* 9 3000.0*/105, /* 10 3500.0*/100, /* 11 4150.0*/106, /* 12 4900.0*/103, /* 13 5800.0*/103, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 8 73.000 *//* 0 700.0*/70, /* 1 820.0*/74, /* 2 950.0*/75, /* 3 1100.0*/79, /* 4 1300.0*/89, /* 5 1550.0*/90, /* 6 1800.0*/95, /* 7 2150.0*/98, /* 8 2500.0*/96, /* 9 3000.0*/100, /* 10 3500.0*/92, /* 11 4150.0*/101, /* 12 4900.0*/103, /* 13 5800.0*/103, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 9 85.000 *//* 0 700.0*/72, /* 1 820.0*/76, /* 2 950.0*/79, /* 3 1100.0*/80, /* 4 1300.0*/83, /* 5 1550.0*/82, /* 6 1800.0*/85, /* 7 2150.0*/97, /* 8 2500.0*/98, /* 9 3000.0*/104, /* 10 3500.0*/102, /* 11 4150.0*/115, /* 12 4900.0*/103, /* 13 5800.0*/103, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 10 99.000 *//* 0 700.0*/78, /* 1 820.0*/77, /* 2 950.0*/79, /* 3 1100.0*/76, /* 4 1300.0*/78, /* 5 1550.0*/78, /* 6 1800.0*/83, /* 7 2150.0*/91, /* 8 2500.0*/101, /* 9 3000.0*/108, /* 10 3500.0*/103, /* 11 4150.0*/116, /* 12 4900.0*/108, /* 13 5800.0*/103, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 11 116.000 *//* 0 700.0*/80, /* 1 820.0*/80, /* 2 950.0*/80, /* 3 1100.0*/80, /* 4 1300.0*/80, /* 5 1550.0*/80, /* 6 1800.0*/80, /* 7 2150.0*/100, /* 8 2500.0*/100, /* 9 3000.0*/100, /* 10 3500.0*/106, /* 11 4150.0*/116, /* 12 4900.0*/108, /* 13 5800.0*/108, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 12 135.000 *//* 0 700.0*/80, /* 1 820.0*/80, /* 2 950.0*/80, /* 3 1100.0*/80, /* 4 1300.0*/80, /* 5 1550.0*/80, /* 6 1800.0*/80, /* 7 2150.0*/100, /* 8 2500.0*/100, /* 9 3000.0*/100, /* 10 3500.0*/106, /* 11 4150.0*/116, /* 12 4900.0*/108, /* 13 5800.0*/108, /* 14 6800.0*/108, /* 15 8000.0*/108, }, - {/* 13 158.000 *//* 0 700.0*/80, /* 1 820.0*/80, /* 2 950.0*/80, /* 3 1100.0*/80, /* 4 1300.0*/80, /* 5 1550.0*/80, /* 6 1800.0*/80, /* 7 2150.0*/80, /* 8 2500.0*/80, /* 9 3000.0*/80, /* 10 3500.0*/80, /* 11 4150.0*/80, /* 12 4900.0*/80, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 14 185.000 *//* 0 700.0*/80, /* 1 820.0*/80, /* 2 950.0*/80, /* 3 1100.0*/80, /* 4 1300.0*/80, /* 5 1550.0*/80, /* 6 1800.0*/80, /* 7 2150.0*/80, /* 8 2500.0*/80, /* 9 3000.0*/80, /* 10 3500.0*/80, /* 11 4150.0*/80, /* 12 4900.0*/80, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, - {/* 15 220.000 *//* 0 700.0*/80, /* 1 820.0*/80, /* 2 950.0*/80, /* 3 1100.0*/80, /* 4 1300.0*/80, /* 5 1550.0*/80, /* 6 1800.0*/80, /* 7 2150.0*/80, /* 8 2500.0*/80, /* 9 3000.0*/80, /* 10 3500.0*/80, /* 11 4150.0*/80, /* 12 4900.0*/80, /* 13 5800.0*/80, /* 14 6800.0*/80, /* 15 8000.0*/80, }, -}; -#endif - -static const uint16_t mazda_miata_nb2_targetLambdaRpmBins[FUEL_RPM_COUNT] = {650, 800, 1050, 1300, - 1550, 1800, 2050, 2300, - 2550, 2800, 3050, 3300, - 3550, 3800, 4050, 6400} -; - -static const uint8_t mazda_miata_nb2_targetLambdaLoadBins[FUEL_LOAD_COUNT] = {10, 20, 30, 40, - 50, 60, 70, 80, - 90, 100, 110, 120, - 130, 140, 150, 160}; - -void setMazdaMiata2003EngineConfigurationNaFuelRail() { - setMazdaMiata2003EngineConfiguration(); - - copyTable(config->scriptTable1, SCRIPT_TABLE_dyno); - - copyArray(config->veRpmBins, mazda_miata_nb2_RpmBins); - copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins); - copyTable(config->veTable, mapBased18vvtVeTable_NA_fuel_rail); - - engineConfiguration->vvtOffsets[0] = 83; // 2002 green car value - - copyArray(config->lambdaRpmBins, mazda_miata_nb2_targetLambdaRpmBins); - copyArray(config->lambdaLoadBins, mazda_miata_nb2_targetLambdaLoadBins); - - engineConfiguration->ignitionPins[2] = Gpio::C7; - - // Frankenso analog #7 pin 3J, W48 top <>W48 bottom jumper, not OEM - engineConfiguration->afr.hwChannel = EFI_ADC_3; // PA3 - - engineConfiguration->mafAdcChannel = EFI_ADC_4; // PA4 - - engineConfiguration->cranking.baseFuel = 27; // higher value for return system NA conversion since lower fuel pressure - engineConfiguration->vbattDividerCoeff = 9.30; // actual value on my new board - - engineConfiguration->ignitionDwellForCrankingMs = 8; - - engineConfiguration->vvtOffsets[0] = 97; - - - engineConfiguration->rpmHardLimit = 7200; // we want to survive the race, but we also want some fun! - - // set idle_position 30 - engineConfiguration->manIdlePosition = 30; - engineConfiguration->crankingIACposition = 65; -} - - diff --git a/firmware/config/engines/mazda/mazda_miata_vvt.h b/firmware/config/engines/mazda/mazda_miata_vvt.h index ecb1a992d1..6e232bc2cb 100644 --- a/firmware/config/engines/mazda/mazda_miata_vvt.h +++ b/firmware/config/engines/mazda/mazda_miata_vvt.h @@ -17,10 +17,6 @@ * set engine_type 47 */ void setMazdaMiata2003EngineConfiguration(); -/** - * race car - NA body and fuel system with NB2 engine - */ -void setMazdaMiata2003EngineConfigurationNaFuelRail(); void setMazdaMiata2003EngineConfigurationBoardTest(); /** diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 06cea18c5f..067d14c208 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -987,9 +987,6 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e case engine_type_e::FRANKENSO_MAZDA_MIATA_2003: setMazdaMiata2003EngineConfiguration(); break; - case engine_type_e::MAZDA_MIATA_2003_NA_RAIL: - setMazdaMiata2003EngineConfigurationNaFuelRail(); - break; case engine_type_e::MAZDA_MIATA_2003_BOARD_TEST: setMazdaMiata2003EngineConfigurationBoardTest(); break; diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index 7c60907cd4..72f54d16f6 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -138,11 +138,7 @@ enum class engine_type_e : uint16_t { TEST_ISSUE_366_BOTH = 52, TEST_ISSUE_366_RISE = 53, - /** - * green Hunchback race car - VVT engine on a NA body with NA return fuel lines which - * means different fuel pressure situation - */ - MAZDA_MIATA_2003_NA_RAIL = 54, + UNUSED_54 = 54, MAZDA_MIATA_2003_BOARD_TEST = 55,