tear down Engine god object #4511

just trying different things
This commit is contained in:
Andrey 2022-09-03 07:44:24 -04:00
parent 78b28c8f90
commit e56924310b
16 changed files with 354 additions and 336 deletions

View File

@ -639,7 +639,8 @@ static void updateFuelLoads() {
}
static void updateFuelResults() {
engine->outputChannels.chargeAirMass = engine->engineState.sd.airMassInOneCylinder;
// todo: kill outputChannel while taking care of gauge name and scale!
engine->outputChannels.chargeAirMass = engine->fuelComputer->sdAirMassInOneCylinder;
engine->outputChannels.baseFuel = engine->engineState.baseFuel * 1000; // Convert grams to mg
engine->outputChannels.fuelRunning = engine->engineState.running.fuel;

View File

@ -200,7 +200,7 @@ void EngineState::periodicFastCallback() {
void EngineState::updateTChargeK(int rpm, float tps) {
#if EFI_ENGINE_CONTROL
float newTCharge = getTCharge(rpm, tps);
float newTCharge = engine->fuelComputer->getTCharge(rpm, tps);
// convert to microsecs and then to seconds
efitick_t curTime = getTimeNowNt();
float secsPassed = (float)NT2US(curTime - timeSinceLastTChargeK) / US_PER_SECOND_F;

View File

@ -17,14 +17,10 @@ LuaAdjustments lua
struct speed_density_s
bit isTChargeAirModel
float airMassInOneCylinder;Speed-density logic: calculated air mass in one cylinder, in grams
float tCharge;speed density\nRate-of-change limiter is applied to degrees, so we store both Kelvin and degrees.;
float tChargeK
float Tcharge_coff
floatms_t airFlow

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Fri Sep 02 18:41:47 UTC 2022
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Sat Sep 03 07:08:26 EDT 2022
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -114,127 +114,22 @@ static_assert(sizeof(LuaAdjustments) == 12);
// start of speed_density_s
struct speed_density_s {
/**
offset 0 bit 0 */
bool isTChargeAirModel : 1 {};
/**
offset 0 bit 1 */
bool unusedBit_1_1 : 1 {};
/**
offset 0 bit 2 */
bool unusedBit_1_2 : 1 {};
/**
offset 0 bit 3 */
bool unusedBit_1_3 : 1 {};
/**
offset 0 bit 4 */
bool unusedBit_1_4 : 1 {};
/**
offset 0 bit 5 */
bool unusedBit_1_5 : 1 {};
/**
offset 0 bit 6 */
bool unusedBit_1_6 : 1 {};
/**
offset 0 bit 7 */
bool unusedBit_1_7 : 1 {};
/**
offset 0 bit 8 */
bool unusedBit_1_8 : 1 {};
/**
offset 0 bit 9 */
bool unusedBit_1_9 : 1 {};
/**
offset 0 bit 10 */
bool unusedBit_1_10 : 1 {};
/**
offset 0 bit 11 */
bool unusedBit_1_11 : 1 {};
/**
offset 0 bit 12 */
bool unusedBit_1_12 : 1 {};
/**
offset 0 bit 13 */
bool unusedBit_1_13 : 1 {};
/**
offset 0 bit 14 */
bool unusedBit_1_14 : 1 {};
/**
offset 0 bit 15 */
bool unusedBit_1_15 : 1 {};
/**
offset 0 bit 16 */
bool unusedBit_1_16 : 1 {};
/**
offset 0 bit 17 */
bool unusedBit_1_17 : 1 {};
/**
offset 0 bit 18 */
bool unusedBit_1_18 : 1 {};
/**
offset 0 bit 19 */
bool unusedBit_1_19 : 1 {};
/**
offset 0 bit 20 */
bool unusedBit_1_20 : 1 {};
/**
offset 0 bit 21 */
bool unusedBit_1_21 : 1 {};
/**
offset 0 bit 22 */
bool unusedBit_1_22 : 1 {};
/**
offset 0 bit 23 */
bool unusedBit_1_23 : 1 {};
/**
offset 0 bit 24 */
bool unusedBit_1_24 : 1 {};
/**
offset 0 bit 25 */
bool unusedBit_1_25 : 1 {};
/**
offset 0 bit 26 */
bool unusedBit_1_26 : 1 {};
/**
offset 0 bit 27 */
bool unusedBit_1_27 : 1 {};
/**
offset 0 bit 28 */
bool unusedBit_1_28 : 1 {};
/**
offset 0 bit 29 */
bool unusedBit_1_29 : 1 {};
/**
offset 0 bit 30 */
bool unusedBit_1_30 : 1 {};
/**
offset 0 bit 31 */
bool unusedBit_1_31 : 1 {};
/**
* Speed-density logic: calculated air mass in one cylinder, in grams
* offset 4
*/
float airMassInOneCylinder = (float)0;
/**
* speed density
* Rate-of-change limiter is applied to degrees, so we store both Kelvin and degrees.
* offset 8
* offset 0
*/
float tCharge = (float)0;
/**
* offset 12
* offset 4
*/
float tChargeK = (float)0;
/**
* offset 16
*/
float Tcharge_coff = (float)0;
/**
* offset 20
* offset 8
*/
floatms_t airFlow = (floatms_t)0;
};
static_assert(sizeof(speed_density_s) == 24);
static_assert(sizeof(speed_density_s) == 12);
// start of cranking_fuel_s
struct cranking_fuel_s {
@ -309,208 +204,208 @@ struct engine_state_s {
*/
speed_density_s sd;
/**
* offset 36
* offset 24
*/
float engineCycleDurationMs = (float)0;
/**
* offset 40
* offset 28
*/
float minRpmKcurrentTPS = (float)0;
/**
* offset 44
* offset 32
*/
int currentTpsAdc = (int)0;
/**
* offset 48
* offset 36
*/
float tpsVoltageMCU = (float)0;
/**
* offset 52
* offset 40
*/
float tpsVoltageBoard = (float)0;
/**
* offset 56
* offset 44
*/
float currentBaroCorrectedVE = (float)0;
/**
* offset 60
* offset 48
*/
float injectorFlowCorrection = (float)0;
/**
* offset 64
* offset 52
*/
float baroCorrection = (float)0;
/**
* offset 68
* offset 56
*/
cranking_fuel_s cranking;
/**
* offset 88
* offset 76
*/
running_fuel_s running;
/**
* ignition dwell duration in ms
* See also dwellAngle
* offset 112
* offset 100
*/
floatms_t sparkDwell = (floatms_t)0;
/**
* ignition dwell duration as crankshaft angle
* NAN if engine is stopped
* See also sparkDwell
* offset 116
* offset 104
*/
angle_t dwellAngle = (angle_t)0;
/**
deg
* offset 120
* offset 108
*/
scaled_channel<int16_t, 100, 1> cltTimingCorrection = (int16_t)0;
/**
deg
* offset 122
* offset 110
*/
scaled_channel<int16_t, 100, 1> timingIatCorrection = (int16_t)0;
/**
deg
* offset 124
* offset 112
*/
scaled_channel<int16_t, 100, 1> timingPidCorrection = (int16_t)0;
/**
* Detected Board ID
id
* offset 126
* offset 114
*/
int16_t hellenBoardId = (int16_t)0;
/**
* @@INDICATOR_NAME_CLUTCH_UP@@
offset 128 bit 0 */
offset 116 bit 0 */
bool clutchUpState : 1 {};
/**
* @@INDICATOR_NAME_CLUTCH_DOWN@@
offset 128 bit 1 */
offset 116 bit 1 */
bool clutchDownState : 1 {};
/**
* @@INDICATOR_NAME_BRAKE_DOWN@@
offset 128 bit 2 */
offset 116 bit 2 */
bool brakePedalState : 1 {};
/**
offset 128 bit 3 */
offset 116 bit 3 */
bool unusedBit_21_3 : 1 {};
/**
offset 128 bit 4 */
offset 116 bit 4 */
bool unusedBit_21_4 : 1 {};
/**
offset 128 bit 5 */
offset 116 bit 5 */
bool unusedBit_21_5 : 1 {};
/**
offset 128 bit 6 */
offset 116 bit 6 */
bool unusedBit_21_6 : 1 {};
/**
offset 128 bit 7 */
offset 116 bit 7 */
bool unusedBit_21_7 : 1 {};
/**
offset 128 bit 8 */
offset 116 bit 8 */
bool unusedBit_21_8 : 1 {};
/**
offset 128 bit 9 */
offset 116 bit 9 */
bool unusedBit_21_9 : 1 {};
/**
offset 128 bit 10 */
offset 116 bit 10 */
bool unusedBit_21_10 : 1 {};
/**
offset 128 bit 11 */
offset 116 bit 11 */
bool unusedBit_21_11 : 1 {};
/**
offset 128 bit 12 */
offset 116 bit 12 */
bool unusedBit_21_12 : 1 {};
/**
offset 128 bit 13 */
offset 116 bit 13 */
bool unusedBit_21_13 : 1 {};
/**
offset 128 bit 14 */
offset 116 bit 14 */
bool unusedBit_21_14 : 1 {};
/**
offset 128 bit 15 */
offset 116 bit 15 */
bool unusedBit_21_15 : 1 {};
/**
offset 128 bit 16 */
offset 116 bit 16 */
bool unusedBit_21_16 : 1 {};
/**
offset 128 bit 17 */
offset 116 bit 17 */
bool unusedBit_21_17 : 1 {};
/**
offset 128 bit 18 */
offset 116 bit 18 */
bool unusedBit_21_18 : 1 {};
/**
offset 128 bit 19 */
offset 116 bit 19 */
bool unusedBit_21_19 : 1 {};
/**
offset 128 bit 20 */
offset 116 bit 20 */
bool unusedBit_21_20 : 1 {};
/**
offset 128 bit 21 */
offset 116 bit 21 */
bool unusedBit_21_21 : 1 {};
/**
offset 128 bit 22 */
offset 116 bit 22 */
bool unusedBit_21_22 : 1 {};
/**
offset 128 bit 23 */
offset 116 bit 23 */
bool unusedBit_21_23 : 1 {};
/**
offset 128 bit 24 */
offset 116 bit 24 */
bool unusedBit_21_24 : 1 {};
/**
offset 128 bit 25 */
offset 116 bit 25 */
bool unusedBit_21_25 : 1 {};
/**
offset 128 bit 26 */
offset 116 bit 26 */
bool unusedBit_21_26 : 1 {};
/**
offset 128 bit 27 */
offset 116 bit 27 */
bool unusedBit_21_27 : 1 {};
/**
offset 128 bit 28 */
offset 116 bit 28 */
bool unusedBit_21_28 : 1 {};
/**
offset 128 bit 29 */
offset 116 bit 29 */
bool unusedBit_21_29 : 1 {};
/**
offset 128 bit 30 */
offset 116 bit 30 */
bool unusedBit_21_30 : 1 {};
/**
offset 128 bit 31 */
offset 116 bit 31 */
bool unusedBit_21_31 : 1 {};
/**
* offset 132
* offset 120
*/
float egt1 = (float)0;
/**
* offset 136
* offset 124
*/
float egt2 = (float)0;
/**
* User-defined RPM hard limit
rpm
* offset 140
* offset 128
*/
int16_t desiredRpmLimit = (int16_t)0;
/**
* need 4 byte alignment
units
* offset 142
* offset 130
*/
uint8_t alignmentFill_at_142[2];
uint8_t alignmentFill_at_130[2];
/**
* offset 144
* offset 132
*/
int fuelInjectionCounter = (int)0;
/**
* offset 148
* offset 136
*/
int sparkCounter = (int)0;
};
static_assert(sizeof(engine_state_s) == 152);
static_assert(sizeof(engine_state_s) == 140);
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Fri Sep 02 18:41:47 UTC 2022
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Sat Sep 03 07:08:26 EDT 2022

View File

@ -67,7 +67,7 @@ float getLoadOverride(float defaultLoad, load_override_e overrideMode) {
// TPS/pedal default to 100% - failed TPS goes rich
case AFR_Tps: return Sensor::get(SensorType::Tps1).value_or(100);
case AFR_AccPedal: return Sensor::get(SensorType::AcceleratorPedal).value_or(100);
case AFR_CylFilling: return 100 * engine->engineState.sd.airMassInOneCylinder / engine->standardAirCharge;
case AFR_CylFilling: return 100 * engine->fuelComputer->sdAirMassInOneCylinder / engine->standardAirCharge;
default: return 0;
}
}

View File

@ -1,3 +1,7 @@
/**
* @file fuel_computer.h
*/
#pragma once
class ValueProvider3D;
@ -7,6 +11,9 @@ class ValueProvider3D;
struct IFuelComputer : public fuel_computer_s {
virtual mass_t getCycleFuel(mass_t airmass, int rpm, float load) = 0;
temperature_t getTCharge(int rpm, float tps);
private:
float getTChargeCoefficient(int rpm, float tps);
};
// This contains the math of the fuel model, but doesn't actually read any configuration

View File

@ -5,4 +5,10 @@ struct_no_prefix fuel_computer_s
float stoichiometricRatio
float targetAFR
! c'mon, not the whole LiveData spaghetti for SD class?
float sdTcharge_coff
float sdAirMassInOneCylinder;Speed-density logic: calculated air mass in one cylinder, in grams
bit sdIsTChargeAirModel
end_struct

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Fri Sep 02 18:41:47 UTC 2022
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Sat Sep 03 07:08:26 EDT 2022
// by class com.rusefi.output.CHeaderConsumer
// begin
#pragma once
@ -21,8 +21,113 @@ struct fuel_computer_s {
* offset 12
*/
float targetAFR = (float)0;
/**
* offset 16
*/
float sdTcharge_coff = (float)0;
/**
* Speed-density logic: calculated air mass in one cylinder, in grams
* offset 20
*/
float sdAirMassInOneCylinder = (float)0;
/**
offset 24 bit 0 */
bool sdIsTChargeAirModel : 1 {};
/**
offset 24 bit 1 */
bool unusedBit_7_1 : 1 {};
/**
offset 24 bit 2 */
bool unusedBit_7_2 : 1 {};
/**
offset 24 bit 3 */
bool unusedBit_7_3 : 1 {};
/**
offset 24 bit 4 */
bool unusedBit_7_4 : 1 {};
/**
offset 24 bit 5 */
bool unusedBit_7_5 : 1 {};
/**
offset 24 bit 6 */
bool unusedBit_7_6 : 1 {};
/**
offset 24 bit 7 */
bool unusedBit_7_7 : 1 {};
/**
offset 24 bit 8 */
bool unusedBit_7_8 : 1 {};
/**
offset 24 bit 9 */
bool unusedBit_7_9 : 1 {};
/**
offset 24 bit 10 */
bool unusedBit_7_10 : 1 {};
/**
offset 24 bit 11 */
bool unusedBit_7_11 : 1 {};
/**
offset 24 bit 12 */
bool unusedBit_7_12 : 1 {};
/**
offset 24 bit 13 */
bool unusedBit_7_13 : 1 {};
/**
offset 24 bit 14 */
bool unusedBit_7_14 : 1 {};
/**
offset 24 bit 15 */
bool unusedBit_7_15 : 1 {};
/**
offset 24 bit 16 */
bool unusedBit_7_16 : 1 {};
/**
offset 24 bit 17 */
bool unusedBit_7_17 : 1 {};
/**
offset 24 bit 18 */
bool unusedBit_7_18 : 1 {};
/**
offset 24 bit 19 */
bool unusedBit_7_19 : 1 {};
/**
offset 24 bit 20 */
bool unusedBit_7_20 : 1 {};
/**
offset 24 bit 21 */
bool unusedBit_7_21 : 1 {};
/**
offset 24 bit 22 */
bool unusedBit_7_22 : 1 {};
/**
offset 24 bit 23 */
bool unusedBit_7_23 : 1 {};
/**
offset 24 bit 24 */
bool unusedBit_7_24 : 1 {};
/**
offset 24 bit 25 */
bool unusedBit_7_25 : 1 {};
/**
offset 24 bit 26 */
bool unusedBit_7_26 : 1 {};
/**
offset 24 bit 27 */
bool unusedBit_7_27 : 1 {};
/**
offset 24 bit 28 */
bool unusedBit_7_28 : 1 {};
/**
offset 24 bit 29 */
bool unusedBit_7_29 : 1 {};
/**
offset 24 bit 30 */
bool unusedBit_7_30 : 1 {};
/**
offset 24 bit 31 */
bool unusedBit_7_31 : 1 {};
};
static_assert(sizeof(fuel_computer_s) == 16);
static_assert(sizeof(fuel_computer_s) == 28);
// end
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Fri Sep 02 18:41:47 UTC 2022
// this section was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Sat Sep 03 07:08:26 EDT 2022

View File

@ -172,7 +172,7 @@ static float getBaseFuelMass(int rpm) {
auto airmass = model->getAirmass(rpm);
// Plop some state for others to read
engine->engineState.sd.airMassInOneCylinder = airmass.CylinderAirmass;
engine->fuelComputer->sdAirMassInOneCylinder = airmass.CylinderAirmass;
engine->engineState.fuelingLoad = airmass.EngineLoadPercent;
engine->engineState.ignitionLoad = getLoadOverride(airmass.EngineLoadPercent, engineConfiguration->ignOverrideMode);

View File

@ -131,7 +131,7 @@ struct Fueling {
};
static void populateFrame(Fueling& msg) {
msg.cylAirmass = engine->engineState.sd.airMassInOneCylinder;
msg.cylAirmass = engine->fuelComputer->sdAirMassInOneCylinder;
msg.estAirflow = engine->engineState.airflowEstimate;
msg.fuel_pulse = (float)engine->outputChannels.actualLastInjection;
msg.knockCount = engine->module<KnockController>()->getKnockCount();

View File

@ -7,9 +7,16 @@
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include <rusefi/interpolation.h>
#include "engine_configuration.h"
#include "error_handling.h"
#include "fuel_computer.h"
#include "speed_density.h"
#include "fuel_math.h"
#include "sensor.h"
#include "efi_interpolation.h"
#include "table_helper.h"
#include "engine_math.h"
#if defined(HAS_OS_ACCESS)
#error "Unexpected OS ACCESS HERE"
@ -24,8 +31,8 @@ lambda_Map3D_t lambdaMap;
#define tpMin 0
#define tpMax 100
static float getTChargeCoefficient(int rpm, float tps) {
engine->engineState.sd.isTChargeAirModel = engineConfiguration->tChargeMode == TCHARGE_MODE_AIR_INTERP;
float IFuelComputer::getTChargeCoefficient(int rpm, float tps) {
sdIsTChargeAirModel = engineConfiguration->tChargeMode == TCHARGE_MODE_AIR_INTERP;
// First, do TPS mode since it doesn't need any of the airflow math.
if (engineConfiguration->tChargeMode == TCHARGE_MODE_RPM_TPS) {
@ -41,7 +48,7 @@ static float getTChargeCoefficient(int rpm, float tps) {
constexpr floatms_t gramsPerMsToKgPerHour = (3600.0f * 1000.0f) / 1000.0f;
// We're actually using an 'old' airMass calculated for the previous cycle, but it's ok, we're not having any self-excitaton issues
floatms_t airMassForEngine = engine->engineState.sd.airMassInOneCylinder * engineConfiguration->specs.cylindersCount;
floatms_t airMassForEngine = sdAirMassInOneCylinder * engineConfiguration->specs.cylindersCount;
// airMass is in grams per 1 cycle for 1 cyl. Convert it to airFlow in kg/h for the engine.
// And if the engine is stopped (0 rpm), then airFlow is also zero (avoiding NaN division)
floatms_t airFlow = (rpm == 0) ? 0 : airMassForEngine * gramsPerMsToKgPerHour / getEngineCycleDuration(rpm);
@ -67,7 +74,7 @@ static float getTChargeCoefficient(int rpm, float tps) {
// http://rusefi.com/math/t_charge.html
/***panel:Charge Temperature*/
temperature_t getTCharge(int rpm, float tps) {
temperature_t IFuelComputer::getTCharge(int rpm, float tps) {
const auto clt = Sensor::get(SensorType::Clt);
const auto iat = Sensor::get(SensorType::Iat);
@ -89,10 +96,9 @@ temperature_t getTCharge(int rpm, float tps) {
float coolantTemp = clt.Value;
auto coefficient = getTChargeCoefficient(rpm, tps);
engine->engineState.sd.Tcharge_coff = coefficient;
sdTcharge_coff = getTChargeCoefficient(rpm, tps);
if (cisnan(coefficient)) {
if (cisnan(sdTcharge_coff)) {
warning(CUSTOM_ERR_T2_CHARGE, "t2-getTCharge NaN");
return coolantTemp;
}
@ -100,7 +106,7 @@ temperature_t getTCharge(int rpm, float tps) {
// Interpolate between CLT and IAT:
// 0.0 coefficient -> use CLT (full heat transfer)
// 1.0 coefficient -> use IAT (no heat transfer)
float Tcharge = interpolateClamped(0.0f, coolantTemp, 1.0f, airTemp, coefficient);
float Tcharge = interpolateClamped(0.0f, coolantTemp, 1.0f, airTemp, sdTcharge_coff);
if (cisnan(Tcharge)) {
// we can probably end up here while resetting engine state - interpolation would fail

View File

@ -9,10 +9,9 @@
#include "airmass.h"
#include "speed_density_base.h"
#include "fuel_computer_generated.h"
#define gramm_second_to_cc_minute(gs) ((gs) / 0.0119997981)
#define cc_minute_to_gramm_second(ccm) ((ccm) * 0.0119997981)
temperature_t getTCharge(int rpm, float tps);
void initSpeedDensity();

View File

@ -143,7 +143,7 @@ void Gm4l6xTransmissionController::setPcState(gear_e gear) {
return;
}
float duty = 0.01f * interpolate2d(engine->engineState.sd.airMassInOneCylinder, config->tcu_pcAirmassBins, *pcts);
float duty = 0.01f * interpolate2d(engine->fuelComputer->sdAirMassInOneCylinder, config->tcu_pcAirmassBins, *pcts);
pcPwm.setSimplePwmDutyCycle(duty);
}

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Fri Sep 02 18:41:47 UTC 2022
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/engine_state.txt Sat Sep 03 07:08:26 EDT 2022
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -421,106 +421,72 @@ public class EngineState {
public static final Field LUA_UNUSEDBIT_5_29 = Field.create("LUA_UNUSEDBIT_5_29", 8, FieldType.BIT, 29);
public static final Field LUA_UNUSEDBIT_5_30 = Field.create("LUA_UNUSEDBIT_5_30", 8, FieldType.BIT, 30);
public static final Field LUA_UNUSEDBIT_5_31 = Field.create("LUA_UNUSEDBIT_5_31", 8, FieldType.BIT, 31);
public static final Field SD_ISTCHARGEAIRMODEL = Field.create("SD_ISTCHARGEAIRMODEL", 12, FieldType.BIT, 0);
public static final Field SD_UNUSEDBIT_1_1 = Field.create("SD_UNUSEDBIT_1_1", 12, FieldType.BIT, 1);
public static final Field SD_UNUSEDBIT_1_2 = Field.create("SD_UNUSEDBIT_1_2", 12, FieldType.BIT, 2);
public static final Field SD_UNUSEDBIT_1_3 = Field.create("SD_UNUSEDBIT_1_3", 12, FieldType.BIT, 3);
public static final Field SD_UNUSEDBIT_1_4 = Field.create("SD_UNUSEDBIT_1_4", 12, FieldType.BIT, 4);
public static final Field SD_UNUSEDBIT_1_5 = Field.create("SD_UNUSEDBIT_1_5", 12, FieldType.BIT, 5);
public static final Field SD_UNUSEDBIT_1_6 = Field.create("SD_UNUSEDBIT_1_6", 12, FieldType.BIT, 6);
public static final Field SD_UNUSEDBIT_1_7 = Field.create("SD_UNUSEDBIT_1_7", 12, FieldType.BIT, 7);
public static final Field SD_UNUSEDBIT_1_8 = Field.create("SD_UNUSEDBIT_1_8", 12, FieldType.BIT, 8);
public static final Field SD_UNUSEDBIT_1_9 = Field.create("SD_UNUSEDBIT_1_9", 12, FieldType.BIT, 9);
public static final Field SD_UNUSEDBIT_1_10 = Field.create("SD_UNUSEDBIT_1_10", 12, FieldType.BIT, 10);
public static final Field SD_UNUSEDBIT_1_11 = Field.create("SD_UNUSEDBIT_1_11", 12, FieldType.BIT, 11);
public static final Field SD_UNUSEDBIT_1_12 = Field.create("SD_UNUSEDBIT_1_12", 12, FieldType.BIT, 12);
public static final Field SD_UNUSEDBIT_1_13 = Field.create("SD_UNUSEDBIT_1_13", 12, FieldType.BIT, 13);
public static final Field SD_UNUSEDBIT_1_14 = Field.create("SD_UNUSEDBIT_1_14", 12, FieldType.BIT, 14);
public static final Field SD_UNUSEDBIT_1_15 = Field.create("SD_UNUSEDBIT_1_15", 12, FieldType.BIT, 15);
public static final Field SD_UNUSEDBIT_1_16 = Field.create("SD_UNUSEDBIT_1_16", 12, FieldType.BIT, 16);
public static final Field SD_UNUSEDBIT_1_17 = Field.create("SD_UNUSEDBIT_1_17", 12, FieldType.BIT, 17);
public static final Field SD_UNUSEDBIT_1_18 = Field.create("SD_UNUSEDBIT_1_18", 12, FieldType.BIT, 18);
public static final Field SD_UNUSEDBIT_1_19 = Field.create("SD_UNUSEDBIT_1_19", 12, FieldType.BIT, 19);
public static final Field SD_UNUSEDBIT_1_20 = Field.create("SD_UNUSEDBIT_1_20", 12, FieldType.BIT, 20);
public static final Field SD_UNUSEDBIT_1_21 = Field.create("SD_UNUSEDBIT_1_21", 12, FieldType.BIT, 21);
public static final Field SD_UNUSEDBIT_1_22 = Field.create("SD_UNUSEDBIT_1_22", 12, FieldType.BIT, 22);
public static final Field SD_UNUSEDBIT_1_23 = Field.create("SD_UNUSEDBIT_1_23", 12, FieldType.BIT, 23);
public static final Field SD_UNUSEDBIT_1_24 = Field.create("SD_UNUSEDBIT_1_24", 12, FieldType.BIT, 24);
public static final Field SD_UNUSEDBIT_1_25 = Field.create("SD_UNUSEDBIT_1_25", 12, FieldType.BIT, 25);
public static final Field SD_UNUSEDBIT_1_26 = Field.create("SD_UNUSEDBIT_1_26", 12, FieldType.BIT, 26);
public static final Field SD_UNUSEDBIT_1_27 = Field.create("SD_UNUSEDBIT_1_27", 12, FieldType.BIT, 27);
public static final Field SD_UNUSEDBIT_1_28 = Field.create("SD_UNUSEDBIT_1_28", 12, FieldType.BIT, 28);
public static final Field SD_UNUSEDBIT_1_29 = Field.create("SD_UNUSEDBIT_1_29", 12, FieldType.BIT, 29);
public static final Field SD_UNUSEDBIT_1_30 = Field.create("SD_UNUSEDBIT_1_30", 12, FieldType.BIT, 30);
public static final Field SD_UNUSEDBIT_1_31 = Field.create("SD_UNUSEDBIT_1_31", 12, FieldType.BIT, 31);
public static final Field SD_AIRMASSINONECYLINDER = Field.create("SD_AIRMASSINONECYLINDER", 16, FieldType.FLOAT);
public static final Field SD_TCHARGE = Field.create("SD_TCHARGE", 20, FieldType.FLOAT);
public static final Field SD_TCHARGEK = Field.create("SD_TCHARGEK", 24, FieldType.FLOAT);
public static final Field SD_TCHARGE_COFF = Field.create("SD_TCHARGE_COFF", 28, FieldType.FLOAT);
public static final Field SD_AIRFLOW = Field.create("SD_AIRFLOW", 32, FieldType.FLOAT);
public static final Field ENGINECYCLEDURATIONMS = Field.create("ENGINECYCLEDURATIONMS", 36, FieldType.FLOAT);
public static final Field MINRPMKCURRENTTPS = Field.create("MINRPMKCURRENTTPS", 40, FieldType.FLOAT);
public static final Field CURRENTTPSADC = Field.create("CURRENTTPSADC", 44, FieldType.INT).setScale(1.0);
public static final Field TPSVOLTAGEMCU = Field.create("TPSVOLTAGEMCU", 48, FieldType.FLOAT);
public static final Field TPSVOLTAGEBOARD = Field.create("TPSVOLTAGEBOARD", 52, FieldType.FLOAT);
public static final Field CURRENTBAROCORRECTEDVE = Field.create("CURRENTBAROCORRECTEDVE", 56, FieldType.FLOAT);
public static final Field INJECTORFLOWCORRECTION = Field.create("INJECTORFLOWCORRECTION", 60, FieldType.FLOAT);
public static final Field BAROCORRECTION = Field.create("BAROCORRECTION", 64, FieldType.FLOAT);
public static final Field CRANKING_BASEFUEL = Field.create("CRANKING_BASEFUEL", 68, FieldType.FLOAT);
public static final Field CRANKING_COOLANTTEMPERATURECOEFFICIENT = Field.create("CRANKING_COOLANTTEMPERATURECOEFFICIENT", 72, FieldType.FLOAT);
public static final Field CRANKING_TPSCOEFFICIENT = Field.create("CRANKING_TPSCOEFFICIENT", 76, FieldType.FLOAT);
public static final Field CRANKING_DURATIONCOEFFICIENT = Field.create("CRANKING_DURATIONCOEFFICIENT", 80, FieldType.FLOAT);
public static final Field CRANKING_FUEL = Field.create("CRANKING_FUEL", 84, FieldType.FLOAT);
public static final Field RUNNING_POSTCRANKINGFUELCORRECTION = Field.create("RUNNING_POSTCRANKINGFUELCORRECTION", 88, FieldType.FLOAT);
public static final Field RUNNING_INTAKETEMPERATURECOEFFICIENT = Field.create("RUNNING_INTAKETEMPERATURECOEFFICIENT", 92, FieldType.FLOAT);
public static final Field RUNNING_COOLANTTEMPERATURECOEFFICIENT = Field.create("RUNNING_COOLANTTEMPERATURECOEFFICIENT", 96, FieldType.FLOAT);
public static final Field RUNNING_TIMESINCECRANKINGINSECS = Field.create("RUNNING_TIMESINCECRANKINGINSECS", 100, FieldType.FLOAT);
public static final Field RUNNING_BASEFUEL = Field.create("RUNNING_BASEFUEL", 104, FieldType.FLOAT);
public static final Field RUNNING_FUEL = Field.create("RUNNING_FUEL", 108, FieldType.FLOAT);
public static final Field SPARKDWELL = Field.create("SPARKDWELL", 112, FieldType.FLOAT);
public static final Field DWELLANGLE = Field.create("DWELLANGLE", 116, FieldType.FLOAT);
public static final Field CLTTIMINGCORRECTION = Field.create("CLTTIMINGCORRECTION", 120, FieldType.INT16).setScale(0.01);
public static final Field TIMINGIATCORRECTION = Field.create("TIMINGIATCORRECTION", 122, FieldType.INT16).setScale(0.01);
public static final Field TIMINGPIDCORRECTION = Field.create("TIMINGPIDCORRECTION", 124, FieldType.INT16).setScale(0.01);
public static final Field HELLENBOARDID = Field.create("HELLENBOARDID", 126, FieldType.INT16).setScale(1.0);
public static final Field CLUTCHUPSTATE = Field.create("CLUTCHUPSTATE", 128, FieldType.BIT, 0);
public static final Field CLUTCHDOWNSTATE = Field.create("CLUTCHDOWNSTATE", 128, FieldType.BIT, 1);
public static final Field BRAKEPEDALSTATE = Field.create("BRAKEPEDALSTATE", 128, FieldType.BIT, 2);
public static final Field UNUSEDBIT_21_3 = Field.create("UNUSEDBIT_21_3", 128, FieldType.BIT, 3);
public static final Field UNUSEDBIT_21_4 = Field.create("UNUSEDBIT_21_4", 128, FieldType.BIT, 4);
public static final Field UNUSEDBIT_21_5 = Field.create("UNUSEDBIT_21_5", 128, FieldType.BIT, 5);
public static final Field UNUSEDBIT_21_6 = Field.create("UNUSEDBIT_21_6", 128, FieldType.BIT, 6);
public static final Field UNUSEDBIT_21_7 = Field.create("UNUSEDBIT_21_7", 128, FieldType.BIT, 7);
public static final Field UNUSEDBIT_21_8 = Field.create("UNUSEDBIT_21_8", 128, FieldType.BIT, 8);
public static final Field UNUSEDBIT_21_9 = Field.create("UNUSEDBIT_21_9", 128, FieldType.BIT, 9);
public static final Field UNUSEDBIT_21_10 = Field.create("UNUSEDBIT_21_10", 128, FieldType.BIT, 10);
public static final Field UNUSEDBIT_21_11 = Field.create("UNUSEDBIT_21_11", 128, FieldType.BIT, 11);
public static final Field UNUSEDBIT_21_12 = Field.create("UNUSEDBIT_21_12", 128, FieldType.BIT, 12);
public static final Field UNUSEDBIT_21_13 = Field.create("UNUSEDBIT_21_13", 128, FieldType.BIT, 13);
public static final Field UNUSEDBIT_21_14 = Field.create("UNUSEDBIT_21_14", 128, FieldType.BIT, 14);
public static final Field UNUSEDBIT_21_15 = Field.create("UNUSEDBIT_21_15", 128, FieldType.BIT, 15);
public static final Field UNUSEDBIT_21_16 = Field.create("UNUSEDBIT_21_16", 128, FieldType.BIT, 16);
public static final Field UNUSEDBIT_21_17 = Field.create("UNUSEDBIT_21_17", 128, FieldType.BIT, 17);
public static final Field UNUSEDBIT_21_18 = Field.create("UNUSEDBIT_21_18", 128, FieldType.BIT, 18);
public static final Field UNUSEDBIT_21_19 = Field.create("UNUSEDBIT_21_19", 128, FieldType.BIT, 19);
public static final Field UNUSEDBIT_21_20 = Field.create("UNUSEDBIT_21_20", 128, FieldType.BIT, 20);
public static final Field UNUSEDBIT_21_21 = Field.create("UNUSEDBIT_21_21", 128, FieldType.BIT, 21);
public static final Field UNUSEDBIT_21_22 = Field.create("UNUSEDBIT_21_22", 128, FieldType.BIT, 22);
public static final Field UNUSEDBIT_21_23 = Field.create("UNUSEDBIT_21_23", 128, FieldType.BIT, 23);
public static final Field UNUSEDBIT_21_24 = Field.create("UNUSEDBIT_21_24", 128, FieldType.BIT, 24);
public static final Field UNUSEDBIT_21_25 = Field.create("UNUSEDBIT_21_25", 128, FieldType.BIT, 25);
public static final Field UNUSEDBIT_21_26 = Field.create("UNUSEDBIT_21_26", 128, FieldType.BIT, 26);
public static final Field UNUSEDBIT_21_27 = Field.create("UNUSEDBIT_21_27", 128, FieldType.BIT, 27);
public static final Field UNUSEDBIT_21_28 = Field.create("UNUSEDBIT_21_28", 128, FieldType.BIT, 28);
public static final Field UNUSEDBIT_21_29 = Field.create("UNUSEDBIT_21_29", 128, FieldType.BIT, 29);
public static final Field UNUSEDBIT_21_30 = Field.create("UNUSEDBIT_21_30", 128, FieldType.BIT, 30);
public static final Field UNUSEDBIT_21_31 = Field.create("UNUSEDBIT_21_31", 128, FieldType.BIT, 31);
public static final Field EGT1 = Field.create("EGT1", 132, FieldType.FLOAT);
public static final Field EGT2 = Field.create("EGT2", 136, FieldType.FLOAT);
public static final Field DESIREDRPMLIMIT = Field.create("DESIREDRPMLIMIT", 140, FieldType.INT16).setScale(1.0);
public static final Field ALIGNMENTFILL_AT_142 = Field.create("ALIGNMENTFILL_AT_142", 142, FieldType.INT8).setScale(1.0);
public static final Field FUELINJECTIONCOUNTER = Field.create("FUELINJECTIONCOUNTER", 144, FieldType.INT).setScale(1.0);
public static final Field SPARKCOUNTER = Field.create("SPARKCOUNTER", 148, FieldType.INT).setScale(1.0);
public static final Field SD_TCHARGE = Field.create("SD_TCHARGE", 12, FieldType.FLOAT);
public static final Field SD_TCHARGEK = Field.create("SD_TCHARGEK", 16, FieldType.FLOAT);
public static final Field SD_AIRFLOW = Field.create("SD_AIRFLOW", 20, FieldType.FLOAT);
public static final Field ENGINECYCLEDURATIONMS = Field.create("ENGINECYCLEDURATIONMS", 24, FieldType.FLOAT);
public static final Field MINRPMKCURRENTTPS = Field.create("MINRPMKCURRENTTPS", 28, FieldType.FLOAT);
public static final Field CURRENTTPSADC = Field.create("CURRENTTPSADC", 32, FieldType.INT).setScale(1.0);
public static final Field TPSVOLTAGEMCU = Field.create("TPSVOLTAGEMCU", 36, FieldType.FLOAT);
public static final Field TPSVOLTAGEBOARD = Field.create("TPSVOLTAGEBOARD", 40, FieldType.FLOAT);
public static final Field CURRENTBAROCORRECTEDVE = Field.create("CURRENTBAROCORRECTEDVE", 44, FieldType.FLOAT);
public static final Field INJECTORFLOWCORRECTION = Field.create("INJECTORFLOWCORRECTION", 48, FieldType.FLOAT);
public static final Field BAROCORRECTION = Field.create("BAROCORRECTION", 52, FieldType.FLOAT);
public static final Field CRANKING_BASEFUEL = Field.create("CRANKING_BASEFUEL", 56, FieldType.FLOAT);
public static final Field CRANKING_COOLANTTEMPERATURECOEFFICIENT = Field.create("CRANKING_COOLANTTEMPERATURECOEFFICIENT", 60, FieldType.FLOAT);
public static final Field CRANKING_TPSCOEFFICIENT = Field.create("CRANKING_TPSCOEFFICIENT", 64, FieldType.FLOAT);
public static final Field CRANKING_DURATIONCOEFFICIENT = Field.create("CRANKING_DURATIONCOEFFICIENT", 68, FieldType.FLOAT);
public static final Field CRANKING_FUEL = Field.create("CRANKING_FUEL", 72, FieldType.FLOAT);
public static final Field RUNNING_POSTCRANKINGFUELCORRECTION = Field.create("RUNNING_POSTCRANKINGFUELCORRECTION", 76, FieldType.FLOAT);
public static final Field RUNNING_INTAKETEMPERATURECOEFFICIENT = Field.create("RUNNING_INTAKETEMPERATURECOEFFICIENT", 80, FieldType.FLOAT);
public static final Field RUNNING_COOLANTTEMPERATURECOEFFICIENT = Field.create("RUNNING_COOLANTTEMPERATURECOEFFICIENT", 84, FieldType.FLOAT);
public static final Field RUNNING_TIMESINCECRANKINGINSECS = Field.create("RUNNING_TIMESINCECRANKINGINSECS", 88, FieldType.FLOAT);
public static final Field RUNNING_BASEFUEL = Field.create("RUNNING_BASEFUEL", 92, FieldType.FLOAT);
public static final Field RUNNING_FUEL = Field.create("RUNNING_FUEL", 96, FieldType.FLOAT);
public static final Field SPARKDWELL = Field.create("SPARKDWELL", 100, FieldType.FLOAT);
public static final Field DWELLANGLE = Field.create("DWELLANGLE", 104, FieldType.FLOAT);
public static final Field CLTTIMINGCORRECTION = Field.create("CLTTIMINGCORRECTION", 108, FieldType.INT16).setScale(0.01);
public static final Field TIMINGIATCORRECTION = Field.create("TIMINGIATCORRECTION", 110, FieldType.INT16).setScale(0.01);
public static final Field TIMINGPIDCORRECTION = Field.create("TIMINGPIDCORRECTION", 112, FieldType.INT16).setScale(0.01);
public static final Field HELLENBOARDID = Field.create("HELLENBOARDID", 114, FieldType.INT16).setScale(1.0);
public static final Field CLUTCHUPSTATE = Field.create("CLUTCHUPSTATE", 116, FieldType.BIT, 0);
public static final Field CLUTCHDOWNSTATE = Field.create("CLUTCHDOWNSTATE", 116, FieldType.BIT, 1);
public static final Field BRAKEPEDALSTATE = Field.create("BRAKEPEDALSTATE", 116, FieldType.BIT, 2);
public static final Field UNUSEDBIT_21_3 = Field.create("UNUSEDBIT_21_3", 116, FieldType.BIT, 3);
public static final Field UNUSEDBIT_21_4 = Field.create("UNUSEDBIT_21_4", 116, FieldType.BIT, 4);
public static final Field UNUSEDBIT_21_5 = Field.create("UNUSEDBIT_21_5", 116, FieldType.BIT, 5);
public static final Field UNUSEDBIT_21_6 = Field.create("UNUSEDBIT_21_6", 116, FieldType.BIT, 6);
public static final Field UNUSEDBIT_21_7 = Field.create("UNUSEDBIT_21_7", 116, FieldType.BIT, 7);
public static final Field UNUSEDBIT_21_8 = Field.create("UNUSEDBIT_21_8", 116, FieldType.BIT, 8);
public static final Field UNUSEDBIT_21_9 = Field.create("UNUSEDBIT_21_9", 116, FieldType.BIT, 9);
public static final Field UNUSEDBIT_21_10 = Field.create("UNUSEDBIT_21_10", 116, FieldType.BIT, 10);
public static final Field UNUSEDBIT_21_11 = Field.create("UNUSEDBIT_21_11", 116, FieldType.BIT, 11);
public static final Field UNUSEDBIT_21_12 = Field.create("UNUSEDBIT_21_12", 116, FieldType.BIT, 12);
public static final Field UNUSEDBIT_21_13 = Field.create("UNUSEDBIT_21_13", 116, FieldType.BIT, 13);
public static final Field UNUSEDBIT_21_14 = Field.create("UNUSEDBIT_21_14", 116, FieldType.BIT, 14);
public static final Field UNUSEDBIT_21_15 = Field.create("UNUSEDBIT_21_15", 116, FieldType.BIT, 15);
public static final Field UNUSEDBIT_21_16 = Field.create("UNUSEDBIT_21_16", 116, FieldType.BIT, 16);
public static final Field UNUSEDBIT_21_17 = Field.create("UNUSEDBIT_21_17", 116, FieldType.BIT, 17);
public static final Field UNUSEDBIT_21_18 = Field.create("UNUSEDBIT_21_18", 116, FieldType.BIT, 18);
public static final Field UNUSEDBIT_21_19 = Field.create("UNUSEDBIT_21_19", 116, FieldType.BIT, 19);
public static final Field UNUSEDBIT_21_20 = Field.create("UNUSEDBIT_21_20", 116, FieldType.BIT, 20);
public static final Field UNUSEDBIT_21_21 = Field.create("UNUSEDBIT_21_21", 116, FieldType.BIT, 21);
public static final Field UNUSEDBIT_21_22 = Field.create("UNUSEDBIT_21_22", 116, FieldType.BIT, 22);
public static final Field UNUSEDBIT_21_23 = Field.create("UNUSEDBIT_21_23", 116, FieldType.BIT, 23);
public static final Field UNUSEDBIT_21_24 = Field.create("UNUSEDBIT_21_24", 116, FieldType.BIT, 24);
public static final Field UNUSEDBIT_21_25 = Field.create("UNUSEDBIT_21_25", 116, FieldType.BIT, 25);
public static final Field UNUSEDBIT_21_26 = Field.create("UNUSEDBIT_21_26", 116, FieldType.BIT, 26);
public static final Field UNUSEDBIT_21_27 = Field.create("UNUSEDBIT_21_27", 116, FieldType.BIT, 27);
public static final Field UNUSEDBIT_21_28 = Field.create("UNUSEDBIT_21_28", 116, FieldType.BIT, 28);
public static final Field UNUSEDBIT_21_29 = Field.create("UNUSEDBIT_21_29", 116, FieldType.BIT, 29);
public static final Field UNUSEDBIT_21_30 = Field.create("UNUSEDBIT_21_30", 116, FieldType.BIT, 30);
public static final Field UNUSEDBIT_21_31 = Field.create("UNUSEDBIT_21_31", 116, FieldType.BIT, 31);
public static final Field EGT1 = Field.create("EGT1", 120, FieldType.FLOAT);
public static final Field EGT2 = Field.create("EGT2", 124, FieldType.FLOAT);
public static final Field DESIREDRPMLIMIT = Field.create("DESIREDRPMLIMIT", 128, FieldType.INT16).setScale(1.0);
public static final Field ALIGNMENTFILL_AT_130 = Field.create("ALIGNMENTFILL_AT_130", 130, FieldType.INT8).setScale(1.0);
public static final Field FUELINJECTIONCOUNTER = Field.create("FUELINJECTIONCOUNTER", 132, FieldType.INT).setScale(1.0);
public static final Field SPARKCOUNTER = Field.create("SPARKCOUNTER", 136, FieldType.INT).setScale(1.0);
public static final Field[] VALUES = {
LUA_FUELADD,
LUA_FUELMULT,
@ -556,42 +522,8 @@ public class EngineState {
LUA_UNUSEDBIT_5_29,
LUA_UNUSEDBIT_5_30,
LUA_UNUSEDBIT_5_31,
SD_ISTCHARGEAIRMODEL,
SD_UNUSEDBIT_1_1,
SD_UNUSEDBIT_1_2,
SD_UNUSEDBIT_1_3,
SD_UNUSEDBIT_1_4,
SD_UNUSEDBIT_1_5,
SD_UNUSEDBIT_1_6,
SD_UNUSEDBIT_1_7,
SD_UNUSEDBIT_1_8,
SD_UNUSEDBIT_1_9,
SD_UNUSEDBIT_1_10,
SD_UNUSEDBIT_1_11,
SD_UNUSEDBIT_1_12,
SD_UNUSEDBIT_1_13,
SD_UNUSEDBIT_1_14,
SD_UNUSEDBIT_1_15,
SD_UNUSEDBIT_1_16,
SD_UNUSEDBIT_1_17,
SD_UNUSEDBIT_1_18,
SD_UNUSEDBIT_1_19,
SD_UNUSEDBIT_1_20,
SD_UNUSEDBIT_1_21,
SD_UNUSEDBIT_1_22,
SD_UNUSEDBIT_1_23,
SD_UNUSEDBIT_1_24,
SD_UNUSEDBIT_1_25,
SD_UNUSEDBIT_1_26,
SD_UNUSEDBIT_1_27,
SD_UNUSEDBIT_1_28,
SD_UNUSEDBIT_1_29,
SD_UNUSEDBIT_1_30,
SD_UNUSEDBIT_1_31,
SD_AIRMASSINONECYLINDER,
SD_TCHARGE,
SD_TCHARGEK,
SD_TCHARGE_COFF,
SD_AIRFLOW,
ENGINECYCLEDURATIONMS,
MINRPMKCURRENTTPS,
@ -653,7 +585,7 @@ public class EngineState {
EGT1,
EGT2,
DESIREDRPMLIMIT,
ALIGNMENTFILL_AT_142,
ALIGNMENTFILL_AT_130,
FUELINJECTIONCOUNTER,
SPARKCOUNTER,
};

View File

@ -1,6 +1,6 @@
package com.rusefi.config.generated;
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Fri Sep 02 18:41:47 UTC 2022
// this file was generated automatically by rusEFI tool ConfigDefinition.jar based on (unknown script) controllers/algo/fuel/fuel_computer.txt Sat Sep 03 07:08:26 EDT 2022
// by class com.rusefi.output.FileJavaFieldsConsumer
import com.rusefi.config.*;
@ -391,10 +391,78 @@ public class FuelComputer {
public static final Field TARGETLAMBDA = Field.create("TARGETLAMBDA", 4, FieldType.FLOAT);
public static final Field STOICHIOMETRICRATIO = Field.create("STOICHIOMETRICRATIO", 8, FieldType.FLOAT);
public static final Field TARGETAFR = Field.create("TARGETAFR", 12, FieldType.FLOAT);
public static final Field SDTCHARGE_COFF = Field.create("SDTCHARGE_COFF", 16, FieldType.FLOAT);
public static final Field SDAIRMASSINONECYLINDER = Field.create("SDAIRMASSINONECYLINDER", 20, FieldType.FLOAT);
public static final Field SDISTCHARGEAIRMODEL = Field.create("SDISTCHARGEAIRMODEL", 24, FieldType.BIT, 0);
public static final Field UNUSEDBIT_7_1 = Field.create("UNUSEDBIT_7_1", 24, FieldType.BIT, 1);
public static final Field UNUSEDBIT_7_2 = Field.create("UNUSEDBIT_7_2", 24, FieldType.BIT, 2);
public static final Field UNUSEDBIT_7_3 = Field.create("UNUSEDBIT_7_3", 24, FieldType.BIT, 3);
public static final Field UNUSEDBIT_7_4 = Field.create("UNUSEDBIT_7_4", 24, FieldType.BIT, 4);
public static final Field UNUSEDBIT_7_5 = Field.create("UNUSEDBIT_7_5", 24, FieldType.BIT, 5);
public static final Field UNUSEDBIT_7_6 = Field.create("UNUSEDBIT_7_6", 24, FieldType.BIT, 6);
public static final Field UNUSEDBIT_7_7 = Field.create("UNUSEDBIT_7_7", 24, FieldType.BIT, 7);
public static final Field UNUSEDBIT_7_8 = Field.create("UNUSEDBIT_7_8", 24, FieldType.BIT, 8);
public static final Field UNUSEDBIT_7_9 = Field.create("UNUSEDBIT_7_9", 24, FieldType.BIT, 9);
public static final Field UNUSEDBIT_7_10 = Field.create("UNUSEDBIT_7_10", 24, FieldType.BIT, 10);
public static final Field UNUSEDBIT_7_11 = Field.create("UNUSEDBIT_7_11", 24, FieldType.BIT, 11);
public static final Field UNUSEDBIT_7_12 = Field.create("UNUSEDBIT_7_12", 24, FieldType.BIT, 12);
public static final Field UNUSEDBIT_7_13 = Field.create("UNUSEDBIT_7_13", 24, FieldType.BIT, 13);
public static final Field UNUSEDBIT_7_14 = Field.create("UNUSEDBIT_7_14", 24, FieldType.BIT, 14);
public static final Field UNUSEDBIT_7_15 = Field.create("UNUSEDBIT_7_15", 24, FieldType.BIT, 15);
public static final Field UNUSEDBIT_7_16 = Field.create("UNUSEDBIT_7_16", 24, FieldType.BIT, 16);
public static final Field UNUSEDBIT_7_17 = Field.create("UNUSEDBIT_7_17", 24, FieldType.BIT, 17);
public static final Field UNUSEDBIT_7_18 = Field.create("UNUSEDBIT_7_18", 24, FieldType.BIT, 18);
public static final Field UNUSEDBIT_7_19 = Field.create("UNUSEDBIT_7_19", 24, FieldType.BIT, 19);
public static final Field UNUSEDBIT_7_20 = Field.create("UNUSEDBIT_7_20", 24, FieldType.BIT, 20);
public static final Field UNUSEDBIT_7_21 = Field.create("UNUSEDBIT_7_21", 24, FieldType.BIT, 21);
public static final Field UNUSEDBIT_7_22 = Field.create("UNUSEDBIT_7_22", 24, FieldType.BIT, 22);
public static final Field UNUSEDBIT_7_23 = Field.create("UNUSEDBIT_7_23", 24, FieldType.BIT, 23);
public static final Field UNUSEDBIT_7_24 = Field.create("UNUSEDBIT_7_24", 24, FieldType.BIT, 24);
public static final Field UNUSEDBIT_7_25 = Field.create("UNUSEDBIT_7_25", 24, FieldType.BIT, 25);
public static final Field UNUSEDBIT_7_26 = Field.create("UNUSEDBIT_7_26", 24, FieldType.BIT, 26);
public static final Field UNUSEDBIT_7_27 = Field.create("UNUSEDBIT_7_27", 24, FieldType.BIT, 27);
public static final Field UNUSEDBIT_7_28 = Field.create("UNUSEDBIT_7_28", 24, FieldType.BIT, 28);
public static final Field UNUSEDBIT_7_29 = Field.create("UNUSEDBIT_7_29", 24, FieldType.BIT, 29);
public static final Field UNUSEDBIT_7_30 = Field.create("UNUSEDBIT_7_30", 24, FieldType.BIT, 30);
public static final Field UNUSEDBIT_7_31 = Field.create("UNUSEDBIT_7_31", 24, FieldType.BIT, 31);
public static final Field[] VALUES = {
CURRENTAFRLOAD,
TARGETLAMBDA,
STOICHIOMETRICRATIO,
TARGETAFR,
SDTCHARGE_COFF,
SDAIRMASSINONECYLINDER,
SDISTCHARGEAIRMODEL,
UNUSEDBIT_7_1,
UNUSEDBIT_7_2,
UNUSEDBIT_7_3,
UNUSEDBIT_7_4,
UNUSEDBIT_7_5,
UNUSEDBIT_7_6,
UNUSEDBIT_7_7,
UNUSEDBIT_7_8,
UNUSEDBIT_7_9,
UNUSEDBIT_7_10,
UNUSEDBIT_7_11,
UNUSEDBIT_7_12,
UNUSEDBIT_7_13,
UNUSEDBIT_7_14,
UNUSEDBIT_7_15,
UNUSEDBIT_7_16,
UNUSEDBIT_7_17,
UNUSEDBIT_7_18,
UNUSEDBIT_7_19,
UNUSEDBIT_7_20,
UNUSEDBIT_7_21,
UNUSEDBIT_7_22,
UNUSEDBIT_7_23,
UNUSEDBIT_7_24,
UNUSEDBIT_7_25,
UNUSEDBIT_7_26,
UNUSEDBIT_7_27,
UNUSEDBIT_7_28,
UNUSEDBIT_7_29,
UNUSEDBIT_7_30,
UNUSEDBIT_7_31,
};
}

View File

@ -24,6 +24,7 @@ TEST(misc, testIgnitionPlanning) {
TEST(misc, testEngineMath) {
printf("*************************************************** testEngineMath\r\n");
// todo: let's see if we can make 'engine' unneeded in this test?
EngineTestHelper eth(FORD_ESCORT_GT);
setCamOperationMode();
@ -32,16 +33,18 @@ TEST(misc, testEngineMath) {
ASSERT_NEAR( 50, getOneDegreeTimeMs(600) * 180, EPS4D) << "600 RPM";
ASSERT_EQ( 5, getOneDegreeTimeMs(6000) * 180) << "6000 RPM";
IFuelComputer *fuelComputer = engine->fuelComputer;
Sensor::setMockValue(SensorType::Clt, 300);
Sensor::setMockValue(SensorType::Iat, 350);
ASSERT_FLOAT_EQ(312.5, getTCharge(1000, 0));
ASSERT_FLOAT_EQ(313.5833, getTCharge(1000, 50));
ASSERT_FLOAT_EQ(314.6667, getTCharge(1000, 100));
ASSERT_FLOAT_EQ(312.5, fuelComputer->getTCharge(1000, 0));
ASSERT_FLOAT_EQ(313.5833, fuelComputer->getTCharge(1000, 50));
ASSERT_FLOAT_EQ(314.6667, fuelComputer->getTCharge(1000, 100));
ASSERT_FLOAT_EQ(312.5, getTCharge(4000, 0));
ASSERT_FLOAT_EQ(320.0833, getTCharge(4000, 50));
ASSERT_FLOAT_EQ(327.6667, getTCharge(4000, 100));
ASSERT_FLOAT_EQ(312.5, fuelComputer->getTCharge(4000, 0));
ASSERT_FLOAT_EQ(320.0833, fuelComputer->getTCharge(4000, 50));
ASSERT_FLOAT_EQ(327.6667, fuelComputer->getTCharge(4000, 100));
// test Air Interpolation mode
engineConfiguration->tChargeMode = TCHARGE_MODE_AIR_INTERP;
@ -49,8 +52,8 @@ TEST(misc, testEngineMath) {
engineConfiguration->tChargeAirCoefMax = 0.902f;
engineConfiguration->tChargeAirFlowMax = 153.6f;
// calc. some airMass given the engine displacement=1.839 and 4 cylinders (FORD_ESCORT_GT)
engine->engineState.sd.airMassInOneCylinder = SpeedDensityBase::getAirmassImpl(/*VE*/1.0f, /*MAP*/100.0f, /*tChargeK*/273.15f + 20.0f);
ASSERT_NEAR(0.5464f, engine->engineState.sd.airMassInOneCylinder, EPS4D);
fuelComputer->sdAirMassInOneCylinder = SpeedDensityBase::getAirmassImpl(/*VE*/1.0f, /*MAP*/100.0f, /*tChargeK*/273.15f + 20.0f);
ASSERT_NEAR(0.5464f, fuelComputer->sdAirMassInOneCylinder, EPS4D);
Sensor::setMockValue(SensorType::Clt, 90);
Sensor::setMockValue(SensorType::Iat, 20);