rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
torque_estimator.cpp File Reference

Functions

void estimateTorqueTable ()
 

Function Documentation

◆ estimateTorqueTable()

void estimateTorqueTable ( )

Definition at line 3 of file torque_estimator.cpp.

3 {
4 for (int rpmIndex = 0;rpmIndex<TORQUE_CURVE_RPM_SIZE;rpmIndex++) {
5 for (int loadIndex = 0;loadIndex<TORQUE_CURVE_SIZE;loadIndex++) {
6 float rpmValue = config->torqueRpmBins[rpmIndex];
7
8 // let's assume speed density for now
9 // here we assume load is MAP while older parts of codebase have TPS, maybe for no good reason
10 // TODO: clean this up, see 'torqueLoadBins' usages
11 float mapValue = config->torqueLoadBins[loadIndex];
12
13 percent_t veValue = interpolate3d(
15 config->veLoadBins, mapValue,
16 config->veRpmBins, rpmValue
17 );
21
22 config->torqueTable[loadIndex][rpmIndex] = estimated;
23 if (loadIndex == 0 && rpmIndex == 0) {
24 efiPrintf("estimateTorqueTable [%f] %f", veValue, estimated);
25 }
26
27 }
28 }
29
30}
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
float percent_t
veValue("Fuel: VE", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 86, 0.1, 0.0, 0.0, "ratio")
scaled_channel< uint16_t, 10, 1 > veTable[VE_LOAD_COUNT][VE_RPM_COUNT]
scaled_channel< uint8_t, 1, 10 > torqueTable[TORQUE_CURVE_SIZE][TORQUE_CURVE_RPM_SIZE]

Referenced by handleCommandX14().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.