Add a bunch more values to the log output (Including boost duty)

This commit is contained in:
Josh Stewart 2017-03-16 18:17:12 +11:00
parent afb6f71aae
commit c28547dc3a
5 changed files with 27 additions and 18 deletions

View File

@ -1710,7 +1710,7 @@ menuDialog = main
ochGetCommand = "A"
ochBlockSize = 38
ochBlockSize = 39
secl = scalar, U08, 0, "sec", 1.000, 0.000
squirt = scalar, U08, 1, "bits", 1.000, 0.000
@ -1773,6 +1773,7 @@ menuDialog = main
errorNum = bits, U08, 36, [0:1]
currentError = bits, U08, 36, [2:7]
boostTarget = scalar, U08, 37, "kPa", 2.000, 0.000
boostDuty = scalar, U08, 38, "%", 1.000, 0.000
; Computed output channels. See "megatuneExamples.ini" for all the
; pre-defined variables, search for "???" and you'll see them.
@ -1864,25 +1865,30 @@ menuDialog = main
entry = spark, "Spark", int, "%d"
entry = egoCorrection, "Gego", int, "%d"
entry = airCorrection, "Gair", int, "%d"
entry = batCorrection, "Gbattery", int, "%d"
entry = warmupEnrich, "Gwarm", int, "%d"
;entry = baroCorrection, "Gbaro", int, "%d"
entry = gammaEnrich, "Gammae", int, "%d"
entry = accelEnrich, "TPSacc", int, "%d"
entry = veCurr, "VE", int, "%d"
entry = pulseWidth, "PW", float, "%.1f"
entry = afrTarget, "AFR Target", float, "%.3f"
entry = pulseWidth, "PW2", float, "%.1f"
entry = dutyCycle, "DutyCycle1", float, "%.1f"
entry = dutyCycle, "DutyCycle2", float, "%.1f"
entry = TPSdot, "TPS DOT", int, "%d"
entry = advance, "Ignition Advance", int,"%d"
entry = dwell, "Dwell", int, "%d"
entry = batteryVoltage, "Battery V", float, "%.1f"
entry = rpmDOT, "rpm/s", int, "%d"
entry = flex, "%", int, "%d"
entry = gammaEnrich, "Gammae", int, "%d"
entry = accelEnrich, "TPSacc", int, "%d"
entry = veCurr, "VE", int, "%d"
entry = pulseWidth, "PW", float, "%.1f"
entry = afrTarget, "AFR Target", float, "%.3f"
entry = pulseWidth, "PW2", float, "%.1f"
entry = dutyCycle, "DutyCycle1", float, "%.1f"
entry = dutyCycle, "DutyCycle2", float, "%.1f"
entry = TPSdot, "TPS DOT", int, "%d"
entry = advance, "Advance", int, "%d"
entry = dwell, "Dwell", int, "%d"
entry = batteryVoltage, "Battery V", float, "%.1f"
entry = rpmDOT, "rpm/s", int, "%d"
entry = flex, "Eth %", int, "%d", { flexEnabled }
entry = errorNum, "Error #", int, "%d"
entry = currentError, "Error ID", int, "%d"
entry = boostTarget, "Boost Target",int, "%d"
entry = boostTarget, "Boost Target",int, "%d", { boostEnabled }
entry = boostDuty, "Boost Duty" ,int, "%d", { boostEnabled }
entry = boostCutOut , "Boost cut", ,int, "%d"
; Indicators
[LoggerDefinition]
; valid logger types: composite, tooth, trigger, csv

View File

@ -52,6 +52,7 @@ void initialiseAuxPWM()
boostPID.SetTunings(configPage3.boostKP, configPage3.boostKI, configPage3.boostKD);
boostPID.SetMode(AUTOMATIC); //Turn PID on
currentStatus.boostDuty = 0;
boostCounter = 0;
}
@ -70,7 +71,7 @@ void boostControl()
if( (boostCounter & 31) == 1) { boostPID.SetTunings(configPage3.boostKP, configPage3.boostKI, configPage3.boostKD); } //This only needs to be run very infrequently, once every 32 calls to boostControl(). This is approx. once per second
boostPID.Compute();
currentStatus.boostDuty = (unsigned long)(boost_pwm_target_value * 100UL) / boost_pwm_max_count;
TIMSK1 |= (1 << OCIE1A); //Turn on the compare unit (ie turn on the interrupt)
}
else { TIMSK1 &= ~(1 << OCIE1A); } // Disable timer channel

View File

@ -12,7 +12,7 @@
#define seqFuelPage 9
#define canbusPage 10//Config Page 10
#define packetSize 38
#define packetSize 39
byte currentPage = 1;//Not the same as the speeduino config page numbers
boolean isMap = true;

View File

@ -262,6 +262,7 @@ void sendValues(int packetlength, byte portNum)
response[35] = currentStatus.flexIgnCorrection; //Ignition correction (Increased degrees of advance) for flex fuel
response[36] = getNextError();
response[37] = currentStatus.boostTarget;
response[38] = currentStatus.boostDuty;
//cli();
if (portNum == 0) { Serial.write(response, (size_t)packetlength); }

View File

@ -206,6 +206,7 @@ struct statuses {
bool flatShiftingHard;
volatile byte startRevolutions; //A counter for how many revolutions have been completed since sync was achieved.
byte boostTarget;
byte boostDuty;
//Helpful bitwise operations:
//Useful reference: http://playground.arduino.cc/Code/BitMath