remove maf2map mode (#1474)

* remove

* remove fully

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-05-28 11:06:18 -07:00 committed by GitHub
parent a92849b0e7
commit bef53d8ba5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 2 additions and 209 deletions

View File

@ -13,7 +13,6 @@
#include "interpolation.h"
#include "engine.h"
#include "engine_math.h"
#include "maf2map.h"
#include "config_engine_specs.h"
#include "perf_trace.h"
#include "sensor.h"
@ -212,5 +211,4 @@ void initSpeedDensity(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// ve2Map.init(engineConfiguration->ve2Table, engineConfiguration->ve2LoadBins, engineConfiguration->ve2RpmBins);
afrMap.init(config->afrTable, config->afrLoadBins, config->afrRpmBins);
baroCorrMap.init(engineConfiguration->baroCorrTable, engineConfiguration->baroCorrPressureBins, engineConfiguration->baroCorrRpmBins);
initMaf2Map();
}

View File

@ -1,48 +0,0 @@
/*
* @file maf2map.cpp
*
* @author Andrey Belomutskiy, (c) 2012-2020
* @date Jan 20, 2018
*/
#include "maf2map.h"
/* rpm bins */
static const float rpmBins[ASIZE] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0, 5500.0, 6000.0, 6500.0, 7000.0, 7500.0, 8000.0};
static const float voltageBins[ASIZE] ={0.23, 0.3, 0.4, 0.5,
0.6, 0.7, 0.8, 1.0,
1.1, 1.2, 1.5, 2.0,
2.5, 3, 3.5, 4.5};
static const float maf2map16[ASIZE][ASIZE] = {
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 225.400009, /*v=0.500000 kpa=*/ 204.539993, /*v=0.600000 kpa=*/ 178.471420, /*v=0.700000 kpa=*/ 159.033340, /*v=0.800000 kpa=*/ 143.249985, /*v=1.000000 kpa=*/ 128.350006, /*v=1.100000 kpa=*/ 123.383331, /*v=1.200000 kpa=*/ 117.149994, /*v=1.500000 kpa=*/ 94.725006, /*v=2.000000 kpa=*/ 66.687500, /*v=2.500000 kpa=*/ 46.200005, /*v=3.000000 kpa=*/ 39.381821, /*v=3.500000 kpa=*/ 32.563641, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 225.400009, /*v=0.500000 kpa=*/ 203.049988, /*v=0.600000 kpa=*/ 170.666656, /*v=0.700000 kpa=*/ 149.044449, /*v=0.800000 kpa=*/ 134.558334, /*v=1.000000 kpa=*/ 122.141670, /*v=1.100000 kpa=*/ 114.233337, /*v=1.200000 kpa=*/ 105.900002, /*v=1.500000 kpa=*/ 75.519356, /*v=2.000000 kpa=*/ 51.166656, /*v=2.500000 kpa=*/ 38.199997, /*v=3.000000 kpa=*/ 28.406252, /*v=3.500000 kpa=*/ 19.093754, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 225.400009, /*v=0.500000 kpa=*/ 195.600021, /*v=0.600000 kpa=*/ 165.700012, /*v=0.700000 kpa=*/ 144.314285, /*v=0.800000 kpa=*/ 130.833344, /*v=1.000000 kpa=*/ 111.669235, /*v=1.100000 kpa=*/ 100.933319, /*v=1.200000 kpa=*/ 91.000008, /*v=1.500000 kpa=*/ 61.099998, /*v=2.000000 kpa=*/ 36.654549, /*v=2.500000 kpa=*/ 26.494740, /*v=3.000000 kpa=*/ 18.652634, /*v=3.500000 kpa=*/ 10.810526, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 206.774979, /*v=0.500000 kpa=*/ 178.116669, /*v=0.600000 kpa=*/ 156.324982, /*v=0.700000 kpa=*/ 133.316666, /*v=0.800000 kpa=*/ 120.900002, /*v=1.000000 kpa=*/ 91.000000, /*v=1.100000 kpa=*/ 80.285713, /*v=1.200000 kpa=*/ 70.412491, /*v=1.500000 kpa=*/ 44.533340, /*v=2.000000 kpa=*/ 29.447060, /*v=2.500000 kpa=*/ 20.682354, /*v=3.000000 kpa=*/ 12.537375, /*v=3.500000 kpa=*/ 5.012123, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 193.100006, /*v=0.500000 kpa=*/ 168.183319, /*v=0.600000 kpa=*/ 148.216644, /*v=0.700000 kpa=*/ 126.487511, /*v=0.800000 kpa=*/ 110.400002, /*v=1.000000 kpa=*/ 77.500000, /*v=1.100000 kpa=*/ 68.111755, /*v=1.200000 kpa=*/ 59.113319, /*v=1.500000 kpa=*/ 36.755554, /*v=2.000000 kpa=*/ 25.240002, /*v=2.500000 kpa=*/ 17.790001, /*v=3.000000 kpa=*/ 7.905632, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 188.099991, /*v=0.500000 kpa=*/ 161.949997, /*v=0.600000 kpa=*/ 135.799988, /*v=0.700000 kpa=*/ 115.900009, /*v=0.800000 kpa=*/ 95.966652, /*v=1.000000 kpa=*/ 61.099998, /*v=1.100000 kpa=*/ 53.649998, /*v=1.200000 kpa=*/ 46.200001, /*v=1.500000 kpa=*/ 31.200003, /*v=2.000000 kpa=*/ 24.427275, /*v=2.500000 kpa=*/ 17.654547, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400009, /*v=0.400000 kpa=*/ 184.349991, /*v=0.500000 kpa=*/ 157.128571, /*v=0.600000 kpa=*/ 127.285713, /*v=0.700000 kpa=*/ 105.900009, /*v=0.800000 kpa=*/ 86.499992, /*v=1.000000 kpa=*/ 59.444450, /*v=1.100000 kpa=*/ 51.166668, /*v=1.200000 kpa=*/ 44.381817, /*v=1.500000 kpa=*/ 31.044794, /*v=2.000000 kpa=*/ 23.284378, /*v=2.500000 kpa=*/ 3.883316, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 225.400024, /*v=0.400000 kpa=*/ 180.600006, /*v=0.500000 kpa=*/ 144.740005, /*v=0.600000 kpa=*/ 118.399994, /*v=0.700000 kpa=*/ 91.000000, /*v=0.800000 kpa=*/ 74.019073, /*v=1.000000 kpa=*/ 56.133339, /*v=1.100000 kpa=*/ 46.199997, /*v=1.200000 kpa=*/ 41.512497, /*v=1.500000 kpa=*/ 29.671795, /*v=2.000000 kpa=*/ 20.120514, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 220.433319, /*v=0.400000 kpa=*/ 175.633316, /*v=0.500000 kpa=*/ 129.414276, /*v=0.600000 kpa=*/ 103.964928, /*v=0.700000 kpa=*/ 84.219177, /*v=0.800000 kpa=*/ 70.771927, /*v=1.000000 kpa=*/ 52.544510, /*v=1.100000 kpa=*/ 44.465305, /*v=1.200000 kpa=*/ 39.363266, /*v=1.500000 kpa=*/ 27.188465, /*v=2.000000 kpa=*/ 11.333336, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 220.433319, /*v=0.400000 kpa=*/ 160.699997, /*v=0.500000 kpa=*/ 115.900002, /*v=0.600000 kpa=*/ 93.128578, /*v=0.700000 kpa=*/ 76.000000, /*v=0.800000 kpa=*/ 67.235291, /*v=1.000000 kpa=*/ 48.186661, /*v=1.100000 kpa=*/ 40.982609, /*v=1.200000 kpa=*/ 34.460869, /*v=1.500000 kpa=*/ 21.887497, /*v=2.000000 kpa=*/ 3.262497, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 215.466675, /*v=0.400000 kpa=*/ 150.699966, /*v=0.500000 kpa=*/ 103.771431, /*v=0.600000 kpa=*/ 80.999985, /*v=0.700000 kpa=*/ 66.830765, /*v=0.800000 kpa=*/ 57.713634, /*v=1.000000 kpa=*/ 43.831581, /*v=1.100000 kpa=*/ 35.936840, /*v=1.200000 kpa=*/ 29.671789, /*v=1.500000 kpa=*/ 18.210253, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 214.225006, /*v=0.400000 kpa=*/ 135.800003, /*v=0.500000 kpa=*/ 89.333328, /*v=0.600000 kpa=*/ 73.290901, /*v=0.700000 kpa=*/ 60.452179, /*v=0.800000 kpa=*/ 53.973915, /*v=1.000000 kpa=*/ 39.141182, /*v=1.100000 kpa=*/ 30.786114, /*v=1.200000 kpa=*/ 26.647224, /*v=1.500000 kpa=*/ 14.230555, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 180.600006, /*v=0.400000 kpa=*/ 128.350006, /*v=0.500000 kpa=*/ 86.000000, /*v=0.600000 kpa=*/ 70.581810, /*v=0.700000 kpa=*/ 59.068188, /*v=0.800000 kpa=*/ 52.295456, /*v=1.000000 kpa=*/ 35.199997, /*v=1.100000 kpa=*/ 28.316130, /*v=1.200000 kpa=*/ 23.509678, /*v=1.500000 kpa=*/ 9.090324, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.400009, /*v=0.300000 kpa=*/ 175.633331, /*v=0.400000 kpa=*/ 120.900017, /*v=0.500000 kpa=*/ 84.571426, /*v=0.600000 kpa=*/ 67.872726, /*v=0.700000 kpa=*/ 57.375000, /*v=0.800000 kpa=*/ 49.924999, /*v=1.000000 kpa=*/ 31.200005, /*v=1.100000 kpa=*/ 25.240004, /*v=1.200000 kpa=*/ 19.280003, /*v=1.500000 kpa=*/ 1.400000, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.399979, /*v=0.300000 kpa=*/ 173.149994, /*v=0.400000 kpa=*/ 113.399986, /*v=0.500000 kpa=*/ 80.999992, /*v=0.600000 kpa=*/ 65.163628, /*v=0.700000 kpa=*/ 54.964710, /*v=0.800000 kpa=*/ 46.199997, /*v=1.000000 kpa=*/ 27.474998, /*v=1.100000 kpa=*/ 20.024996, /*v=1.200000 kpa=*/ 12.574998, /*v=1.500000 kpa=*/ 1.400000, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
/*v=0.230000 kpa=*/ 225.399979, /*v=0.300000 kpa=*/ 165.699997, /*v=0.400000 kpa=*/ 102.175003, /*v=0.500000 kpa=*/ 76.000000, /*v=0.600000 kpa=*/ 61.100002, /*v=0.700000 kpa=*/ 52.335297, /*v=0.800000 kpa=*/ 41.700005, /*v=1.000000 kpa=*/ 20.438889, /*v=1.100000 kpa=*/ 12.161111, /*v=1.200000 kpa=*/ 3.883333, /*v=1.500000 kpa=*/ 1.400000, /*v=2.000000 kpa=*/ 1.400000, /*v=2.500000 kpa=*/ 1.400000, /*v=3.000000 kpa=*/ 1.400000, /*v=3.500000 kpa=*/ 1.400000, /*v=4.500000 kpa=*/ 1.400000,
};
maf2map_Map3D_t maf2MapMap("maf2map");
void initMaf2Map() {
// RPM and load are flipped in this table, that's just the way we have data
maf2MapMap.init((float (*)[ASIZE])maf2map16, rpmBins, voltageBins);
}
float estimateMapByRpmAndMaf(int rpm, float maf) {
// RPM and load are flipped in this table, that's just the way we have data
return maf2MapMap.getValue(maf, rpm);
}

