diff --git a/firmware/console/binary/generated/data_logs.ini b/firmware/console/binary/generated/data_logs.ini index 98f353a22d..2f99e01872 100644 --- a/firmware/console/binary/generated/data_logs.ini +++ b/firmware/console/binary/generated/data_logs.ini @@ -284,6 +284,9 @@ entry = currentAfrLoad, "currentAfrLoad", float, "%.3f" entry = targetLambda, "targetLambda", float, "%.3f" entry = stoichiometricRatio, "stoichiometricRatio", float, "%.3f" entry = targetAFR, "targetAFR", float, "%.3f" +entry = sdTcharge_coff, "sdTcharge_coff", float, "%.3f" +entry = sdAirMassInOneCylinder, "Speed-density logic: calculated air mass in one cylinder, in grams", float, "%.3f" +entry = sdIsTChargeAirModel, "sdIsTChargeAirModel", int, "%d" entry = retardThresholdRpm, "retardThresholdRpm", int, "%d" entry = combinedConditions, "combinedConditions", int, "%d" entry = launchActivatePinState, "launchActivatePinState", int, "%d" @@ -336,11 +339,8 @@ entry = lua_fuelMult, "lua_fuelMult", float, "%.3f" entry = lua_clutchUpState, "lua_clutchUpState", int, "%d" entry = lua_brakePedalState, "lua_brakePedalState", int, "%d" entry = lua_acRequestState, "lua_acRequestState", int, "%d" -entry = sd_isTChargeAirModel, "sd_isTChargeAirModel", int, "%d" -entry = sd_airMassInOneCylinder, "Speed-density logic: calculated air mass in one cylinder, in grams", float, "%.3f" entry = sd_tCharge, "speed density", float, "%.3f" entry = sd_tChargeK, "sd_tChargeK", float, "%.3f" -entry = sd_Tcharge_coff, "sd_Tcharge_coff", float, "%.3f" entry = sd_airFlow, "sd_airFlow", float, "%.3f" entry = engineCycleDurationMs, "engineCycleDurationMs", float, "%.3f" entry = minRpmKcurrentTPS, "minRpmKcurrentTPS", float, "%.3f" diff --git a/firmware/console/binary/generated/fancy_content.ini b/firmware/console/binary/generated/fancy_content.ini index 6a02731265..0f58d3903a 100644 --- a/firmware/console/binary/generated/fancy_content.ini +++ b/firmware/console/binary/generated/fancy_content.ini @@ -28,13 +28,19 @@ dialog = injector_modelDialog, "injector_model" graphLine = pressureDelta graphLine = pressureRatio +indicatorPanel = fuel_computerIndicatorPanel, 2 + indicator = {sdIsTChargeAirModel}, "sdIsTChargeAirModel No", "sdIsTChargeAirModel Yes" dialog = fuel_computerDialog, "fuel_computer" + panel = fuel_computerIndicatorPanel liveGraph = fuel_computer_1_Graph, "Graph", South graphLine = currentAfrLoad graphLine = targetLambda graphLine = stoichiometricRatio graphLine = targetAFR + liveGraph = fuel_computer_2_Graph, "Graph", South + graphLine = sdTcharge_coff + graphLine = sdAirMassInOneCylinder indicatorPanel = launch_control_stateIndicatorPanel, 2 indicator = {combinedConditions}, "combinedConditions No", "combinedConditions Yes" @@ -121,7 +127,6 @@ indicatorPanel = engine_stateIndicatorPanel, 2 indicator = {lua_clutchUpState}, "clutchUpState No", "clutchUpState Yes" indicator = {lua_brakePedalState}, "brakePedalState No", "brakePedalState Yes" indicator = {lua_acRequestState}, "acRequestState No", "acRequestState Yes" - indicator = {sd_isTChargeAirModel}, "isTChargeAirModel No", "isTChargeAirModel Yes" indicator = {clutchUpState}, "clutchUpState No", "clutchUpState Yes" indicator = {clutchDownState}, "clutchDownState No", "clutchDownState Yes" indicator = {brakePedalState}, "brakePedalState No", "brakePedalState Yes" @@ -131,49 +136,46 @@ dialog = engine_stateDialog, "engine_state" liveGraph = engine_state_1_Graph, "Graph", South graphLine = lua_fuelAdd graphLine = lua_fuelMult - graphLine = sd_airMassInOneCylinder graphLine = sd_tCharge - liveGraph = engine_state_2_Graph, "Graph", South graphLine = sd_tChargeK - graphLine = sd_Tcharge_coff + liveGraph = engine_state_2_Graph, "Graph", South graphLine = sd_airFlow graphLine = engineCycleDurationMs - liveGraph = engine_state_3_Graph, "Graph", South graphLine = minRpmKcurrentTPS graphLine = currentTpsAdc + liveGraph = engine_state_3_Graph, "Graph", South graphLine = tpsVoltageMCU graphLine = tpsVoltageBoard - liveGraph = engine_state_4_Graph, "Graph", South graphLine = currentBaroCorrectedVE graphLine = injectorFlowCorrection + liveGraph = engine_state_4_Graph, "Graph", South graphLine = baroCorrection graphLine = cranking_baseFuel - liveGraph = engine_state_5_Graph, "Graph", South graphLine = cranking_coolantTemperatureCoefficient graphLine = cranking_tpsCoefficient + liveGraph = engine_state_5_Graph, "Graph", South graphLine = cranking_durationCoefficient graphLine = cranking_fuel - liveGraph = engine_state_6_Graph, "Graph", South graphLine = running_postCrankingFuelCorrection graphLine = running_intakeTemperatureCoefficient + liveGraph = engine_state_6_Graph, "Graph", South graphLine = running_coolantTemperatureCoefficient graphLine = running_timeSinceCrankingInSecs - liveGraph = engine_state_7_Graph, "Graph", South graphLine = running_baseFuel graphLine = running_fuel + liveGraph = engine_state_7_Graph, "Graph", South graphLine = sparkDwell graphLine = dwellAngle - liveGraph = engine_state_8_Graph, "Graph", South graphLine = cltTimingCorrection graphLine = timingIatCorrection + liveGraph = engine_state_8_Graph, "Graph", South graphLine = timingPidCorrection graphLine = hellenBoardId - liveGraph = engine_state_9_Graph, "Graph", South graphLine = egt1 graphLine = egt2 + liveGraph = engine_state_9_Graph, "Graph", South graphLine = desiredRpmLimit graphLine = fuelInjectionCounter - liveGraph = engine_state_10_Graph, "Graph", South graphLine = sparkCounter indicatorPanel = tps_accel_stateIndicatorPanel, 2 diff --git a/firmware/console/binary/generated/output_channels.ini b/firmware/console/binary/generated/output_channels.ini index d7b978e4a8..5e6c836a6d 100644 --- a/firmware/console/binary/generated/output_channels.ini +++ b/firmware/console/binary/generated/output_channels.ini @@ -568,283 +568,283 @@ currentAfrLoad = scalar, F32, 800, "", 1, 0 targetLambda = scalar, F32, 804, "", 1, 0 stoichiometricRatio = scalar, F32, 808, "", 1, 0 targetAFR = scalar, F32, 812, "", 1, 0 -; total TS size = 816 -retardThresholdRpm = scalar, S32, 816, "", 1, 0 -combinedConditions = bits, U32, 820, [0:0] -launchActivatePinState = bits, U32, 820, [1:1] -isLaunchCondition = bits, U32, 820, [2:2] -isSwitchActivated = bits, U32, 820, [3:3] -isClutchActivated = bits, U32, 820, [4:4] -isValidInputPin = bits, U32, 820, [5:5] -activateSwitchCondition = bits, U32, 820, [6:6] -rpmCondition = bits, U32, 820, [7:7] -speedCondition = bits, U32, 820, [8:8] -tpsCondition = bits, U32, 820, [9:9] -unusedBit_11_10 = bits, U32, 820, [10:10] -unusedBit_11_11 = bits, U32, 820, [11:11] -unusedBit_11_12 = bits, U32, 820, [12:12] -unusedBit_11_13 = bits, U32, 820, [13:13] -unusedBit_11_14 = bits, U32, 820, [14:14] -unusedBit_11_15 = bits, U32, 820, [15:15] -unusedBit_11_16 = bits, U32, 820, [16:16] -unusedBit_11_17 = bits, U32, 820, [17:17] -unusedBit_11_18 = bits, U32, 820, [18:18] -unusedBit_11_19 = bits, U32, 820, [19:19] -unusedBit_11_20 = bits, U32, 820, [20:20] -unusedBit_11_21 = bits, U32, 820, [21:21] -unusedBit_11_22 = bits, U32, 820, [22:22] -unusedBit_11_23 = bits, U32, 820, [23:23] -unusedBit_11_24 = bits, U32, 820, [24:24] -unusedBit_11_25 = bits, U32, 820, [25:25] -unusedBit_11_26 = bits, U32, 820, [26:26] -unusedBit_11_27 = bits, U32, 820, [27:27] -unusedBit_11_28 = bits, U32, 820, [28:28] -unusedBit_11_29 = bits, U32, 820, [29:29] -unusedBit_11_30 = bits, U32, 820, [30:30] -unusedBit_11_31 = bits, U32, 820, [31:31] -; total TS size = 824 -isTpsInvalid = bits, U32, 824, [0:0] -m_shouldResetPid = bits, U32, 824, [1:1] -isBelowClosedLoopThreshold = bits, U32, 824, [2:2] -isNotClosedLoop = bits, U32, 824, [3:3] -isZeroRpm = bits, U32, 824, [4:4] -unusedBit_5_5 = bits, U32, 824, [5:5] -unusedBit_5_6 = bits, U32, 824, [6:6] -unusedBit_5_7 = bits, U32, 824, [7:7] -unusedBit_5_8 = bits, U32, 824, [8:8] -unusedBit_5_9 = bits, U32, 824, [9:9] -unusedBit_5_10 = bits, U32, 824, [10:10] -unusedBit_5_11 = bits, U32, 824, [11:11] -unusedBit_5_12 = bits, U32, 824, [12:12] -unusedBit_5_13 = bits, U32, 824, [13:13] -unusedBit_5_14 = bits, U32, 824, [14:14] -unusedBit_5_15 = bits, U32, 824, [15:15] -unusedBit_5_16 = bits, U32, 824, [16:16] -unusedBit_5_17 = bits, U32, 824, [17:17] -unusedBit_5_18 = bits, U32, 824, [18:18] -unusedBit_5_19 = bits, U32, 824, [19:19] -unusedBit_5_20 = bits, U32, 824, [20:20] -unusedBit_5_21 = bits, U32, 824, [21:21] -unusedBit_5_22 = bits, U32, 824, [22:22] -unusedBit_5_23 = bits, U32, 824, [23:23] -unusedBit_5_24 = bits, U32, 824, [24:24] -unusedBit_5_25 = bits, U32, 824, [25:25] -unusedBit_5_26 = bits, U32, 824, [26:26] -unusedBit_5_27 = bits, U32, 824, [27:27] -unusedBit_5_28 = bits, U32, 824, [28:28] -unusedBit_5_29 = bits, U32, 824, [29:29] -unusedBit_5_30 = bits, U32, 824, [30:30] -unusedBit_5_31 = bits, U32, 824, [31:31] -luaTargetAdd = scalar, F32, 828, "", 1, 0 -luaTargetMult = scalar, F32, 832, "", 1, 0 -openLoopPart = scalar, F32, 836, "", 1, 0 -boostControllerClosedLoopPart = scalar, S08, 840, "%", 0.5, 0 -boostControlTarget = scalar, S16, 842, "kPa", 0.03333333333333333, 0 -; total TS size = 844 -acButtonState = bits, U32, 844, [0:0] -m_acEnabled = bits, U32, 844, [1:1] -engineTooSlow = bits, U32, 844, [2:2] -engineTooFast = bits, U32, 844, [3:3] -noClt = bits, U32, 844, [4:4] -engineTooHot = bits, U32, 844, [5:5] -tpsTooHigh = bits, U32, 844, [6:6] -isDisabledByLua = bits, U32, 844, [7:7] -acCompressorState = bits, U32, 844, [8:8] -unusedBit_9_9 = bits, U32, 844, [9:9] -unusedBit_9_10 = bits, U32, 844, [10:10] -unusedBit_9_11 = bits, U32, 844, [11:11] -unusedBit_9_12 = bits, U32, 844, [12:12] -unusedBit_9_13 = bits, U32, 844, [13:13] -unusedBit_9_14 = bits, U32, 844, [14:14] -unusedBit_9_15 = bits, U32, 844, [15:15] -unusedBit_9_16 = bits, U32, 844, [16:16] -unusedBit_9_17 = bits, U32, 844, [17:17] -unusedBit_9_18 = bits, U32, 844, [18:18] -unusedBit_9_19 = bits, U32, 844, [19:19] -unusedBit_9_20 = bits, U32, 844, [20:20] -unusedBit_9_21 = bits, U32, 844, [21:21] -unusedBit_9_22 = bits, U32, 844, [22:22] -unusedBit_9_23 = bits, U32, 844, [23:23] -unusedBit_9_24 = bits, U32, 844, [24:24] -unusedBit_9_25 = bits, U32, 844, [25:25] -unusedBit_9_26 = bits, U32, 844, [26:26] -unusedBit_9_27 = bits, U32, 844, [27:27] -unusedBit_9_28 = bits, U32, 844, [28:28] -unusedBit_9_29 = bits, U32, 844, [29:29] -unusedBit_9_30 = bits, U32, 844, [30:30] -unusedBit_9_31 = bits, U32, 844, [31:31] -latest_usage_ac_control = scalar, S32, 848, "", 1, 0 -acSwitchLastChangeTimeMs = scalar, S32, 852, "", 1, 0 +sdTcharge_coff = scalar, F32, 816, "", 1, 0 +sdAirMassInOneCylinder = scalar, F32, 820, "", 1, 0 +sdIsTChargeAirModel = bits, U32, 824, [0:0] +unusedBit_7_1 = bits, U32, 824, [1:1] +unusedBit_7_2 = bits, U32, 824, [2:2] +unusedBit_7_3 = bits, U32, 824, [3:3] +unusedBit_7_4 = bits, U32, 824, [4:4] +unusedBit_7_5 = bits, U32, 824, [5:5] +unusedBit_7_6 = bits, U32, 824, [6:6] +unusedBit_7_7 = bits, U32, 824, [7:7] +unusedBit_7_8 = bits, U32, 824, [8:8] +unusedBit_7_9 = bits, U32, 824, [9:9] +unusedBit_7_10 = bits, U32, 824, [10:10] +unusedBit_7_11 = bits, U32, 824, [11:11] +unusedBit_7_12 = bits, U32, 824, [12:12] +unusedBit_7_13 = bits, U32, 824, [13:13] +unusedBit_7_14 = bits, U32, 824, [14:14] +unusedBit_7_15 = bits, U32, 824, [15:15] +unusedBit_7_16 = bits, U32, 824, [16:16] +unusedBit_7_17 = bits, U32, 824, [17:17] +unusedBit_7_18 = bits, U32, 824, [18:18] +unusedBit_7_19 = bits, U32, 824, [19:19] +unusedBit_7_20 = bits, U32, 824, [20:20] +unusedBit_7_21 = bits, U32, 824, [21:21] +unusedBit_7_22 = bits, U32, 824, [22:22] +unusedBit_7_23 = bits, U32, 824, [23:23] +unusedBit_7_24 = bits, U32, 824, [24:24] +unusedBit_7_25 = bits, U32, 824, [25:25] +unusedBit_7_26 = bits, U32, 824, [26:26] +unusedBit_7_27 = bits, U32, 824, [27:27] +unusedBit_7_28 = bits, U32, 824, [28:28] +unusedBit_7_29 = bits, U32, 824, [29:29] +unusedBit_7_30 = bits, U32, 824, [30:30] +unusedBit_7_31 = bits, U32, 824, [31:31] +; total TS size = 828 +retardThresholdRpm = scalar, S32, 828, "", 1, 0 +combinedConditions = bits, U32, 832, [0:0] +launchActivatePinState = bits, U32, 832, [1:1] +isLaunchCondition = bits, U32, 832, [2:2] +isSwitchActivated = bits, U32, 832, [3:3] +isClutchActivated = bits, U32, 832, [4:4] +isValidInputPin = bits, U32, 832, [5:5] +activateSwitchCondition = bits, U32, 832, [6:6] +rpmCondition = bits, U32, 832, [7:7] +speedCondition = bits, U32, 832, [8:8] +tpsCondition = bits, U32, 832, [9:9] +unusedBit_11_10 = bits, U32, 832, [10:10] +unusedBit_11_11 = bits, U32, 832, [11:11] +unusedBit_11_12 = bits, U32, 832, [12:12] +unusedBit_11_13 = bits, U32, 832, [13:13] +unusedBit_11_14 = bits, U32, 832, [14:14] +unusedBit_11_15 = bits, U32, 832, [15:15] +unusedBit_11_16 = bits, U32, 832, [16:16] +unusedBit_11_17 = bits, U32, 832, [17:17] +unusedBit_11_18 = bits, U32, 832, [18:18] +unusedBit_11_19 = bits, U32, 832, [19:19] +unusedBit_11_20 = bits, U32, 832, [20:20] +unusedBit_11_21 = bits, U32, 832, [21:21] +unusedBit_11_22 = bits, U32, 832, [22:22] +unusedBit_11_23 = bits, U32, 832, [23:23] +unusedBit_11_24 = bits, U32, 832, [24:24] +unusedBit_11_25 = bits, U32, 832, [25:25] +unusedBit_11_26 = bits, U32, 832, [26:26] +unusedBit_11_27 = bits, U32, 832, [27:27] +unusedBit_11_28 = bits, U32, 832, [28:28] +unusedBit_11_29 = bits, U32, 832, [29:29] +unusedBit_11_30 = bits, U32, 832, [30:30] +unusedBit_11_31 = bits, U32, 832, [31:31] +; total TS size = 836 +isTpsInvalid = bits, U32, 836, [0:0] +m_shouldResetPid = bits, U32, 836, [1:1] +isBelowClosedLoopThreshold = bits, U32, 836, [2:2] +isNotClosedLoop = bits, U32, 836, [3:3] +isZeroRpm = bits, U32, 836, [4:4] +unusedBit_5_5 = bits, U32, 836, [5:5] +unusedBit_5_6 = bits, U32, 836, [6:6] +unusedBit_5_7 = bits, U32, 836, [7:7] +unusedBit_5_8 = bits, U32, 836, [8:8] +unusedBit_5_9 = bits, U32, 836, [9:9] +unusedBit_5_10 = bits, U32, 836, [10:10] +unusedBit_5_11 = bits, U32, 836, [11:11] +unusedBit_5_12 = bits, U32, 836, [12:12] +unusedBit_5_13 = bits, U32, 836, [13:13] +unusedBit_5_14 = bits, U32, 836, [14:14] +unusedBit_5_15 = bits, U32, 836, [15:15] +unusedBit_5_16 = bits, U32, 836, [16:16] +unusedBit_5_17 = bits, U32, 836, [17:17] +unusedBit_5_18 = bits, U32, 836, [18:18] +unusedBit_5_19 = bits, U32, 836, [19:19] +unusedBit_5_20 = bits, U32, 836, [20:20] +unusedBit_5_21 = bits, U32, 836, [21:21] +unusedBit_5_22 = bits, U32, 836, [22:22] +unusedBit_5_23 = bits, U32, 836, [23:23] +unusedBit_5_24 = bits, U32, 836, [24:24] +unusedBit_5_25 = bits, U32, 836, [25:25] +unusedBit_5_26 = bits, U32, 836, [26:26] +unusedBit_5_27 = bits, U32, 836, [27:27] +unusedBit_5_28 = bits, U32, 836, [28:28] +unusedBit_5_29 = bits, U32, 836, [29:29] +unusedBit_5_30 = bits, U32, 836, [30:30] +unusedBit_5_31 = bits, U32, 836, [31:31] +luaTargetAdd = scalar, F32, 840, "", 1, 0 +luaTargetMult = scalar, F32, 844, "", 1, 0 +openLoopPart = scalar, F32, 848, "", 1, 0 +boostControllerClosedLoopPart = scalar, S08, 852, "%", 0.5, 0 +boostControlTarget = scalar, S16, 854, "kPa", 0.03333333333333333, 0 ; total TS size = 856 -cranking = bits, U32, 856, [0:0] -notRunning = bits, U32, 856, [1:1] -disabledWhileEngineStopped = bits, U32, 856, [2:2] -brokenClt = bits, U32, 856, [3:3] -enabledForAc = bits, U32, 856, [4:4] -hot = bits, U32, 856, [5:5] -cold = bits, U32, 856, [6:6] -unusedBit_7_7 = bits, U32, 856, [7:7] -unusedBit_7_8 = bits, U32, 856, [8:8] -unusedBit_7_9 = bits, U32, 856, [9:9] -unusedBit_7_10 = bits, U32, 856, [10:10] -unusedBit_7_11 = bits, U32, 856, [11:11] -unusedBit_7_12 = bits, U32, 856, [12:12] -unusedBit_7_13 = bits, U32, 856, [13:13] -unusedBit_7_14 = bits, U32, 856, [14:14] -unusedBit_7_15 = bits, U32, 856, [15:15] -unusedBit_7_16 = bits, U32, 856, [16:16] -unusedBit_7_17 = bits, U32, 856, [17:17] -unusedBit_7_18 = bits, U32, 856, [18:18] -unusedBit_7_19 = bits, U32, 856, [19:19] -unusedBit_7_20 = bits, U32, 856, [20:20] -unusedBit_7_21 = bits, U32, 856, [21:21] -unusedBit_7_22 = bits, U32, 856, [22:22] -unusedBit_7_23 = bits, U32, 856, [23:23] -unusedBit_7_24 = bits, U32, 856, [24:24] -unusedBit_7_25 = bits, U32, 856, [25:25] -unusedBit_7_26 = bits, U32, 856, [26:26] -unusedBit_7_27 = bits, U32, 856, [27:27] -unusedBit_7_28 = bits, U32, 856, [28:28] -unusedBit_7_29 = bits, U32, 856, [29:29] -unusedBit_7_30 = bits, U32, 856, [30:30] -unusedBit_7_31 = bits, U32, 856, [31:31] -; total TS size = 860 -isPrime = bits, U32, 860, [0:0] -engineTurnedRecently = bits, U32, 860, [1:1] -isFuelPumpOn = bits, U32, 860, [2:2] -ignitionOn = bits, U32, 860, [3:3] -unusedBit_4_4 = bits, U32, 860, [4:4] -unusedBit_4_5 = bits, U32, 860, [5:5] -unusedBit_4_6 = bits, U32, 860, [6:6] -unusedBit_4_7 = bits, U32, 860, [7:7] -unusedBit_4_8 = bits, U32, 860, [8:8] -unusedBit_4_9 = bits, U32, 860, [9:9] -unusedBit_4_10 = bits, U32, 860, [10:10] -unusedBit_4_11 = bits, U32, 860, [11:11] -unusedBit_4_12 = bits, U32, 860, [12:12] -unusedBit_4_13 = bits, U32, 860, [13:13] -unusedBit_4_14 = bits, U32, 860, [14:14] -unusedBit_4_15 = bits, U32, 860, [15:15] -unusedBit_4_16 = bits, U32, 860, [16:16] -unusedBit_4_17 = bits, U32, 860, [17:17] -unusedBit_4_18 = bits, U32, 860, [18:18] -unusedBit_4_19 = bits, U32, 860, [19:19] -unusedBit_4_20 = bits, U32, 860, [20:20] -unusedBit_4_21 = bits, U32, 860, [21:21] -unusedBit_4_22 = bits, U32, 860, [22:22] -unusedBit_4_23 = bits, U32, 860, [23:23] -unusedBit_4_24 = bits, U32, 860, [24:24] -unusedBit_4_25 = bits, U32, 860, [25:25] -unusedBit_4_26 = bits, U32, 860, [26:26] -unusedBit_4_27 = bits, U32, 860, [27:27] -unusedBit_4_28 = bits, U32, 860, [28:28] -unusedBit_4_29 = bits, U32, 860, [29:29] -unusedBit_4_30 = bits, U32, 860, [30:30] -unusedBit_4_31 = bits, U32, 860, [31:31] -; total TS size = 864 -isBenchTest = bits, U32, 864, [0:0] -hasIgnitionVoltage = bits, U32, 864, [1:1] -mainRelayState = bits, U32, 864, [2:2] -delayedShutoffRequested = bits, U32, 864, [3:3] -unusedBit_4_4 = bits, U32, 864, [4:4] -unusedBit_4_5 = bits, U32, 864, [5:5] -unusedBit_4_6 = bits, U32, 864, [6:6] -unusedBit_4_7 = bits, U32, 864, [7:7] -unusedBit_4_8 = bits, U32, 864, [8:8] -unusedBit_4_9 = bits, U32, 864, [9:9] -unusedBit_4_10 = bits, U32, 864, [10:10] -unusedBit_4_11 = bits, U32, 864, [11:11] -unusedBit_4_12 = bits, U32, 864, [12:12] -unusedBit_4_13 = bits, U32, 864, [13:13] -unusedBit_4_14 = bits, U32, 864, [14:14] -unusedBit_4_15 = bits, U32, 864, [15:15] -unusedBit_4_16 = bits, U32, 864, [16:16] -unusedBit_4_17 = bits, U32, 864, [17:17] -unusedBit_4_18 = bits, U32, 864, [18:18] -unusedBit_4_19 = bits, U32, 864, [19:19] -unusedBit_4_20 = bits, U32, 864, [20:20] -unusedBit_4_21 = bits, U32, 864, [21:21] -unusedBit_4_22 = bits, U32, 864, [22:22] -unusedBit_4_23 = bits, U32, 864, [23:23] -unusedBit_4_24 = bits, U32, 864, [24:24] -unusedBit_4_25 = bits, U32, 864, [25:25] -unusedBit_4_26 = bits, U32, 864, [26:26] -unusedBit_4_27 = bits, U32, 864, [27:27] -unusedBit_4_28 = bits, U32, 864, [28:28] -unusedBit_4_29 = bits, U32, 864, [29:29] -unusedBit_4_30 = bits, U32, 864, [30:30] -unusedBit_4_31 = bits, U32, 864, [31:31] +acButtonState = bits, U32, 856, [0:0] +m_acEnabled = bits, U32, 856, [1:1] +engineTooSlow = bits, U32, 856, [2:2] +engineTooFast = bits, U32, 856, [3:3] +noClt = bits, U32, 856, [4:4] +engineTooHot = bits, U32, 856, [5:5] +tpsTooHigh = bits, U32, 856, [6:6] +isDisabledByLua = bits, U32, 856, [7:7] +acCompressorState = bits, U32, 856, [8:8] +unusedBit_9_9 = bits, U32, 856, [9:9] +unusedBit_9_10 = bits, U32, 856, [10:10] +unusedBit_9_11 = bits, U32, 856, [11:11] +unusedBit_9_12 = bits, U32, 856, [12:12] +unusedBit_9_13 = bits, U32, 856, [13:13] +unusedBit_9_14 = bits, U32, 856, [14:14] +unusedBit_9_15 = bits, U32, 856, [15:15] +unusedBit_9_16 = bits, U32, 856, [16:16] +unusedBit_9_17 = bits, U32, 856, [17:17] +unusedBit_9_18 = bits, U32, 856, [18:18] +unusedBit_9_19 = bits, U32, 856, [19:19] +unusedBit_9_20 = bits, U32, 856, [20:20] +unusedBit_9_21 = bits, U32, 856, [21:21] +unusedBit_9_22 = bits, U32, 856, [22:22] +unusedBit_9_23 = bits, U32, 856, [23:23] +unusedBit_9_24 = bits, U32, 856, [24:24] +unusedBit_9_25 = bits, U32, 856, [25:25] +unusedBit_9_26 = bits, U32, 856, [26:26] +unusedBit_9_27 = bits, U32, 856, [27:27] +unusedBit_9_28 = bits, U32, 856, [28:28] +unusedBit_9_29 = bits, U32, 856, [29:29] +unusedBit_9_30 = bits, U32, 856, [30:30] +unusedBit_9_31 = bits, U32, 856, [31:31] +latest_usage_ac_control = scalar, S32, 860, "", 1, 0 +acSwitchLastChangeTimeMs = scalar, S32, 864, "", 1, 0 ; total TS size = 868 -lua_fuelAdd = scalar, F32, 868, "", 1, 0 -lua_fuelMult = scalar, F32, 872, "", 1, 0 -lua_clutchUpState = bits, U32, 876, [0:0] -lua_brakePedalState = bits, U32, 876, [1:1] -lua_acRequestState = bits, U32, 876, [2:2] -lua_unusedBit_5_3 = bits, U32, 876, [3:3] -lua_unusedBit_5_4 = bits, U32, 876, [4:4] -lua_unusedBit_5_5 = bits, U32, 876, [5:5] -lua_unusedBit_5_6 = bits, U32, 876, [6:6] -lua_unusedBit_5_7 = bits, U32, 876, [7:7] -lua_unusedBit_5_8 = bits, U32, 876, [8:8] -lua_unusedBit_5_9 = bits, U32, 876, [9:9] -lua_unusedBit_5_10 = bits, U32, 876, [10:10] -lua_unusedBit_5_11 = bits, U32, 876, [11:11] -lua_unusedBit_5_12 = bits, U32, 876, [12:12] -lua_unusedBit_5_13 = bits, U32, 876, [13:13] -lua_unusedBit_5_14 = bits, U32, 876, [14:14] -lua_unusedBit_5_15 = bits, U32, 876, [15:15] -lua_unusedBit_5_16 = bits, U32, 876, [16:16] -lua_unusedBit_5_17 = bits, U32, 876, [17:17] -lua_unusedBit_5_18 = bits, U32, 876, [18:18] -lua_unusedBit_5_19 = bits, U32, 876, [19:19] -lua_unusedBit_5_20 = bits, U32, 876, [20:20] -lua_unusedBit_5_21 = bits, U32, 876, [21:21] -lua_unusedBit_5_22 = bits, U32, 876, [22:22] -lua_unusedBit_5_23 = bits, U32, 876, [23:23] -lua_unusedBit_5_24 = bits, U32, 876, [24:24] -lua_unusedBit_5_25 = bits, U32, 876, [25:25] -lua_unusedBit_5_26 = bits, U32, 876, [26:26] -lua_unusedBit_5_27 = bits, U32, 876, [27:27] -lua_unusedBit_5_28 = bits, U32, 876, [28:28] -lua_unusedBit_5_29 = bits, U32, 876, [29:29] -lua_unusedBit_5_30 = bits, U32, 876, [30:30] -lua_unusedBit_5_31 = bits, U32, 876, [31:31] -sd_isTChargeAirModel = bits, U32, 880, [0:0] -sd_unusedBit_1_1 = bits, U32, 880, [1:1] -sd_unusedBit_1_2 = bits, U32, 880, [2:2] -sd_unusedBit_1_3 = bits, U32, 880, [3:3] -sd_unusedBit_1_4 = bits, U32, 880, [4:4] -sd_unusedBit_1_5 = bits, U32, 880, [5:5] -sd_unusedBit_1_6 = bits, U32, 880, [6:6] -sd_unusedBit_1_7 = bits, U32, 880, [7:7] -sd_unusedBit_1_8 = bits, U32, 880, [8:8] -sd_unusedBit_1_9 = bits, U32, 880, [9:9] -sd_unusedBit_1_10 = bits, U32, 880, [10:10] -sd_unusedBit_1_11 = bits, U32, 880, [11:11] -sd_unusedBit_1_12 = bits, U32, 880, [12:12] -sd_unusedBit_1_13 = bits, U32, 880, [13:13] -sd_unusedBit_1_14 = bits, U32, 880, [14:14] -sd_unusedBit_1_15 = bits, U32, 880, [15:15] -sd_unusedBit_1_16 = bits, U32, 880, [16:16] -sd_unusedBit_1_17 = bits, U32, 880, [17:17] -sd_unusedBit_1_18 = bits, U32, 880, [18:18] -sd_unusedBit_1_19 = bits, U32, 880, [19:19] -sd_unusedBit_1_20 = bits, U32, 880, [20:20] -sd_unusedBit_1_21 = bits, U32, 880, [21:21] -sd_unusedBit_1_22 = bits, U32, 880, [22:22] -sd_unusedBit_1_23 = bits, U32, 880, [23:23] -sd_unusedBit_1_24 = bits, U32, 880, [24:24] -sd_unusedBit_1_25 = bits, U32, 880, [25:25] -sd_unusedBit_1_26 = bits, U32, 880, [26:26] -sd_unusedBit_1_27 = bits, U32, 880, [27:27] -sd_unusedBit_1_28 = bits, U32, 880, [28:28] -sd_unusedBit_1_29 = bits, U32, 880, [29:29] -sd_unusedBit_1_30 = bits, U32, 880, [30:30] -sd_unusedBit_1_31 = bits, U32, 880, [31:31] -sd_airMassInOneCylinder = scalar, F32, 884, "", 1, 0 -sd_tCharge = scalar, F32, 888, "", 1, 0 -sd_tChargeK = scalar, F32, 892, "", 1, 0 -sd_Tcharge_coff = scalar, F32, 896, "", 1, 0 +cranking = bits, U32, 868, [0:0] +notRunning = bits, U32, 868, [1:1] +disabledWhileEngineStopped = bits, U32, 868, [2:2] +brokenClt = bits, U32, 868, [3:3] +enabledForAc = bits, U32, 868, [4:4] +hot = bits, U32, 868, [5:5] +cold = bits, U32, 868, [6:6] +unusedBit_7_7 = bits, U32, 868, [7:7] +unusedBit_7_8 = bits, U32, 868, [8:8] +unusedBit_7_9 = bits, U32, 868, [9:9] +unusedBit_7_10 = bits, U32, 868, [10:10] +unusedBit_7_11 = bits, U32, 868, [11:11] +unusedBit_7_12 = bits, U32, 868, [12:12] +unusedBit_7_13 = bits, U32, 868, [13:13] +unusedBit_7_14 = bits, U32, 868, [14:14] +unusedBit_7_15 = bits, U32, 868, [15:15] +unusedBit_7_16 = bits, U32, 868, [16:16] +unusedBit_7_17 = bits, U32, 868, [17:17] +unusedBit_7_18 = bits, U32, 868, [18:18] +unusedBit_7_19 = bits, U32, 868, [19:19] +unusedBit_7_20 = bits, U32, 868, [20:20] +unusedBit_7_21 = bits, U32, 868, [21:21] +unusedBit_7_22 = bits, U32, 868, [22:22] +unusedBit_7_23 = bits, U32, 868, [23:23] +unusedBit_7_24 = bits, U32, 868, [24:24] +unusedBit_7_25 = bits, U32, 868, [25:25] +unusedBit_7_26 = bits, U32, 868, [26:26] +unusedBit_7_27 = bits, U32, 868, [27:27] +unusedBit_7_28 = bits, U32, 868, [28:28] +unusedBit_7_29 = bits, U32, 868, [29:29] +unusedBit_7_30 = bits, U32, 868, [30:30] +unusedBit_7_31 = bits, U32, 868, [31:31] +; total TS size = 872 +isPrime = bits, U32, 872, [0:0] +engineTurnedRecently = bits, U32, 872, [1:1] +isFuelPumpOn = bits, U32, 872, [2:2] +ignitionOn = bits, U32, 872, [3:3] +unusedBit_4_4 = bits, U32, 872, [4:4] +unusedBit_4_5 = bits, U32, 872, [5:5] +unusedBit_4_6 = bits, U32, 872, [6:6] +unusedBit_4_7 = bits, U32, 872, [7:7] +unusedBit_4_8 = bits, U32, 872, [8:8] +unusedBit_4_9 = bits, U32, 872, [9:9] +unusedBit_4_10 = bits, U32, 872, [10:10] +unusedBit_4_11 = bits, U32, 872, [11:11] +unusedBit_4_12 = bits, U32, 872, [12:12] +unusedBit_4_13 = bits, U32, 872, [13:13] +unusedBit_4_14 = bits, U32, 872, [14:14] +unusedBit_4_15 = bits, U32, 872, [15:15] +unusedBit_4_16 = bits, U32, 872, [16:16] +unusedBit_4_17 = bits, U32, 872, [17:17] +unusedBit_4_18 = bits, U32, 872, [18:18] +unusedBit_4_19 = bits, U32, 872, [19:19] +unusedBit_4_20 = bits, U32, 872, [20:20] +unusedBit_4_21 = bits, U32, 872, [21:21] +unusedBit_4_22 = bits, U32, 872, [22:22] +unusedBit_4_23 = bits, U32, 872, [23:23] +unusedBit_4_24 = bits, U32, 872, [24:24] +unusedBit_4_25 = bits, U32, 872, [25:25] +unusedBit_4_26 = bits, U32, 872, [26:26] +unusedBit_4_27 = bits, U32, 872, [27:27] +unusedBit_4_28 = bits, U32, 872, [28:28] +unusedBit_4_29 = bits, U32, 872, [29:29] +unusedBit_4_30 = bits, U32, 872, [30:30] +unusedBit_4_31 = bits, U32, 872, [31:31] +; total TS size = 876 +isBenchTest = bits, U32, 876, [0:0] +hasIgnitionVoltage = bits, U32, 876, [1:1] +mainRelayState = bits, U32, 876, [2:2] +delayedShutoffRequested = bits, U32, 876, [3:3] +unusedBit_4_4 = bits, U32, 876, [4:4] +unusedBit_4_5 = bits, U32, 876, [5:5] +unusedBit_4_6 = bits, U32, 876, [6:6] +unusedBit_4_7 = bits, U32, 876, [7:7] +unusedBit_4_8 = bits, U32, 876, [8:8] +unusedBit_4_9 = bits, U32, 876, [9:9] +unusedBit_4_10 = bits, U32, 876, [10:10] +unusedBit_4_11 = bits, U32, 876, [11:11] +unusedBit_4_12 = bits, U32, 876, [12:12] +unusedBit_4_13 = bits, U32, 876, [13:13] +unusedBit_4_14 = bits, U32, 876, [14:14] +unusedBit_4_15 = bits, U32, 876, [15:15] +unusedBit_4_16 = bits, U32, 876, [16:16] +unusedBit_4_17 = bits, U32, 876, [17:17] +unusedBit_4_18 = bits, U32, 876, [18:18] +unusedBit_4_19 = bits, U32, 876, [19:19] +unusedBit_4_20 = bits, U32, 876, [20:20] +unusedBit_4_21 = bits, U32, 876, [21:21] +unusedBit_4_22 = bits, U32, 876, [22:22] +unusedBit_4_23 = bits, U32, 876, [23:23] +unusedBit_4_24 = bits, U32, 876, [24:24] +unusedBit_4_25 = bits, U32, 876, [25:25] +unusedBit_4_26 = bits, U32, 876, [26:26] +unusedBit_4_27 = bits, U32, 876, [27:27] +unusedBit_4_28 = bits, U32, 876, [28:28] +unusedBit_4_29 = bits, U32, 876, [29:29] +unusedBit_4_30 = bits, U32, 876, [30:30] +unusedBit_4_31 = bits, U32, 876, [31:31] +; total TS size = 880 +lua_fuelAdd = scalar, F32, 880, "", 1, 0 +lua_fuelMult = scalar, F32, 884, "", 1, 0 +lua_clutchUpState = bits, U32, 888, [0:0] +lua_brakePedalState = bits, U32, 888, [1:1] +lua_acRequestState = bits, U32, 888, [2:2] +lua_unusedBit_5_3 = bits, U32, 888, [3:3] +lua_unusedBit_5_4 = bits, U32, 888, [4:4] +lua_unusedBit_5_5 = bits, U32, 888, [5:5] +lua_unusedBit_5_6 = bits, U32, 888, [6:6] +lua_unusedBit_5_7 = bits, U32, 888, [7:7] +lua_unusedBit_5_8 = bits, U32, 888, [8:8] +lua_unusedBit_5_9 = bits, U32, 888, [9:9] +lua_unusedBit_5_10 = bits, U32, 888, [10:10] +lua_unusedBit_5_11 = bits, U32, 888, [11:11] +lua_unusedBit_5_12 = bits, U32, 888, [12:12] +lua_unusedBit_5_13 = bits, U32, 888, [13:13] +lua_unusedBit_5_14 = bits, U32, 888, [14:14] +lua_unusedBit_5_15 = bits, U32, 888, [15:15] +lua_unusedBit_5_16 = bits, U32, 888, [16:16] +lua_unusedBit_5_17 = bits, U32, 888, [17:17] +lua_unusedBit_5_18 = bits, U32, 888, [18:18] +lua_unusedBit_5_19 = bits, U32, 888, [19:19] +lua_unusedBit_5_20 = bits, U32, 888, [20:20] +lua_unusedBit_5_21 = bits, U32, 888, [21:21] +lua_unusedBit_5_22 = bits, U32, 888, [22:22] +lua_unusedBit_5_23 = bits, U32, 888, [23:23] +lua_unusedBit_5_24 = bits, U32, 888, [24:24] +lua_unusedBit_5_25 = bits, U32, 888, [25:25] +lua_unusedBit_5_26 = bits, U32, 888, [26:26] +lua_unusedBit_5_27 = bits, U32, 888, [27:27] +lua_unusedBit_5_28 = bits, U32, 888, [28:28] +lua_unusedBit_5_29 = bits, U32, 888, [29:29] +lua_unusedBit_5_30 = bits, U32, 888, [30:30] +lua_unusedBit_5_31 = bits, U32, 888, [31:31] +sd_tCharge = scalar, F32, 892, "", 1, 0 +sd_tChargeK = scalar, F32, 896, "", 1, 0 sd_airFlow = scalar, F32, 900, "", 1, 0 engineCycleDurationMs = scalar, F32, 904, "", 1, 0 minRpmKcurrentTPS = scalar, F32, 908, "", 1, 0 diff --git a/firmware/console/binary/generated/sensors.java b/firmware/console/binary/generated/sensors.java index a538df1c57..a253d7ec31 100644 --- a/firmware/console/binary/generated/sensors.java +++ b/firmware/console/binary/generated/sensors.java @@ -399,17 +399,19 @@ currentAfrLoad("currentAfrLoad", SensorCategory.SENSOR_INPUTS, FieldType.INT, 80 targetLambda("targetLambda", SensorCategory.SENSOR_INPUTS, FieldType.INT, 804, 1.0, -1.0, -1.0, ""), stoichiometricRatio("stoichiometricRatio", SensorCategory.SENSOR_INPUTS, FieldType.INT, 808, 1.0, -1.0, -1.0, ""), targetAFR("targetAFR", SensorCategory.SENSOR_INPUTS, FieldType.INT, 812, 1.0, -1.0, -1.0, ""), -retardThresholdRpm("retardThresholdRpm", SensorCategory.SENSOR_INPUTS, FieldType.INT, 816, 1.0, -1.0, -1.0, ""), -luaTargetAdd("luaTargetAdd", SensorCategory.SENSOR_INPUTS, FieldType.INT, 828, 1.0, -1.0, -1.0, ""), -luaTargetMult("luaTargetMult", SensorCategory.SENSOR_INPUTS, FieldType.INT, 832, 1.0, -1.0, -1.0, ""), -openLoopPart("openLoopPart", SensorCategory.SENSOR_INPUTS, FieldType.INT, 836, 1.0, -1.0, -1.0, ""), -boostControllerClosedLoopPart("Boost Closed Loop", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 840, 0.5, -50.0, 50.0, "%"), -alignmentFill_at_17("need 4 byte alignment", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 841, 1.0, -20.0, 100.0, "units"), -boostControlTarget("Boost Target", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 842, 0.03333333333333333, 0.0, 0.0, "kPa"), -latest_usage_ac_control("AC latest activity", SensorCategory.SENSOR_INPUTS, FieldType.INT, 848, 1.0, -1.0, -1.0, ""), -acSwitchLastChangeTimeMs("acSwitchLastChangeTimeMs", SensorCategory.SENSOR_INPUTS, FieldType.INT, 852, 1.0, -1.0, -1.0, ""), -lua("lua", SensorCategory.SENSOR_INPUTS, FieldType.INT, 868, 1.0, -1.0, -1.0, ""), -sd("sd", SensorCategory.SENSOR_INPUTS, FieldType.INT, 880, 1.0, -1.0, -1.0, ""), +sdTcharge_coff("sdTcharge_coff", SensorCategory.SENSOR_INPUTS, FieldType.INT, 816, 1.0, -1.0, -1.0, ""), +sdAirMassInOneCylinder("Speed-density logic: calculated air mass in one cylinder, in grams", SensorCategory.SENSOR_INPUTS, FieldType.INT, 820, 1.0, -1.0, -1.0, ""), +retardThresholdRpm("retardThresholdRpm", SensorCategory.SENSOR_INPUTS, FieldType.INT, 828, 1.0, -1.0, -1.0, ""), +luaTargetAdd("luaTargetAdd", SensorCategory.SENSOR_INPUTS, FieldType.INT, 840, 1.0, -1.0, -1.0, ""), +luaTargetMult("luaTargetMult", SensorCategory.SENSOR_INPUTS, FieldType.INT, 844, 1.0, -1.0, -1.0, ""), +openLoopPart("openLoopPart", SensorCategory.SENSOR_INPUTS, FieldType.INT, 848, 1.0, -1.0, -1.0, ""), +boostControllerClosedLoopPart("Boost Closed Loop", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 852, 0.5, -50.0, 50.0, "%"), +alignmentFill_at_17("need 4 byte alignment", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 853, 1.0, -20.0, 100.0, "units"), +boostControlTarget("Boost Target", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 854, 0.03333333333333333, 0.0, 0.0, "kPa"), +latest_usage_ac_control("AC latest activity", SensorCategory.SENSOR_INPUTS, FieldType.INT, 860, 1.0, -1.0, -1.0, ""), +acSwitchLastChangeTimeMs("acSwitchLastChangeTimeMs", SensorCategory.SENSOR_INPUTS, FieldType.INT, 864, 1.0, -1.0, -1.0, ""), +lua("lua", SensorCategory.SENSOR_INPUTS, FieldType.INT, 880, 1.0, -1.0, -1.0, ""), +sd("sd", SensorCategory.SENSOR_INPUTS, FieldType.INT, 892, 1.0, -1.0, -1.0, ""), engineCycleDurationMs("engineCycleDurationMs", SensorCategory.SENSOR_INPUTS, FieldType.INT, 904, 1.0, -1.0, -1.0, ""), minRpmKcurrentTPS("minRpmKcurrentTPS", SensorCategory.SENSOR_INPUTS, FieldType.INT, 908, 1.0, -1.0, -1.0, ""), currentTpsAdc("currentTpsAdc", SensorCategory.SENSOR_INPUTS, FieldType.INT, 912, 1.0, -1.0, -1.0, ""), @@ -429,7 +431,7 @@ hellenBoardId("Detected Board ID", SensorCategory.SENSOR_INPUTS, FieldType.INT16 egt1("egt1", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1000, 1.0, -1.0, -1.0, ""), egt2("egt2", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1004, 1.0, -1.0, -1.0, ""), desiredRpmLimit("User-defined RPM hard limit", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 1008, 1.0, 0.0, 30000.0, "rpm"), -alignmentFill_at_142("need 4 byte alignment", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1010, 1.0, -20.0, 100.0, "units"), +alignmentFill_at_130("need 4 byte alignment", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1010, 1.0, -20.0, 100.0, "units"), fuelInjectionCounter("fuelInjectionCounter", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1012, 1.0, -1.0, -1.0, ""), sparkCounter("sparkCounter", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1016, 1.0, -1.0, -1.0, ""), tpsFrom("tpsFrom", SensorCategory.SENSOR_INPUTS, FieldType.INT, 1020, 1.0, -1.0, -1.0, ""), diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 4608254f74..fb1feb97a6 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -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; diff --git a/firmware/controllers/algo/engine2.cpp b/firmware/controllers/algo/engine2.cpp index 3176907ca2..e0bdcd06ce 100644 --- a/firmware/controllers/algo/engine2.cpp +++ b/firmware/controllers/algo/engine2.cpp @@ -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; diff --git a/firmware/controllers/algo/engine_state.txt b/firmware/controllers/algo/engine_state.txt index fadfe32a67..5fe4e14aee 100644 --- a/firmware/controllers/algo/engine_state.txt +++ b/firmware/controllers/algo/engine_state.txt @@ -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 diff --git a/firmware/controllers/algo/engine_state_generated.h b/firmware/controllers/algo/engine_state_generated.h index cb79d5e01c..af40b6c277 100644 --- a/firmware/controllers/algo/engine_state_generated.h +++ b/firmware/controllers/algo/engine_state_generated.h @@ -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 cltTimingCorrection = (int16_t)0; /** deg - * offset 122 + * offset 110 */ scaled_channel timingIatCorrection = (int16_t)0; /** deg - * offset 124 + * offset 112 */ scaled_channel 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 diff --git a/firmware/controllers/algo/fuel/fuel_computer.cpp b/firmware/controllers/algo/fuel/fuel_computer.cpp index c5e11a5420..a3cc72505c 100644 --- a/firmware/controllers/algo/fuel/fuel_computer.cpp +++ b/firmware/controllers/algo/fuel/fuel_computer.cpp @@ -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; } } diff --git a/firmware/controllers/algo/fuel/fuel_computer.h b/firmware/controllers/algo/fuel/fuel_computer.h index fcc7e6a56b..70978df69e 100644 --- a/firmware/controllers/algo/fuel/fuel_computer.h +++ b/firmware/controllers/algo/fuel/fuel_computer.h @@ -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 diff --git a/firmware/controllers/algo/fuel/fuel_computer.txt b/firmware/controllers/algo/fuel/fuel_computer.txt index 67645986de..846f27a2b2 100644 --- a/firmware/controllers/algo/fuel/fuel_computer.txt +++ b/firmware/controllers/algo/fuel/fuel_computer.txt @@ -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 \ No newline at end of file diff --git a/firmware/controllers/algo/fuel/fuel_computer_generated.h b/firmware/controllers/algo/fuel/fuel_computer_generated.h index a8b3ef08a4..e5589177aa 100644 --- a/firmware/controllers/algo/fuel/fuel_computer_generated.h +++ b/firmware/controllers/algo/fuel/fuel_computer_generated.h @@ -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 diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 4afd12db82..04dd81857e 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -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); diff --git a/firmware/controllers/can/can_verbose.cpp b/firmware/controllers/can/can_verbose.cpp index 6565b9a565..04418bccb1 100644 --- a/firmware/controllers/can/can_verbose.cpp +++ b/firmware/controllers/can/can_verbose.cpp @@ -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()->getKnockCount(); diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index 6065f2e94d..8069bdbe0c 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -7,9 +7,16 @@ * @author Andrey Belomutskiy, (c) 2012-2020 */ -#include "pch.h" +#include +#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 diff --git a/firmware/controllers/math/speed_density.h b/firmware/controllers/math/speed_density.h index 94fc9661a6..b3e4072524 100644 --- a/firmware/controllers/math/speed_density.h +++ b/firmware/controllers/math/speed_density.h @@ -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(); diff --git a/firmware/controllers/tc_4l6x.cpp b/firmware/controllers/tc_4l6x.cpp index a47f9b125a..b14003827b 100644 --- a/firmware/controllers/tc_4l6x.cpp +++ b/firmware/controllers/tc_4l6x.cpp @@ -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); } diff --git a/java_console/models/src/main/java/com/rusefi/config/generated/EngineState.java b/java_console/models/src/main/java/com/rusefi/config/generated/EngineState.java index 58b3af3779..4f53b250e3 100644 --- a/java_console/models/src/main/java/com/rusefi/config/generated/EngineState.java +++ b/java_console/models/src/main/java/com/rusefi/config/generated/EngineState.java @@ -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, }; diff --git a/java_console/models/src/main/java/com/rusefi/config/generated/FuelComputer.java b/java_console/models/src/main/java/com/rusefi/config/generated/FuelComputer.java index ec1de8b29c..41c89053b6 100644 --- a/java_console/models/src/main/java/com/rusefi/config/generated/FuelComputer.java +++ b/java_console/models/src/main/java/com/rusefi/config/generated/FuelComputer.java @@ -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, }; } diff --git a/unit_tests/tests/test_engine_math.cpp b/unit_tests/tests/test_engine_math.cpp index 98fd867acd..84825c9a87 100644 --- a/unit_tests/tests/test_engine_math.cpp +++ b/unit_tests/tests/test_engine_math.cpp @@ -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);