compactify miata maps

This commit is contained in:
Matthew Kennedy 2023-02-28 20:00:03 -08:00
parent fcc3d1b1a2
commit c58d99d1f3
2 changed files with 10 additions and 30 deletions

View File

@ -19,23 +19,6 @@
#include "mazda_miata_base_maps.h"
#include "mre_meta.h"
static const float hardCodedmafDecodingBins[42] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.5999985, 0.70000076, 0.79999924, 0.9000015, 1.0, 1.0999985, 1.199997, 1.300003, 1.4000015, 1.5, 1.5999985, 1.699997, 1.800003, 1.9000015, 2.0, 2.100006, 2.2000122, 2.2999878, 2.399994, 2.5, 2.600006, 2.7000122, 2.7999878, 2.899994, 3.0, 3.100006, 3.2000122, 3.2999878, 3.399994, 3.5, 3.600006, 3.7000122, 3.7999878, 3.899994, 4.0, 4.0999756, 4.2};
static const float hardCodedmafDecoding[42] = {570.0, 437.0, 351.5, 293.55078, 237.0, 186.0, 145.0, 116.0, 96.0, 78.84961, 65.549805, 56.049805, 48.0, 40.0, 33.25, 29.449951, 25.649902, 22.800049, 20.899902, 19.0, 17.100098, 16.149902, 13.775024, 12.824951, 11.400024, 10.449951, 9.5, 8.550049, 8.454956, 8.359985, 8.300049, 8.199951, 7.5999756, 7.125, 7.125, 7.125, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244, 6.6500244};
/* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/
static void setMafDecodingBins() {
for (size_t i = 0; i < 42; i++) {
config->mafDecodingBins[i] = hardCodedmafDecodingBins[i];
config->mafDecoding[i] = hardCodedmafDecoding[i];
}
for (size_t i = 42; i < MAF_DECODING_COUNT; i++) {
config->mafDecodingBins[i] = 4.2 + 0.01 * i;
config->mafDecoding[i] = 0;
}
}
static const uint8_t hardCodedveLoadBins[16] = {20, 30, 34, 38, 43, 48, 54, 60, 67, 74, 82, 90, 99, 108, 118, 128};
static const uint16_t hardCodedveRpmBins[16] = {650, 950, 1250, 1600, 1950, 2350, 2750, 3200, 3700, 4200, 4700, 5200, 5800, 6400, 7100, 7800};
@ -229,7 +212,6 @@ void miataNAcommonEngineSettings() {
miataNA_setCltIdleCorrBins();
miataNA_setCltIdleRpmBins();
miataNA_setIacCoastingBins();
setMafDecodingBins();
miataNA_setIgnitionTable();
setMapVeTable();
setTable(config->injectionPhase, 400);

View File

@ -8,8 +8,8 @@
#include "pch.h"
// todo: use these defaults wider? make them global defaults maybe?
static const float hardCodedcrankingFuelBins[8] = {-20.0, -10.0, 3.6799927, 22.77002, 34.049805, 49.95996, 65.0, 90.0};
static const float hardCodedcrankingFuelCoef[8] = {2.7999878, 2.2000122, 1.6900024, 1.2900009, 1.199997, 1.050003, 1.0, 1.0};
static const int8_t hardCodedcrankingFuelBins[8] = {-20, -10, 4, 23, 34, 50, 65, 90};
static const float hardCodedcrankingFuelCoef[8] = {2.8, 2.2, 1.69, 1.29, 1.2, 1.05, 1, 1};
/* Generated by TS2C on Thu Jul 30 00:03:20 EDT 2020*/
void miataNA_setCrankingFuelBins() {
@ -17,9 +17,8 @@ void miataNA_setCrankingFuelBins() {
copyArray(config->crankingFuelCoef, hardCodedcrankingFuelCoef);
}
static const float hardCodediacCoastingRpmBins[16] = { 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500 };
static const float hardCodediacCoasting[16] = {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0};
static const std::remove_all_extents_t<decltype(persistent_config_s::iacCoastingRpmBins)> hardCodediacCoastingRpmBins[16] = { 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500 };
static const std::remove_all_extents_t<decltype(persistent_config_s::iacCoasting)> hardCodediacCoasting[16] = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40};
/* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/
void miataNA_setIacCoastingBins() {
@ -27,9 +26,9 @@ void miataNA_setIacCoastingBins() {
copyArray(config->iacCoasting, hardCodediacCoasting);
}
static const float hardCodedcltIdleCorrBins[16] = {-40.0, -30.0, -20.0, -10.0, 0.0, 9.439941, 19.120117, 30.810059, 42.509766, 54.529785, 64.21973, 71.90039, 80.0, 90.0, 100.0, 110.0};
static const int8_t hardCodedcltIdleCorrBins[16] = {-40, -30, -20, -10, 0, 9, 20, 31, 43, 55, 64, 72, 80, 90, 100, 110};
static const float hardCodedcltIdleCorr[16] = {1.4000015, 1.3199997, 1.2600021, 1.2099991, 1.1699982, 1.050003, 1.0299988, 1.0199966, 1.0299988, 1.0199966, 1.0100021, 1.0, 0.9900017, 0.9900017, 0.9900017, 0.9900017};
static const float hardCodedcltIdleCorr[16] = {1.4, 1.32, 1.26, 1.21, 1.17, 1.05, 1.03, 1.02, 1.03, 1.02, 1.01, 1.0, 0.99, 0.99, 0.99, 0.99};
/* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/
void miataNA_setCltIdleCorrBins() {
@ -37,9 +36,9 @@ void miataNA_setCltIdleCorrBins() {
copyArray(config->cltIdleCorr, hardCodedcltIdleCorr);
}
static const float hardCodedcltIdleRpmBins[16] = {-40.0, -30.0, -20.0, 0.0, 10.0, 20.0, 30.0, 40.0, 60.0, 70.0, 80.0, 90.0, 100.0, 120.0, 130.0, 140.0};
static const std::remove_all_extents_t<decltype(persistent_config_s::cltIdleRpmBins)> hardCodedcltIdleRpmBins[16] = {-40, -30, -20, 0, 10, 20, 30, 40, 60, 70, 80, 90, 100, 120, 130, 140};
static const float hardCodedcltIdleRpm[16] = {1180.0, 1150.0, 1130.0, 1110.0, 1090.0, 1070.0, 1050.0, 1020.0, 990.0, 970.0, 950.0, 950.0, 950.0, 950.0, 950.0, 950.0};
static const std::remove_all_extents_t<decltype(persistent_config_s::cltIdleRpm)> hardCodedcltIdleRpm[16] = {1180, 1150, 1130, 1110, 1090, 1070, 1050, 1020, 990, 970, 950, 950, 950, 950, 950, 950};
/* Generated by TS2C on Fri Jul 31 14:02:18 EDT 2020*/
void miataNA_setCltIdleRpmBins() {
@ -47,9 +46,8 @@ void miataNA_setCltIdleRpmBins() {
copyArray(config->cltIdleRpm, hardCodedcltIdleRpm);
}
static const float hardCodedignitionLoadBins[16] = {10.0, 24.0, 35.0, 55.0, 65.0, 75.0, 84.0, 99.0, 110.0, 125.0, 140.0, 160.0, 180.0, 200.0, 220.0, 250.0};
static const float hardCodedignitionRpmBins[16] = {500.0, 800.0, 1000.0, 1500.0, 1800.0, 2300.0, 2900.0, 3400.0, 3900.0, 4300.0, 4800.0, 5300.0, 5900.0, 6500.0, 7200.0, 8000.0};
static const uint8_t hardCodedignitionLoadBins[16] = {10, 24, 35, 55, 65, 75, 84, 99, 110, 125, 140, 160, 180, 200, 220, 250};
static const uint16_t hardCodedignitionRpmBins[16] = {500, 800, 1000, 1500, 1800, 2300, 2900, 3400, 3900, 4300, 4800, 5300, 5900, 6500, 7200, 8000};
static const uint8_t hardCodedignitionTable[16][16] = {
/* Generated by TS2C on Sun Aug 02 11:58:01 EDT 2020*/