Flex fuel boost adder

This commit is contained in:
Josh Stewart 2017-05-12 18:14:14 +10:00
parent bcd7b29b59
commit 1db7be4a33
3 changed files with 24 additions and 9 deletions

View File

@ -153,8 +153,8 @@ page = 1
;Page 2 is all general settings (Previously part of page 1) ;Page 2 is all general settings (Previously part of page 1)
;-------------------------------------------------- ;--------------------------------------------------
page = 2 page = 2
unused2-1 = scalar, U08, 0, "ms", 0.1, 0.0, 0.0, 25.5, 1 flexBoostLow = scalar, S08, 0, "kPa", 1.0, 0.0, -127, 127, 0
unused2-2 = scalar, U08, 1, "ms", 0.1, 0.0, 0.0, 25.5, 1 flexBoostHigh = scalar, U08, 0, "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
@ -715,6 +715,8 @@ page = 10
defaultValue = flexFuelHigh,163 defaultValue = flexFuelHigh,163
defaultValue = flexAdvLow, 0 defaultValue = flexAdvLow, 0
defaultValue = flexAdvHigh, 13 defaultValue = flexAdvHigh, 13
defaultValue = flexBoostLow,0
defaultValue = flexBoostHigh,0
defaultValue = fuelPumpPin, 0 defaultValue = fuelPumpPin, 0
defaultValue = fanPin, 0 defaultValue = fanPin, 0
defaultValue = iacCLminDuty,0 defaultValue = iacCLminDuty,0
@ -922,6 +924,8 @@ menuDialog = main
flexFuelHigh = "Fuel % to be used for the highest ethanol reading (Typically 163% for 100% ethanol)" flexFuelHigh = "Fuel % to be used for the highest ethanol reading (Typically 163% for 100% ethanol)"
flexAdvLow = "Additional advance (in degrees) at lowest ethanol reading (Typically 0)" flexAdvLow = "Additional advance (in degrees) at lowest ethanol reading (Typically 0)"
flexAdvHigh = "Additional advance (in degrees) at highest ethanol reading (Typically 10-20 degrees)" flexAdvHigh = "Additional advance (in degrees) at highest ethanol reading (Typically 10-20 degrees)"
flexBoostHigh = "This amount that will be added to the boost target at E100. Between E0 and E100, the amount added to the boost target will be scaled from 0 to this value"
flexBoostLow = "Typically should be set to 0, but can be used to lower boost at E0 if the bast tune is setup with some ethanol"
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" 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"
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" 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"
@ -1032,24 +1036,27 @@ menuDialog = main
field = "Sensor Frequency" field = "Sensor Frequency"
field = "Fuel Multiplier%" field = "Fuel Multiplier%"
field = "Additional advance" field = "Additional advance"
field = "Additional boost", { boostEnabled }
#field = "#Temp Sense" #field = "#Temp Sense"
#field = "Sensor PW" #field = "Sensor PW"
#field = "Fuel Temp" #field = "Fuel Temp"
dialog = flexl, "" dialog = flexl, ""
field = "Low" field = "Low (E0)"
field = "", flexFreqLow, { flexEnabled } field = "", flexFreqLow, { flexEnabled }
field = "", flexFuelLow, { flexEnabled } field = "", flexFuelLow, { flexEnabled }
field = "", flexAdvLow, { flexEnabled } field = "", flexAdvLow, { flexEnabled }
field = "", flexBoostLow, { boostEnabled }
#field = "Low" #field = "Low"
#field = "", ff_tpw0, { flexEnabled && (fueltemp1 == 1)} #field = "", ff_tpw0, { flexEnabled && (fueltemp1 == 1)}
#field = "", ff_temp0, { flexEnabled && (fueltemp1 == 1)} #field = "", ff_temp0, { flexEnabled && (fueltemp1 == 1)}
dialog = flexh, "" dialog = flexh, ""
field = "High" field = "High (E100)"
field = "", flexFreqHigh, { flexEnabled } field = "", flexFreqHigh, { flexEnabled }
field = "", flexFuelHigh, { flexEnabled } field = "", flexFuelHigh, { flexEnabled }
field = "", flexAdvHigh, { flexEnabled } field = "", flexAdvHigh, { flexEnabled }
field = "", flexBoostHigh, { boostEnabled }
#field = "High" #field = "High"
#field = "", ff_tpw1, { flexFuel && (fueltemp1 == 1)} #field = "", ff_tpw1, { flexFuel && (fueltemp1 == 1)}
#field = "", ff_temp1, { flexFuel && (fueltemp1 == 1)} #field = "", ff_temp1, { flexFuel && (fueltemp1 == 1)}

View File

@ -64,6 +64,14 @@ void boostControl()
MAPx100 = currentStatus.MAP * 100; MAPx100 = currentStatus.MAP * 100;
boost_cl_target_boost = get3DTableValue(&boostTable, currentStatus.TPS, currentStatus.RPM) * 2; //Boost target table is in kpa and divided by 2 boost_cl_target_boost = get3DTableValue(&boostTable, currentStatus.TPS, currentStatus.RPM) * 2; //Boost target table is in kpa and divided by 2
//If flex fuel is enabled, there can be an adder to the boost target based on ethanol content
if(configPage1.flexEnabled)
{
int16_t boostAdder = (((int16_t)configPage1.flexBoostHigh - (int16_t)configPage1.flexBoostLow) * currentStatus.ethanolPct) / 100;
boostAdder = boostAdder + configPage1.flexBoostLow; //Required in case flexBoostLow is less than 0
boost_cl_target_boost = boost_cl_target_boost + boostAdder;
}
boostTargetx100 = boost_cl_target_boost * 100; boostTargetx100 = boost_cl_target_boost * 100;
currentStatus.boostTarget = boost_cl_target_boost >> 1; //Boost target is sent as a byte value to TS and so is divided by 2 currentStatus.boostTarget = boost_cl_target_boost >> 1; //Boost target is sent as a byte value to TS and so is divided by 2
if(currentStatus.boostTarget == 0) { TIMSK1 &= ~(1 << OCIE1A); digitalWrite(pinBoost, LOW); return; } //Set duty to 0 and turn off timer compare if the target is 0 if(currentStatus.boostTarget == 0) { TIMSK1 &= ~(1 << OCIE1A); digitalWrite(pinBoost, LOW); return; } //Set duty to 0 and turn off timer compare if the target is 0

View File

@ -240,8 +240,8 @@ struct statuses currentStatus; //The global status object
//This mostly covers off variables that are required for fuel //This mostly covers off variables that are required for fuel
struct config1 { struct config1 {
byte unused1; //Cold cranking pulsewidth modifier. This is added to the fuel pulsewidth when cranking under a certain temp threshold (ms) int8_t flexBoostLow;
byte unused2; //Warm cranking pulsewidth modifier. This is added to the fuel pulsewidth when cranking (ms) byte flexBoostHigh;
byte asePct; //Afterstart enrichment (%) byte asePct; //Afterstart enrichment (%)
byte aseCount; //Afterstart enrichment cycles. This is the number of ignition cycles that the afterstart enrichment % lasts for byte aseCount; //Afterstart enrichment cycles. This is the number of ignition cycles that the afterstart enrichment % lasts for
byte wueValues[10]; //Warm up enrichment array (10 bytes) byte wueValues[10]; //Warm up enrichment array (10 bytes)