Some initial work at Launch/ALS

(cherry picked from commit 07b3a0632f)
This commit is contained in:
ola 2020-02-02 16:44:31 +01:00 committed by rusefi
parent 7a4a4c2c64
commit d49e253bff
5 changed files with 100 additions and 35 deletions

View File

@ -67,9 +67,11 @@ static const ignition_table_t defaultIatTiming = {
#endif /* IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT */
bool isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
return CONFIG(enabledStep1Limiter) && rpm >= engineConfiguration->step1rpm;
}
//Todo: There are some more conditions that needs to be true, and RPM range must be added to launchrpm?
//bool isLaunchCondition(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
// return CONFIG(launchControlEnabled) && rpm >= engineConfiguration->launchRpm;
//}
/**
* @return ignition timing angle advance before TDC
@ -86,10 +88,11 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
efiAssert(CUSTOM_ERR_ASSERT, !cisnan(engineLoad), "invalid el", NAN);
engine->m.beforeZeroTest = getTimeNowLowerNt();
engine->m.zeroTestTime = getTimeNowLowerNt() - engine->m.beforeZeroTest;
//See comment at line 70
if (isStep1Condition(rpm PASS_ENGINE_PARAMETER_SUFFIX)) {
return engineConfiguration->step1timing;
}
// if (isLaunchCondition(rpm PASS_ENGINE_PARAMETER_SUFFIX)) {
// return engineConfiguration->launchTimingRetard;
// }
float advanceAngle;
if (CONFIG(useTPSAdvanceTable)) {

View File

@ -778,12 +778,12 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->warningPeriod = 0;
#endif /* EFI_PROD_CODE */
engineConfiguration->step1rpm = 3000;
engineConfiguration->step1timing = 10;
engineConfiguration->step1RpmWindow = 500;
engineConfiguration->step1fuelCutEnable = false;
engineConfiguration->step1SparkCutEnable = false;
engineConfiguration->step1RpmWindow = 500;
engineConfiguration->launchRpm = 3000;
engineConfiguration->launchTimingRetard = 10;
engineConfiguration->launchTimingRpmRange = 500;
engineConfiguration->launchSparkCutEnable = false;
engineConfiguration->launchFuelCutEnable = false;
engineConfiguration->hardCutRpmRange = 500;
engineConfiguration->slowAdcAlpha = 0.33333;
engineConfiguration->engineSnifferRpmThreshold = 2500;

View File

@ -845,3 +845,16 @@ typedef enum {
CLOSED_LOOP = 1,
Force_4bytes_size_boostType_e = ENUM_32_BITS,
} boostType_e;
typedef enum {
SWITCH_INPUT_LAUNCH = 0,
CLUTCH_INPUT_LAUNCH = 1,
ALWAYS_ACTIVE_LAUNCH = 2,
Force_4bytes_size_launchActivationMode_e = ENUM_32_BITS,
} launchActivationMode_e;
typedef enum {
SWITCH_INPUT_ANTILAG = 0,
ALWAYS_ON_ANTILAG = 1,
Force_4bytes_size_antiLagActivationMode_e = ENUM_32_BITS,
} antiLagActivationMode_e;

View File

