PJSC(Pump Jet Solenoid Controller)はArduinoを使用したバイク用燃料噴射コントローラです。このプロジェクトは、オープンソースECUプロジェクト『Speeduino』をベースにしています。
Speeduino Jun.2018 version.
Date: July 3rd 2018
Details: See https://speeduino.com/forum/viewtopic.php?f=13&t=1938
Download: https://speeduino.com/wiki/images/e/e0/Speeduino-Jun18.zip
Change List:
- 2 stage nitrous control
- Acceleration enrichment now has a RPM based taper. This scales the AE amount down linearly as the RPMs increase, which allows a more useful enrichment throughout the whole RPM range.
- Auto switching of TPS reverse calibration. If the TPS is wired with the 5v and Gnd 'reversed', then the calibration will now auto adjust for this without the need to change the wiring.
- Add an On/Off mode for the locked timing option. This means you can now lock your timing at 0 degrees for testing if needed
- Fixed a bug that would prevent the missing tooth pattern running correctly at cam speed
- Many improvements to the 6g72 (6 cylinder) version of the 4g63 decoder. Still needs more testing on vehicle.
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | MTversion = 2.25 |
| 7 | 7 | |
| 8 | 8 | queryCommand = "Q" |
| 9 | - signature = "speeduino 201805" | |
| 9 | + signature = "speeduino 201806" | |
| 10 | 10 | versionInfo = "S" ;This info is what is displayed to user |
| 11 | 11 | |
| 12 | 12 | [TunerStudio] |
| @@ -54,6 +54,8 @@ | ||
| 54 | 54 | ;algorithmUnits = bits, U08, [0:2], $loadSourceUnits |
| 55 | 55 | algorithmUnits = bits, U08, [0:2], "kPa", "% TPS", "%", "% TPS", "INVALID", "INVALID", "INVALID", "INVALID" |
| 56 | 56 | algorithmLimits= array, U16, [8], "", 1.0, 0, 0, 511, 0, noMsqSave |
| 57 | + #define all_IO_Pins = "Board Default", "INVALID", "INVALID", "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", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "INVALID" | |
| 58 | + #define IO_Pins_no_def = "INVALID", "INVALID", "INVALID", "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", "A8", "A9", "A10", "A11", "A12", "A13", "A14", "A15", "INVALID" | |
| 57 | 59 | |
| 58 | 60 | boostTableLabels = bits, U08, [0:1], "Duty Cycle %", "kPa" |
| 59 | 61 |
| @@ -220,7 +222,7 @@ | ||
| 220 | 222 | |
| 221 | 223 | ; Config2 |
| 222 | 224 | algorithm = bits, U08, 37, [0:2], $loadSourceNames ;Has to be called algorithm for the req fuel calculator to work :( |
| 223 | - unused2_37d = bits, U08, 37, [3:3], "Off", "On" | |
| 225 | + fixAngEnable = bits, U08, 37, [3:3], "Off", "On" | |
| 224 | 226 | nInjectors = bits, U08, 37, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID" |
| 225 | 227 | |
| 226 | 228 | ; Config3 |
| @@ -252,8 +254,8 @@ | ||
| 252 | 254 | idleUpPolarity= bits, U08, 57, [6:6], "Normal", "Inverted" |
| 253 | 255 | idleUpEnabled = bits, U08, 57, [7:7], "Off", "On" |
| 254 | 256 | idleUpAdder = scalar, U08, 58, "% / Steps" 1.0, 0.0, 0.0, 250.0, 0 |
| 255 | - unused2-59 = scalar, U08, 59, "Deg", 1.0, 0.0, 0.0, 250.0, 0 | |
| 256 | - unused2-60 = scalar, U08, 60, "Deg", 1.0, 0.0, 0.0, 250.0, 0 | |
| 257 | + taeTaperMin = scalar, U08, 59, "RPM", 100, 0.0, 1000, 10000, 0 | |
| 258 | + taeTaperMax = scalar, U08, 60, "RPM", 100, 0.0, 2000, 10000, 0 | |
| 257 | 259 | |
| 258 | 260 | iacCLminDuty = scalar, U08, 61, "%", 1.0, 0.0, 0.0, 100.0, 0 ; Minimum and maximum duty cycles when using closed loop idle |
| 259 | 261 | iacCLmaxDuty = scalar, U08, 62, "%", 1.0, 0.0, 0.0, 100.0, 0 |
| @@ -351,9 +353,9 @@ | ||
| 351 | 353 | dfcoHyster = scalar, U08, 61, "RPM", 1.0, 0.0, 100, 255.0, 0 |
| 352 | 354 | dfcoTPSThresh= scalar, U08, 62, "%", 1.0, 0.0, 0, 100.0, 0 |
| 353 | 355 | ;Cranking ignition bypass |
| 354 | - ignBypassEnable = bits, U08, 63, [0:0], "Off", "On" | |
| 355 | - ignBypassPin = bits , U08, 63, [1:6], "INVALID", "INVALID", "INVALID", "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" | |
| 356 | - ignBypassHiLo = bits, U08, 63, [7:7], "LOW", "HIGH" | |
| 356 | + ignBypassEnable = bits, U08, 63, [0:0], "Off", "On" | |
| 357 | + ignBypassPin = bits , U08, 63, [1:6], "INVALID", "INVALID", "INVALID", "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" | |
| 358 | + ignBypassHiLo = bits, U08, 63, [7:7], "LOW", "HIGH" | |
| 357 | 359 | |
| 358 | 360 | unused4-64 = array, U08, 64, [63], "%", 1.0, 0.0, 0.0, 255, 0 |
| 359 | 361 | ;-------------------------------------------------- |
| @@ -423,7 +425,7 @@ | ||
| 423 | 425 | ; Launch Control |
| 424 | 426 | launchPin = bits , U08, 48, [0:5], "Board Default", "INVALID", "INVALID", "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" |
| 425 | 427 | launchEnable= bits, U08, 48, [6:6], "No", "Yes" |
| 426 | - launchHiLo = bits, U08, 48, [7:7], "LOW", "HIGH" | |
| 428 | + launchHiLo = bits, U08, 48, [7:7], "LOW", "HIGH" | |
| 427 | 429 | |
| 428 | 430 | lnchSoftLim = scalar, U08, 49, "rpm", 100, 0.0, 100, 25500, 0 |
| 429 | 431 | lnchRetard = scalar, S08, 50, "deg", 1.0, 0.0, -30, 40, 0 |
| @@ -742,8 +744,38 @@ | ||
| 742 | 744 | flexAdvBins = array, U08, 63, [6], "%", 1.0, 0.0, 0.0, 250.0, 0 |
| 743 | 745 | flexAdvAdj = array, U08, 69, [6], "Deg", 1.0, 0.0, 0.0, 250.0, 0 |
| 744 | 746 | |
| 745 | - unused11_75_191 = array, U08, 75,[116],"RPM", 100.0, 0.0, 100, 25500, 0 | |
| 747 | + n2o_enable = bits , U08, 75, [0:1], "Off","1 Stage","2 stage", "INVALID" | |
| 748 | + n2o_arming_pin = bits , U08, 75, [2:7], $IO_Pins_no_def | |
| 749 | +#if CELSIUS | |
| 750 | + n2o_minCLT = scalar, U08, 76, "C", 1.0, -40, -40, 215, 0 | |
| 751 | +#else | |
| 752 | + n2o_minCLT = scalar, U08, 76, "F", 1.8, -22.23, -40, 215, 0 | |
| 753 | +#endif | |
| 754 | + n2o_maxMAP = scalar, U08, 77, "kPa", 2.0, 0.0, 0.0, 511.0, 0 | |
| 755 | + n2o_minTPS = scalar, U08, 78, "%TPS", 1.0, 0.0, 0.0, 100, 0 | |
| 756 | + n2o_maxAFR = scalar, U08, 79, "kPa", 0.1, 0.0, 0.0, 25.5, 1 | |
| 757 | + | |
| 746 | 758 | |
| 759 | + n2o_stage1_pin = bits , U08, 80, [0:5], $IO_Pins_no_def | |
| 760 | + n2o_pin_polarity = bits , U08, 80, [6:6], "HIGH", "LOW" | |
| 761 | + n2o_unused = bits , U08, 80, [7:7], "INVALID", "INVALID" | |
| 762 | + n2o_stage1_minRPM = scalar, U08, 81, "RPM", 100, 0.0, 1000, 10000, 0 | |
| 763 | + n2o_stage1_maxRPM = scalar, U08, 82, "RPM", 100, 0.0, 1000, 10000, 0 | |
| 764 | + n2o_stage1_adderMin = scalar, U08, 83, "ms", 0.1, 0, 0, 25.5, 1 | |
| 765 | + n2o_stage1_adderMax = scalar, U08, 84, "ms", 0.1, 0, 0, 25.5, 1 | |
| 766 | + n2o_stage1_retard = scalar, U08, 85, "Deg", 1.0, 0.0, 0.0, 250.0, 0 | |
| 767 | + | |
| 768 | + n2o_stage2_pin = bits , U08, 86, [0:5], $IO_Pins_no_def | |
| 769 | + n2o_stage2_unused = bits , U08, 86, [6:7], "INVALID", "INVALID", "INVALID", "INVALID" | |
| 770 | + n2o_stage2_minRPM = scalar, U08, 87, "RPM", 100, 0.0, 1000, 10000, 0 | |
| 771 | + n2o_stage2_maxRPM = scalar, U08, 88, "RPM", 100, 0.0, 1000, 10000, 0 | |
| 772 | + n2o_stage2_adderMin = scalar, U08, 89, "ms", 0.1, 0, 0, 32, 1 | |
| 773 | + n2o_stage2_adderMax = scalar, U08, 90, "ms", 0.1, 0, 0, 32, 1 | |
| 774 | + n2o_stage2_retard = scalar, U08, 91, "Deg", 1.0, 0.0, 0.0, 250.0, 0 | |
| 775 | + | |
| 776 | + | |
| 777 | + unused11_75_191 = array, U08, 92,[99],"RPM", 100.0, 0.0, 100, 25500, 0 | |
| 778 | + | |
| 747 | 779 | ;------------------------------------------------------------------------------- |
| 748 | 780 | |
| 749 | 781 | [ConstantsExtensions] |
| @@ -782,6 +814,9 @@ | ||
| 782 | 814 | requiresPowerCycle = stagingEnabled |
| 783 | 815 | requiresPowerCycle = resetControl |
| 784 | 816 | requiresPowerCycle = resetControlPin |
| 817 | + requiresPowerCycle = n2o_enable | |
| 818 | + requiresPowerCycle = n2o_arming_pin | |
| 819 | + requiresPowerCycle = n2o_pin_polarity | |
| 785 | 820 | |
| 786 | 821 | defaultValue = pinLayout, 1 |
| 787 | 822 | defaultValue = TrigPattern, 0 |
| @@ -823,14 +858,18 @@ | ||
| 823 | 858 | defaultValue = boostSens, 2000 |
| 824 | 859 | defaultValue = boostIntv, 30 |
| 825 | 860 | defaultValue = sparkDur, 1.0 |
| 826 | - defaultValue = speeduino_tsCanId, 0 | |
| 827 | - defaultValue = true_address, 256 | |
| 828 | - defaultValue = realtime_base_address, 336 | |
| 861 | + defaultValue = fixAngEnable,0 | |
| 862 | + defaultValue = n2o_enable, 0 | |
| 863 | + defaultValue = speeduino_tsCanId, 0 | |
| 864 | + defaultValue = true_address, 256 | |
| 865 | + defaultValue = realtime_base_address, 336 | |
| 829 | 866 | defaultValue = VVTasOnOff, 0 |
| 830 | 867 | defaultValue = stagingEnabled, 0 |
| 831 | 868 | defaultValue = lnchCtrlTPS, 0 |
| 832 | 869 | defaultValue = resetControl, 0 |
| 833 | 870 | defaultValue = bootloaderCaps, 0 |
| 871 | + defaultValue = taeTaperMin, 1000 | |
| 872 | + defaultValue = taeTaperMax, 5000 | |
| 834 | 873 | ; defaultValue = obd_address, 0 |
| 835 | 874 | |
| 836 | 875 | ;Default pins |
| @@ -932,6 +971,7 @@ | ||
| 932 | 971 | subMenu = fanSettings, "Thermo Fan" |
| 933 | 972 | subMenu = LaunchControl, "Launch Control / Flat Shift" |
| 934 | 973 | subMenu = fuelpump, "Fuel Pump" |
| 974 | + subMenu = NitrousControl, "Nitrous" | |
| 935 | 975 | subMenu = std_separator |
| 936 | 976 | subMenu = boostSettings, "Boost Control" |
| 937 | 977 | subMenu = boostLoad, "Boost Targets/Load", 8, { boostEnabled } |
| @@ -1003,6 +1043,8 @@ | ||
| 1003 | 1043 | sparkMode = "Wasted Spark: Ignition outputs are on the channels <= half the number of cylinders. Eg 4 cylinder outputs on IGN1 and IGN2.\nSingle Channel: All ignition pulses are output on IGN1.\nWasted COP: Ignition pulses are output on all ignition channels up to the number of cylinders. Eg 4 cylinder outputs on all ignition channels. No valid for >4 cylinders" |
| 1004 | 1044 | IgInv = "Whether the spark fires when the ignition signal goes high or goes low. Nearly all ignition systems use 'Going Low' but please verify this as damage to coils can result from the incorrect selection. (NOTE: THIS IS NOT MEGASQUIRT. THIS SETTING IS USUALLY THE OPPOSITE OF WHAT THEY USE!)" |
| 1005 | 1045 | sparkDur = "The duration of the spark at full dwell. Typically around 1ms" |
| 1046 | + fixAngEnable= "If enabled, timing will be locked/fixed and the ignition map will be ignored" | |
| 1047 | + FixAng = "Timing will be locked at this value if the above is enabled" | |
| 1006 | 1048 | |
| 1007 | 1049 | crankRPM = "The cranking RPM threshold. When RPM is lower than this value (and above 0) the system will be considered to be cranking" |
| 1008 | 1050 |
| @@ -1048,6 +1090,9 @@ | ||
| 1048 | 1090 | flexAdvAdj = "Additional advance (in degrees) for the current ethanol % (Typically 0 @ 0%, 10-20 @ 100%)" |
| 1049 | 1091 | flexBoostAdj = "Adjustment, in kPa, to the boost target for the current ethanol %. Negative values are allowed to lower boost at lower ethanol % if necessary." |
| 1050 | 1092 | |
| 1093 | + n2o_arming_pin = "Pin that the nitrous arming/enagement switch is on." | |
| 1094 | + n2o_pin_polarity = "Whether Nitrous is active (Armed) when the pin is LOW or HIGH. If LOW is selected, the internal pullup will be used." | |
| 1095 | + | |
| 1051 | 1096 | flatSArm = "The RPM switch point that determines whether an eganged clutch is for launch control or flat shift. Below this figure, an engaged clutch is considered to be for launch, above this figure an active clutch input will be considered a flat shift. This should be set at least several hundred RPM above idle" |
| 1052 | 1097 | 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" |
| 1053 | 1098 | flatSRetard = "The absolute timing (BTDC) that will be used when within the soft limit window" |
| @@ -1223,8 +1268,10 @@ | ||
| 1223 | 1268 | field = "Output speed", tachoDiv |
| 1224 | 1269 | |
| 1225 | 1270 | dialog = accelEnrichments_center, "" |
| 1226 | - field = "TPSdot Threshold", tpsThresh | |
| 1227 | - field = "Accel Time", taeTime | |
| 1271 | + field = "TPSdot Threshold", tpsThresh | |
| 1272 | + field = "Accel Time", taeTime | |
| 1273 | + field = "Taper Start RPM", taeTaperMin | |
| 1274 | + field = "Taper End RPM", taeTaperMax | |
| 1228 | 1275 | |
| 1229 | 1276 | dialog = accelEnrichments_south, "Decelleration Fuel Cutoff (DFCO)" |
| 1230 | 1277 | field = "Enabled", dfcoEnabled |
| @@ -1312,8 +1359,8 @@ | ||
| 1312 | 1359 | field = "Maximum valve duty", iacCLmaxDuty, { iacAlgorithm == 3 } |
| 1313 | 1360 | |
| 1314 | 1361 | dialog = idleSettings, "Idle Settings" |
| 1315 | - topicHelp = "http://speeduino.com/wiki/index.php/Idle" | |
| 1316 | - field = "Idle control type", iacAlgorithm | |
| 1362 | + topicHelp = "http://speeduino.com/wiki/index.php/Idle" | |
| 1363 | + field = "Idle control type", iacAlgorithm | |
| 1317 | 1364 | field = "#Fast Idle" |
| 1318 | 1365 | field = "Fast idle temp", iacFastTemp, { iacAlgorithm == 1 } |
| 1319 | 1366 | panel = pwm_idle |
| @@ -1365,7 +1412,6 @@ | ||
| 1365 | 1412 | field = "Primary base teeth", numTeeth, { TrigPattern == 0 || TrigPattern == 2 || TrigPattern == 11 } |
| 1366 | 1413 | field = "Primary trigger speed", TrigSpeed, { TrigPattern == 0 } |
| 1367 | 1414 | field = "Missing teeth", missingTeeth, { TrigPattern == 0 } |
| 1368 | - field = "Secondary teeth", missingTeeth, { TrigPattern == 2 } | |
| 1369 | 1415 | field = "Trigger angle multiplier", TrigAngMul, { TrigPattern == 11 } |
| 1370 | 1416 | field = "Trigger Angle ", TrigAng |
| 1371 | 1417 | field = "This number represents the angle ATDC when " |
| @@ -1374,9 +1420,9 @@ | ||
| 1374 | 1420 | field = "Skip Revolutions", SkipCycles |
| 1375 | 1421 | field = "Note: This is the number of revolutions that will be skipped during" |
| 1376 | 1422 | field = "cranking before the injectors and coils are fired" |
| 1377 | - field = "Trigger edge", TrigEdge | |
| 1378 | - field = "Secondary trigger edge", TrigEdgeSec, { TrigPattern == 0 || TrigPattern == 2 || TrigPattern == 9 || TrigPattern == 12 } ;Missing tooth, dual wheel and Miata 9905 | |
| 1379 | - field = "Missing Tooth Secondary type" trigPatternSec, { TrigPattern == 0 } | |
| 1423 | + field = "Trigger edge", TrigEdge { TrigPattern != 4 } ;4G63 uses both edges | |
| 1424 | + field = "Secondary trigger edge", TrigEdgeSec, { (TrigPattern == 0 && TrigSpeed == 0) || TrigPattern == 2 || TrigPattern == 9 || TrigPattern == 12 } ;Missing tooth, dual wheel and Miata 9905 | |
| 1425 | + field = "Missing Tooth Secondary type" trigPatternSec, { (TrigPattern == 0&& TrigSpeed == 0) } | |
| 1380 | 1426 | field = "Trigger Filter", TrigFilter |
| 1381 | 1427 | field = "Re-sync every cycle", useResync, { TrigPattern == 2 || TrigPattern == 4 || TrigPattern == 7 || TrigPattern == 12 || TrigPattern == 9 } ;Dual wheel, 4G63, Audi 135, Nissan 360, Miata 99-05 |
| 1382 | 1428 | field = "" |
| @@ -1389,7 +1435,8 @@ | ||
| 1389 | 1435 | field = "Cranking advance Angle", CrankAng |
| 1390 | 1436 | field = "Spark Outputs triggers", IgInv |
| 1391 | 1437 | field = "" |
| 1392 | - field = "Fixed Angle (0 = use map)", FixAng | |
| 1438 | + field = "Enabled Fixed/Locked timing", fixAngEnable | |
| 1439 | + field = "Fixed Angle", FixAng, { fixAngEnable } | |
| 1393 | 1440 | |
| 1394 | 1441 | dialog = dwellSettings, "Dwell Settings", 4 |
| 1395 | 1442 | topicHelp = "http://speeduino.com/wiki/index.php/Dwell" |
| @@ -1456,7 +1503,37 @@ | ||
| 1456 | 1503 | field = "Soft rev window", flatSSoftWin, { flatSEnable } |
| 1457 | 1504 | field = "Soft limit absolute timing", flatSRetard, { flatSEnable } |
| 1458 | 1505 | |
| 1506 | + dialog = NitrousStage1, "Stage 1" | |
| 1507 | + field = "Nitrous Output Pin", n2o_stage1_pin | |
| 1508 | + field = "Minimum Engage RPM", n2o_stage1_minRPM | |
| 1509 | + field = "Maximum Engage RPM", n2o_stage1_maxRPM | |
| 1510 | + field = "Fuel adder @ Min RPM", n2o_stage1_adderMin | |
| 1511 | + field = "Fuel adder @ Max RPM", n2o_stage1_adderMax | |
| 1512 | + field = "Ignition retard when active", n2o_stage1_retard | |
| 1459 | 1513 | |
| 1514 | + dialog = NitrousStage2, "Stage 2" | |
| 1515 | + field = "Nitrous Output Pin", n2o_stage2_pin | |
| 1516 | + field = "Minimum Engage RPM", n2o_stage2_minRPM | |
| 1517 | + field = "Maximum Engage RPM", n2o_stage2_maxRPM | |
| 1518 | + field = "Fuel adder @ Min RPM", n2o_stage2_adderMin | |
| 1519 | + field = "Fuel adder @ Max RPM", n2o_stage2_adderMax | |
| 1520 | + field = "Ignition retard when active", n2o_stage2_retard | |
| 1521 | + | |
| 1522 | + dialog = NitrousMain, "Settings" | |
| 1523 | + field = "Nitrous Mode", n2o_enable | |
| 1524 | + field = "Arming Pin", n2o_arming_pin, { n2o_enable > 0 } | |
| 1525 | + field = "Nitrous is armed when pin is", n2o_pin_polarity,{ n2o_enable > 0 } | |
| 1526 | + field = "Minimum CLT", n2o_minCLT, { n2o_enable > 0 } | |
| 1527 | + field = "Minimum TPS", n2o_minTPS, { n2o_enable > 0 } | |
| 1528 | + field = "Maximum MAP", n2o_maxMAP, { n2o_enable > 0 } | |
| 1529 | + field = "Leanest AFR", n2o_maxAFR, { n2o_enable > 0 } | |
| 1530 | + | |
| 1531 | + dialog = NitrousControl, "Nitrous" | |
| 1532 | + panel = NitrousMain, North | |
| 1533 | + panel = NitrousStage1, West, { n2o_enable > 0 } | |
| 1534 | + panel = NitrousStage2, East, { n2o_enable > 1 } | |
| 1535 | + | |
| 1536 | + | |
| 1460 | 1537 | dialog = OLED, "OLED Display", 2 |
| 1461 | 1538 | field = "Display Type", display |
| 1462 | 1539 | field = "#Note" |
| @@ -2344,6 +2421,7 @@ | ||
| 2344 | 2421 | indicator = { sync }, "No Sync", "Sync", white, black, green, black |
| 2345 | 2422 | indicator = { resetLockOn }, "Reset Lock OFF","Reset Lock ON", red, black, green, black |
| 2346 | 2423 | indicator = { bootloaderCaps > 0 }, "Std. Boot", "Custom Boot", white, black, white, black |
| 2424 | + indicator = { nitrousOn }, "Nitrous Off", "Nitrous On", white, black, red, black | |
| 2347 | 2425 | |
| 2348 | 2426 | ;------------------------------------------------------------------------------- |
| 2349 | 2427 |
| @@ -2427,13 +2505,13 @@ | ||
| 2427 | 2505 | canin_gauge6 = scalar, U16, 53, "", 1.000, 0.000 |
| 2428 | 2506 | canin_gauge7 = scalar, U16, 55, "", 1.000, 0.000 |
| 2429 | 2507 | canin_gauge8 = scalar, U16, 57, "", 1.000, 0.000 |
| 2430 | - canin_gauge9 = scalar, U16, 59, "", 1.000, 0.000 | |
| 2431 | - canin_gauge10 = scalar, U16, 61, "", 1.000, 0.000 | |
| 2432 | - canin_gauge11 = scalar, U16, 63, "", 1.000, 0.000 | |
| 2433 | - canin_gauge12 = scalar, U16, 65, "", 1.000, 0.000 | |
| 2434 | - canin_gauge13 = scalar, U16, 67, "", 1.000, 0.000 | |
| 2435 | - canin_gauge14 = scalar, U16, 69, "", 1.000, 0.000 | |
| 2436 | - canin_gauge15 = scalar, U16, 71, "", 1.000, 0.000 | |
| 2508 | + canin_gauge9 = scalar, U16, 59, "", 1.000, 0.000 | |
| 2509 | + canin_gauge10 = scalar, U16, 61, "", 1.000, 0.000 | |
| 2510 | + canin_gauge11 = scalar, U16, 63, "", 1.000, 0.000 | |
| 2511 | + canin_gauge12 = scalar, U16, 65, "", 1.000, 0.000 | |
| 2512 | + canin_gauge13 = scalar, U16, 67, "", 1.000, 0.000 | |
| 2513 | + canin_gauge14 = scalar, U16, 69, "", 1.000, 0.000 | |
| 2514 | + canin_gauge15 = scalar, U16, 71, "", 1.000, 0.000 | |
| 2437 | 2515 | tpsADC = scalar, U08, 73, "ADC",1.000, 0.000 |
| 2438 | 2516 | errors = scalar, U08, 74, "bits", 1.000, 0.000 |
| 2439 | 2517 | errorNum = bits, U08, 74, [0:1] |
| @@ -2443,7 +2521,8 @@ | ||
| 2443 | 2521 | pulseWidth4 = scalar, U16, 79, "ms", 0.001, 0.000 |
| 2444 | 2522 | status3 = scalar, U08, 81, "bits", 1.000, 0.000 |
| 2445 | 2523 | resetLockOn = bits, U08, 81, [0:0] |
| 2446 | - unused81_1-4 = bits, U08, 81, [1:4] | |
| 2524 | + nitrousOn = bits, U08, 81, [1:1] | |
| 2525 | + unused81_2-4 = bits, U08, 81, [2:4] | |
| 2447 | 2526 | nSquirts = bits, U08, 81, [5:7] |
| 2448 | 2527 | flexBoostCor = scalar, S16, 82, "kPa", 1.000, 0.000 |
| 2449 | 2528 | nChannels = scalar, U08, 84, "bits", 1.000, 0.000 |
| @@ -2508,59 +2587,60 @@ | ||
| 2508 | 2587 | ; Type - Data type of output, converted before writing. |
| 2509 | 2588 | ; Format - C-style output format of data. |
| 2510 | 2589 | ; |
| 2511 | - ; Channel Label Type Format | |
| 2512 | - ; -------------- ---------- ----- ------ | |
| 2513 | - entry = time, "Time", float, "%.3f" | |
| 2514 | - entry = secl, "SecL", int, "%d" | |
| 2515 | - entry = rpm, "RPM", int, "%d" | |
| 2516 | - entry = map, "MAP", int, "%d" | |
| 2517 | - entry = MAPxRPM, "MAPxRPM", int, "%d" | |
| 2518 | - entry = tps, "TPS", int, "%d" | |
| 2519 | - entry = afr, "O2", float, "%.3f" | |
| 2520 | - entry = lambda, "Lambda", float, "%.3f" | |
| 2521 | - entry = iat, "IAT", int, "%d" | |
| 2522 | - entry = coolant, "CLT", int, "%d" | |
| 2523 | - entry = engine, "Engine", int, "%d" | |
| 2524 | - entry = DFCOOn, "DFCO", int, "%d" | |
| 2525 | - entry = egoCorrection, "Gego", int, "%d" | |
| 2526 | - entry = airCorrection, "Gair", int, "%d" | |
| 2527 | - entry = batCorrection, "Gbattery", int, "%d" | |
| 2528 | - entry = warmupEnrich, "Gwarm", int, "%d" | |
| 2590 | + ; Channel Label Type Format | |
| 2591 | + ; -------------- ---------- ----- ------ | |
| 2592 | + entry = time, "Time", float, "%.3f" | |
| 2593 | + entry = secl, "SecL", int, "%d" | |
| 2594 | + entry = rpm, "RPM", int, "%d" | |
| 2595 | + entry = map, "MAP", int, "%d" | |
| 2596 | + entry = MAPxRPM, "MAPxRPM", int, "%d" | |
| 2597 | + entry = tps, "TPS", int, "%d" | |
| 2598 | + entry = afr, "O2", float, "%.3f" | |
| 2599 | + entry = lambda, "Lambda", float, "%.3f" | |
| 2600 | + entry = iat, "IAT", int, "%d" | |
| 2601 | + entry = coolant, "CLT", int, "%d" | |
| 2602 | + entry = engine, "Engine", int, "%d" | |
| 2603 | + entry = DFCOOn, "DFCO", int, "%d" | |
| 2604 | + entry = egoCorrection, "Gego", int, "%d" | |
| 2605 | + entry = airCorrection, "Gair", int, "%d" | |
| 2606 | + entry = batCorrection, "Gbattery", int, "%d" | |
| 2607 | + entry = warmupEnrich, "Gwarm", int, "%d" | |
| 2529 | 2608 | ;entry = baroCorrection, "Gbaro", int, "%d" |
| 2530 | - entry = gammaEnrich, "Gammae", int, "%d" | |
| 2531 | - entry = accelEnrich, "Accel Enrich",int, "%d" | |
| 2532 | - entry = veCurr, "VE", int, "%d" | |
| 2533 | - entry = pulseWidth, "PW", float, "%.1f" | |
| 2534 | - entry = afrTarget, "AFR Target", float, "%.3f" | |
| 2535 | - entry = pulseWidth, "PW2", float, "%.1f" | |
| 2536 | - entry = dutyCycle, "DutyCycle1", float, "%.1f" | |
| 2537 | - entry = dutyCycle, "DutyCycle2", float, "%.1f" | |
| 2538 | - entry = TPSdot, "TPS DOT", int, "%d" | |
| 2539 | - entry = advance, "Advance", int, "%d" | |
| 2540 | - entry = dwell, "Dwell", float, "%.1f" | |
| 2541 | - entry = batteryVoltage, "Battery V", float, "%.1f" | |
| 2542 | - entry = rpmDOT, "rpm/s", int, "%d" | |
| 2543 | - entry = flex, "Eth %", int, "%d", { flexEnabled } | |
| 2544 | - entry = errorNum, "Error #", int, "%d" | |
| 2545 | - entry = currentError, "Error ID", int, "%d" | |
| 2546 | - entry = map_psi, "Boost PSI", float, "%.1f" | |
| 2547 | - entry = boostTarget, "Boost Target",int, "%d", { boostEnabled } | |
| 2548 | - entry = boostDuty, "Boost Duty", int, "%d", { boostEnabled } | |
| 2549 | - entry = boostCutOut , "Boost cut", int, "%d" | |
| 2550 | - entry = launchHard , "Launch Hard", int, "%d" | |
| 2551 | - entry = hardLimitOn , "Hard Limiter",int, "%d" | |
| 2552 | - entry = idleLoad, "IAC value", int, "%d" | |
| 2609 | + entry = gammaEnrich, "Gammae", int, "%d" | |
| 2610 | + entry = accelEnrich, "Accel Enrich", int, "%d" | |
| 2611 | + entry = veCurr, "VE", int, "%d" | |
| 2612 | + entry = pulseWidth, "PW", float, "%.1f" | |
| 2613 | + entry = afrTarget, "AFR Target", float, "%.3f" | |
| 2614 | + entry = pulseWidth, "PW2", float, "%.1f" | |
| 2615 | + entry = dutyCycle, "DutyCycle1", float, "%.1f" | |
| 2616 | + entry = dutyCycle, "DutyCycle2", float, "%.1f" | |
| 2617 | + entry = TPSdot, "TPS DOT", int, "%d" | |
| 2618 | + entry = advance, "Advance", int, "%d" | |
| 2619 | + entry = dwell, "Dwell", float, "%.1f" | |
| 2620 | + entry = batteryVoltage, "Battery V", float, "%.1f" | |
| 2621 | + entry = rpmDOT, "rpm/s", int, "%d" | |
| 2622 | + entry = flex, "Eth %", int, "%d", { flexEnabled } | |
| 2623 | + entry = errorNum, "Error #", int, "%d" | |
| 2624 | + entry = currentError, "Error ID", int, "%d" | |
| 2625 | + entry = map_psi, "Boost PSI", float, "%.1f" | |
| 2626 | + entry = boostTarget, "Boost Target", int, "%d", { boostEnabled } | |
| 2627 | + entry = boostDuty, "Boost Duty", int, "%d", { boostEnabled } | |
| 2628 | + entry = boostCutOut , "Boost cut", int, "%d" | |
| 2629 | + entry = launchHard , "Launch Hard", int, "%d" | |
| 2630 | + entry = hardLimitOn , "Hard Limiter", int, "%d" | |
| 2631 | + entry = idleLoad, "IAC value", int, "%d" | |
| 2553 | 2632 | entry = baro, "Baro Pressure",int, "%d" |
| 2633 | + entry = nitrousOn, "Nitrous On", int, "%d", { n2o_enable > 0 } | |
| 2554 | 2634 | |
| 2555 | 2635 | #if CAN_COMMANDS |
| 2556 | - entry = canin_gauge0, "CanIn CH0", int, "%d" | |
| 2557 | - entry = canin_gauge1, "CanIn CH1", int, "%d" | |
| 2558 | - entry = canin_gauge2, "CanIn CH2", int, "%d" | |
| 2559 | - entry = canin_gauge3, "CanIn CH3", int, "%d" | |
| 2560 | - entry = canin_gauge4, "CanIn CH4", int, "%d" | |
| 2561 | - entry = canin_gauge5, "CanIn CH5", int, "%d" | |
| 2562 | - entry = canin_gauge6, "CanIn CH6", int, "%d" | |
| 2563 | - entry = canin_gauge7, "CanIn CH7", int, "%d" | |
| 2636 | + entry = canin_gauge0, "CanIn CH0", int, "%d" | |
| 2637 | + entry = canin_gauge1, "CanIn CH1", int, "%d" | |
| 2638 | + entry = canin_gauge2, "CanIn CH2", int, "%d" | |
| 2639 | + entry = canin_gauge3, "CanIn CH3", int, "%d" | |
| 2640 | + entry = canin_gauge4, "CanIn CH4", int, "%d" | |
| 2641 | + entry = canin_gauge5, "CanIn CH5", int, "%d" | |
| 2642 | + entry = canin_gauge6, "CanIn CH6", int, "%d" | |
| 2643 | + entry = canin_gauge7, "CanIn CH7", int, "%d" | |
| 2564 | 2644 | #endif |
| 2565 | 2645 | |
| 2566 | 2646 |
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | void boostControl(); |
| 6 | 6 | void vvtControl(); |
| 7 | 7 | void initialiseFan(); |
| 8 | +void nitrousControl(); | |
| 8 | 9 | |
| 9 | 10 | #if defined(CORE_AVR) |
| 10 | 11 | #define ENABLE_BOOST_TIMER() TIMSK1 |= (1 << OCIE1A) |
| @@ -61,8 +62,12 @@ | ||
| 61 | 62 | #define VVT_PIN_HIGH() *vvt_pin_port |= (vvt_pin_mask) |
| 62 | 63 | #define FAN_PIN_LOW() *fan_pin_port &= ~(fan_pin_mask) |
| 63 | 64 | #define FAN_PIN_HIGH() *fan_pin_port |= (fan_pin_mask) |
| 65 | +#define N2O_STAGE1_PIN_LOW() *n2o_stage1_pin_port &= ~(n2o_stage1_pin_mask) | |
| 66 | +#define N2O_STAGE1_PIN_HIGH() *n2o_stage1_pin_port |= (n2o_stage1_pin_mask) | |
| 67 | +#define N2O_STAGE2_PIN_LOW() *n2o_stage2_pin_port &= ~(n2o_stage2_pin_mask) | |
| 68 | +#define N2O_STAGE2_PIN_HIGH() *n2o_stage2_pin_port |= (n2o_stage2_pin_mask) | |
| 69 | +#define READ_N2O_ARM_PIN() ((*n2o_arming_pin_port & n2o_arming_pin_mask) ? true : false) | |
| 64 | 70 | |
| 65 | - | |
| 66 | 71 | volatile byte *boost_pin_port; |
| 67 | 72 | volatile byte boost_pin_mask; |
| 68 | 73 | volatile byte *vvt_pin_port; |
| @@ -69,6 +74,12 @@ | ||
| 69 | 74 | volatile byte vvt_pin_mask; |
| 70 | 75 | volatile byte *fan_pin_port; |
| 71 | 76 | volatile byte fan_pin_mask; |
| 77 | +volatile byte *n2o_stage1_pin_port; | |
| 78 | +volatile byte n2o_stage1_pin_mask; | |
| 79 | +volatile byte *n2o_stage2_pin_port; | |
| 80 | +volatile byte n2o_stage2_pin_mask; | |
| 81 | +volatile byte *n2o_arming_pin_port; | |
| 82 | +volatile byte n2o_arming_pin_mask; | |
| 72 | 83 | |
| 73 | 84 | volatile bool boost_pwm_state; |
| 74 | 85 | unsigned int boost_pwm_max_count; //Used for variable PWM frequency |
| @@ -26,6 +26,7 @@ | ||
| 26 | 26 | static inline int8_t correctionFlexTiming(int8_t); |
| 27 | 27 | static inline int8_t correctionIATretard(int8_t); |
| 28 | 28 | static inline int8_t correctionSoftRevLimit(int8_t); |
| 29 | +static inline int8_t correctionNitrous(int8_t); | |
| 29 | 30 | static inline int8_t correctionSoftLaunch(int8_t); |
| 30 | 31 | static inline int8_t correctionSoftFlatShift(int8_t); |
| 31 | 32 |
| @@ -0,0 +1,7 @@ | ||
| 1 | +#define CRANKMATH_METHOD_INTERVAL_RPM 0 | |
| 2 | +#define CRANKMATH_METHOD_INTERVAL_TOOTH 1 | |
| 3 | +#define CRANKMATH_METHOD_ALPHA_BETA 2 | |
| 4 | +#define CRANKMATH_METHOD_2ND_DERIVATIVE 3 | |
| 5 | + | |
| 6 | +unsigned long angleToTime(int16_t angle); | |
| 7 | +uint16_t timeToAngle(unsigned long time); | |
| \ No newline at end of file |
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | #endif |
| 13 | 13 | |
| 14 | 14 | static inline void addToothLogEntry(unsigned long); |
| 15 | -static inline uint16_t stdGetRPM(); | |
| 15 | +static inline uint16_t stdGetRPM(uint16_t degreesOver); | |
| 16 | 16 | static inline void setFilter(unsigned long); |
| 17 | 17 | static inline int crankingGetRPM(byte); |
| 18 | 18 | static inline void doPerToothTiming(uint16_t crankAngle); |
| @@ -81,4 +81,7 @@ | ||
| 81 | 81 | #define LONG 0; |
| 82 | 82 | #define SHORT 1; |
| 83 | 83 | |
| 84 | +#define CRANK_SPEED 0 | |
| 85 | +#define CAM_SPEED 1 | |
| 86 | + | |
| 84 | 87 | #endif |
| @@ -115,7 +115,7 @@ | ||
| 115 | 115 | #define BIT_TIMER_30HZ 4 |
| 116 | 116 | |
| 117 | 117 | #define BIT_STATUS3_RESET_PREVENT 0 //Indicates whether reset prevention is enabled |
| 118 | -#define BIT_STATUS3_UNUSED1 1 | |
| 118 | +#define BIT_STATUS3_NITROUS 1 | |
| 119 | 119 | #define BIT_STATUS3_UNUSED2 2 |
| 120 | 120 | #define BIT_STATUS3_UNUSED3 3 |
| 121 | 121 | #define BIT_STATUS3_UNUSED4 4 |
| @@ -165,6 +165,10 @@ | ||
| 165 | 165 | #define STAGING_MODE_TABLE 0 |
| 166 | 166 | #define STAGING_MODE_AUTO 1 |
| 167 | 167 | |
| 168 | +#define NITROUS_OFF 0 | |
| 169 | +#define NITROUS_STAGE1 1 | |
| 170 | +#define NITROUS_STAGE2 2 | |
| 171 | + | |
| 168 | 172 | #define RESET_CONTROL_DISABLED 0 |
| 169 | 173 | #define RESET_CONTROL_PREVENT_WHEN_RUNNING 1 |
| 170 | 174 | #define RESET_CONTROL_PREVENT_ALWAYS 2 |
| @@ -217,7 +221,7 @@ | ||
| 217 | 221 | struct table2D flexAdvTable; //6 bin flex fuel correction table for timing advance (2D) |
| 218 | 222 | struct table2D flexBoostTable; //6 bin flex fuel correction table for boost adjustments (2D) |
| 219 | 223 | |
| 220 | -//These are for the direct port manipulation of the injectors and coils | |
| 224 | +//These are for the direct port manipulation of the injectors, coils and aux outputs | |
| 221 | 225 | volatile byte *inj1_pin_port; |
| 222 | 226 | volatile byte inj1_pin_mask; |
| 223 | 227 | volatile byte *inj2_pin_port; |
| @@ -368,6 +372,7 @@ | ||
| 368 | 372 | uint16_t crankRPM = 400; //The actual cranking RPM limit. Saves us multiplying it everytime from the config page |
| 369 | 373 | volatile byte status3; |
| 370 | 374 | int16_t flexBoostCorrection; //Amount of boost added based on flex |
| 375 | + byte nitrous_status; | |
| 371 | 376 | byte nSquirts; |
| 372 | 377 | byte nChannels; //Number of fuel and ignition channels |
| 373 | 378 | int16_t fuelLoad; |
| @@ -434,7 +439,7 @@ | ||
| 434 | 439 | |
| 435 | 440 | //config2 in ini |
| 436 | 441 | byte fuelAlgorithm : 3; |
| 437 | - byte unused2_37d : 1; | |
| 442 | + byte fixAngEnable : 1; //Whether fixed/locked timing is enabled | |
| 438 | 443 | byte nInjectors : 4; //Number of injectors |
| 439 | 444 | |
| 440 | 445 |
| @@ -468,8 +473,8 @@ | ||
| 468 | 473 | byte idleUpEnabled : 1; |
| 469 | 474 | |
| 470 | 475 | byte idleUpAdder; |
| 471 | - byte unused2_59; | |
| 472 | - byte unused2_60; | |
| 476 | + byte taeTaperMin; | |
| 477 | + byte taeTaperMax; | |
| 473 | 478 | |
| 474 | 479 | byte iacCLminDuty; |
| 475 | 480 | byte iacCLmaxDuty; |
| @@ -730,8 +735,32 @@ | ||
| 730 | 735 | uint8_t flexAdvAdj[6]; //Additional advance (in degrees) @ current ethanol (typically 0 @ 0%, 10-20 @ 100%) |
| 731 | 736 | //And another three corn rows die. |
| 732 | 737 | |
| 733 | - byte unused11_75_191[117]; | |
| 738 | + byte n2o_enable : 2; | |
| 739 | + byte n2o_arming_pin : 6; | |
| 740 | + byte n2o_minCLT; | |
| 741 | + byte n2o_maxMAP; | |
| 742 | + byte n2o_minTPS; | |
| 743 | + byte n2o_maxAFR; | |
| 734 | 744 | |
| 745 | + byte n2o_stage1_pin : 6; | |
| 746 | + byte n2o_pin_polarity : 1; | |
| 747 | + byte n2o_stage1_unused : 1; | |
| 748 | + byte n2o_stage1_minRPM; | |
| 749 | + byte n2o_stage1_maxRPM; | |
| 750 | + byte n2o_stage1_adderMin; | |
| 751 | + byte n2o_stage1_adderMax; | |
| 752 | + byte n2o_stage1_retard; | |
| 753 | + | |
| 754 | + byte n2o_stage2_pin : 6; | |
| 755 | + byte n2o_stage2_unused : 2; | |
| 756 | + byte n2o_stage2_minRPM; | |
| 757 | + byte n2o_stage2_maxRPM; | |
| 758 | + byte n2o_stage2_adderMin; | |
| 759 | + byte n2o_stage2_adderMax; | |
| 760 | + byte n2o_stage2_retard; | |
| 761 | + | |
| 762 | + byte unused11_75_191[99]; | |
| 763 | + | |
| 735 | 764 | #if defined(CORE_AVR) |
| 736 | 765 | }; |
| 737 | 766 | #else |
| @@ -4,14 +4,6 @@ | ||
| 4 | 4 | int fastMap1023toX(int, int); |
| 5 | 5 | unsigned long percentage(byte, unsigned long); |
| 6 | 6 | |
| 7 | -//#define degreesToUS(degrees) (decoderIsLowRes == true ) ? ((degrees * 166666UL) / currentStatus.RPM) : (degrees * (unsigned long)timePerDegree) | |
| 8 | -#define degreesToUS(degrees) ((degrees * revolutionTime) / 360) | |
| 9 | -#define fastDegreesToUS(degrees) (degrees * (unsigned long)timePerDegree) | |
| 10 | -//#define degreesToUS(degrees) ((degrees * revolutionTime * 3054198967ULL) >> 40) //Fast version of divide by 360 | |
| 11 | -//#define degreesToUS(degrees) (degrees * (unsigned long)timePerDegree) | |
| 12 | - | |
| 13 | -#define uSToDegrees(time) (((unsigned long)time * currentStatus.RPM) / 166666) | |
| 14 | -//#define uSToDegrees(time) ( (((uint64_t)time * currentStatus.RPM * 211107077ULL) >> 45) ) //Crazy magic numbers method from Hackers delight (www.hackersdelight.org/magic.htm) | |
| 15 | 7 | #define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) ^ ((d) < 0)) ? (((n) - (d)/2)/(d)) : (((n) + (d)/2)/(d))) |
| 16 | 8 | |
| 17 | 9 | //This is a dedicated function that specifically handles the case of mapping 0-1023 values into a 0 to X range |