Fix duty cycle calculation when sequential fuel is used (+formatting of ini)

This commit is contained in:
Josh Stewart 2017-11-01 13:33:39 +11:00
parent 95aea5637c
commit c7a78ae44f
1 changed files with 63 additions and 62 deletions

View File

@ -160,65 +160,65 @@ page = 1
page = 2 page = 2
flexBoostLow = scalar, S08, 0, "kPa", 1.0, 0.0, -127, 127, 0 flexBoostLow = scalar, S08, 0, "kPa", 1.0, 0.0, -127, 127, 0
flexBoostHigh = scalar, U08, 1, "kPa", 1.0, 0.0, 0.0, 255, 0 flexBoostHigh = scalar, U08, 1, "kPa", 1.0, 0.0, 0.0, 255, 0
asePct = scalar, U08, 2, "%", 1.0, 0.0, 0.0, 95.0, 0 asePct = scalar, U08, 2, "%", 1.0, 0.0, 0.0, 95.0, 0
aseCount = scalar, U08, 3, "s", 1.0, 0.0, 0.0, 255, 0 aseCount = scalar, U08, 3, "s", 1.0, 0.0, 0.0, 255, 0
wueRates = array, U08, 4, [10], "%", 1.0, 0.0, 0.0, 255, 0 wueRates = array, U08, 4, [10], "%", 1.0, 0.0, 0.0, 255, 0
crankingPct= scalar, U08, 14, "%", 1.0, 0.0, 0.0, 255, 0 crankingPct = scalar, U08, 14, "%", 1.0, 0.0, 0.0, 255, 0
pinLayout = bits, U08, 15, [0:7], "Speeduino v0.1", "Speeduino v0.2", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NA6 MX5 PNP", "Turtana PCB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Plazomat I/O 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Daz V6 Shield 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NO2C", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" pinLayout = bits, U08, 15, [0:7], "Speeduino v0.1", "Speeduino v0.2", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NA6 MX5 PNP", "Turtana PCB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Plazomat I/O 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Daz V6 Shield 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NO2C", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
tachoPin = bits, U08, 16, [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" tachoPin = bits, U08, 16, [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"
tachoDiv = bits, U08, 16, [6:7], "Normal", "Half", "INVALID", "INVALID" tachoDiv = bits, U08, 16, [6:7], "Normal", "Half", "INVALID", "INVALID"
unused2-17 = scalar, U08, 17, "ms", 0.1, 0.0, 0.0, 25.5, 1 unused2-17 = scalar, U08, 17, "ms", 0.1, 0.0, 0.0, 25.5, 1
unused2-18 = scalar, U08, 18, "ms", 0.1, 0.0, 0.0, 25.5, 1 unused2-18 = scalar, U08, 18, "ms", 0.1, 0.0, 0.0, 25.5, 1
tpsThresh = scalar, U08, 19, "%/s", 1.0, 0.0, 0.0, 255, 0 tpsThresh = scalar, U08, 19, "%/s", 1.0, 0.0, 0.0, 255, 0
taeTime = scalar, U08, 20, "ms", 10, 0.0, 0.0, 2550, 0 taeTime = scalar, U08, 20, "ms", 10, 0.0, 0.0, 2550, 0
; Display (Options for what the display is showing) ; Display (Options for what the display is showing)
display = bits, U08, 21, [0:2], "Unused", "Adafruit 128x32", "Generic 128x32", "Adafruit 128x64", "Generic 128x64", "INVALID", "INVALID", "INVALID" display = bits, U08, 21, [0:2], "Unused", "Adafruit 128x32", "Generic 128x32", "Adafruit 128x64", "Generic 128x64", "INVALID", "INVALID", "INVALID"
display1 = bits U08, 21, [3:5], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" display1 = bits U08, 21, [3:5], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
display2 = bits U08, 21, [6:7], "O2", "Voltage", "CPU", "Mem" display2 = bits U08, 21, [6:7], "O2", "Voltage", "CPU", "Mem"
display3 = bits U08, 22, [0:2], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" display3 = bits U08, 22, [0:2], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
display4 = bits U08, 22, [3:4], "O2", "Voltage", "CPU", "Mem" display4 = bits U08, 22, [3:4], "O2", "Voltage", "CPU", "Mem"
display5 = bits U08, 22, [5:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" display5 = bits U08, 22, [5:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
displayB1 = bits U08, 23, [0:3], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" displayB1 = bits U08, 23, [0:3], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
displayB2 = bits U08, 23, [4:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT" displayB2 = bits U08, 23, [4:7], "RPM", "PW", "Advance", "VE", "GammaE", "TPS", "IAT", "CLT"
reqFuel = scalar, U08, 24, "ms", 0.1, 0.0, 0.0, 25.5, 1 reqFuel = scalar, U08, 24, "ms", 0.1, 0.0, 0.0, 25.5, 1
divider = scalar, U08, 25, "", 1.0, 0.0 divider = scalar, U08, 25, "", 1.0, 0.0
alternate = bits, U08, 26, [0:0], "Simultaneous", "Alternating" alternate = bits, U08, 26, [0:0], "Simultaneous", "Alternating"
multiplyMAP= bits, U08, 26, [1:1], "No", "Yes" multiplyMAP = bits, U08, 26, [1:1], "No", "Yes"
includeAFR = bits, U08, 26, [2:2], "No", "Yes" includeAFR = bits, U08, 26, [2:2], "No", "Yes"
hardCutType= bits, U08, 26, [3:3], "Full", "Rolling" hardCutType = bits, U08, 26, [3:3], "Full", "Rolling"
unused2-26e= bits, U08, 26, [4:4], "No", "Yes" unused2-26e = bits, U08, 26, [4:4], "No", "Yes"
unused2-26f= bits, U08, 26, [5:5], "No", "Yes" unused2-26f = bits, U08, 26, [5:5], "No", "Yes"
unused2-26g= bits, U08, 26, [6:6], "No", "Yes" unused2-26g = bits, U08, 26, [6:6], "No", "Yes"
indInjAng = bits, U08, 26, [7:7], "Disabled", "Enabled" indInjAng = bits, U08, 26, [7:7], "Disabled", "Enabled"
injOpen = scalar, U08, 27, "ms", 0.1, 0.0, 0.1, 25.5, 1 injOpen = scalar, U08, 27, "ms", 0.1, 0.0, 0.1, 25.5, 1
inj1Ang = scalar, U16, 28, "deg", 1.0, 0.0, 0.0, 360, 0 inj1Ang = scalar, U16, 28, "deg", 1.0, 0.0, 0.0, 360, 0
inj2Ang = scalar, U16, 30, "deg", 1.0, 0.0, 0.0, 360, 0 inj2Ang = scalar, U16, 30, "deg", 1.0, 0.0, 0.0, 360, 0
inj3Ang = scalar, U16, 32, "deg", 1.0, 0.0, 0.0, 360, 0 inj3Ang = scalar, U16, 32, "deg", 1.0, 0.0, 0.0, 360, 0
inj4Ang = scalar, U16, 34, "deg", 1.0, 0.0, 0.0, 360, 0 inj4Ang = scalar, U16, 34, "deg", 1.0, 0.0, 0.0, 360, 0
; Config1 ; Config1
mapSample = bits, U08, 36, [0:1], "Instantaneous", "Cycle Average", "Cycle Minimum", "INVALID" mapSample = bits, U08, 36, [0:1], "Instantaneous", "Cycle Average", "Cycle Minimum", "INVALID"
twoStroke = bits, U08, 36, [2:2], "Four-stroke", "Two-stroke" twoStroke = bits, U08, 36, [2:2], "Four-stroke", "Two-stroke"
injType = bits, U08, 36, [3:3], "Port", "Throttle Body" injType = bits, U08, 36, [3:3], "Port", "Throttle Body"
nCylinders = bits, U08, 36, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" nCylinders = bits, U08, 36, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
; Config2 ; Config2
unused2-37a= bits, U08, 37, [0:1], "INVALID", "None", "None", "None" unused2-37a = bits, U08, 37, [0:1], "INVALID", "None", "None", "None"
unused2-37b= bits, U08, 37, [2:3], "INVALID", "None", "None", "None" unused2-37b = bits, U08, 37, [2:3], "INVALID", "None", "None", "None"
nInjectors = bits, U08, 37, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" nInjectors = bits, U08, 37, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
; Config3 ; Config3
engineType = bits, U08, 38, [0:0], "Even fire", "Odd fire" engineType = bits, U08, 38, [0:0], "Even fire", "Odd fire"
flexEnabled= bits, U08, 38, [1:1], "Off", "On" flexEnabled = bits, U08, 38, [1:1], "Off", "On"
algorithm = bits, U08, 38, [2:2], "Speed Density", "Alpha-N" algorithm = bits, U08, 38, [2:2], "Speed Density", "Alpha-N"
baroCorr = bits, U08, 38, [3:3], "Off", "On" baroCorr = bits, U08, 38, [3:3], "Off", "On"
injLayout = bits, U08, 38, [4:5], "Paired", "Semi-Sequential", "INVALID", "Sequential" injLayout = bits, U08, 38, [4:5], "Paired", "Semi-Sequential", "INVALID", "Sequential"
perToothIgn= bits, U08, 38, [6:6], "No", "Yes" perToothIgn = bits, U08, 38, [6:6], "No", "Yes"
dfcoEnabled= bits, U08, 38, [7:7], "Off", "On" dfcoEnabled = bits, U08, 38, [7:7], "Off", "On"
primePulse = scalar, U08, 39, "ms", 0.1, 0.0, 0.0, 25.5, 1 primePulse = scalar, U08, 39, "ms", 0.1, 0.0, 0.0, 25.5, 1
dutyLim = scalar, U08, 40, "%", 1.0, 0.0, 0.0, 100.0, 0 dutyLim = scalar, U08, 40, "%", 1.0, 0.0, 0.0, 100.0, 0
@ -963,7 +963,7 @@ menuDialog = main
ignBypassEnable = "If turned on, a ground signal will be output during cranking on the specified pin. This is used to bypass the Speeduino ignition control during cranking." ignBypassEnable = "If turned on, a ground signal will be output during cranking on the specified pin. This is used to bypass the Speeduino ignition control during cranking."
ignCranklock = "On certain low resolution ignition patterns, the cranking timing can be locked to occur when a pulse is recieved." ignCranklock = "On certain low resolution ignition patterns, the cranking timing can be locked to occur when a pulse is recieved."
multiplyMAP = "If enabled, the MAP reading is included directly into the pulsewidth calculation. This results in a flatter VE table that can be easier to tune in some instances. VE table must be retuned when this value is changed." multiplyMAP = "If enabled, the MAP reading is included directly into the pulsewidth calculation by multiplying the VE lookup value by the MAP:Baro ratio. This results in a flatter VE table that can be easier to tune in some instances. VE table must be retuned when this value is changed."
includeAFR = "When enabled, the current AFR reading is incorporated directly in the pulsewidth calculation as a percentage of the current target ratio. VE table must be retuned when this value is changed. " includeAFR = "When enabled, the current AFR reading is incorporated directly in the pulsewidth calculation as a percentage of the current target ratio. VE table must be retuned when this value is changed. "
useExtBaro = "By Default, Speeduino will measure barometric pressure upon startup. Optionally however, a 2nd pressure sensor can be used to perform live barometric readings whilst the system is on." useExtBaro = "By Default, Speeduino will measure barometric pressure upon startup. Optionally however, a 2nd pressure sensor can be used to perform live barometric readings whilst the system is on."
@ -1185,8 +1185,8 @@ menuDialog = main
panel = veTable1Tbl panel = veTable1Tbl
dialog = veTableDialog_south, "" dialog = veTableDialog_south, ""
field = "Multiply VE value by MAP", multiplyMAP field = "Multiply VE value by MAP:Baro ratio", multiplyMAP
field = "Include AFR directly", includeAFR, { egoType == 2 } field = "Multiply by ratio of AFR to Target AFR", includeAFR, { egoType == 2 }
dialog = veTableDialog, "VE Table" dialog = veTableDialog, "VE Table"
panel = veTableDialog_north, North panel = veTableDialog_north, North
@ -1390,19 +1390,19 @@ menuDialog = main
dialog = mapCal, "Calibrate MAP" dialog = mapCal, "Calibrate MAP"
field = "#MAP Sensor" field = "#MAP Sensor"
settingSelector = "Common Pressure Sensors" settingSelector = "Common Pressure Sensors"
settingOption = "MPX4115", mapMin=10, mapMax=122 settingOption = "MPX4115", mapMin=10, mapMax=118 ; https://www.nxp.com/docs/en/data-sheet/MPX4115.pdf
settingOption = "MPX4250", mapMin=10, mapMax=260 settingOption = "MPX4250", mapMin=10, mapMax=260 ; https://www.nxp.com/docs/en/data-sheet/MPX4250A.pdf Vout = VCC x (P x 0.004 0.04)
settingOption = "GM 1-BAR", mapMin=10, mapMax=105 settingOption = "GM 1-BAR", mapMin=10, mapMax=105 ; https://speeduino.com/wiki/index.php/File:GM_Table.gif
settingOption = "GM 2-BAR", mapMin=9, mapMax=208 settingOption = "GM 2-BAR", mapMin=9, mapMax=208 ; https://speeduino.com/wiki/index.php/File:GM_Table.gif
settingOption = "GM 3-BAR / MPXH6300", mapMin=1, mapMax=315 settingOption = "GM 3-BAR", mapMin=1, mapMax=315 ; VOUT = VS*(.00318*P-.00353)
settingOption = "MPXH5700", mapMin=0, mapMax=700 settingOption = "MPXH6300", mapMin=1, mapMax=315 ; https://www.nxp.com/docs/en/data-sheet/MPXH6300A.pdf VOUT = VS*(.00318*P-.00353)
settingOption = "MPXH6400", mapMin=3, mapMax=416 settingOption = "MPX5700", mapMin=-31, mapMax=746 ; https://www.nxp.com/docs/en/data-sheet/MPX5700.pdf Vout = VS*(0.0012858*P+0.04)
settingOption = "MPX4400", mapMin=0, mapMax=400 settingOption = "MPX6400", mapMin=3, mapMax=416 ; https://www.nxp.com/docs/en/data-sheet/MPXH6400A.pdf VOUT = VS x (0.002421xP0.00842)
settingOption = "Denso 079800", mapMin=0, mapMax=173 ; http://speeduino.com/forum/viewtopic.php?f=18&t=510&p=7023#p7021 settingOption = "Denso 079800", mapMin=0, mapMax=173 ; http://speeduino.com/forum/viewtopic.php?f=18&t=510&p=7023#p7021
settingOption = "VW/Audi/Porsche 250kPa", mapMin=26, mapMax=250 ; http://speeduino.com/forum/viewtopic.php?p=17502#p17502 settingOption = "VW/Audi/Porsche 250kPa", mapMin=26, mapMax=250 ; http://speeduino.com/forum/viewtopic.php?p=17502#p17502
field = "Value At 0.0 Volts", mapMin field = "kPa At 0.0 Volts", mapMin
field = "Value At 5.0 Volts", mapMax field = "kPa At 5.0 Volts", mapMax
field = "#Baro Sensor" field = "#Baro Sensor"
field = "Use external Baro sensor", useExtBaro field = "Use external Baro sensor", useExtBaro
@ -2276,7 +2276,8 @@ cmdtestspk450dc = "E\x03\x0C"
throttle = { tps }, "%" throttle = { tps }, "%"
cycleTime = { rpm ? ( 60000.0 / rpm ) : 0 } cycleTime = { rpm ? ( 60000.0 / rpm ) : 0 }
dutyCycle = { rpm ? ( 100.0*pulseWidth/cycleTime ) : 0 } cycleMultiplier = { injLayout == 3 ? 2 : 1 }
dutyCycle = { rpm ? ( 100.0*pulseWidth/(cycleTime * cycleMultiplier) ) : 0 }
boostCutOut = { boostCutFuel || boostCutSpark } boostCutOut = { boostCutFuel || boostCutSpark }
lambda = { afr / stoich } lambda = { afr / stoich }