View File

@ -1,17 +0,0 @@
/*
* @file maf2map.h
*
* @author Andrey Belomutskiy, (c) 2012-2020
* @date Jan 20, 2018
*/
#pragma once
#include "table_helper.h"
#define ASIZE 16
typedef Map3D<ASIZE, ASIZE, float, float> maf2map_Map3D_t;
void initMaf2Map();
float estimateMapByRpmAndMaf(int rpm, float maf);

View File

@ -8,7 +8,6 @@ CONTROLLERS_SENSORS_SRC_CPP = $(PROJECT_DIR)/controllers/sensors/thermistors.cp
$(PROJECT_DIR)/controllers/sensors/maf.cpp \
$(PROJECT_DIR)/controllers/sensors/tps.cpp \
$(PROJECT_DIR)/controllers/sensors/ego.cpp \
$(PROJECT_DIR)/controllers/sensors/maf2map.cpp \
$(PROJECT_DIR)/controllers/sensors/hip9011_lookup.cpp \
$(PROJECT_DIR)/controllers/sensors/sensor.cpp \
$(PROJECT_DIR)/controllers/sensors/sensor_info_printing.cpp \

View File

@ -1,98 +0,0 @@
/*
* @file afm2mapConverter.cpp
*
* Helper code for https://github.com/rusefi/rusefi/issues/538 conversion RPM,MAP>MAF to RPM,MAF>MAP
* @author Andrey Belomutskiy, (c) 2012-2020
* @date Jan 20, 2018
*/
#include <stdio.h>
#include <stdlib.h>
#include "afm2mapConverter.h"
#include "table_helper.h"
#include "interpolation.h"
#include "map.h"
#define ASIZE 16
/* rpm bins */
static const float rpmBins[ASIZE] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0, 3000.0, 3500.0, 4000.0, 4500.0, 5000.0, 5500.0, 6000.0, 6500.0, 7000.0, 7500.0, 8000.0};
/* Generated by TS2C on Sat Jan 20 23:46:29 EST 2018*/
static const float afr2map[ASIZE][ASIZE]= {
{/* 0 500.000 *//* 0 500.0*/4.500, /* 1 1000.0*/4.280, /* 2 1500.0*/4.100, /* 3 2000.0*/3.740, /* 4 2500.0*/3.310, /* 5 3000.0*/2.830, /* 6 3500.0*/2.510, /* 7 4000.0*/2.355, /* 8 4500.0*/2.240, /* 9 5000.0*/2.050, /* 10 5500.0*/1.940, /* 11 6000.0*/1.810, /* 12 6500.0*/1.660, /* 13 7000.0*/1.500, /* 14 7500.0*/1.350, /* 15 8000.0*/1.230, },
{/* 1 1000.000 *//* 0 500.0*/4.000, /* 1 1000.0*/3.650, /* 2 1500.0*/3.150, /* 3 2000.0*/2.750, /* 4 2500.0*/2.600, /* 5 3000.0*/2.600, /* 6 3500.0*/2.450, /* 7 4000.0*/2.200, /* 8 4500.0*/1.880, /* 9 5000.0*/1.650, /* 10 5500.0*/1.550, /* 11 6000.0*/1.450, /* 12 6500.0*/1.350, /* 13 7000.0*/1.250, /* 14 7500.0*/1.150, /* 15 8000.0*/1.050, },
{/* 2 1500.000 *//* 0 500.0*/3.600, /* 1 1000.0*/2.850, /* 2 1500.0*/2.200, /* 3 2000.0*/1.900, /* 4 2500.0*/1.600, /* 5 3000.0*/1.500, /* 6 3500.0*/1.490, /* 7 4000.0*/1.420, /* 8 4500.0*/1.360, /* 9 5000.0*/1.250, /* 10 5500.0*/1.160, /* 11 6000.0*/1.090, /* 12 6500.0*/1.040, /* 13 7000.0*/1.000, /* 14 7500.0*/0.950, /* 15 8000.0*/0.870, },
{/* 3 2000.000 *//* 0 500.0*/2.500, /* 1 1000.0*/2.100, /* 2 1500.0*/1.650, /* 3 2000.0*/1.450, /* 4 2500.0*/1.330, /* 5 3000.0*/1.200, /* 6 3500.0*/1.160, /* 7 4000.0*/1.100, /* 8 4500.0*/1.066, /* 9 5000.0*/1.020, /* 10 5500.0*/0.970, /* 11 6000.0*/0.920, /* 12 6500.0*/0.890, /* 13 7000.0*/0.850, /* 14 7500.0*/0.800, /* 15 8000.0*/0.770, },
{/* 4 2500.000 *//* 0 500.0*/2.150, /* 1 1000.0*/1.800, /* 2 1500.0*/1.500, /* 3 2000.0*/1.300, /* 4 2500.0*/1.180, /* 5 3000.0*/1.000, /* 6 3500.0*/0.980, /* 7 4000.0*/0.950, /* 8 4500.0*/0.911, /* 9 5000.0*/0.870, /* 10 5500.0*/0.750, /* 11 6000.0*/0.690, /* 12 6500.0*/0.670, /* 13 7000.0*/0.650, /* 14 7500.0*/0.630, /* 15 8000.0*/0.600, },
{/* 5 3000.000 *//* 0 500.0*/1.750, /* 1 1000.0*/1.490, /* 2 1500.0*/1.310, /* 3 2000.0*/1.140, /* 4 2500.0*/1.010, /* 5 3000.0*/0.910, /* 6 3500.0*/0.870, /* 7 4000.0*/0.777, /* 8 4500.0*/0.740, /* 9 5000.0*/0.700, /* 10 5500.0*/0.620, /* 11 6000.0*/0.580, /* 12 6500.0*/0.560, /* 13 7000.0*/0.540, /* 14 7500.0*/0.520, /* 15 8000.0*/0.500, },
{/* 6 3500.000 *//* 0 500.0*/1.550, /* 1 1000.0*/1.350, /* 2 1500.0*/1.200, /* 3 2000.0*/1.000, /* 4 2500.0*/0.910, /* 5 3000.0*/0.820, /* 6 3500.0*/0.770, /* 7 4000.0*/0.700, /* 8 4500.0*/0.667, /* 9 5000.0*/0.610, /* 10 5500.0*/0.560, /* 11 6000.0*/0.490, /* 12 6500.0*/0.470, /* 13 7000.0*/0.470, /* 14 7500.0*/0.460, /* 15 8000.0*/0.430, },
{/* 7 4000.000 *//* 0 500.0*/1.350, /* 1 1000.0*/1.200, /* 2 1500.0*/1.050, /* 3 2000.0*/0.900, /* 4 2500.0*/0.830, /* 5 3000.0*/0.760, /* 6 3500.0*/0.700, /* 7 4000.0*/0.650, /* 8 4500.0*/0.590, /* 9 5000.0*/0.540, /* 10 5500.0*/0.490, /* 11 6000.0*/0.470, /* 12 6500.0*/0.450, /* 13 7000.0*/0.440, /* 14 7500.0*/0.420, /* 15 8000.0*/0.390, },
{/* 8 4500.000 *//* 0 500.0*/1.150, /* 1 1000.0*/1.020, /* 2 1500.0*/0.920, /* 3 2000.0*/0.800, /* 4 2500.0*/0.730, /* 5 3000.0*/0.670, /* 6 3500.0*/0.630, /* 7 4000.0*/0.590, /* 8 4500.0*/0.540, /* 9 5000.0*/0.480, /* 10 5500.0*/0.450, /* 11 6000.0*/0.430, /* 12 6500.0*/0.410, /* 13 7000.0*/0.400, /* 14 7500.0*/0.380, /* 15 8000.0*/0.360, },
{/* 9 5000.000 *//* 0 500.0*/0.850, /* 1 1000.0*/0.780, /* 2 1500.0*/0.740, /* 3 2000.0*/0.680, /* 4 2500.0*/0.650, /* 5 3000.0*/0.600, /* 6 3500.0*/0.560, /* 7 4000.0*/0.530, /* 8 4500.0*/0.470, /* 9 5000.0*/0.440, /* 10 5500.0*/0.410, /* 11 6000.0*/0.400, /* 12 6500.0*/0.390, /* 13 7000.0*/0.380, /* 14 7500.0*/0.360, /* 15 8000.0*/0.340, },
{/* 10 5500.000 *//* 0 500.0*/0.750, /* 1 1000.0*/0.690, /* 2 1500.0*/0.670, /* 3 2000.0*/0.630, /* 4 2500.0*/0.590, /* 5 3000.0*/0.560, /* 6 3500.0*/0.530, /* 7 4000.0*/0.480, /* 8 4500.0*/0.450, /* 9 5000.0*/0.420, /* 10 5500.0*/0.400, /* 11 6000.0*/0.380, /* 12 6500.0*/0.370, /* 13 7000.0*/0.360, /* 14 7500.0*/0.340, /* 15 8000.0*/0.320, },
{/* 11 6000.000 *//* 0 500.0*/0.660, /* 1 1000.0*/0.620, /* 2 1500.0*/0.600, /* 3 2000.0*/0.550, /* 4 2500.0*/0.510, /* 5 3000.0*/0.480, /* 6 3500.0*/0.460, /* 7 4000.0*/0.440, /* 8 4500.0*/0.420, /* 9 5000.0*/0.390, /* 10 5500.0*/0.370, /* 11 6000.0*/0.350, /* 12 6500.0*/0.330, /* 13 7000.0*/0.320, /* 14 7500.0*/0.310, /* 15 8000.0*/0.300, },
{/* 12 6500.000 *//* 0 500.0*/0.590, /* 1 1000.0*/0.560, /* 2 1500.0*/0.540, /* 3 2000.0*/0.490, /* 4 2500.0*/0.450, /* 5 3000.0*/0.420, /* 6 3500.0*/0.410, /* 7 4000.0*/0.400, /* 8 4500.0*/0.390, /* 9 5000.0*/0.370, /* 10 5500.0*/0.350, /* 11 6000.0*/0.330, /* 12 6500.0*/0.300, /* 13 7000.0*/0.290, /* 14 7500.0*/0.290, /* 15 8000.0*/0.280, },
{/* 13 7000.000 *//* 0 500.0*/0.530, /* 1 1000.0*/0.520, /* 2 1500.0*/0.500, /* 3 2000.0*/0.430, /* 4 2500.0*/0.390, /* 5 3000.0*/0.380, /* 6 3500.0*/0.370, /* 7 4000.0*/0.360, /* 8 4500.0*/0.350, /* 9 5000.0*/0.340, /* 10 5500.0*/0.330, /* 11 6000.0*/0.320, /* 12 6500.0*/0.290, /* 13 7000.0*/0.280, /* 14 7500.0*/0.260, /* 15 8000.0*/0.260, },
{/* 14 7500.000 *//* 0 500.0*/0.480, /* 1 1000.0*/0.480, /* 2 1500.0*/0.460, /* 3 2000.0*/0.390, /* 4 2500.0*/0.350, /* 5 3000.0*/0.350, /* 6 3500.0*/0.340, /* 7 4000.0*/0.330, /* 8 4500.0*/0.320, /* 9 5000.0*/0.320, /* 10 5500.0*/0.310, /* 11 6000.0*/0.310, /* 12 6500.0*/0.290, /* 13 7000.0*/0.270, /* 14 7500.0*/0.240, /* 15 8000.0*/0.240, },
{/* 15 8000.000 *//* 0 500.0*/0.450, /* 1 1000.0*/0.450, /* 2 1500.0*/0.430, /* 3 2000.0*/0.360, /* 4 2500.0*/0.320, /* 5 3000.0*/0.330, /* 6 3500.0*/0.310, /* 7 4000.0*/0.300, /* 8 4500.0*/0.290, /* 9 5000.0*/0.290, /* 10 5500.0*/0.280, /* 11 6000.0*/0.270, /* 12 6500.0*/0.270, /* 13 7000.0*/0.260, /* 14 7500.0*/0.230, /* 15 8000.0*/0.230, },
};
float PSI_BINS[ASIZE];
/**
* see maf2map.cpp#voltageBins
*/
const float V_BINS[ASIZE] = {0.23, 0.3, 0.4, 0.5,
0.6, 0.7, 0.8, 1.0,
1.1, 1.2, 1.5, 2.0,
2.5, 3, 3.5, 4.5};
void printConvertedTable() {
printf("printConvertedTable for miata 1.6\n");
// setLinearCurve(V_BINS, ASIZE, 0.2, 4.5 , 0.01);
for (int i = 0; i< ASIZE;i++) {
printf("%f, ", V_BINS[i]);
}
printf("\n");
setLinearCurve(PSI_BINS, PSI2KPA(18), PSI2KPA(-14.5f), 0.1f); // we invert PSI scale since voltage is inverted below
for (int i = 0; i< ASIZE;i++) {
printf("%f, ", PSI_BINS[i]);
}
printf("\n");
for (int rpmIndex = 0; rpmIndex< ASIZE;rpmIndex++) {
float rpmValue = rpmBins[rpmIndex];
float vValues[ASIZE];
for (int vIndex = 0; vIndex< ASIZE;vIndex++) {
// fliping indexes to get proper ascending sorting
vValues[ASIZE - 1 - vIndex] = afr2map[vIndex][rpmIndex];
}
// printf("vArray for %f\n", rpmValue);
// for (int i = 0; i< ASIZE;i++) {
// printf("/*psi=%f v=*/ %f, ", PSI_BINS[i], vValues[i]);
// }
// printf("\n");
// float psiValues[ASIZE];
for (int vIndex = 0; vIndex< ASIZE;vIndex++) {
float volts = V_BINS[vIndex];
float psiValue = interpolate2d("conv", volts, vValues, PSI_BINS);
// psiValues[vIndex] = psiValue;
printf("/*v=%f kpa=*/ %f, ", volts, psiValue);
}
printf("\n");
}
}

