Change the pulsewidth calc to us rather than ms
This commit is contained in:
parent
066e0ee9e8
commit
0fd819fe3b
|
@ -103,6 +103,12 @@ void loop()
|
||||||
//Serial.println(VE);
|
//Serial.println(VE);
|
||||||
Serial.print("VE: ");
|
Serial.print("VE: ");
|
||||||
Serial.println(VE);
|
Serial.println(VE);
|
||||||
|
|
||||||
|
Serial.print("Injector pulsewidth: ");
|
||||||
|
Serial.println(pulseWidth);
|
||||||
|
//Serial.println(req_fuel * (float)(VE/100.0) * (float)(MAP/100.0) * (float)(100/100.0) + engineInjectorDeadTime);
|
||||||
|
//Serial.println( (float)(req_fuel * (float)(VE/100)) );
|
||||||
|
//Serial.println( (float)(VE/100.0));
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
6
utils.h
6
utils.h
|
@ -15,16 +15,16 @@ int AIRDEN(int MAP, int temp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This functino retuns a pulsewidth time (in tenths of a ms) given the following:
|
This functino retuns a pulsewidth time (in us) given the following:
|
||||||
REQ_FUEL
|
REQ_FUEL
|
||||||
VE: Lookup from the main MAP vs RPM fuel table
|
VE: Lookup from the main MAP vs RPM fuel table
|
||||||
MAP: In KPa, read from the sensor
|
MAP: In KPa, read from the sensor
|
||||||
GammaE: Sum of Enrichment factors (Cold start, acceleration). This is a multiplication factor (Eg to add 10%, this should be 110)
|
GammaE: Sum of Enrichment factors (Cold start, acceleration). This is a multiplication factor (Eg to add 10%, this should be 110)
|
||||||
injOpen: Injector open time. The time the injector take to open in tenths of a ms
|
injOpen: Injector open time. The time the injector take to open in tenths of a ms
|
||||||
*/
|
*/
|
||||||
int PW(int REQ_FUEL, int VE, int MAP, int GammaE, int injOpen)
|
int PW(float REQ_FUEL, int VE, int MAP, int GammaE, float injOpen)
|
||||||
{
|
{
|
||||||
return REQ_FUEL * (VE/100) * (MAP/100) * (GammaE/100) + injOpen;
|
return (REQ_FUEL * (float)(VE/100.0) * (float)(MAP/100.0) * (float)(GammaE/100.0) + injOpen) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine the Gamma Enrichment number. Forumla borrowed from MS2 manual... may be skipped/simplified for arduino!
|
/* Determine the Gamma Enrichment number. Forumla borrowed from MS2 manual... may be skipped/simplified for arduino!
|
||||||
|
|
Loading…
Reference in New Issue