Fix for potentially wrong initialisation of the on/off idle control

This commit is contained in:
Josh Stewart 2017-03-30 00:01:52 +11:00
parent e96feaa560
commit 822c400c01
3 changed files with 15 additions and 13 deletions

View File

@ -881,6 +881,7 @@ menuDialog = main
iacPWMdir = "Normal PWM valves increase RPM with higher duty. If RPM decreases with higher duty then select Reverse"
iacCLminDuty= "When using closed loop idle control, this is the minimum duty cycle that the PID loop will allow. Combined with the maximum value, this specifies the working range of your idle valve"
iacCLmaxDuty= "When using closed loop idle control, this is the maximum duty cycle that the PID loop will allow. Combined with the minimum value, this specifies the working range of your idle valve"
iacFastTemp = "Below this temperature, the idle output will be high (On). Above this temperature, it will turn off."
oddfire2 = "The ATDC angle of channel 2 for oddfire engines. This is relative to the TDC angle of channel 1"
oddfire3 = "The ATDC angle of channel 3 for oddfire engines. This is relative to the TDC angle of channel 1 (NOT channel 2)"

View File

@ -87,9 +87,10 @@ void initialiseIdle()
case IAC_ALGORITHM_ONOFF:
//Case 1 is on/off idle control
if (currentStatus.coolant < configPage4.iacFastTemp)
if ((currentStatus.coolant + CALIBRATION_TEMPERATURE_OFFSET) < configPage4.iacFastTemp)
{
digitalWrite(pinIdle1, HIGH);
idleOn = true;
}
break;

View File

@ -13,15 +13,15 @@ The 2D table can contain either 8-bit (byte) or 16-bit (int) values
The valueSize variable should be set to either 8 or 16 to indicate this BEFORE the table is used
*/
struct table2D {
byte valueSize;
byte valueSize;
byte xSize;
byte *values;
byte *axisX;
int *values16;
int *axisX16;
int16_t *values16;
int16_t *axisX16;
//Store the last X and Y coordinates in the table. This is used to make the next check faster
int lastXMax, lastXMin;
};
@ -29,16 +29,16 @@ struct table2D {
void table2D_setSize(struct table2D targetTable, byte newSize);
struct table3D {
//All tables must be the same size for simplicity
byte xSize;
byte ySize;
byte **values;
int *axisX;
int *axisY;
int16_t *axisX;
int16_t *axisY;
//Store the last X and Y coordinates in the table. This is used to make the next check faster
byte lastXMax, lastXMin;
byte lastYMax, lastYMin;