@ -327,9 +327,9 @@ bit useTLE8888_hall_mode;
bit useTLE8888_cranking_hack;
bit useInstantRpmForIdle;
bit absoluteFuelPressure;+If your fuel regulator does not have vacuum line
bit issue_294_21;
bit issue_294_22;
bit issue_294_23;
bit launchControlEnabled;
bit rollingLaunchEnabled;
bit antiLagEnabled;
bit issue_294_24;
bit issue_294_25;
bit issue_294_26;
@ -358,8 +358,8 @@ MAP_sensor_config_s map;@see hasMapSensor\n@see isMapAveragingEnabled
ThermistorConf clt;todo: merge with channel settings, use full-scale Thermistor here!
ThermistorConf iat;
int step1rpm;A secondary Rev limit engaged by the driver to help launch the vehicle faster;"rpm", 1, 0, 0, 20000.0, 2
int step1timing;;"deg", 1, 0, -180, 180, 2
int launchRpm;A secondary Rev limit engaged by the driver to help launch the vehicle faster;"rpm", 1, 0, 0, 20000.0, 2
int launchTimingRetard;;"deg", 1, 0, -180, 180, 2
int hip9011PrescalerAndSDO;+value '6' for 8MHz hw osc\nread hip9011 datasheet for details\ntodo split into two bit fields;"integer", 1, 0.0, 0.0, 32, 0
float knockBandCustom;+We calculate knock band based of cylinderBore\n Use this to override - kHz knock band override;"kHz", 1, 0.0, 0.0, 10.0, 2
@ -751,7 +751,26 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:7], @@maf_sensor_type_e_enum@
boostType_e boostType;
int boostPwmFrequency;;"Hz", 1, 0, 0, 3000.0, 0
int[111] unusedAtOldBoardConfigurationEnd;
#define launchActivationMode_e_enum "Switch Input", "Clutch Input", "Always Active(Disabled By Speed)","INVALID"
custom launchActivationMode_e 4 bits, S32, @OFFSET@, [0:7], @@launchActivationMode_e_enum@@
launchActivationMode_e launchActivationMode;
#define antiLagActivationMode_e_enum "Always Active", "Switch Input"
custom antiLagActivationMode_e 4 bits, S32, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@
antiLagActivationMode_e antiLagActivationMode;
switch_input_pin_e antiLagActivatePin;
switch_input_pin_e launchActivatePin;
int launchSpeedTreshold;+Disabled above this speed;"Kph", 1, 0, 0, 300.0, 0
int launchRpmTreshold;+Disabled below this rpm;"RPM", 1, 0, 0, 8000.0, 0
int launchTimingRpmRange;+Range from Launch Rpm for Timing Retard to activate;"RPM", 1, 0, 0, 8000.0, 0
int launchFuelAdded;+Extra Fuel Added;"%", 1, 0, 0, 100.0, 0
int launchBoostDuty;+Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100.0, 0
int hardCutRpmRange;+RPM Range for Hard Cut;"rpm", 1, 0, 0, 3000.0, 2
uint8_t[2] unusedMoreSpace;
int[102] unusedAtOldBoardConfigurationEnd;
bit vvtDisplayInverted
bit fuelClosedLoopCorrectionEnabled;+Enables lambda sensor closed loop feedback for fuelling.
@ -772,8 +791,8 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:7], @@maf_sensor_type_e_enum@
bit cutFuelOnHardLimit
bit cutSparkOnHardLimit
bit step1fuelCutEnable
bit step1SparkCutEnable
bit launchFuelCutEnable
bit launchSparkCutEnable;+This is the Cut Mode normally used
bit hasFrequencyReportingMapSensor;
bit useFSIO8ForServo1
bit useFSIO9ForServo2
@ -818,7 +837,7 @@ bit useTPSAdvanceTable;+This flag allows to use TPS for ignition lookup while in
bit etbCalibrationOnStart
bit useIacPidMultTable;+This flag allows to use a special 'PID Multiplier' table (0.0-1.0) to compensate for nonlinear nature of IAC-RPM controller
bit isBoostControlEnabled;
bit unused_1484_bit_23
bit launchSmoothRetard;+Interpolates the Ignition Retard from 0 to 100% within the RPM Range
bit unused_1484_bit_24
bit unused_1484_bit_25
bit unused_1484_bit_26
@ -888,7 +907,7 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\
! todo: mapErrorDetectionIdleTooLow? 30kPa is usually lowest on idle
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
uint8_t[4] unusedSomething;
pid_s idleRpmPid;See cltIdleRpmBins
float wwaeBeta;+0 = No fuel settling on port walls 1 = All the fuel settling on port walls setting this to 0 disables the wall wetting enrichment. ;"Fraction", 1, 0, 0.0, 1.0, 2

View File

