Speeduino
Loading...
Searching...
No Matches
Macros | Functions | Variables
corrections.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IGN_IDLE_THRESHOLD   200
 

Functions

void initialiseCorrections (void)
 
uint16_t correctionsFuel (void)
 
uint8_t calculateAfrTarget (table3d16RpmLoad &afrLookUpTable, const statuses &current, const config2 &page2, const config6 &page6)
 
byte correctionWUE (void)
 
uint16_t correctionCranking (void)
 
byte correctionASE (void)
 
uint16_t correctionAccel (void)
 
byte correctionFloodClear (void)
 
byte correctionAFRClosedLoop (void)
 
byte correctionFlex (void)
 
byte correctionFuelTemp (void)
 
byte correctionBatVoltage (void)
 
byte correctionIATDensity (void)
 
byte correctionBaro (void)
 
byte correctionLaunch (void)
 
byte correctionDFCOfuel (void)
 
bool correctionDFCO (void)
 
int8_t correctionsIgn (int8_t advance)
 
int8_t correctionFixedTiming (int8_t advance)
 
int8_t correctionCrankingFixedTiming (int8_t advance)
 
int8_t correctionFlexTiming (int8_t advance)
 
int8_t correctionWMITiming (int8_t advance)
 
int8_t correctionKnockTiming (int8_t advance)
 
int8_t correctionIATretard (int8_t advance)
 
int8_t correctionCLTadvance (int8_t advance)
 
int8_t correctionIdleAdvance (int8_t advance)
 
int8_t correctionSoftRevLimit (int8_t advance)
 
int8_t correctionNitrous (int8_t advance)
 
int8_t correctionSoftLaunch (int8_t advance)
 
int8_t correctionSoftFlatShift (int8_t advance)
 
int8_t correctionKnock (int8_t advance)
 
int8_t correctionDFCOignition (int8_t advance)
 
uint16_t correctionsDwell (uint16_t dwell)
 

Variables

byte activateMAPDOT
 
byte activateTPSDOT
 
uint16_t AFRnextCycle
 
uint8_t aseTaper
 
uint8_t dfcoDelay
 
uint8_t idleAdvTaper
 
uint8_t crankingEnrichTaper
 
uint8_t dfcoTaper
 

Macro Definition Documentation

◆ IGN_IDLE_THRESHOLD

#define IGN_IDLE_THRESHOLD   200

Function Documentation

◆ calculateAfrTarget()

