Speeduino
Loading...
Searching...
No Matches
Functions | Variables
fuel_calcs.h File Reference
#include <stdint.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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.
 
uint16_t calculatePWLimit ()
 
void calculateStaging (uint32_t)
 

Variables

uint16_t req_fuel_uS
 
uint16_t inj_opentime_uS
 
Staging

These values are a percentage of the total (Combined) req_fuel value that would be required for each injector channel to deliver that much fuel.

Eg:

  • Pri injectors are 250cc
  • Sec injectors are 500cc
  • Total injector capacity = 750cc
  • staged_req_fuel_mult_pri = 300% (The primary injectors would have to run 3x the overall PW in order to be the equivalent of the full 750cc capacity
  • staged_req_fuel_mult_sec = 150% (The secondary injectors would have to run 1.5x the overall PW in order to be the equivalent of the full 750cc capacity
uint16_t staged_req_fuel_mult_pri
 
uint16_t staged_req_fuel_mult_sec
 

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
extern

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
extern

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

◆ staged_req_fuel_mult_pri

uint16_t staged_req_fuel_mult_pri
extern

◆ staged_req_fuel_mult_sec

uint16_t staged_req_fuel_mult_sec
extern