This commit is contained in:
rusefi 2018-01-07 12:11:49 -05:00
parent 01f36869de
commit 7b5302d897
9 changed files with 81 additions and 54 deletions

View File

@ -12,6 +12,7 @@ current binaries are always available at http://rusefi.com/build_server/
| Release date | Revision | Details |
| ------------ | --------- | ------- |
| 01/07/2018 | r14952 | usability & minor bugfix #532 idle defaults are broken |
| 12/17/2017 | r14892 | bugfix #513: console: erase on older chips does not work |
| 11/26/2017 | r14789 | bugfix #500: set_rpn_expression command is broken |
| 11/23/2017 | r14779 | bugfix #497: engine does not start with SD card |

View File

@ -517,8 +517,12 @@ static void setDefaultCrankingSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
/**
* see also setTargetRpmCurve()
*/
static void setDefaultIdleSpeedTarget(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// todo: set bins
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, -40, 140, 10);
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -30, 1350);
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -20, 1300);
setCurveValue(engineConfiguration->cltIdleRpmBins, engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, -10, 1200);
@ -556,9 +560,12 @@ static void setCanDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
}
/**
* see also setDefaultIdleSpeedTarget()
*/
void setTargetRpmCurve(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
setLinearCurve(engineConfiguration->cltIdleRpmBins, DWELL_CURVE_SIZE, -40, 90, 0);
setLinearCurve(engineConfiguration->cltIdleRpm, DWELL_CURVE_SIZE, rpm, rpm, 0);
setLinearCurve(engineConfiguration->cltIdleRpmBins, CLT_CURVE_SIZE, -40, 90, 10);
setLinearCurve(engineConfiguration->cltIdleRpm, CLT_CURVE_SIZE, rpm, rpm, 10);
}
/**
@ -728,9 +735,6 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->warmupTargetAfrBins[3] = 60;
engineConfiguration->warmupTargetAfr[3] = 14.5;
setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_SIGNATURE);
engineConfiguration->fuelClosedLoopCorrectionEnabled = false;
engineConfiguration->fuelClosedLoopCltThreshold = 70;
engineConfiguration->fuelClosedLoopRpmThreshold = 900;
@ -739,8 +743,11 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->fuelClosedLoopAfrHighThreshold = 19.8;
engineConfiguration->fuelClosedLoopPid.pFactor = -0.1;
engineConfiguration->cranking.baseFuel = 5;
engineConfiguration->startUpFuelPumpDuration = 4;
/**
* Idle control defaults
*/
setDefaultIdleSpeedTarget(PASS_ENGINE_PARAMETER_SIGNATURE);
// setTargetRpmCurve(1200 PASS_ENGINE_PARAMETER_SUFFIX);
engineConfiguration->idleRpmPid.pFactor = 0.05;
engineConfiguration->idleRpmPid.iFactor = 0.002;
@ -749,12 +756,31 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->idleRpmPid.maxValue = 95;
boardConfiguration->idlePidDeactivationTpsThreshold = 2;
engineConfiguration->analogInputDividerCoefficient = 2;
boardConfiguration->idleStepperPulseDuration = 10;
boardConfiguration->idle.solenoidFrequency = 200;
// set idle_position 50
boardConfiguration->manIdlePosition = 50;
engineConfiguration->crankingIACposition = 50;
// engineConfiguration->idleMode = IM_AUTO;
engineConfiguration->idleMode = IM_MANUAL;
boardConfiguration->useStepperIdle = false;
setDefaultStepperIdleParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
/**
* Cranking defaults
*/
engineConfiguration->startUpFuelPumpDuration = 4;
engineConfiguration->cranking.baseFuel = 5;
engineConfiguration->crankingChargeAngle = 70;
engineConfiguration->timingMode = TM_DYNAMIC;
engineConfiguration->fixedModeTiming = 50;
engineConfiguration->analogInputDividerCoefficient = 2;
// performance optimization
boardConfiguration->sensorChartMode = SC_OFF;
@ -841,22 +867,11 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->useOnlyRisingEdgeForTrigger = false;
boardConfiguration->idleStepperPulseDuration = 10;
boardConfiguration->idle.solenoidFrequency = 200;
// set idle_position 50
boardConfiguration->manIdlePosition = 50;
engineConfiguration->crankingIACposition = 50;
setTargetRpmCurve(1200 PASS_ENGINE_PARAMETER_SUFFIX);
// engineConfiguration->idleMode = IM_AUTO;
engineConfiguration->idleMode = IM_MANUAL;
engineConfiguration->acSwitchAdc = EFI_ADC_NONE;
engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE;
boardConfiguration->useStepperIdle = false;
setDefaultStepperIdleParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
#if EFI_PROD_CODE || defined(__DOXYGEN__)

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Jan 06 10:47:12 EST 2018
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 07 12:06:45 EST 2018
// begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_
@ -1591,6 +1591,7 @@ typedef struct {
*/
int step1RpmWindow;
/**
* See cltIdleRpmBins
* offset 1884
*/
pid_s idleRpmPid;
@ -1663,6 +1664,7 @@ typedef struct {
*/
float cltIdleRpmBins[CLT_CURVE_SIZE];
/**
* See idleRpmPid
* offset 2076
*/
float cltIdleRpm[CLT_CURVE_SIZE];
@ -2317,4 +2319,4 @@ typedef struct {
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Jan 06 10:47:12 EST 2018
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Jan 07 12:06:45 EST 2018

View File

@ -15,7 +15,7 @@
*/
void setLinearCurve(float array[], int size, float from, float to, float precision) {
for (int i = 0; i < size; i++) {
float value = interpolateMsg("setTable", 0, from, size - 1, to, i);
float value = interpolateMsg("setLinearCurve", 0, from, size - 1, to, i);
/**
* rounded values look nicer, also we want to avoid precision mismatch with Tuner Studio
*/

View File

@ -133,10 +133,10 @@ custom ignition_table_t 1024 array, F32, @OFFSET@, [16x16],"deg", 1,
custom angle_table_t 1024 array, F32, @OFFSET@, [16x16],"deg", 1, 0, -720, 720, 2
struct pid_s
float pFactor;;"value", 1, 0, -10000, 10000, 7
float iFactor;;"value", 1, 0, -10000, 10000, 7
float dFactor;;"value", 1, 0, -10000, 10000, 7
int16_t offset;Linear addition to PID logic;"value", 1, 0, 0, 1000, 0
float pFactor;;"", 1, 0, -10000, 10000, 7
float iFactor;;"", 1, 0, -10000, 10000, 7
float dFactor;;"", 1, 0, -10000, 10000, 7
int16_t offset;Linear addition to PID logic;"", 1, 0, 0, 1000, 0
int16_t period;PID dTime;"ms", 1, 0, 0, 3000, 0
int16_t minValue;;"", 1, 0, 0, 3000.0, 3
int16_t maxValue;;"", 1, 0, 0, 3000.0, 3
@ -185,9 +185,9 @@ adc_channel_e hwChannel;
end_struct
struct MAP_sensor_config_s @brief MAP averaging configuration
float[MAP_ANGLE_SIZE] samplingAngleBins;;"RPM", 1, 0, 0.0, 18000, 2
float[MAP_ANGLE_SIZE] samplingAngleBins;;"", 1, 0, 0.0, 18000, 2
float[MAP_ANGLE_SIZE] samplingAngle;@brief MAP averaging sampling start angle, by RPM;"deg", 1, 0, -180, 180, 2
float[MAP_WINDOW_SIZE] samplingWindowBins;;"RPM", 1, 0, 0.0, 18000, 2
float[MAP_WINDOW_SIZE] samplingWindowBins;;"", 1, 0, 0.0, 18000, 2
float[MAP_WINDOW_SIZE] samplingWindow;@brief MAP averaging angle duration, by RPM;"deg", 1, 0, 0, 180, 2
air_pressure_sensor_config_s sensor
end_struct
@ -663,7 +663,7 @@ bit unused_bit_1472_26;
bit unused_bit_1472_27;
adc_channel_e hipOutputChannel;
custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "false", "true"
custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual"
idle_mode_e idleMode;
bit isInjectionEnabled;+enable injection
@ -753,7 +753,7 @@ custom pin_mode_e 4 bits, U32, @OFFSET@, [0:5], @@pin_mode_e_enum@@
float mapErrorDetectionTooLow;kPa value which is too low to be true;"kPa", 1, 0, -100.0, 100.0, 2
float mapErrorDetectionTooHigh;kPa value which is too high to be true;"kPa", 1, 0, -100.0, 800.0, 2
int step1RpmWindow;RPMs prior to step1rpm point where ignition advance is retarded;"rpm", 1, 0, 0, 3000.0, 2
pid_s idleRpmPid;
pid_s idleRpmPid;See cltIdleRpmBins
float addedToWallCoef;;"%", 1, 0, 0.0, 300.0, 2
brain_pin_e communicationPin;blue LED on discovery by default
brain_pin_e runningPin;green LED on discovery by default
@ -773,7 +773,7 @@ custom pin_mode_e 4 bits, U32, @OFFSET@, [0:5], @@pin_mode_e_enum@@
float[CLT_CURVE_SIZE] cltIdleRpmBins;CLT-based target RPM for automatic idle controller;"C", 1, 0, -100.0, 250.0, 2
float[CLT_CURVE_SIZE] cltIdleRpm;;"RPM", 1, 0, 0.0, 8000.0, 0
float[CLT_CURVE_SIZE] cltIdleRpm;See idleRpmPid;"", 1, 0, 0.0, 8000.0, 0
float targetVBatt;set targetvbatt VOLTS;"Volts", 1, 0, 0,30, 1
float alternatorOffAboveTps;Turn off alternator output above specified TPS;"%", 1, 0, 0, 200, 2

View File

@ -263,5 +263,5 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20180104;
return 20180107;
}

View File

@ -1,5 +1,5 @@
// This file was generated by Version2Header
// Mon Dec 25 10:11:16 EST 2017
// Sun Jan 07 12:10:11 EST 2018
#ifndef VCS_VERSION
#define VCS_VERSION "14915"
#define VCS_VERSION "14952"
#endif

View File

@ -445,14 +445,14 @@ fileVersion = { 20171101 }
curve = cltIdleRPMCurve, "Idle Target RPM"
columnLabel = "Coolant", "RPM"
xAxis = -40, 120, 10
yAxis = 0, 0, 8000
yAxis = 0, 8000, 10
xBins = cltIdleRpmBins, coolant
yBins = cltIdleRpm, RPMValue
gauge = CLTGauge
curve = idleAdvanceCurve, "Idle Advance Angle"
columnLabel = "RPM", "degrees"
xAxis = 0, 8000, 1000
xAxis = 0, 8000, 10
yAxis = -100, 100, 10
xBins = idleAdvanceBins, RPMValue
yBins = idleAdvance
@ -460,7 +460,7 @@ fileVersion = { 20171101 }
curve = idleVeCurve, "Idle VE"
columnLabel = "RPM", "%"
xAxis = 0, 8000, 1000
xAxis = 0, 8000, 10
yAxis = 0, 250, 10
xBins = idleVeBins, RPMValue
yBins = idleVe
@ -926,7 +926,6 @@ gaugeCategory = Fuel Data
subMenu = tachSettings, "Tachometer output"
subMenu = std_separator
subMenu = fanSetting, "Fan Settings"
subMenu = idleSettings, "Idle Settings"
subMenu = mainRealay, "Main Relay Settings"
subMenu = fuelPump, "Fuel Pump Settings"
subMenu = malfunction, "MIL Settings"
@ -949,6 +948,7 @@ gaugeCategory = Fuel Data
subMenu = warmupTargetAfrCurve, "Warmup fuel auto correction AFR target", 0, {useWarmupPidAfr == 1}
subMenu = cltIdleCurve, "Warmup Idle multiplier"
subMenu = cltTimingCorrCurve, "Warmup timing correction"
subMenu = idleSettings, "Idle Settings"
subMenu = cltIdleRPMCurve, "Idle Target RPM", 0, {idleMode == 0}
subMenu = std_separator
subMenu = fuelTableDialog, "Fuel Table", 0, {fuelAlgorithm != LM_SPEED_DENSITY}
@ -1495,12 +1495,12 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "CS #8", max31855_cs8
; Engine->idle Settings
dialog = idleSolenoid, "solenoid"
dialog = idleSolenoid, "Solenoid"
field = "Idle Solenoid Pin Mode", idle_solenoidPinMode, !useStepperIdle
field = "Idle Solenoid Pin", idle_solenoidPin, !useStepperIdle
field = "Idle Solenoid Frequency", idle_solenoidFrequency, !useStepperIdle
dialog = idleStepper, "stepper"
dialog = idleStepper, "Stepper"
field = "Idle Stepper Step", idle_stepperStepPin, useStepperIdle
field = "Idle Stepper Dir", idle_stepperDirectionPin, useStepperIdle
field = "Idle Stepper Enable", stepperEnablePin, useStepperIdle
@ -1508,34 +1508,37 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
field = "Stepper reaction time", idleStepperReactionTime, useStepperIdle
field = "Stepper total steps", idleStepperTotalSteps, useStepperIdle
dialog = idleType, "Type idle valve", border
dialog = idleHwType, "Idle Valve Hardware", border
field = "use stepper", useStepperIdle
panel = idleSolenoid, West
panel = idleStepper, East
dialog = idlePidSettings, "PID control"
field = "P-factor", idleRpmPid_pFactor
field = "I-factor", idleRpmPid_iFactor
field = "D-factor", idleRpmPid_dFactor
field = "Offset", idleRpmPid_offset
field = "Min", idleRpmPid_minValue
field = "Max", idleRpmPid_maxValue
dialog = idleSettings, "", yAxis
field = "#Automatic Mode is still Alpha Version"
field = "Manual mode", idleMode
field = "!Automatic Mode is now Beta Version"
field = "Idle control mode", idleMode
field = "Use separate Advance Table for idle", useSeparateAdvanceForIdle
field = "Use separate VE Table for idle", useSeparateVeForIdle
field = "Cranking Idle Air", crankingIACposition
field = "TPS deactivation threshold", idlePidDeactivationTpsThreshold
; field = "# Warmup Idle multipplier is apploed to target RPM"
; field = "Auto target", targetIdleRpm, { idleMode == 0}
field = "idle P", idleRpmPid_pFactor, { idleMode == 0}
field = "idle I", idleRpmPid_iFactor, { idleMode == 0}
field = "idle D", idleRpmPid_dFactor, { idleMode == 0}
field = "idle offset", idleRpmPid_offset, { idleMode == 0}
field = "#See Idle Target RPM Curve"
panel = idlePidSettings, { idleMode == 0}
field = "period", idleRpmPid_period
field = "pid min", idleRpmPid_minValue, { idleMode == 0}
field = "pid max", idleRpmPid_maxValue, { idleMode == 0}
field = "RPM dead zone to deactivate IAC pid", idlePidRpmDeadZone, { idleMode == 0}
field = "RPM upper limit to deactivate IAC pid",idlePidRpmUpperLimit, { idleMode == 0}
field = "iacByTpsTaper", iacByTpsTaper;
field = "verbose", isVerboseIAC
slider = "Manual Idle Position", manIdlePosition, horizontal
field = ""
field = "use stepper", useStepperIdle
panel = idleType
panel = idleHwType
; Engine->Fan Settings
dialog = fanSetting, "Fan Settings"

View File

@ -12,6 +12,7 @@
#include "efilib.h"
#include "datalogging.h"
#include "histogram.h"
#include "error_handling.h"
const char * boolToString(bool value) {
return value ? "Yes" : "No";
@ -28,7 +29,12 @@ float efiFloor(float value, float precision) {
}
*/
/**
*
* @param precision for example '0.1' for one digit fractional part
*/
float efiRound(float value, float precision) {
efiAssert(precision != 0, "zero precision", NAN);
float a = rintf (value / precision);
return a * precision;
}