mirror of https://github.com/rusefi/speeduino.git
Voltage correction tables added (Not currently used)
This commit is contained in:
parent
d662611710
commit
2d815fa9c1
|
@ -222,7 +222,7 @@ struct config3 {
|
||||||
byte floodClear; //TPS value that triggers flood clear mode (No fuel whilst cranking)
|
byte floodClear; //TPS value that triggers flood clear mode (No fuel whilst cranking)
|
||||||
byte egoLoadMax; //Load (TPS or MAP) must be below this for closed loop to function
|
byte egoLoadMax; //Load (TPS or MAP) must be below this for closed loop to function
|
||||||
byte egoLoadMin; //Load (TPS or MAP) must be above this for closed loop to function
|
byte egoLoadMin; //Load (TPS or MAP) must be above this for closed loop to function
|
||||||
byte dwellCorrectionBins[6]; //Correction table for dwell vs battery voltage
|
byte voltageCorrectionBins[6]; //X axis bins for voltage correction tables
|
||||||
byte injVoltageCorrectionBins[6]; //Correction table for injector PW vs battery voltage
|
byte injVoltageCorrectionBins[6]; //Correction table for injector PW vs battery voltage
|
||||||
byte unused107;
|
byte unused107;
|
||||||
byte unused108;
|
byte unused108;
|
||||||
|
|
|
@ -25,8 +25,12 @@ See page 136 of the processors datasheet: http://www.atmel.com/Images/doc2549.pd
|
||||||
#ifndef SCHEDULER_H
|
#ifndef SCHEDULER_H
|
||||||
#define SCHEDULER_H
|
#define SCHEDULER_H
|
||||||
|
|
||||||
#include <avr/interrupt.h>
|
#ifdef __SAM3X8E__
|
||||||
#include <avr/io.h>
|
//Do stuff for ARM based CPUs
|
||||||
|
#else
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <avr/io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void initialiseSchedulers();
|
void initialiseSchedulers();
|
||||||
void setFuelSchedule1(void (*startCallback)(), unsigned long timeout, unsigned long duration, void(*endCallback)());
|
void setFuelSchedule1(void (*startCallback)(), unsigned long timeout, unsigned long duration, void(*endCallback)());
|
||||||
|
|
|
@ -54,6 +54,8 @@ struct table3D ignitionTable; //8x8 ignition map
|
||||||
struct table3D afrTable; //8x8 afr target map
|
struct table3D afrTable; //8x8 afr target map
|
||||||
struct table2D taeTable; //4 bin TPS Acceleration Enrichment map (2D)
|
struct table2D taeTable; //4 bin TPS Acceleration Enrichment map (2D)
|
||||||
struct table2D WUETable; //10 bin Warm Up Enrichment map (2D)
|
struct table2D WUETable; //10 bin Warm Up Enrichment map (2D)
|
||||||
|
struct table2D dwellVCorrectionTable; //6 bin dwell voltage correction (2D)
|
||||||
|
struct table2D injectorVCorrectionTable; //6 bin injector voltage correction (2D)
|
||||||
byte cltCalibrationTable[CALIBRATION_TABLE_SIZE];
|
byte cltCalibrationTable[CALIBRATION_TABLE_SIZE];
|
||||||
byte iatCalibrationTable[CALIBRATION_TABLE_SIZE];
|
byte iatCalibrationTable[CALIBRATION_TABLE_SIZE];
|
||||||
byte o2CalibrationTable[CALIBRATION_TABLE_SIZE];
|
byte o2CalibrationTable[CALIBRATION_TABLE_SIZE];
|
||||||
|
@ -104,6 +106,7 @@ void setup()
|
||||||
WUETable.xSize = 10;
|
WUETable.xSize = 10;
|
||||||
WUETable.values = configPage1.wueValues;
|
WUETable.values = configPage1.wueValues;
|
||||||
WUETable.axisX = configPage2.wueBins;
|
WUETable.axisX = configPage2.wueBins;
|
||||||
|
//The WUE X axis values are hard coded (Don't ask, they just are)
|
||||||
WUETable.axisX[0] = 0;
|
WUETable.axisX[0] = 0;
|
||||||
WUETable.axisX[1] = 11;
|
WUETable.axisX[1] = 11;
|
||||||
WUETable.axisX[2] = 22;
|
WUETable.axisX[2] = 22;
|
||||||
|
@ -115,6 +118,15 @@ void setup()
|
||||||
WUETable.axisX[8] = 94;
|
WUETable.axisX[8] = 94;
|
||||||
WUETable.axisX[9] = 111;
|
WUETable.axisX[9] = 111;
|
||||||
|
|
||||||
|
dwellVCorrectionTable.valueSize = SIZE_BYTE;
|
||||||
|
dwellVCorrectionTable.xSize = 6;
|
||||||
|
dwellVCorrectionTable.values = configPage2.dwellCorrectionValues;
|
||||||
|
dwellVCorrectionTable.axisX = configPage3.voltageCorrectionBins;
|
||||||
|
injectorVCorrectionTable.valueSize = SIZE_BYTE;
|
||||||
|
injectorVCorrectionTable.xSize = 6;
|
||||||
|
injectorVCorrectionTable.values = configPage3.injVoltageCorrectionBins;
|
||||||
|
injectorVCorrectionTable.axisX = configPage3.voltageCorrectionBins;
|
||||||
|
|
||||||
//Setup the calibration tables
|
//Setup the calibration tables
|
||||||
loadCalibration();
|
loadCalibration();
|
||||||
//Set the pin mappings
|
//Set the pin mappings
|
||||||
|
@ -560,6 +572,12 @@ void closeInjector4() { digitalWrite(pinInjector4, LOW); BIT_CLEAR(currentStatus
|
||||||
void beginCoil4Charge() { digitalWrite(pinCoil4, coilHIGH); BIT_SET(currentStatus.spark, 3); }
|
void beginCoil4Charge() { digitalWrite(pinCoil4, coilHIGH); BIT_SET(currentStatus.spark, 3); }
|
||||||
void endCoil4Charge() { digitalWrite(pinCoil4, coilLOW); BIT_CLEAR(currentStatus.spark, 3); }
|
void endCoil4Charge() { digitalWrite(pinCoil4, coilLOW); BIT_CLEAR(currentStatus.spark, 3); }
|
||||||
|
|
||||||
|
//Combination functions for semi-sequential injection
|
||||||
|
void openInjector1and4() { digitalWrite(pinInjector1, HIGH); digitalWrite(pinInjector4, HIGH); BIT_SET(currentStatus.squirt, 0); }
|
||||||
|
void closeInjector1and4() { digitalWrite(pinInjector1, LOW); digitalWrite(pinInjector4, LOW);BIT_CLEAR(currentStatus.squirt, 0); }
|
||||||
|
void openInjector2and3() { digitalWrite(pinInjector2, HIGH); digitalWrite(pinInjector3, HIGH); BIT_SET(currentStatus.squirt, 1); }
|
||||||
|
void closeInjector2and3() { digitalWrite(pinInjector2, LOW); digitalWrite(pinInjector3, LOW); BIT_CLEAR(currentStatus.squirt, 1); }
|
||||||
|
|
||||||
//The trigger function is called everytime a crank tooth passes the sensor
|
//The trigger function is called everytime a crank tooth passes the sensor
|
||||||
volatile unsigned long curTime;
|
volatile unsigned long curTime;
|
||||||
volatile unsigned int curGap;
|
volatile unsigned int curGap;
|
||||||
|
|
Loading…
Reference in New Issue