rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
engine_configuration_defaults.h
Go to the documentation of this file.
1//
2// Created by kifir on 8/23/24.
3//
4
5#pragma once
6#include <array>
7#include "arrays_util.h"
9
10using torqueReductionCutTable = std::array<std::array<int8_t, TORQUE_TABLE_Y_SIZE>, TORQUE_TABLE_X_SIZE>;
11using torqueReductionTable = std::array<std::array<float, TORQUE_TABLE_Y_SIZE>, TORQUE_TABLE_X_SIZE>;
13
15 /* A/C Settings: */
16 constexpr float AC_DELAY = 0.5f;
17 constexpr uint16_t MIN_AC_PRESSURE = 100;
18 constexpr uint16_t MAX_AC_PRESSURE = 300;
19 constexpr float AC_PRESSURE_ENABLE_HYST = 10.0f;
20
21 /* Shift Torque Reduction (Flat Shift): */
22 constexpr bool ENABLE_SHIFT_TORQUE_REDUCTION = false;
26 constexpr torqueReductionTimeTable TORQUE_REDUCTION_TIME = { { {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f} } };
27 constexpr bool LIMIT_TORQUE_REDUCTION_TIME = false;
28 constexpr float TORQUE_REDUCTION_ARMING_RPM = 0.0f;
29 constexpr float TORQUE_REDUCTION_ARMING_APP = 0.0f;
31 constexpr torqueReductionTable TORQUE_REDUCTION_IGNITION_RETARD = { { {0.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, 0.0f} } };
32
33 /* Other Sensor Inputs: */
37 constexpr pin_input_mode_e CLUTCH_UP_PIN_MODE = PI_PULLUP;
38
39 /* Launch Control: */
42 constexpr launchActivationMode_e LAUNCH_ACTIVATION_MODE = SWITCH_INPUT_LAUNCH;
43 constexpr int LAUNCH_SPEED_THRESHOLD = 0;
44
46
47 /* Injector */
48 constexpr bool INJECTOR_FLOW_AS_MASS_FLOW = false;
49 constexpr float INJECTOR_FLOW = 200.0f;
50
51 // we use `initTableFromAnotherTable` template function to handle cases when `VBAT_INJECTOR_CURVE_SIZE` is not 8 or
52 // `VBAT_INJECTOR_CURVE_PRESSURE_SIZE` is not 2
54 float,
55 8,
56 2,
57 VBAT_INJECTOR_CURVE_SIZE,
58 VBAT_INJECTOR_CURVE_PRESSURE_SIZE
59 >(
60 { {
61#if (VBAT_INJECTOR_CURVE_PRESSURE_SIZE == 2) && (VBAT_INJECTOR_CURVE_SIZE == 8)
62 { 4.240f, 2.483f, 1.739f, 1.501f, 1.308f, 1.149f, 0.964f, 0.913f },
63 { 3.084f, 1.641f, 1.149f, 1.194f, 0.992f, 0.759f, 0.637f, 0.603f },
64#else //(VBAT_INJECTOR_CURVE_PRESSURE_SIZE == 2) && (VBAT_INJECTOR_CURVE_SIZE == 8)
65 { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f },
66 { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f },
67#endif //(VBAT_INJECTOR_CURVE_PRESSURE_SIZE == 2) && (VBAT_INJECTOR_CURVE_SIZE == 8)
68 } },
69 0.0f
70 );
71 constexpr float FUEL_REFERENCE_PRESSURE = 300.0f;
73
74 /* Secondary injector: */
79
80 /* Staged injection: */
81 constexpr bool ENABLE_STAGED_INJECTION = false;
82
83 /* Nitrous control */
84 constexpr bool NITROUS_CONTROL_ENABLED = false;
88 constexpr lua_gauge_e NITROUS_LUA_GAUGE = LUA_GAUGE_1;
89 constexpr lua_gauge_meaning_e NITROUS_LUA_GAUGE_MEANING = LUA_GAUGE_LOWER_BOUND;
90 constexpr float NITROUS_LUA_GAUGE_ARMING_VALUE = 0.0f;
91
92 constexpr uint16_t NITROUS_MINIMUM_VEHICLE_SPEED = 0;
93 constexpr int NITROUS_MINIMUM_TPS = 80;
94 constexpr uint8_t NITROUS_MINIMUM_CLT = 60;
95 constexpr uint16_t NITROUS_MAXIMUM_MAP = 0;
96 constexpr float NITROUS_MAXIMUM_AFR = 14.0f;
97 constexpr uint16_t NITROUS_ACTIVATION_RPM = 4000;
98 constexpr uint16_t NITROUS_DEACTIVATION_RPM = 7000;
99 constexpr uint16_t NITROUS_DEACTIVATION_RPM_WINDOW = 500;
100 constexpr int8_t NITROUS_FUEL_ADDER_PERCENT = 0;
101 constexpr float NITROUS_IGNITION_RETARD = 0.0f;
102
103 constexpr float FUEL_LEVEL_AVERAGING_ALPHA = 0.001f;
104 constexpr float FUEL_LEVEL_UPDATE_PERIOD_SEC = 0.1f;
105 constexpr float FUEL_LEVEL_LOW_THRESHOLD_VOLTAGE = 0.25f;
106 constexpr float FUEL_LEVEL_HIGH_THRESHOLD_VOLTAGE = 4.5f;
107
108 constexpr float DEFAULT_LAMBDA_LOAD_BINS[] = { 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 150, 175, 200, 225, 250 };
109 constexpr float DEFAULT_LAMBDA_TABLE_ROW[] = {
110 1, 1, 1, 1, // 30, 40, 50, 60 kpa
111 1, 0.95, 0.92, 0.90, // 70, 80, 90, 100 kpa
112 0.89, 0.88, 0.86, 0.84, // 110, 120, 130, 150 kpa
113 0.8, 0.77, 0.75, 0.73, // 175, 200, 225, 250 kpa
114 };
115}
constexpr std::array< std::array< ValueType, target_col_count >, target_row_count > initTableFromAnotherTable(const std::array< std::array< ValueType, source_col_count >, source_row_count > &source, const ValueType defaultValue)
Definition arrays_util.h:11
std::array< std::array< float, VBAT_INJECTOR_CURVE_SIZE >, VBAT_INJECTOR_CURVE_PRESSURE_SIZE > BattLagCorrTable
@ Unassigned
std::array< std::array< float, TORQUE_TABLE_Y_SIZE >, TORQUE_TABLE_X_SIZE > torqueReductionTable
std::array< std::array< int8_t, TORQUE_TABLE_Y_SIZE >, TORQUE_TABLE_X_SIZE > torqueReductionCutTable
torqueReductionTable torqueReductionTimeTable
constexpr injector_compensation_mode_e INJECTOR_COMPENSATION_MODE
constexpr pin_input_mode_e NITROUS_CONTROL_TRIGGER_PIN_MODE
constexpr switch_input_pin_e LAUNCH_ACTIVATE_PIN
constexpr pin_input_mode_e LAUNCH_ACTIVATE_PIN_MODE
constexpr nitrous_arming_method_e NITROUS_CONTROL_ARMING_METHOD
constexpr pin_input_mode_e TORQUE_REDUCTION_TRIGGER_PIN_MODE
constexpr lua_gauge_meaning_e NITROUS_LUA_GAUGE_MEANING
constexpr BattLagCorrTable INJECTOR_SECONDARY_BATT_LAG_CURR
constexpr switch_input_pin_e TORQUE_REDUCTION_TRIGGER_PIN
constexpr launchActivationMode_e LAUNCH_ACTIVATION_MODE
constexpr switch_input_pin_e NITROUS_CONTROL_TRIGGER_PIN
constexpr torqueReductionTable TORQUE_REDUCTION_IGNITION_RETARD
constexpr torqueReductionCutTable TORQUE_REDUCTION_IGNITION_CUT
constexpr injector_compensation_mode_e SECONDARY_INJECTOR_COMPENSATION_MODE
constexpr torqueReductionActivationMode_e TORQUE_REDUCTION_ACTIVATION_MODE
constexpr pin_input_mode_e CLUTCH_UP_PIN_MODE
constexpr torqueReductionTimeTable TORQUE_REDUCTION_TIME
constexpr pin_input_mode_e CLUTCH_DOWN_PIN_MODE
constexpr BattLagCorrTable INJECTOR_BATT_LAG_CURR
constexpr switch_input_pin_e CLUTCH_DOWN_PIN
constexpr switch_input_pin_e CLUTCH_UP_PIN
constexpr fuel_pressure_sensor_mode_e FUEL_PRESSURE_SENSOR_MODE
launchActivationMode_e
lua_gauge_e
injector_compensation_mode_e
nitrous_arming_method_e
pin_input_mode_e
fuel_pressure_sensor_mode_e
torqueReductionActivationMode_e
lua_gauge_meaning_e