Memory allocation and TS interface for flat shift

This commit is contained in:
Josh Stewart 2017-01-17 13:33:41 +11:00
parent 0e176f0724
commit 109f64f342
2 changed files with 38 additions and 23 deletions

View File

@ -343,8 +343,8 @@ struct config3 {
byte ego_sdelay; //Time in seconds after engine starts that closed loop becomes available byte ego_sdelay; //Time in seconds after engine starts that closed loop becomes available
byte egoRPM; //RPM must be above this for closed loop to function byte egoRPM; //RPM must be above this for closed loop to function
byte egoTPSMax; //TPS must be below this for closed loop to function byte egoTPSMax; //TPS must be below this for closed loop to function
byte egoLoadMax; //Load (TPS or MAP) must be below this for closed loop to function byte unused6_13;
byte egoLoadMin; //Load (TPS or MAP) must be above this for closed loop to function byte unused6_14;
byte voltageCorrectionBins[6]; //X axis bins for voltage correction tables byte voltageCorrectionBins[6]; //X axis bins for voltage correction tables
byte injVoltageCorrectionValues[6]; //Correction table for injector PW vs battery voltage byte injVoltageCorrectionValues[6]; //Correction table for injector PW vs battery voltage
byte airDenBins[9]; byte airDenBins[9];
@ -374,10 +374,11 @@ struct config3 {
byte lnchPullRes : 2; byte lnchPullRes : 2;
byte fuelTrimEnabled : 1; byte fuelTrimEnabled : 1;
byte unused60 : 5; byte flatSEnable : 1;
byte unused61; byte unused60 : 4;
byte unused62; byte flatSSoftWin;
byte unused63; byte flatSRetard;
byte flatSArm;
}; };

View File

