Selectable boost and VVT pins

This commit is contained in:
Josh Stewart 2017-01-19 14:54:07 +11:00
parent f08ec585e6
commit 770da8b43e
3 changed files with 21 additions and 11 deletions

View File

@ -377,8 +377,10 @@ 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 unused6_13; byte boostPin : 6;
byte unused6_14; byte unused6_13 : 2;
byte vvtPin : 6;
byte unused6_14 : 2;
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];

View File

@ -357,8 +357,12 @@ 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
unused6-13 = scalar, U08, 13, "%", 1, 0, 0, 120, 0 vvtPin = bits , U08, 13, [0:5], "Board Default", "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", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
unused6-14 = scalar, U08, 14, "%", 1, 0, 0, 120, 0 unused6-13e = bits, U08, 13, [6:6], "ONE", "INVALID"
unused6-13f = bits, U08, 13, [7:7], "ONE", "INVALID"
boostPin = bits , U08, 14, [0:5], "Board Default", "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", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
unused6-14e = bits, U08, 14, [6:6], "ONE", "INVALID"
unused6-14f = bits, U08, 14, [7:7], "ONE", "INVALID"
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
@ -1068,17 +1072,19 @@ menuDialog = main
dialog = boostSettings, "Boost Control" dialog = boostSettings, "Boost Control"
field = "Boost Control Enabled", boostEnabled field = "Boost Control Enabled", boostEnabled
field = "Boost solenoid freq.", boostFreq field = "Boost output pin", boostPin, { boostEnabled }
field = "Boost Cut", boostCutType field = "Boost solenoid freq.", boostFreq, { boostEnabled }
field = "Boost Limit", boostLimit, { boostCutType } field = "Boost Cut", boostCutType, { boostEnabled }
field = "Boost Limit", boostLimit, { boostEnabled && boostCutType }
field = "Closed Loop settings" field = "Closed Loop settings"
field = "P", boostKP field = "P", boostKP, { boostEnabled }
field = "I", boostKI field = "I", boostKI, { boostEnabled }
field = "D", boostKD field = "D", boostKD, { boostEnabled }
dialog = vvtSettings, "VVT Control" dialog = vvtSettings, "VVT Control"
field = "VVT Control Enabled", vvtEnabled field = "VVT Control Enabled", vvtEnabled
field = "VVT solenoid freq.", vvtFreq field = "VVT output pin", vvtPin, { vvtEnabled }
field = "VVT solenoid freq.", vvtFreq, { vvtEnabled }
dialog = wc_note dialog = wc_note
field = "For 99% of engines, warmup must have 100% in the final row. Typical maximum is 255% (cold)." field = "For 99% of engines, warmup must have 100% in the final row. Typical maximum is 255% (cold)."

View File

@ -331,6 +331,8 @@ void setPinMapping(byte boardID)
if(configPage1.tachoPin != 0) { pinTachOut = configPage1.tachoPin; } if(configPage1.tachoPin != 0) { pinTachOut = configPage1.tachoPin; }
if(configPage2.fuelPumpPin != 0) { pinFuelPump = configPage2.fuelPumpPin; } if(configPage2.fuelPumpPin != 0) { pinFuelPump = configPage2.fuelPumpPin; }
if(configPage4.fanPin != 0) { pinFan = configPage4.fanPin; } if(configPage4.fanPin != 0) { pinFan = configPage4.fanPin; }
if(configPage3.boostPin != 0) { pinBoost = configPage3.boostPin; }
if(configPage3.vvtPin != 0) { pinVVT_1 = configPage3.vvtPin; }
//Finally, set the relevant pin modes for outputs //Finally, set the relevant pin modes for outputs
pinMode(pinCoil1, OUTPUT); pinMode(pinCoil1, OUTPUT);