View File

@ -1,10 +0,0 @@
/*
* @file afm2mapConverter.h
*
* @author Andrey Belomutskiy, (c) 2012-2020
* @date Jan 20, 2018
*/
#pragma once
void printConvertedTable();

View File

@ -12,7 +12,6 @@
#include "engine_configuration.h"
#include "afm2mapConverter.h"
#include "test_signal_executor.h"
#include "trigger_central.h"
#include "map_resize.h"
@ -41,7 +40,7 @@ GTEST_API_ int main(int argc, char **argv) {
// resizeMap();
printf("Success 20200510\r\n");
printAllTriggers();
// printConvertedTable();
testing::InitGoogleTest(&argc, argv);
// uncomment if you only want to run selected tests
//::testing::GTEST_FLAG(filter) = "*testFasterEngineSpinningUp*";

View File

@ -5,5 +5,4 @@ FRAMEWORK_SRC_CPP = unit_test_framework.cpp \
test_basic_math/test_find_index.cpp \
test_basic_math/test_interpolation_3d.cpp \
test_basic_math/test_efilib.cpp \
afm2mapConverter.cpp

View File

@ -1,28 +0,0 @@
/*
* @file test_maf2map.cpp
*
* @date Jan 13, 2019
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "engine_test_helper.h"
#include "maf2map.h"
#define round_2d(x) efiRound(x, 0.01)
TEST(maf2map, util) {
WITH_ENGINE_TEST_HELPER(FORD_ASPIRE_1996);
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
ASSERT_FLOAT_EQ(61.1, estimateMapByRpmAndMaf(8000, 0.6));
ASSERT_FLOAT_EQ(1.4, estimateMapByRpmAndMaf(2000, 5.6));
}
TEST(maf2map, integrated) {
WITH_ENGINE_TEST_HELPER(MIATA_NA6_VAF);
}

View File

@ -24,7 +24,6 @@ TESTS_SRC_CPP = \
tests/test_fuel_map.cpp \
tests/test_fuel_wall_wetting.cpp \
tests/test_one_cylinder_logic.cpp \
tests/test_maf2map.cpp \
tests/test_fuelCut.cpp \
tests/test_pwm_generator.cpp \
tests/test_logic_expression.cpp \