Cleanup idle adv dialog and add delay

This commit is contained in:
Josh Stewart 2019-11-10 19:26:10 +11:00
parent 892e05d2fc
commit 44ce30ab75
3 changed files with 15 additions and 7 deletions

View File

@ -321,7 +321,7 @@ page = 1
CTPSEnabled = bits, U08, 91, [7:7], "Off", "On"
idleAdvEnabled = bits, U08, 92, [0:1], "Off", "Added", "Switched", "INVALID"
idleAdvAlgorithm = bits, U08, 92, [2:2], "TPS", "CTPS"
unused_idle_bits = bits, U08, 92, [3:7]
IdleAdvDelay = bits, U08, 92, [3:7], "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "INVALID", "INVALID"
idleAdvRPM = scalar, U08, 93, "rpm", 100, 0.0, 100, 25500, 0
idleAdvTPS = scalar, U08, 94, "%", 1, 0, 0, 120, 0
@ -1251,8 +1251,6 @@ menuDialog = main
subMenu = sparkTbl, "Spark Table", 2
subMenu = dwellSettings, "Dwell settings"
subMenu = dwell_correction_curve, "Dwell Compensation"
subMenu = idleAdvanceSettings, "Idle Advance Settings"
subMenu = idle_advance_curve, "Idle Advance" { idleAdvEnabled >= 1 }
subMenu = iat_retard_curve, "IAT Retard"
subMenu = clt_advance_curve, "Cold Advance"
;subMenu = knockSettings, "Knock Settings"
@ -1272,6 +1270,8 @@ menuDialog = main
subMenu = iacStepCrank_curve, "Idle - Stepper Motor Cranking", 7, { iacAlgorithm == 4 }
subMenu = std_separator
subMenu = idleUpSettings, "Idle Up Settings", { iacAlgorithm == 2 || iacAlgorithm == 3 || iacAlgorithm == 4 || iacAlgorithm == 5 }
subMenu = std_separator
subMenu = idleAdvanceSettings, "Idle Advance Settings"
menu = "&Accessories"
subMenu = fanSettings, "Thermo Fan"
@ -1380,8 +1380,9 @@ menuDialog = main
idleUpPolarity = "Normal polarity is a ground switch where an earthed signal activates the Idle Up. The internal pullup will be enabled with Normal polarity. \n Inverted may be used if a 5v signal is used to enable the Idle Up."
CTPSPolarity = "Normal polarity is a ground switch where an earthed signal activates the closed throttle position. The internal pullup will be enabled with Normal polarity. \n Inverted may be used if a 5v signal is used to enable the closed throttle position."
idleUpAdder = "The amount (In either Duty Cycle % or Steps (Depending on the idle control method in use), that the idle control will increase by when Idle Up is active"
idleAdvEnabled = "Added setting adds curve values to current spark table values when user defined idle is active. \n Switched setting overrides spark table values and uses curve values for idle ignition timing.
idleAdvEnabled = "Added setting adds curve values to current spark table values when user defined idle is active. \n Switched setting overrides spark table values and uses curve values for idle ignition timing."
idleAdvAlgorithm = "Use Throttle position sensor (TPS) or closed throttle position sensor (CTPS) to detect idle state."
idleAdvDelay= "The number of seconds after sync is achieved before the idle advvance control begins"
oddfire2 = "The ATDC angle of channel 2 for oddfire engines. This is relative to the TDC angle of channel 1"
oddfire3 = "The ATDC angle of channel 3 for oddfire engines. This is relative to the TDC angle of channel 1 (NOT channel 2)"
@ -1910,15 +1911,22 @@ menuDialog = main
field = "Note: Set the maximum dwell time at least 3ms above"
field = "your desired dwell time (Including cranking)"
dialog = idleAdvanceSettings,"Idle Advance Settings",4
dialog = idleAdvanceSettings_east
field = "Idle advance mode", idleAdvEnabled
field = "Idle detect mode", idleAdvAlgorithm, { idleAdvEnabled >= 1 }
field = "Delay before idle control starts (s)",idleAdvDelay, { idleAdvEnabled >= 1 }
field = "Active Below RPM", idleAdvRPM, { idleAdvEnabled >= 1 }
field = "Active Below TPS", idleAdvTPS, { idleAdvEnabled >= 1 && idleAdvAlgorithm == 0 }
field = "Closed Throttle Sensor Enabled", CTPSEnabled, { idleAdvEnabled >= 1 && idleAdvAlgorithm == 1 }
field = "Closed Throttle Sensor Pin", CTPSPin, { idleAdvEnabled >= 1 && idleAdvAlgorithm == 1 && CTPSEnabled == 1 }
field = "Closed Throttle Sensor Pin Polarity", CTPSPolarity, { idleAdvEnabled >= 1 && idleAdvAlgorithm == 1 && CTPSEnabled == 1 }
dialog = idleAdvanceSettings,"Idle Advance Settings", xAxis
panel = idleAdvanceSettings_east
panel = idle_advance_curve, { idleAdvEnabled >= 1 }
panel = iacClosedLoop_curve, { iacAlgorithm == 3 || iacAlgorithm == 5 || idleAdvEnabled >= 1 }
dialog = rotary_ignition, "Rotary Ignition", 4
field = "Ignition Configuration", rotaryType
panel = rotaryTrailing_curve

View File

@ -538,7 +538,7 @@ static inline int8_t correctionIdleAdvance(int8_t advance)
int8_t ignIdleValue = advance;
//Adjust the advance based on idle target rpm.
if(configPage2.idleAdvEnabled >= 1)
if( (configPage2.idleAdvEnabled) >= 1 && (currentStatus.runSecs >= configPage2.IdleAdvDelay))
{
currentStatus.CLIdleTarget = (byte)table2D_getValue(&idleTargetTable, currentStatus.coolant + CALIBRATION_TEMPERATURE_OFFSET); //All temps are offset by 40 degrees
int idleRPMdelta = (currentStatus.CLIdleTarget - currentStatus.RPM / 10) + 50;

View File

@ -611,7 +611,7 @@ struct config2 {
byte CTPSEnabled : 1;
byte idleAdvEnabled : 2;
byte idleAdvAlgorithm : 1;
byte idleUnused : 5;
byte IdleAdvDelay : 5;
byte idleAdvRPM;
byte idleAdvTPS;
byte unused2_95[33];