Fix multi bank fueling (#2661)

* add cylinder number

* changelog

* wording
This commit is contained in:
Matthew Kennedy 2021-05-09 06:37:07 -07:00 committed by GitHub
parent 155bfd9aeb
commit 13f3d1e291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,8 @@ All notable user-facing or behavior-altering changes will be documented in this
## Month 202x Release - "Release Name"
### Fixed
- LCD screen works again #2576
### Added
- Per-bank closed loop fuel correction (each cylinder corrected by the sensor that sees its exhaust)
## April 2021 Release - "Malbec"
### Added

View File

@ -32,7 +32,8 @@ public:
*/
bool isSimultanious = false;
InjectorOutputPin *outputs[MAX_WIRES_COUNT];
int ownIndex = 0;
uint8_t ownIndex = 0;
uint8_t cylinderNumber = 0;
DECLARE_ENGINE_PTR;
event_trigger_position_s injectionStart;

View File

@ -106,6 +106,8 @@ bool FuelSchedule::addFuelEventsForCylinder(int i DECLARE_ENGINE_PARAMETER_SUFF
ev->outputs[0] = output;
ev->outputs[1] = secondOutput;
ev->isSimultanious = isSimultanious;
// Stash the cylinder number so we can select the correct fueling bank later
ev->cylinderNumber = injectorIndex;
if (!isSimultanious && !output->isInitialized()) {
// todo: extract method for this index math

View File

@ -204,7 +204,7 @@ void InjectionEvent::onTriggerTooth(size_t trgEventIndex, int rpm, efitick_t now
}
// Select fuel mass from the correct bank
uint8_t bankIndex = CONFIG(cylinderBankSelect[this->ownIndex]);
uint8_t bankIndex = CONFIG(cylinderBankSelect[this->cylinderNumber]);
float injectionMassGrams = ENGINE(injectionMass)[bankIndex];
// Perform wall wetting adjustment on fuel mass, not duration, so that