Speeduino
Loading...
Searching...
No Matches
Functions | Variables
fuel_calcs.cpp File Reference
#include "fuel_calcs.h"
#include "globals.h"

Functions

uint16_t PW (int REQ_FUEL, byte VE, long MAP, uint16_t corrections, int injOpen)
 This function calculates the required pulsewidth time (in us) given the current system state.
 
uint16_t calculatePWLimit ()
 
void calculateStaging (uint32_t pwLimit)
 

Variables

uint16_t req_fuel_uS = 0
 
uint16_t inj_opentime_uS = 0
 
uint16_t staged_req_fuel_mult_pri = 0
 
uint16_t staged_req_fuel_mult_sec = 0
 

Function Documentation

◆ calculatePWLimit()

uint16_t calculatePWLimit ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateStaging()

void calculateStaging ( uint32_t  pwLimit)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PW()

uint16_t PW ( int  REQ_FUEL,
uint8_t  VE,
long  MAP,
uint16_t  corrections,
int  injOpen 
)

This function calculates the required pulsewidth time (in us) given the current system state.

Parameters
REQ_FUELThe required fuel value in uS, as calculated by TunerStudio
VELookup from the main fuel table. This can either have been MAP or TPS based, depending on the algorithm used
MAPIn KPa, read from the sensor (This is used when performing a multiply of the map only. It is applicable in both Speed density and Alpha-N)
correctionsSum of Enrichment factors (Cold start, acceleration). This is a multiplication factor (Eg to add 10%, this should be 110)
injOpenInjector opening time. The time the injector take to open minus the time it takes to close (Both in uS)
Returns
uint16_t The injector pulse width in uS
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ inj_opentime_uS

uint16_t inj_opentime_uS = 0

The injector opening time. This is set within Tuner Studio, but stored here in uS rather than mS

◆ req_fuel_uS

uint16_t req_fuel_uS = 0

The required fuel variable (As calculated by TunerStudio) in uS

◆ staged_req_fuel_mult_pri

uint16_t staged_req_fuel_mult_pri = 0

◆ staged_req_fuel_mult_sec

uint16_t staged_req_fuel_mult_sec = 0