High resolution RPM logging

This commit is contained in:
Josh Stewart 2015-02-07 13:50:23 +11:00
parent ae6b28fd81
commit 39cdb0a316
3 changed files with 12 additions and 17 deletions

View File

@ -132,14 +132,16 @@ void sendValues(int length)
response[10] = currentStatus.egoCorrection; //Exhaust gas correction (%)
response[11] = 0x00; //Air Correction (%)
response[12] = currentStatus.wueCorrection; //Warmup enrichment (%)
response[13] = (byte)(div(currentStatus.RPM, 100).quot); //rpm / 100
response[14] = (byte)(currentStatus.PW / 200); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
//response[13] = (byte)(div(currentStatus.RPM, 100).quot); //rpm / 100
response[13] = highByte(currentStatus.RPM); //rpm HB
response[14] = lowByte(currentStatus.RPM); //rpm LB
//response[14] = (byte)(currentStatus.PW / 200); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
response[15] = currentStatus.TAEamount; //acceleration enrichment (%)
response[16] = 0x00; //Barometer correction (%)
response[17] = currentStatus.corrections; //Total GammaE (%)
response[18] = currentStatus.VE; //Current VE 1 (%)
response[19] = currentStatus.afrTarget;
response[20] = 0x00; //Current VE 2 (Unused Currently)
response[20] = (byte)(currentStatus.PW / 200); //Pulsewidth 1 multiplied by 10 in ms. Have to convert from uS to mS.
response[21] = currentStatus.tpsDOT; //TPS DOT
response[22] = currentStatus.advance;
response[23] = currentStatus.TPS; // TPS (0% to 100%)

View File

@ -718,7 +718,7 @@ help = helpEnrichments, "Enrichments Help"
veBucketGauge = veTuneValue, "VE Value", "%", 0, 120, -1, -1, 999, 999, 0, 0
veGauge = veCurr, "VE Current", "%", 0, 120, -1, -1, 999, 999, 0, 0
voltMeter = batteryVoltage,"Battery Voltage", "volts", 0, 25, 8, 9, 15, 16, 2, 2
warmupEnrichGauge = warmupEnrich, "Warmup Enrichment", "%", 100, 150, -1, -1, 101, 105, 0, 0
warmupEnrichGauge = warmupEnrich, "Warmup Enrichment", "%", 100, 200, 130, 140, 140, 150, 0, 0
#if CELSIUS
cltGauge = coolant, "Coolant Temp", "TEMP", -40, 120, -15, 0, 95, 105, 0, 0
@ -893,14 +893,14 @@ help = helpEnrichments, "Enrichments Help"
egoCorrection = scalar, U08, 10, "%", 1.000, 0.000
airCorrection = scalar, U08, 11, "%", 1.000, 0.000
warmupEnrich = scalar, U08, 12, "%", 1.000, 0.000
rpm100 = scalar, U08, 13, "r100", 1.000, 0.000
pulseWidth = scalar, U08, 14, "ms", 0.2, 0.000
rpm = scalar, S16, 13, "rpm", 1.000, 0.000
accelEnrich = scalar, U08, 15, "%", 1.000, 0.000
baroCorrection = scalar, U08, 16, "%", 1.000, 0.000
gammaEnrich = scalar, U08, 17, "%", 1.000, 0.000
veCurr = scalar, U08, 18, "%", 1.000, 0.000
afrTarget = scalar, U08, 19 "O2", 0.100, 0.000
blank2 = scalar, U08, 20
#blank2 = scalar, U08, 20
pulseWidth = scalar, U08, 20, "ms", 0.2, 0.000
TPSdot = scalar, U08, 21, "%/s", 0.100, 0.000
advance = scalar, U08, 22, "deg", 1.000, 0.000
tps = scalar, U08, 23, "%", 1.000, 0.000
@ -911,11 +911,10 @@ help = helpEnrichments, "Enrichments Help"
; pre-defined variables, search for "???" and you'll see them.
accDecEnrich = { accelEnrich + ((engine & 0b00100000) ? tdePct : 100) }
#batteryVoltage = { batADC / 255.0 * 30.0 } ; Current MS power supply voltage.
;batteryVoltage = { batADC / 255.0 * 30.0 } ; Current MS power supply voltage.
coolant = { coolantRaw - 40 } ; Coolant sensor temperature in user units.
mat = { matRaw - 40 } ; Manifold temperature in user units.
; egoVoltage = { egoADC / 255.0 * 5.0 } ; EGO sensor voltage.
rpm = { rpm100*100 } ; True RPM.
time = { timeNow } ; "timeNow" is a parameterless built-in function.
;loopsPerSecond = { loopsPerSecond10*10 } ; True number of mainloops per second
@ -984,7 +983,7 @@ help = helpEnrichments, "Enrichments Help"
; -------------- ---------- ----- ------
entry = time, "Time", float, "%.3f"
entry = secl, "SecL", int, "%d"
entry = rpm100, "RPM100", int, "%d"
entry = rpm, "RPM", int, "%d"
entry = map, "MAP", int, "%d"
entry = tpsADC, "tpsADC", int, "%d"
entry = tps, "TPS", int, "%d"

View File

@ -1,10 +1,3 @@
/*
These are some utility functions and variables used through the main code
*/
#include <Arduino.h>
#define MS_IN_MINUTE 60000
#define US_IN_MINUTE 60000000
/*
Returns how much free dynamic memory exists (between heap and stack)
*/
@ -43,6 +36,7 @@ unsigned int PW(int REQ_FUEL, byte VE, byte MAP, int corrections, int injOpen, b
//100% float free version, does sacrifice a little bit of accuracy.
int iVE = ((int)VE << 7) / 100;
//int iVE = divs100( ((int)VE << 7));
//int iMAP = ((int)MAP << 7) / 100;
int iCorrections = (corrections << 7) / 100;
//int iTPS = ((int)TPS << 7) / 100;