Merge pull request #188 from cmjdev/testing
Option to only run FAN when ENGINE ON
This commit is contained in:
commit
c431caeafa
|
@ -304,7 +304,11 @@ page = 2
|
||||||
baroMax = scalar, U16, 65, "kpa", 1.0, 0.0, 0.0, 25500, 0
|
baroMax = scalar, U16, 65, "kpa", 1.0, 0.0, 0.0, 25500, 0
|
||||||
EMAPMin = scalar, S08, 67, "kpa", 1.0, 0.0, -100, 127.0, 0
|
EMAPMin = scalar, S08, 67, "kpa", 1.0, 0.0, -100, 127.0, 0
|
||||||
EMAPMax = scalar, U16, 68, "kpa", 1.0, 0.0, 0.0, 25500, 0
|
EMAPMax = scalar, U16, 68, "kpa", 1.0, 0.0, 0.0, 25500, 0
|
||||||
unused2-67 = array, U08, 70, [57], "%", 1.0, 0.0, 0.0, 255, 0
|
|
||||||
|
fanWhenOff = bits, U08, 70, [0:0], "No", "Yes"
|
||||||
|
unused_fan_bits = bits, U08, 70,[1:7]
|
||||||
|
|
||||||
|
unused2-67 = array, U08, 71, [56], "%", 1.0, 0.0, 0.0, 255, 0
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
@ -532,7 +536,7 @@ page = 6
|
||||||
; Begin fan control vairables
|
; Begin fan control vairables
|
||||||
fanInv = bits, U08, 120, [0:0], "No", "Yes"
|
fanInv = bits, U08, 120, [0:0], "No", "Yes"
|
||||||
fanEnable = bits, U08, 120, [1:1], "Off", "On/Off"
|
fanEnable = bits, U08, 120, [1:1], "Off", "On/Off"
|
||||||
fanPin = bits , U08, 120, [2:7], "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"
|
fanPin = bits, U08, 120, [2:7], "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"
|
||||||
#if CELSIUS
|
#if CELSIUS
|
||||||
fanSP = scalar, U08, 121, "C", 1.0, -40, -40, 215.0, 0
|
fanSP = scalar, U08, 121, "C", 1.0, -40, -40, 215.0, 0
|
||||||
fanHyster = scalar, U08, 122, "C", 1.0, 0.0, 0.0, 40, 0
|
fanHyster = scalar, U08, 122, "C", 1.0, 0.0, 0.0, 40, 0
|
||||||
|
@ -547,7 +551,6 @@ page = 6
|
||||||
fanPWMBins = array, U08, 124, [4], "F", 1.8, -22.23, -40, 215, 0
|
fanPWMBins = array, U08, 124, [4], "F", 1.8, -22.23, -40, 215, 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
;Boost and vvt maps (Page 7)
|
;Boost and vvt maps (Page 7)
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
@ -1708,6 +1711,7 @@ menuDialog = main
|
||||||
|
|
||||||
dialog = fanSettings,"Fan Settings",7
|
dialog = fanSettings,"Fan Settings",7
|
||||||
field = "Fan Mode", fanEnable
|
field = "Fan Mode", fanEnable
|
||||||
|
field = "Fan when off", fanWhenOff, { fanEnable }
|
||||||
field = "Fan output pin", fanPin, { fanEnable }
|
field = "Fan output pin", fanPin, { fanEnable }
|
||||||
field = "Fan Output Inverted", fanInv , { fanEnable }
|
field = "Fan Output Inverted", fanInv , { fanEnable }
|
||||||
field = "Fan temperature SP", fanSP, { fanEnable }
|
field = "Fan temperature SP", fanSP, { fanEnable }
|
||||||
|
|
|
@ -32,15 +32,19 @@ void fanControl()
|
||||||
{
|
{
|
||||||
int onTemp = (int)configPage6.fanSP - CALIBRATION_TEMPERATURE_OFFSET;
|
int onTemp = (int)configPage6.fanSP - CALIBRATION_TEMPERATURE_OFFSET;
|
||||||
int offTemp = onTemp - configPage6.fanHyster;
|
int offTemp = onTemp - configPage6.fanHyster;
|
||||||
|
bool fanPermit = false;
|
||||||
|
|
||||||
if ( currentStatus.coolant >= onTemp )
|
if ( configPage2.fanWhenOff ) { fanPermit = true; }
|
||||||
|
else { fanPermit = BIT_CHECK(currentStatus.engine, BIT_ENGINE_RUN); }
|
||||||
|
|
||||||
|
if ( currentStatus.coolant >= onTemp && fanPermit )
|
||||||
{
|
{
|
||||||
//Fan needs to be turned on. Checked for normal or inverted fan signal
|
//Fan needs to be turned on. Checked for normal or inverted fan signal
|
||||||
if( configPage6.fanInv == 0 ) { FAN_PIN_HIGH(); }
|
if( configPage6.fanInv == 0 ) { FAN_PIN_HIGH(); }
|
||||||
else { FAN_PIN_LOW(); }
|
else { FAN_PIN_LOW(); }
|
||||||
currentStatus.fanOn = true;
|
currentStatus.fanOn = true;
|
||||||
}
|
}
|
||||||
else if ( currentStatus.coolant <= offTemp )
|
else if ( currentStatus.coolant <= offTemp || !fanPermit )
|
||||||
{
|
{
|
||||||
//Fan needs to be turned off. Checked for normal or inverted fan signal
|
//Fan needs to be turned off. Checked for normal or inverted fan signal
|
||||||
if( configPage6.fanInv == 0 ) { FAN_PIN_LOW(); }
|
if( configPage6.fanInv == 0 ) { FAN_PIN_LOW(); }
|
||||||
|
|
|
@ -522,7 +522,11 @@ struct config2 {
|
||||||
|
|
||||||
int8_t EMAPMin; //Must be signed
|
int8_t EMAPMin; //Must be signed
|
||||||
uint16_t EMAPMax;
|
uint16_t EMAPMax;
|
||||||
byte unused1_70[58];
|
|
||||||
|
byte fanWhenOff : 1; // Only run fan when engine is running
|
||||||
|
byte fanUnused : 7;
|
||||||
|
|
||||||
|
byte unused1_70[57];
|
||||||
|
|
||||||
#if defined(CORE_AVR)
|
#if defined(CORE_AVR)
|
||||||
};
|
};
|
||||||
|
@ -692,6 +696,7 @@ struct config6 {
|
||||||
byte fanHyster; // Fan hysteresis
|
byte fanHyster; // Fan hysteresis
|
||||||
byte fanFreq; // Fan PWM frequency
|
byte fanFreq; // Fan PWM frequency
|
||||||
byte fanPWMBins[4]; //Temperature Bins for the PWM fan control
|
byte fanPWMBins[4]; //Temperature Bins for the PWM fan control
|
||||||
|
|
||||||
#if defined(CORE_AVR)
|
#if defined(CORE_AVR)
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue