diff --git a/firmware/controllers/algo/engine_configuration.h b/firmware/controllers/algo/engine_configuration.h index 023043f124..f58dcbf4b2 100644 --- a/firmware/controllers/algo/engine_configuration.h +++ b/firmware/controllers/algo/engine_configuration.h @@ -395,26 +395,30 @@ typedef struct { /** * this value could be used to offset the whole ignition timing table by a constant - */ + * offset 772 + */ float ignitionBaseAngle; - /** * While cranking (which causes battery voltage to drop) we can calculate dwell time in shaft * degrees, not in absolute time as in running mode. - */ + * offset 776 + */ float crankingChargeAngle; - + /** + * offset 780 + */ timing_mode_e timingMode; + /** * This value is used in 'fixed timing' mode, i.e. constant timing * This mode is useful for instance while adjusting distributor location */ float fixedModeTiming; - float injectorLag; // size 4, offset 0 + float injectorLag; - float fuelLoadBins[FUEL_LOAD_COUNT]; // + float fuelLoadBins[FUEL_LOAD_COUNT]; // RPM is float and not integer in order to use unified methods for interpolation float fuelRpmBins[FUEL_RPM_COUNT]; // diff --git a/firmware/rusefi_config.ini b/firmware/rusefi_config.ini index a0c7be4ac3..b00c1ebabc 100644 --- a/firmware/rusefi_config.ini +++ b/firmware/rusefi_config.ini @@ -5,44 +5,47 @@ ! comments start with '#' ! ! each field is declared as -! type;name;comment +! type name;comment struct cranking_parameters_s -float;baseCrankingFuel; -int16_t;crankingRpm;This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\nAnything above 'crankingRpm' would be 'running' +float baseCrankingFuel; +int16_t crankingRpm;This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')\nAnything above 'crankingRpm' would be 'running' end_struct struct air_pressure_sensor_config_s - float;customValueAt0;kPa value at zero volts -float;customValueAt5;kPa value at 5 volts -air_pressure_sensor_type_e;sensorType; -adc_channel_e;hwChannel +float customValueAt0;kPa value at zero volts +float customValueAt5;kPa value at 5 volts +air_pressure_sensor_type_e sensorType; +adc_channel_e hwChannel; end_struct #define MAP_ANGLE_SIZE 8 #define MAP_WINDOW_SIZE 8 -struct MAP_sensor_config_s -array float MAP_ANGLE_SIZE;samplingAngleBins -array float MAP_ANGLE_SIZE;samplingAngle;@brief MAP averaging sampling start angle, by RPM +struct MAP_sensor_config_s @brief MAP averaging configuration +float[MAP_ANGLE_SIZE] samplingAngleBins +float[MAP_ANGLE_SIZE] samplingAngle;@brief MAP averaging sampling start angle, by RPM +float[MAP_WINDOW_SIZE] samplingWindowBins; +float[MAP_WINDOW_SIZE] samplingWindow;@brief MAP averaging angle duration, by RPM +air_pressure_sensor_config_s sensor end_struct struct ThermistorConf @brief Thermistor curve parameters -float;tempC_1;these values are in Celcuus -float;tempC_2 -float;tempC_3 -float;resistance_1 -float;resistance_2 -float;resistance_3 +float tempC_1;these values are in Celcuus +float tempC_2 +float tempC_3 +float resistance_1 +float resistance_2 +float resistance_3 - float;bias_resistor; + float bias_resistor; - float;s_h_a; - float;s_h_b; - float;s_h_c; + float s_h_a; + float s_h_b; + float s_h_c; end_struct @@ -53,9 +56,9 @@ struct engine_configuration_s -engine_type_e;engineType;http://rusefi.com/wiki/index.php?title=Manual:Engine_Type +engine_type_e engineType;http://rusefi.com/wiki/index.php?title=Manual:Engine_Type -int;headerMagicValue;this magic number is used to make sure that what we read from Flash is in fact some configuration +int headerMagicValue;this magic number is used to make sure that what we read from Flash is in fact some configuration #define CLT_CURVE_SIZE 16 #define IAT_CURVE_SIZE 16 @@ -64,30 +67,54 @@ int;headerMagicValue;this magic number is used to make sure that what we read fr #define IGN_LOAD_COUNT 16 #define IGN_RPM_COUNT 16 -array float VBAT_INJECTOR_CURVE_SIZE;battInjectorLagCorrBins; -array float VBAT_INJECTOR_CURVE_SIZE;battInjectorLagCorr; +float[VBAT_INJECTOR_CURVE_SIZE] battInjectorLagCorrBins; +float[VBAT_INJECTOR_CURVE_SIZE] battInjectorLagCorr; -array float CLT_CURVE_SIZE;cltFuelCorrBins; -array float CLT_CURVE_SIZE;cltFuelCorr; +float[CLT_CURVE_SIZE] cltFuelCorrBins; +float[CLT_CURVE_SIZE] cltFuelCorr; -array float IAT_CURVE_SIZE;iatFuelCorrBins; -array float IAT_CURVE_SIZE;iatFuelCorr; +float[IAT_CURVE_SIZE] iatFuelCorrBins; +float[IAT_CURVE_SIZE] iatFuelCorr; -int16_t;directSelfStimulation;Should the trigger emulator push data right into trigger input, eliminating the need for physical jumper wires?\nPS: Funny name, right? :)\ntodo: make this a bit on some bit field +int16_t directSelfStimulation;Should the trigger emulator push data right into trigger input, eliminating the need for physical jumper wires?\nPS: Funny name, right? :)\ntodo: make this a bit on some bit field -int16_t;tpsMin;todo: extract these two fields into a structure\ntodo: we need two sets of TPS parameters - modern ETBs have to sensors -int16_t;tpsMax;tpsMax value as 10 bit ADC value. Not Voltage! +int16_t tpsMin;todo: extract these two fields into a structure\ntodo: we need two sets of TPS parameters - modern ETBs have to sensors +int16_t tpsMax;tpsMax value as 10 bit ADC value. Not Voltage! -int16_t;analogChartMode; +int16_t analogChartMode; -int16_t;tpsErrorLowValue;todo: finish implementation. These values are used for TPS disconnect detection -int16_t;tpsErrorHighValue +int16_t tpsErrorLowValue;todo: finish implementation. These values are used for TPS disconnect detection +int16_t tpsErrorHighValue -float;primingSquirtDurationMs -int;engineCycle;360 for two-stroke\n720 for four-stroke +float primingSquirtDurationMs +int engineCycle;360 for two-stroke\n720 for four-stroke -cranking_parameters_s;crankingSettings -MAP_sensor_config_s;map;@see hasMapSensor\n@see isMapAveragingEnabled +cranking_parameters_s crankingSettings +MAP_sensor_config_s map;@see hasMapSensor\n@see isMapAveragingEnabled +ThermistorConf cltThermistorConf;todo: merge with channel settings, use full-scale Thermistor here! + ThermistorConf iatThermistorConf; + +#define DWELL_COUNT 8 + +#define CRANKING_CURVE_SIZE 8 + +#define IGN_LOAD_COUNT 16 +#define IGN_RPM_COUNT 16 + + +float[DWELL_COUNT] sparkDwellBins; + float[DWELL_COUNT] sparkDwell; + + float[IGN_LOAD_COUNT] ignitionLoadBins; + float[IGN_RPM_COUNT] ignitionRpmBins; + +float ignitionBaseAngle;this value could be used to offset the whole ignition timing table by a constant + + +float crankingChargeAngle;While cranking (which causes battery voltage to drop) we can calculate dwell time in shaft\ndegrees, not in absolute time as in running mode. + +timing_mode_e timingMode; + end_struct \ No newline at end of file