uint8_t calculateAfrTarget ( table3d16RpmLoad afrLookUpTable,
const statuses current,
const config2 page2,
const config6 page6 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionAccel()

uint16_t correctionAccel ( void  )

Acceleration enrichment correction calculation.

Calculates the % change of the throttle over time (%/second) and performs a lookup based on this Coolant-based modifier is applied on the top of this. When the enrichment is turned on, it runs at that amount for a fixed period of time (taeTime)

Returns
uint16_t The Acceleration enrichment modifier as a %. 100% = No modification.

As the maximum enrichment amount is +255% and maximum cold adjustment for this is 255%, the overall return value from this function can be 100+(255*255/100)=750. Hence this function returns a uint16_t rather than byte.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionAFRClosedLoop()

byte correctionAFRClosedLoop ( void  )

Lookup the AFR target table and perform either a simple or PID adjustment based on this.

Simple (Best suited to narrowband sensors): If the O2 sensor reports that the mixture is lean/rich compared to the desired AFR target, it will make a 1% adjustment It then waits egoDelta number of ignition events and compares O2 against the target table again. If it is still lean/rich then the adjustment is increased to 2%.

This continues until either:

  • the O2 reading flips from lean to rich, at which point the adjustment cycle starts again at 1% or
  • the adjustment amount increases to egoLimit at which point it stays at this level until the O2 state (rich/lean) changes

PID (Best suited to wideband sensors):

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionASE()

byte correctionASE ( void  )

After Start Enrichment calculation. This is a short period (Usually <20 seconds) immediately after the engine first fires (But not when cranking) where an additional amount of fuel is added (Over and above the WUE amount).

Returns
uint8_t The After Start Enrichment modifier as a %. 100% = No modification.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionBaro()

byte correctionBaro ( void  )

Correction for current barometric / ambient pressure.

Returns
A percentage value indicating the amount the fuelling should be changed based on the barometric reading. 100 = No change. 110 = 10% increase. 90 = 10% decrease
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionBatVoltage()

byte correctionBatVoltage ( void  )

Battery Voltage correction. Uses a 2D enrichment table (WUETable) where the X axis is engine temp and the Y axis is the amount of extra fuel to add.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionCLTadvance()

int8_t correctionCLTadvance ( int8_t  advance)

Ignition correction for coolant temperature (CLT).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionCranking()

uint16_t correctionCranking ( void  )

Cranking Enrichment corrections. Additional fuel % to be added when the engine is cranking

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionCrankingFixedTiming()

int8_t correctionCrankingFixedTiming ( int8_t  advance)

Correct ignition timing to configured fixed value to use during craning. Must be called near end to override all other corrections.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionDFCO()

bool correctionDFCO ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionDFCOfuel()

byte correctionDFCOfuel ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionDFCOignition()

int8_t correctionDFCOignition ( int8_t  advance)

Ignition DFCO taper correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionFixedTiming()

int8_t correctionFixedTiming ( int8_t  advance)

Correct ignition timing to configured fixed value. Must be called near end to override all other corrections.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionFlex()

byte correctionFlex ( void  )

Flex fuel adjustment to vary fuel based on ethanol content. The amount of extra fuel required is a linear relationship based on the % of ethanol.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionFlexTiming()

int8_t correctionFlexTiming ( int8_t  advance)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionFloodClear()

byte correctionFloodClear ( void  )

Simple check to see whether we are cranking with the TPS above the flood clear threshold.

Returns
100 (not cranking and thus no need for flood-clear) or 0 (Engine cranking and TPS above config4::floodClear limit).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionFuelTemp()

byte correctionFuelTemp ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionIATDensity()

byte correctionIATDensity ( void  )

Simple temperature based corrections lookup based on the inlet air temperature (IAT). This corrects for changes in air density from movement of the temperature.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionIATretard()

int8_t correctionIATretard ( int8_t  advance)

Ignition correction for inlet air temperature (IAT).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionIdleAdvance()

int8_t correctionIdleAdvance ( int8_t  advance)

Ignition Idle advance correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionKnock()

int8_t correctionKnock ( int8_t  advance)

◆ correctionKnockTiming()

int8_t correctionKnockTiming ( int8_t  advance)

Ignition knock (retard) correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionLaunch()

byte correctionLaunch ( void  )

Launch control has a setting to increase the fuel load to assist in bringing up boost. This simple check applies the extra fuel if we're currently launching

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionNitrous()

int8_t correctionNitrous ( int8_t  advance)

Ignition Nitrous oxide correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionsDwell()

uint16_t correctionsDwell ( uint16_t  dwell)

Ignition Dwell Correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionsFuel()

uint16_t correctionsFuel ( void  )

Dispatch calculations for all fuel related corrections. Calls all the other corrections functions and combines their results. This is the only function that should be called from anywhere outside the file

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionsIgn()

int8_t correctionsIgn ( int8_t  base_advance)

Dispatch calculations for all ignition related corrections.

Parameters
base_advance- Base ignition advance (deg. ?)
Returns
Advance considering all (~12) individual corrections
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionSoftFlatShift()

int8_t correctionSoftFlatShift ( int8_t  advance)

Ignition correction for soft flat shift.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionSoftLaunch()

int8_t correctionSoftLaunch ( int8_t  advance)

Ignition soft launch correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionSoftRevLimit()

int8_t correctionSoftRevLimit ( int8_t  advance)

Ignition soft revlimit correction.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionWMITiming()

int8_t correctionWMITiming ( int8_t  advance)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ correctionWUE()

byte correctionWUE ( void  )

Warm Up Enrichment (WUE) corrections. Uses a 2D enrichment table (WUETable) where the X axis is engine temp and the Y axis is the amount of extra fuel to add

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseCorrections()

void initialiseCorrections ( void  )

Initialise instances and vars related to corrections (at ECU boot-up).

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ activateMAPDOT

byte activateMAPDOT
extern

◆ activateTPSDOT

byte activateTPSDOT
extern

◆ AFRnextCycle

uint16_t AFRnextCycle
extern

◆ aseTaper

uint8_t aseTaper
extern

◆ crankingEnrichTaper

uint8_t crankingEnrichTaper
extern

◆ dfcoDelay

uint8_t dfcoDelay
extern

◆ dfcoTaper

uint8_t dfcoTaper
extern

◆ idleAdvTaper

uint8_t idleAdvTaper
extern