@ -357,8 +357,8 @@ page = 6
ego_sdelay = scalar, U08, 10, "sec", 1, 0, 0, 120, 0 ego_sdelay = scalar, U08, 10, "sec", 1, 0, 0, 120, 0
egoRPM = scalar, U08, 11, "rpm", 100, 0.0, 100, 25500, 0 egoRPM = scalar, U08, 11, "rpm", 100, 0.0, 100, 25500, 0
egoTPSMax = scalar, U08, 12, "%", 1, 0, 0, 120, 0 egoTPSMax = scalar, U08, 12, "%", 1, 0, 0, 120, 0
egoLoadMax = scalar, U08, 13, "%", 1, 0, 0, 120, 0 unused6-13 = scalar, U08, 13, "%", 1, 0, 0, 120, 0
egoLoadMin = scalar, U08, 14, "%", 1, 0, 0, 120, 0 unused6-14 = scalar, U08, 14, "%", 1, 0, 0, 120, 0
brvBins = array, U08, 15, [6], "V", 0.1, 0, 6, 24, 1 ; Bins for the battery reference voltage brvBins = array, U08, 15, [6], "V", 0.1, 0, 6, 24, 1 ; Bins for the battery reference voltage
injBatRates = array, U08, 21, [6], "%", 1, 0, 0, 255, 0 ;Values for injector pulsewidth vs voltage injBatRates = array, U08, 21, [6], "%", 1, 0, 0, 255, 0 ;Values for injector pulsewidth vs voltage
#if CELSIUS #if CELSIUS
@ -378,29 +378,31 @@ page = 6
launchEnable= bits, U08, 48, [6:6], "No", "Yes" launchEnable= bits, U08, 48, [6:6], "No", "Yes"
launchHiLo = bits, U08, 48, [7:7], "LOW", "HIGH" launchHiLo = bits, U08, 48, [7:7], "LOW", "HIGH"
lnchSoftLim = scalar, U08, 49, "rpm", 100, 0.0, 100, 25500, 0 lnchSoftLim = scalar, U08, 49, "rpm", 100, 0.0, 100, 25500, 0
lnchRetard = scalar, U08, 50, "deg", 1.0, 0.0, 0.0, 80, 0 lnchRetard = scalar, U08, 50, "deg", 1.0, 0.0, 0.0, 80, 0
lnchHardLim = scalar, U08, 51, "rpm", 100, 0.0, 100, 25500, 0 lnchHardLim = scalar, U08, 51, "rpm", 100, 0.0, 100, 25500, 0
lnchFuelAdd = scalar, U08, 52, "%", 1.0, 0.0, 0.0, 80, 0 lnchFuelAdd = scalar, U08, 52, "%", 1.0, 0.0, 0.0, 80, 0
idleKP = scalar, U08, 53, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) idleKP = scalar, U08, 53, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKI = scalar, U08, 54, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) idleKI = scalar, U08, 54, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
idleKD = scalar, U08, 55, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) idleKD = scalar, U08, 55, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
boostLimit = scalar, U08, 56, "kPa", 2.0, 0.0, 0, 511, 0 boostLimit = scalar, U08, 56, "kPa", 2.0, 0.0, 0.0, 511.0, 0
boostKP = scalar, U08, 57, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) boostKP = scalar, U08, 57, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
boostKI = scalar, U08, 58, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) boostKI = scalar, U08, 58, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
boostKD = scalar, U08, 59, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte) boostKD = scalar, U08, 59, "%", 1.0, 0.0, 0.0, 200.0, 0 ; * ( 1 byte)
lnchPullRes = bits, U08, 60, [0:1], "Float" , "Pullup", "INVALID", "INVALID" lnchPullRes = bits, U08, 60, [0:1], "Float" , "Pullup", "INVALID", "INVALID"
fuelTrimEnabled= bits, U08, 60, [2:2], "No", "Yes" fuelTrimEnabled= bits, U08, 60, [2:2], "No", "Yes"
unused6-60d = bits, U08, 60, [3:3], "ONE", "INVALID" flatSEnable = bits, U08, 60, [3:3], "No", "Yes"
unused6-60e = bits, U08, 60, [4:4], "ONE", "INVALID" unused6-60e = bits, U08, 60, [4:4], "ONE", "INVALID"
unused6-60f = bits, U08, 60, [5:5], "ONE", "INVALID" unused6-60f = bits, U08, 60, [5:5], "ONE", "INVALID"
unused6-60g = bits, U08, 60, [6:6], "ONE", "INVALID" unused6-60g = bits, U08, 60, [6:6], "ONE", "INVALID"
unused6-60h = bits, U08, 60, [7:7], "ONE", "INVALID" unused6-60h = bits, U08, 60, [7:7], "ONE", "INVALID"
unused6-61 = scalar, U08, 61, "RPM", 100.0, 0.0, 100, 25500, 0
unused6-62 = scalar, U08, 62, "RPM", 100.0, 0.0, 100, 25500, 0 ; Flat shift
unused6-63 = scalar, U08, 63, "RPM", 100.0, 0.0, 100, 25500, 0 flatSSoftWin = scalar, U08, 61, "rpm", 100, 0.0, 100, 25500, 0
flatSRetard = scalar, U08, 62, "deg", 1.0, 0.0, 0.0, 80, 0
flatSArm = scalar, U08, 63, "rpm", 100, 0.0, 100, 25500, 0
;-------------------------------------------------- ;--------------------------------------------------
;Start idle and fan controls (Page 7) ;Start idle and fan controls (Page 7)
@ -638,7 +640,7 @@ menuDialog = main
menu = "&Accessories" menu = "&Accessories"
subMenu = fanSettings, "Thermo Fan" subMenu = fanSettings, "Thermo Fan"
subMenu = LaunchControl, "Launch Control" subMenu = LaunchControl, "Launch Control / Flat Shift"
subMenu = fuelpump, "Fuel Pump" subMenu = fuelpump, "Fuel Pump"
subMenu = std_separator subMenu = std_separator
subMenu = boostSettings, "Boost Control" subMenu = boostSettings, "Boost Control"
@ -736,6 +738,10 @@ menuDialog = main
flexAdvLow = "Additional advance (in degrees) at lowest ethanol reading (Typically 0)" flexAdvLow = "Additional advance (in degrees) at lowest ethanol reading (Typically 0)"
flexAdvHigh = "Additional advance (in degrees) at highest ethanol reading (Typically 10-20 degrees)" flexAdvHigh = "Additional advance (in degrees) at highest ethanol reading (Typically 10-20 degrees)"
flatSArm = "The RPM above which an active clutch input will be considered a flat shift (instead of launch). This must be at least several hundred RPM above idle"
flatSSoftWin= "The number of RPM below the flat shift point where the softlimit will be applied (aka Soft limit window). Recommended values are 200-1000"
flatSRetard = "The absolute timing (BTDC) that will be used when within the soft limit window"
[UserDefined] [UserDefined]
; Enhanced TunerStudio dialogs can be defined here ; Enhanced TunerStudio dialogs can be defined here
@ -900,8 +906,6 @@ menuDialog = main
field = "Active Above Coolant", egoTemp, { egoType && (egoAlgorithm < 3) } field = "Active Above Coolant", egoTemp, { egoType && (egoAlgorithm < 3) }
field = "Active Above RPM", egoRPM, { egoType && (egoAlgorithm < 3) } field = "Active Above RPM", egoRPM, { egoType && (egoAlgorithm < 3) }
field = "Active Below TPS", egoTPSMax, { egoType && (egoAlgorithm < 3) } field = "Active Below TPS", egoTPSMax, { egoType && (egoAlgorithm < 3) }
field = "Active Below Load", egoLoadMax, { egoType && (egoAlgorithm < 3) }
field = "Active Above Load", egoLoadMin, { egoType && (egoAlgorithm < 3) }
field = "EGO delay after start", ego_sdelay, { (egoAlgorithm < 3) } field = "EGO delay after start", ego_sdelay, { (egoAlgorithm < 3) }
field = "PID Proportional Gain", egoKP, { egoType && (egoAlgorithm == 2) } field = "PID Proportional Gain", egoKP, { egoType && (egoAlgorithm == 2) }
field = "PID Integral", egoKI, { egoType && (egoAlgorithm == 2) } field = "PID Integral", egoKI, { egoType && (egoAlgorithm == 2) }
@ -1014,18 +1018,28 @@ menuDialog = main
field = "Soft limit max time", SoftLimMax field = "Soft limit max time", SoftLimMax
field = "Hard Rev limit", HardRevLim field = "Hard Rev limit", HardRevLim
dialog = clutchInput, "Clutch input"
field = "Clutch Input Pin", launchPin, { launchEnable || flatSEnable }
field = "Clutch enabled when signal is",launchHiLo, { launchEnable || flatSEnable }
field = "Clutch Pullup Resistor", lnchPullRes, { launchEnable || flatSEnable }
dialog = LaunchControl, "Launch Control", 6 dialog = LaunchControl, "Launch Control", 6
topicHelp = Fhelp7 topicHelp = Fhelp7
panel = clutchInput
field = "Launch Control" field = "Launch Control"
field = "Enable Launch", launchEnable field = "Enable Launch", launchEnable
field = "Launch Input Pin", launchPin, { launchEnable }
field = "Launch enabled when signal is",launchHiLo, { launchEnable }
field = "Launch Pullup Resistor", lnchPullRes, { launchEnable }
field = "Soft rev limit", lnchSoftLim, { launchEnable } field = "Soft rev limit", lnchSoftLim, { launchEnable }
field = "Soft limit absolute timing", lnchRetard, { launchEnable } field = "Soft limit absolute timing", lnchRetard, { launchEnable }
field = "Hard rev limit", lnchHardLim, { launchEnable } field = "Hard rev limit", lnchHardLim, { launchEnable }
field = "Fuel adder during launch", lnchFuelAdd, { launchEnable } field = "Fuel adder during launch", lnchFuelAdd, { launchEnable }
field = "Flat Shift"
field = "Enable flat shift", flatSEnable
field = "Flat Shift above", flatSArm, { flatSEnable }
field = "Soft rev limit", flatSSoftWin, { flatSEnable }
field = "Soft limit absolute timing", flatSRetard, { flatSEnable }
dialog = OLED, "OLED Display", 2 dialog = OLED, "OLED Display", 2
field = "Display Type", display field = "Display Type", display
field = "#Note" field = "#Note"