@ -1304,7 +1304,6 @@ menuDialog = main
# EXPERIMENTAL FEATURES
subMenu = parkingLot, "Experimental/Broken"
subMenu = smLaunchControl, "Launch control"
subMenu = std_separator
subMenu = hipFunction, "HIP9011 settings (knock sensor) (alpha version)" @@if_ts_show_hip9011
@ -1313,6 +1312,13 @@ menuDialog = main
subMenu = etbDialog, "Electronic throttle body (beta version)" @@if_ts_show_etb
subMenu = etbTpsBiasCurve, "Electronic throttle body bias curve" @@if_ts_show_etb
subMenu = pedalToTpsTbl, "Electronic Pedal Map" @@if_ts_show_etb
subMenu = std_separator
subMenu = smLaunchControl, "Launch Control"
subMenu = std_separator
subMenu = smRollingLaunch, "Rolling Launch"
subMenu = std_separator
subMenu = antiLag, "Antilag Setup"
subMenu = std_separator
[ControllerCommands]
@ -1636,9 +1642,9 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = otherSensorInputs, "Other Sensor Inputs"
field = "Fuel level", fuelLevelSensor
field = "Clutch down switch", clutchDownPin
field = "Clutch down inverted", clutchDownPinInverted
field = "Clutch down inverted", clutchDownPinMode
field = "Clutch up switch", clutchUpPin
field = "Clutch up inverted", clutchUpPinInverted
field = "Clutch up inverted", clutchUpPinMode
field = "Throttle Up switch", throttlePedalUpPin
field = "Brake pedal switch", brakePedalPin
field = "A/C switch", acSwitchAdc
@ -2527,7 +2533,6 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
;Boost Closed Loop
dialog = boostPidleft, ""
field = "!Boost Control is experimental/Alpha Version"
field = "P Gain", boostPid_pFactor, { isBoostControlEnabled && boostType == 1 }
field = "I Gain", boostPid_iFactor, { isBoostControlEnabled && boostType == 1 }
field = "D Gain", boostPid_dFactor, { isBoostControlEnabled && boostType == 1 }
@ -2606,7 +2611,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "Neutral Position", etbNeutralPosition
field = "Debug mode", debugMode
field = "use ETB for idle", useETBforIdleControl
field = "ETB idle maximum angle", etbIdleRange
field = "ETB idle maximum angle", etbIdleThrottleRange
field = "Press buttons to calibrate sensors"
field = "You would have to remove air filter to move throttle manually"
commandButton = "TPS#1 closed position", cmd_calibrate_tps_1_closed
@ -2704,14 +2709,39 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
; Racing Features->Launch Control
dialog = smLaunchControl, "Launch Control Settings NOT WORKING"
field = "RPM Step1 Limit", step1rpm
field = "Launch RPM Window" step1RpmWindow
field = "Step1 Ignition Advance", step1timing
field = "Use Spark Cut", step1SparkCutEnable
field = "Use Fuel Cut", step1fuelCutEnable
field = "clutchDownPin", clutchDownPin
field = "clutchUpPin", clutchUpPin
field = "brakePedalPin", brakePedalPin
field = "Enable Launch Control", launchControlEnabled
field = "Activation Mode", launchActivationMode
field = "Switch Input", launchActivatePin, {launchActivationMode == 0 && launchControlEnabled == 1}
field = "Clutch Input", clutchDownPin, {launchActivationMode == 1 && launchControlEnabled == 1}
field = ""
field = "Rpm Treshold", launchRpmTreshold, {launchControlEnabled == 1}
field = "Speed Treshold", launchSpeedTreshold, {launchControlEnabled == 1}
field = ""
field = "Launch RPM", launchRpm, {launchControlEnabled == 1}
field = "Extra Fuel", launchFuelAdded, {launchControlEnabled == 1}
field = "Boost Solenoid Duty", launchBoostDuty, {launchControlEnabled == 1}
field = "Ignition Retard", launchTimingRetard, {launchControlEnabled == 1}
field = "Ignition Retard RPM Range", launchTimingRpmRange, {launchControlEnabled == 1}
field = "Smooth Retard Mode", launchSmoothRetard, {launchControlEnabled == 1}
field = "Hard Cut Mode"
field = "Ignition Cut", launchSparkCutEnable, {launchControlEnabled == 1}
field = "Fuel Cut", launchFuelCutEnable, {launchControlEnabled == 1}
field = "Hard Cut RPM Range", hardCutRpmRange, {launchControlEnabled == 1}
; Racing Features->Rolling Launch
dialog = smRollingLaunch, "Rolling Launch Settings NOT WORKING"
field = "Enable Rolling Launch", rollingLaunchEnabled
; Racing Features->Rolling Launch
dialog = antiLag, "AntiLag Settings NOT WORKING"
field = "Enable AntiLag", antiLagEnabled
field = "Activation Mode", antiLagActivationMode, {antiLagEnabled == 1}
field = "Switch Input", antiLagActivatePin, {antiLagActivationMode == 1 && antiLagEnabled == 1}
dialog = coastingFuelCutControl, "Coasting Fuel Cutoff Settings"
field = "Enable Coasting Fuel Cutoff", coastingFuelCutEnabled