• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

PJSC(Pump Jet Solenoid Controller)はArduinoを使用したバイク用燃料噴射コントローラです。このプロジェクトは、オープンソースECUプロジェクト『Speeduino』をベースにしています。


Commit MetaInfo

Revision16 (tree)
Time2018-07-05 15:17:50
Authormaharu

Log Message

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.

Change Summary

Incremental Difference

--- branches/Speeduino/reference/speeduino.ini (revision 15)
+++ branches/Speeduino/reference/speeduino.ini (revision 16)
@@ -6,7 +6,7 @@
66 MTversion = 2.25
77
88 queryCommand = "Q"
9- signature = "speeduino 201805"
9+ signature = "speeduino 201806"
1010 versionInfo = "S" ;This info is what is displayed to user
1111
1212 [TunerStudio]
@@ -54,6 +54,8 @@
5454 ;algorithmUnits = bits, U08, [0:2], $loadSourceUnits
5555 algorithmUnits = bits, U08, [0:2], "kPa", "% TPS", "%", "% TPS", "INVALID", "INVALID", "INVALID", "INVALID"
5656 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"
5759
5860 boostTableLabels = bits, U08, [0:1], "Duty Cycle %", "kPa"
5961
@@ -220,7 +222,7 @@
220222
221223 ; Config2
222224 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"
224226 nInjectors = bits, U08, 37, [4:7], "INVALID","1","2","3","4","5","6","INVALID","8","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
225227
226228 ; Config3
@@ -252,8 +254,8 @@
252254 idleUpPolarity= bits, U08, 57, [6:6], "Normal", "Inverted"
253255 idleUpEnabled = bits, U08, 57, [7:7], "Off", "On"
254256 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
257259
258260 iacCLminDuty = scalar, U08, 61, "%", 1.0, 0.0, 0.0, 100.0, 0 ; Minimum and maximum duty cycles when using closed loop idle
259261 iacCLmaxDuty = scalar, U08, 62, "%", 1.0, 0.0, 0.0, 100.0, 0
@@ -351,9 +353,9 @@
351353 dfcoHyster = scalar, U08, 61, "RPM", 1.0, 0.0, 100, 255.0, 0
352354 dfcoTPSThresh= scalar, U08, 62, "%", 1.0, 0.0, 0, 100.0, 0
353355 ;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"
357359
358360 unused4-64 = array, U08, 64, [63], "%", 1.0, 0.0, 0.0, 255, 0
359361 ;--------------------------------------------------
@@ -423,7 +425,7 @@
423425 ; Launch Control
424426 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"
425427 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"
427429
428430 lnchSoftLim = scalar, U08, 49, "rpm", 100, 0.0, 100, 25500, 0
429431 lnchRetard = scalar, S08, 50, "deg", 1.0, 0.0, -30, 40, 0
@@ -742,8 +744,38 @@
742744 flexAdvBins = array, U08, 63, [6], "%", 1.0, 0.0, 0.0, 250.0, 0
743745 flexAdvAdj = array, U08, 69, [6], "Deg", 1.0, 0.0, 0.0, 250.0, 0
744746
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+
746758
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+
747779 ;-------------------------------------------------------------------------------
748780
749781 [ConstantsExtensions]
@@ -782,6 +814,9 @@
782814 requiresPowerCycle = stagingEnabled
783815 requiresPowerCycle = resetControl
784816 requiresPowerCycle = resetControlPin
817+ requiresPowerCycle = n2o_enable
818+ requiresPowerCycle = n2o_arming_pin
819+ requiresPowerCycle = n2o_pin_polarity
785820
786821 defaultValue = pinLayout, 1
787822 defaultValue = TrigPattern, 0
@@ -823,14 +858,18 @@
823858 defaultValue = boostSens, 2000
824859 defaultValue = boostIntv, 30
825860 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
829866 defaultValue = VVTasOnOff, 0
830867 defaultValue = stagingEnabled, 0
831868 defaultValue = lnchCtrlTPS, 0
832869 defaultValue = resetControl, 0
833870 defaultValue = bootloaderCaps, 0
871+ defaultValue = taeTaperMin, 1000
872+ defaultValue = taeTaperMax, 5000
834873 ; defaultValue = obd_address, 0
835874
836875 ;Default pins
@@ -932,6 +971,7 @@
932971 subMenu = fanSettings, "Thermo Fan"
933972 subMenu = LaunchControl, "Launch Control / Flat Shift"
934973 subMenu = fuelpump, "Fuel Pump"
974+ subMenu = NitrousControl, "Nitrous"
935975 subMenu = std_separator
936976 subMenu = boostSettings, "Boost Control"
937977 subMenu = boostLoad, "Boost Targets/Load", 8, { boostEnabled }
@@ -1003,6 +1043,8 @@
10031043 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"
10041044 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!)"
10051045 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"
10061048
10071049 crankRPM = "The cranking RPM threshold. When RPM is lower than this value (and above 0) the system will be considered to be cranking"
10081050
@@ -1048,6 +1090,9 @@
10481090 flexAdvAdj = "Additional advance (in degrees) for the current ethanol % (Typically 0 @ 0%, 10-20 @ 100%)"
10491091 flexBoostAdj = "Adjustment, in kPa, to the boost target for the current ethanol %. Negative values are allowed to lower boost at lower ethanol % if necessary."
10501092
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+
10511096 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"
10521097 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"
10531098 flatSRetard = "The absolute timing (BTDC) that will be used when within the soft limit window"
@@ -1223,8 +1268,10 @@
12231268 field = "Output speed", tachoDiv
12241269
12251270 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
12281275
12291276 dialog = accelEnrichments_south, "Decelleration Fuel Cutoff (DFCO)"
12301277 field = "Enabled", dfcoEnabled
@@ -1312,8 +1359,8 @@
13121359 field = "Maximum valve duty", iacCLmaxDuty, { iacAlgorithm == 3 }
13131360
13141361 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
13171364 field = "#Fast Idle"
13181365 field = "Fast idle temp", iacFastTemp, { iacAlgorithm == 1 }
13191366 panel = pwm_idle
@@ -1365,7 +1412,6 @@
13651412 field = "Primary base teeth", numTeeth, { TrigPattern == 0 || TrigPattern == 2 || TrigPattern == 11 }
13661413 field = "Primary trigger speed", TrigSpeed, { TrigPattern == 0 }
13671414 field = "Missing teeth", missingTeeth, { TrigPattern == 0 }
1368- field = "Secondary teeth", missingTeeth, { TrigPattern == 2 }
13691415 field = "Trigger angle multiplier", TrigAngMul, { TrigPattern == 11 }
13701416 field = "Trigger Angle ", TrigAng
13711417 field = "This number represents the angle ATDC when "
@@ -1374,9 +1420,9 @@
13741420 field = "Skip Revolutions", SkipCycles
13751421 field = "Note: This is the number of revolutions that will be skipped during"
13761422 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) }
13801426 field = "Trigger Filter", TrigFilter
13811427 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
13821428 field = ""
@@ -1389,7 +1435,8 @@
13891435 field = "Cranking advance Angle", CrankAng
13901436 field = "Spark Outputs triggers", IgInv
13911437 field = ""
1392- field = "Fixed Angle (0 = use map)", FixAng
1438+ field = "Enabled Fixed/Locked timing", fixAngEnable
1439+ field = "Fixed Angle", FixAng, { fixAngEnable }
13931440
13941441 dialog = dwellSettings, "Dwell Settings", 4
13951442 topicHelp = "http://speeduino.com/wiki/index.php/Dwell"
@@ -1456,7 +1503,37 @@
14561503 field = "Soft rev window", flatSSoftWin, { flatSEnable }
14571504 field = "Soft limit absolute timing", flatSRetard, { flatSEnable }
14581505
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
14591513
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+
14601537 dialog = OLED, "OLED Display", 2
14611538 field = "Display Type", display
14621539 field = "#Note"
@@ -2344,6 +2421,7 @@
23442421 indicator = { sync }, "No Sync", "Sync", white, black, green, black
23452422 indicator = { resetLockOn }, "Reset Lock OFF","Reset Lock ON", red, black, green, black
23462423 indicator = { bootloaderCaps > 0 }, "Std. Boot", "Custom Boot", white, black, white, black
2424+ indicator = { nitrousOn }, "Nitrous Off", "Nitrous On", white, black, red, black
23472425
23482426 ;-------------------------------------------------------------------------------
23492427
@@ -2427,13 +2505,13 @@
24272505 canin_gauge6 = scalar, U16, 53, "", 1.000, 0.000
24282506 canin_gauge7 = scalar, U16, 55, "", 1.000, 0.000
24292507 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
24372515 tpsADC = scalar, U08, 73, "ADC",1.000, 0.000
24382516 errors = scalar, U08, 74, "bits", 1.000, 0.000
24392517 errorNum = bits, U08, 74, [0:1]
@@ -2443,7 +2521,8 @@
24432521 pulseWidth4 = scalar, U16, 79, "ms", 0.001, 0.000
24442522 status3 = scalar, U08, 81, "bits", 1.000, 0.000
24452523 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]
24472526 nSquirts = bits, U08, 81, [5:7]
24482527 flexBoostCor = scalar, S16, 82, "kPa", 1.000, 0.000
24492528 nChannels = scalar, U08, 84, "bits", 1.000, 0.000
@@ -2508,59 +2587,60 @@
25082587 ; Type - Data type of output, converted before writing.
25092588 ; Format - C-style output format of data.
25102589 ;
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"
25292608 ;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"
25532632 entry = baro, "Baro Pressure",int, "%d"
2633+ entry = nitrousOn, "Nitrous On", int, "%d", { n2o_enable > 0 }
25542634
25552635 #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"
25642644 #endif
25652645
25662646
--- branches/Speeduino/speeduino/auxiliaries.h (revision 15)
+++ branches/Speeduino/speeduino/auxiliaries.h (revision 16)
@@ -5,6 +5,7 @@
55 void boostControl();
66 void vvtControl();
77 void initialiseFan();
8+void nitrousControl();
89
910 #if defined(CORE_AVR)
1011 #define ENABLE_BOOST_TIMER() TIMSK1 |= (1 << OCIE1A)
@@ -61,8 +62,12 @@
6162 #define VVT_PIN_HIGH() *vvt_pin_port |= (vvt_pin_mask)
6263 #define FAN_PIN_LOW() *fan_pin_port &= ~(fan_pin_mask)
6364 #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)
6470
65-
6671 volatile byte *boost_pin_port;
6772 volatile byte boost_pin_mask;
6873 volatile byte *vvt_pin_port;
@@ -69,6 +74,12 @@
6974 volatile byte vvt_pin_mask;
7075 volatile byte *fan_pin_port;
7176 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;
7283
7384 volatile bool boost_pwm_state;
7485 unsigned int boost_pwm_max_count; //Used for variable PWM frequency
--- branches/Speeduino/speeduino/corrections.h (revision 15)
+++ branches/Speeduino/speeduino/corrections.h (revision 16)
@@ -26,6 +26,7 @@
2626 static inline int8_t correctionFlexTiming(int8_t);
2727 static inline int8_t correctionIATretard(int8_t);
2828 static inline int8_t correctionSoftRevLimit(int8_t);
29+static inline int8_t correctionNitrous(int8_t);
2930 static inline int8_t correctionSoftLaunch(int8_t);
3031 static inline int8_t correctionSoftFlatShift(int8_t);
3132
--- branches/Speeduino/speeduino/crankMaths.h (nonexistent)
+++ branches/Speeduino/speeduino/crankMaths.h (revision 16)
@@ -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
--- branches/Speeduino/speeduino/decoders.h (revision 15)
+++ branches/Speeduino/speeduino/decoders.h (revision 16)
@@ -12,7 +12,7 @@
1212 #endif
1313
1414 static inline void addToothLogEntry(unsigned long);
15-static inline uint16_t stdGetRPM();
15+static inline uint16_t stdGetRPM(uint16_t degreesOver);
1616 static inline void setFilter(unsigned long);
1717 static inline int crankingGetRPM(byte);
1818 static inline void doPerToothTiming(uint16_t crankAngle);
@@ -81,4 +81,7 @@
8181 #define LONG 0;
8282 #define SHORT 1;
8383
84+#define CRANK_SPEED 0
85+#define CAM_SPEED 1
86+
8487 #endif
--- branches/Speeduino/speeduino/globals.h (revision 15)
+++ branches/Speeduino/speeduino/globals.h (revision 16)
@@ -115,7 +115,7 @@
115115 #define BIT_TIMER_30HZ 4
116116
117117 #define BIT_STATUS3_RESET_PREVENT 0 //Indicates whether reset prevention is enabled
118-#define BIT_STATUS3_UNUSED1 1
118+#define BIT_STATUS3_NITROUS 1
119119 #define BIT_STATUS3_UNUSED2 2
120120 #define BIT_STATUS3_UNUSED3 3
121121 #define BIT_STATUS3_UNUSED4 4
@@ -165,6 +165,10 @@
165165 #define STAGING_MODE_TABLE 0
166166 #define STAGING_MODE_AUTO 1
167167
168+#define NITROUS_OFF 0
169+#define NITROUS_STAGE1 1
170+#define NITROUS_STAGE2 2
171+
168172 #define RESET_CONTROL_DISABLED 0
169173 #define RESET_CONTROL_PREVENT_WHEN_RUNNING 1
170174 #define RESET_CONTROL_PREVENT_ALWAYS 2
@@ -217,7 +221,7 @@
217221 struct table2D flexAdvTable; //6 bin flex fuel correction table for timing advance (2D)
218222 struct table2D flexBoostTable; //6 bin flex fuel correction table for boost adjustments (2D)
219223
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
221225 volatile byte *inj1_pin_port;
222226 volatile byte inj1_pin_mask;
223227 volatile byte *inj2_pin_port;
@@ -368,6 +372,7 @@
368372 uint16_t crankRPM = 400; //The actual cranking RPM limit. Saves us multiplying it everytime from the config page
369373 volatile byte status3;
370374 int16_t flexBoostCorrection; //Amount of boost added based on flex
375+ byte nitrous_status;
371376 byte nSquirts;
372377 byte nChannels; //Number of fuel and ignition channels
373378 int16_t fuelLoad;
@@ -434,7 +439,7 @@
434439
435440 //config2 in ini
436441 byte fuelAlgorithm : 3;
437- byte unused2_37d : 1;
442+ byte fixAngEnable : 1; //Whether fixed/locked timing is enabled
438443 byte nInjectors : 4; //Number of injectors
439444
440445
@@ -468,8 +473,8 @@
468473 byte idleUpEnabled : 1;
469474
470475 byte idleUpAdder;
471- byte unused2_59;
472- byte unused2_60;
476+ byte taeTaperMin;
477+ byte taeTaperMax;
473478
474479 byte iacCLminDuty;
475480 byte iacCLmaxDuty;
@@ -730,8 +735,32 @@
730735 uint8_t flexAdvAdj[6]; //Additional advance (in degrees) @ current ethanol (typically 0 @ 0%, 10-20 @ 100%)
731736 //And another three corn rows die.
732737
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;
734744
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+
735764 #if defined(CORE_AVR)
736765 };
737766 #else
--- branches/Speeduino/speeduino/maths.h (revision 15)
+++ branches/Speeduino/speeduino/maths.h (revision 16)
@@ -4,14 +4,6 @@
44 int fastMap1023toX(int, int);
55 unsigned long percentage(byte, unsigned long);
66
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)
157 #define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) ^ ((d) < 0)) ? (((n) - (d)/2)/(d)) : (((n) + (d)/2)/(d)))
168
179 //This is a dedicated function that specifically handles the case of mapping 0-1023 values into a 0 to X range