Speeduino
|
Speeduino main file containing initial setup and system loop functions. More...
Go to the source code of this file.
Macros | |
#define | CRANK_RUN_HYSTER 15 |
Functions | |
void | setup (void) |
void | loop (void) |
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. | |
byte | getVE1 (void) |
byte | getAdvance1 (void) |
uint16_t | calculatePWLimit () |
void | calculateStaging (uint32_t) |
void | calculateIgnitionAngles (uint16_t dwellAngle) |
void | checkLaunchAndFlatShift () |
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:
| |
uint16_t | staged_req_fuel_mult_pri |
uint16_t | staged_req_fuel_mult_sec |
Speeduino main file containing initial setup and system loop functions.
This file contains the main system loop of the Speeduino core and thus much of the logic of the fuel and ignition algorithms is contained within this It is where calls to all the auxiliary control systems, sensor reads, comms etc are made
It also contains the setup() function that is called by the bootloader on system startup
#define CRANK_RUN_HYSTER 15 |
Calculate the Ignition angles for all cylinders (based on config2::nCylinders). both start and end angles are calculated for each channel. Also the mode of ignition firing - wasted spark vs. dedicated spark per cyl. - is considered here.
uint16_t calculatePWLimit | ( | ) |
void checkLaunchAndFlatShift | ( | ) |
Lookup the ignition advance from 3D ignition table. The values used to look this up will be RPM and whatever load source the user has configured.
Lookup the current VE value from the primary 3D fuel map. The Y axis value used for this lookup varies based on the fuel algorithm selected (speed density, alpha-n etc).
Speeduino main loop.
Main loop chores (roughly in the order that they are performed):
single byte variable LOOP_TIMER plays a big part here as:
This function calculates the required pulsewidth time (in us) given the current system state.
REQ_FUEL | The required fuel value in uS, as calculated by TunerStudio |
VE | Lookup from the main fuel table. This can either have been MAP or TPS based, depending on the algorithm used |
MAP | In 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) |
corrections | Sum of Enrichment factors (Cold start, acceleration). This is a multiplication factor (Eg to add 10%, this should be 110) |
injOpen | Injector opening time. The time the injector take to open minus the time it takes to close (Both in uS) |
|
extern |
The injector opening time. This is set within Tuner Studio, but stored here in uS rather than mS
|
extern |
The required fuel variable (As calculated by TunerStudio) in uS
|
extern |
|
extern |