only:VE_RPM_COUNT

This commit is contained in:
rusefillc 2025-01-14 18:33:08 -05:00
parent 674618064d
commit 5ea65826bd
12 changed files with 20 additions and 15 deletions

View File

@ -42,14 +42,14 @@ static void cannedignitionLoadBins() {
} }
static void cannedveRpmBins() { static void cannedveRpmBins() {
#if (IGN_LOAD_COUNT == 16) && (IGN_RPM_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const float hardCodedveRpmBins[16] = {800.0, 1000.0, 1300.0, 1600.0, 2000.0, 2500.0, 3000.0, 3600.0, 4000.0, 4400.0, 4900.0, 5300.0, 5800.0, 6200.0, 7100.0, 8000.0}; static const float hardCodedveRpmBins[16] = {800.0, 1000.0, 1300.0, 1600.0, 2000.0, 2500.0, 3000.0, 3600.0, 4000.0, 4400.0, 4900.0, 5300.0, 5800.0, 6200.0, 7100.0, 8000.0};
copyArray(config->veRpmBins, hardCodedveRpmBins); copyArray(config->veRpmBins, hardCodedveRpmBins);
#endif #endif
} }
static void cannedveLoadBins() { static void cannedveLoadBins() {
#if (IGN_LOAD_COUNT == 16) && (IGN_RPM_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const float hardCodedveLoadBins[16] = {15.0, 27.0, 33.0, 45.0, 57.0, 69.0, 81.0, 93.0, 105.0, 129.0, 157.0, 186.0, 214.0, 243.0, 271.0, 300.0}; static const float hardCodedveLoadBins[16] = {15.0, 27.0, 33.0, 45.0, 57.0, 69.0, 81.0, 93.0, 105.0, 129.0, 157.0, 186.0, 214.0, 243.0, 271.0, 300.0};
copyArray(config->veLoadBins, hardCodedveLoadBins); copyArray(config->veLoadBins, hardCodedveLoadBins);
#endif #endif

View File

@ -71,7 +71,7 @@ void setFordEscortGt() {
engineConfiguration->displacement = 1.839; engineConfiguration->displacement = 1.839;
setAlgorithm(LM_SPEED_DENSITY); setAlgorithm(LM_SPEED_DENSITY);
#if (IGN_RPM_COUNT == 16) && (IGN_LOAD_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const uint16_t veRpmBins[] = static const uint16_t veRpmBins[] =
{ {
800, 800,

View File

@ -24,7 +24,7 @@ static void cannedcltIdleCorr() {
} }
static void couplecannedveTable() { static void couplecannedveTable() {
#if (IGN_LOAD_COUNT == 16) && (IGN_RPM_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const float hardCodedveTable[16][16] = { static const float hardCodedveTable[16][16] = {
{52.000, 54.000, 54.000, 56.000, 61.000, 55.000, 55.000, 65.000, 65.000, 60.000, 60.000, 60.000, 60.000, 60.000, 60.000, 60.000, }, {52.000, 54.000, 54.000, 56.000, 61.000, 55.000, 55.000, 65.000, 65.000, 60.000, 60.000, 60.000, 60.000, 60.000, 60.000, 60.000, },
{51.500, 54.500, 54.400, 56.000, 61.000, 68.100, 66.800, 67.600, 68.200, 63.400, 63.400, 63.400, 63.400, 63.400, 63.400, 63.400, }, {51.500, 54.500, 54.400, 56.000, 61.000, 68.100, 66.800, 67.600, 68.200, 63.400, 63.400, 63.400, 63.400, 63.400, 63.400, 63.400, },

View File

@ -55,6 +55,7 @@ static void pbcannedignitionTable() {
} }
static void pbcannedveTable() { static void pbcannedveTable() {
#if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const float hardCodedveTable[16][16] = { static const float hardCodedveTable[16][16] = {
{70.300, 70.300, 70.400, 70.500, 70.600, 70.600, 70.300, 29.900, 29.800, 29.900, 30.400, 31.400, 33.000, 35.100, 37.700, 40.900, }, {70.300, 70.300, 70.400, 70.500, 70.600, 70.600, 70.300, 29.900, 29.800, 29.900, 30.400, 31.400, 33.000, 35.100, 37.700, 40.900, },
{70.800, 71.500, 72.100, 72.900, 73.300, 72.800, 72.000, 31.300, 31.200, 31.500, 32.200, 33.500, 35.300, 37.700, 40.500, 43.900, }, {70.800, 71.500, 72.100, 72.900, 73.300, 72.800, 72.000, 31.300, 31.200, 31.500, 32.200, 33.500, 35.300, 37.700, 40.500, 43.900, },
@ -74,6 +75,7 @@ static void pbcannedveTable() {
{127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, }, {127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, 127.600, },
}; };
copyTable(config->veTable, hardCodedveTable); copyTable(config->veTable, hardCodedveTable);
#endif
} }
static void pbcannedinjectionPhase() { static void pbcannedinjectionPhase() {

View File

@ -66,7 +66,7 @@ static const uint8_t hardCodedveTable[16][16] = {
/* Generated by TS2C on Sun Aug 02 10:02:25 EDT 2020*/ /* Generated by TS2C on Sun Aug 02 10:02:25 EDT 2020*/
static void setMapVeTable() { static void setMapVeTable() {
#if (IGN_LOAD_COUNT == 16) && (IGN_RPM_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
copyArray(config->veLoadBins, hardCodedveLoadBins); copyArray(config->veLoadBins, hardCodedveLoadBins);
copyArray(config->veRpmBins, hardCodedveRpmBins); copyArray(config->veRpmBins, hardCodedveRpmBins);
copyTable(config->veTable, hardCodedveTable); copyTable(config->veTable, hardCodedveTable);

View File

@ -300,14 +300,14 @@ static void setCommonMazdaNB() {
// Tach // Tach
engineConfiguration->tachPulsePerRev = 2; engineConfiguration->tachPulsePerRev = 2;
#if (FUEL_RPM_COUNT == 16) && (FUEL_LOAD_COUNT == 16) #if (VE_RPM_COUNT == 16) && (VE_LOAD_COUNT == 16)
// Tables // Tables
copyArray(config->veRpmBins, mazda_miata_nb2_RpmBins); copyArray(config->veRpmBins, mazda_miata_nb2_RpmBins);
copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins); copyArray(config->veLoadBins, mazda_miata_nb2_LoadBins);
copyTable(config->veTable, mapBased18vvtVeTable_NB_fuel_rail);
#endif #endif
#if (IGN_RPM_COUNT == 16) && (IGN_LOAD_COUNT == 16) #if (IGN_RPM_COUNT == 16) && (IGN_LOAD_COUNT == 16)
copyTable(config->veTable, mapBased18vvtVeTable_NB_fuel_rail);
copyArray(config->ignitionRpmBins, ignition18vvtRpmBins); copyArray(config->ignitionRpmBins, ignition18vvtRpmBins);
copyArray(config->ignitionLoadBins, ignition18vvtLoadBins); copyArray(config->ignitionLoadBins, ignition18vvtLoadBins);
copyTable(config->ignitionTable, mapBased18vvtTimingTable); copyTable(config->ignitionTable, mapBased18vvtTimingTable);

View File

@ -81,7 +81,7 @@ static void setDefaultWarmupFuelEnrichment() {
static void setDefaultVETable() { static void setDefaultVETable() {
setRpmTableBin(config->veRpmBins); setRpmTableBin(config->veRpmBins);
#if (IGN_LOAD_COUNT == 16) && (IGN_RPM_COUNT == 16) #if (VE_LOAD_COUNT == 16) && (VE_RPM_COUNT == 16)
static const float hardCodedveTable[16][16] = { static const float hardCodedveTable[16][16] = {
{49.300, 49.300, 49.400, 49.600, 50.200, 51.400, 52.600, 53.800, 54.400, 54.600, 54.400, 53.700, 52.800, 51.800, 50.900, 50.000, }, {49.300, 49.300, 49.400, 49.600, 50.200, 51.400, 52.600, 53.800, 54.400, 54.600, 54.400, 53.700, 52.800, 51.800, 50.900, 50.000, },
{49.600, 50.500, 51.500, 54.100, 57.500, 60.700, 62.900, 64.400, 65.000, 65.000, 64.500, 63.500, 62.300, 61.100, 60.000, 58.800, }, {49.600, 50.500, 51.500, 54.100, 57.500, 60.700, 62.900, 64.400, 65.000, 65.000, 64.500, 63.500, 62.300, 61.100, 60.000, 58.800, },

View File

@ -34,7 +34,7 @@
#include "speed_density_base.h" #include "speed_density_base.h"
#include "lua_hooks.h" #include "lua_hooks.h"
extern fuel_Map3D_t veMap; extern ve_Map3D_t veMap;
static mapEstimate_Map3D_t mapEstimationTable{"mape"}; static mapEstimate_Map3D_t mapEstimationTable{"mape"};
#if EFI_ENGINE_CONTROL #if EFI_ENGINE_CONTROL

View File

@ -16,7 +16,7 @@
#define rpmMin 500 #define rpmMin 500
#define rpmMax 8000 #define rpmMax 8000
fuel_Map3D_t veMap{"ve"}; ve_Map3D_t veMap{"ve"};
#define tpMin 0 #define tpMin 0
#define tpMax 100 #define tpMax 100

View File

@ -215,6 +215,8 @@ struct_no_prefix engine_configuration_s
#define VEHICLE_INFO_SIZE 32 #define VEHICLE_INFO_SIZE 32
#define VE_RPM_COUNT 16
#define VE_LOAD_COUNT 16
#define FUEL_RPM_COUNT 16 #define FUEL_RPM_COUNT 16
#define FUEL_LOAD_COUNT 16 #define FUEL_LOAD_COUNT 16
#define INJ_PHASE_RPM_COUNT 16 #define INJ_PHASE_RPM_COUNT 16
@ -1937,9 +1939,9 @@ int16_t[IGN_LOAD_COUNT x IGN_RPM_COUNT] autoscale ignitionTable;;"deg", 0.1, 0,
uint16_t[IGN_LOAD_COUNT] ignitionLoadBins;;"Load", 1, 0, 0, @@MAP_UPPER_LIMIT@@, 0 uint16_t[IGN_LOAD_COUNT] ignitionLoadBins;;"Load", 1, 0, 0, @@MAP_UPPER_LIMIT@@, 0
uint16_t[IGN_RPM_COUNT] ignitionRpmBins;;"RPM", 1, 0, 0, 18000, 0 uint16_t[IGN_RPM_COUNT] ignitionRpmBins;;"RPM", 1, 0, 0, 18000, 0
uint16_t[FUEL_LOAD_COUNT x FUEL_RPM_COUNT] autoscale veTable;;"%", 0.1, 0, 0, 999, 1 uint16_t[VE_LOAD_COUNT x VE_RPM_COUNT] autoscale veTable;;"%", 0.1, 0, 0, 999, 1
uint16_t[FUEL_LOAD_COUNT] veLoadBins;;{bitStringValue(fuelUnits, fuelAlgorithm) }, 1, 0, 0, @@MAP_UPPER_LIMIT@@, 0 uint16_t[VE_LOAD_COUNT] veLoadBins;;{bitStringValue(fuelUnits, fuelAlgorithm) }, 1, 0, 0, @@MAP_UPPER_LIMIT@@, 0
uint16_t[FUEL_RPM_COUNT] veRpmBins;;"RPM", 1, 0, 0, 18000, 0 uint16_t[VE_RPM_COUNT] veRpmBins;;"RPM", 1, 0, 0, 18000, 0
#if LAMBDA #if LAMBDA
uint8_t[FUEL_LOAD_COUNT x FUEL_RPM_COUNT] autoscale lambdaTable;;"lambda", {1/@@PACK_MULT_LAMBDA_CFG@@}, 0, 0.6, 1.5, 2 uint8_t[FUEL_LOAD_COUNT x FUEL_RPM_COUNT] autoscale lambdaTable;;"lambda", {1/@@PACK_MULT_LAMBDA_CFG@@}, 0, 0.6, 1.5, 2

View File

@ -132,7 +132,7 @@ private:
const char *m_name; const char *m_name;
}; };
typedef Map3D<FUEL_RPM_COUNT, FUEL_LOAD_COUNT, uint16_t, uint16_t, uint16_t> fuel_Map3D_t; typedef Map3D<VE_RPM_COUNT, VE_LOAD_COUNT, uint16_t, uint16_t, uint16_t> ve_Map3D_t;
typedef Map3D<PEDAL_TO_TPS_SIZE, PEDAL_TO_TPS_SIZE, uint8_t, uint8_t, uint8_t> pedal2tps_t; typedef Map3D<PEDAL_TO_TPS_SIZE, PEDAL_TO_TPS_SIZE, uint8_t, uint8_t, uint8_t> pedal2tps_t;
typedef Map3D<FUEL_RPM_COUNT, FUEL_LOAD_COUNT, uint16_t, uint16_t, uint16_t> mapEstimate_Map3D_t; typedef Map3D<FUEL_RPM_COUNT, FUEL_LOAD_COUNT, uint16_t, uint16_t, uint16_t> mapEstimate_Map3D_t;

View File

@ -25,6 +25,7 @@ TEST(misc, testEngineMath) {
// todo: let's see if we can make 'engine' unneeded in this test? // todo: let's see if we can make 'engine' unneeded in this test?
EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT); EngineTestHelper eth(engine_type_e::FORD_ESCORT_GT);
setTable(config->veTable, 80);
setCamOperationMode(); setCamOperationMode();
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY; engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;
@ -63,7 +64,7 @@ TEST(misc, testEngineMath) {
// calc. airFlow using airMass, and find tCharge // calc. airFlow using airMass, and find tCharge
engine->periodicFastCallback(); engine->periodicFastCallback();
ASSERT_NEAR(59.12f, engine->engineState.sd.tCharge, EPS4D); ASSERT_NEAR(59.12f, engine->engineState.sd.tCharge, EPS4D);
ASSERT_NEAR(56.9758f/*kg/h*/, engine->engineState.airflowEstimate, EPS4D); ASSERT_NEAR(46.2747f/*kg/h*/, engine->engineState.airflowEstimate, EPS4D);
} }
typedef enum { typedef enum {