Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jun 25, 2023
1 parent 9e979e9 commit b0c3357
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 36 deletions.
1 change: 1 addition & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Release template (copy/paste this for new release):
- Improved bench test resolution (more usable for testing injectors, dwell, etc)
- Maximum knock retard table displays correct Y axis values in TunerStudio
- Make errors about fuel pressure sensors less aggressive #111 #117
- Always operate in "two wire" mode for batch fuel, fixing batch firing order #23

## May 2023 Release

Expand Down
2 changes: 1 addition & 1 deletion firmware/config/engines/chevrolet_camaro_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void setCamaro4() {
engineConfiguration->triggerInputPins[1] = Gpio::C6;

engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;

// set ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;

Expand Down
4 changes: 0 additions & 4 deletions firmware/config/engines/dodge_neon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void setDodgeNeon1995EngineConfiguration() {
// set injection_mode 1
engineConfiguration->injectionMode = IM_SEQUENTIAL;

// this is needed for injector lag auto-tune research if switching to batch
// enable two_wire_batch_injection
engineConfiguration->twoWireBatchInjection = true;

// set ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// set_firing_order 2
Expand Down
2 changes: 0 additions & 2 deletions firmware/config/engines/ford_1995_inline_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ void setFordInline6() {
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;


/**
* 0.5ms dwell time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway
Expand Down
4 changes: 0 additions & 4 deletions firmware/config/engines/gm_ls_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
void setGmLs4() {
engineConfiguration->globalTriggerAngleOffset = 86;

// would not hurt just in case no cam
engineConfiguration->twoWireBatchInjection = true;


engineConfiguration->fuelReferencePressure = 400; // 400 kPa, 58 psi
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
engineConfiguration->injector.flow = 440;
Expand Down
3 changes: 0 additions & 3 deletions firmware/config/engines/mazda_miata_1_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ void setMiataNA6_MAP_MRE() {

engineConfiguration->fuelPumpPin = Gpio::Unassigned;


engineConfiguration->twoWireBatchInjection = true;

engineConfiguration->useIacTableForCoasting = true;
engineConfiguration->idlePidDeactivationTpsThreshold = 90;

Expand Down
2 changes: 0 additions & 2 deletions firmware/config/engines/mazda_miata_vvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,6 @@ void setMazdaMiata2003EngineConfiguration() {

// engineConfiguration->is_enabled_spi_1 = true;

engineConfiguration->twoWireBatchInjection = true; // this is needed for #492 testing

engineConfiguration->alternatorControlPin = Gpio::E10;
engineConfiguration->alternatorControlPinMode = OM_OPENDRAIN;

Expand Down
1 change: 0 additions & 1 deletion firmware/config/engines/toyota_jzs147.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ void setToyota_2jz_vics() {

engineConfiguration->ignitionMode = IM_WASTED_SPARK; // just for now
engineConfiguration->injectionMode = IM_BATCH; // just for now
engineConfiguration->twoWireBatchInjection = true;

strcpy(engineConfiguration->engineMake, ENGINE_MAKE_TOYOTA);
strcpy(engineConfiguration->engineCode, "2JZ");
Expand Down
13 changes: 2 additions & 11 deletions firmware/controllers/engine_cycle/fuel_schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,21 @@ bool FuelSchedule::addFuelEventsForCylinder(int i) {
injection_mode_e mode = getCurrentInjectionMode();
engine->outputChannels.currentInjectionMode = static_cast<uint8_t>(mode);

// We need two outputs if:
// - we are running batch fuel, and have "use two wire batch" enabled
// - running mode is sequential, but cranking mode is batch, so we should run two wire batch while cranking
// (if we didn't, only half of injectors would fire while cranking)
bool isTwoWireBatch = engineConfiguration->twoWireBatchInjection || (engineConfiguration->injectionMode == IM_SEQUENTIAL);

int injectorIndex;
if (mode == IM_SIMULTANEOUS || mode == IM_SINGLE_POINT) {
// These modes only have one injector
injectorIndex = 0;
} else if (mode == IM_SEQUENTIAL || (mode == IM_BATCH && isTwoWireBatch)) {
} else if (mode == IM_SEQUENTIAL || mode == IM_BATCH) {
// Map order index -> cylinder index (firing order)
injectorIndex = getCylinderId(i) - 1;
} else if (mode == IM_BATCH) {
// Loop over the first half of the firing order twice
injectorIndex = i % (engineConfiguration->cylindersCount / 2);
} else {
firmwareError(ObdCode::CUSTOM_OBD_UNEXPECTED_INJECTION_MODE, "Unexpected injection mode %d", mode);
injectorIndex = 0;
}

InjectorOutputPin *secondOutput;

if (mode == IM_BATCH && isTwoWireBatch) {
if (mode == IM_BATCH) {
/**
* also fire the 2nd half of the injectors so that we can implement a batch mode on individual wires
*/
Expand Down
3 changes: 0 additions & 3 deletions firmware/controllers/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ static void enableOrDisable(const char *param, bool isEnabled) {
#endif // EFI_PROD_CODE
} else if (strEqualCaseInsensitive(param, "stepperidle")) {
engineConfiguration->useStepperIdle = isEnabled;
} else if (strEqualCaseInsensitive(param, "two_wire_batch_injection")) {
engineConfiguration->twoWireBatchInjection = isEnabled;
incrementGlobalConfigurationVersion();
} else if (strEqualCaseInsensitive(param, "boardUseTempPullUp")) {
engineConfiguration->boardUseTempPullUp = isEnabled;
incrementGlobalConfigurationVersion();
Expand Down
2 changes: 1 addition & 1 deletion firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ bit skippedWheelOnCam,"On camshaft","On crankshaft";Where is your primary skippe
bit useSeparateVeForIdle;This activates a separate fuel table for Idle, this allows fine tuning of the idle fuelling.
bit verboseTriggerSynchDetails;Verbose info in console below engineSnifferRpmThreshold\nenable trigger_details
bit isManualSpinningMode;Usually if we have no trigger events that means engine is stopped\nUnless we are troubleshooting and spinning the engine by hand - this case a longer\ndelay is needed
bit twoWireBatchInjection;This is needed if your coils are individually wired and you wish to use batch injection.\nenable two_wire_batch_injection
bit unused1200b12
bit neverInstantRpm
bit unused1200b14
bit useFixedBaroCorrFromMap
Expand Down
1 change: 0 additions & 1 deletion firmware/tunerstudio/rusefi.input
Original file line number Diff line number Diff line change
Expand Up @@ -2158,7 +2158,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Enabled", isInjectionEnabled
field = "Mode", injectionMode, {isInjectionEnabled == 1}
field = "#Batch injection with individual wiring"
field = "Individually wired Batch Fuel", twoWireBatchInjection, {isInjectionEnabled == 1 && injectionMode == @@injection_mode_e_IM_BATCH@@ }
field = "Override VE table load axis", veOverrideMode, { isInjectionEnabled }
field = "Override AFR table load axis", afrOverrideMode, { isInjectionEnabled }
field = "Injection phase control mode", injectionTimingMode, { isInjectionEnabled }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ TEST(fuelControl, transitionIssue1592) {

// Test the transition from batch cranking to sequential running
engineConfiguration->crankingInjectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;


// First sync point will schedule cranking pulse since we're in "faster spin up" mode
doRevolution(eth, 240);
Expand Down
1 change: 0 additions & 1 deletion unit_tests/tests/trigger/test_trigger_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ TEST(big, testTwoWireBatch) {
.WillRepeatedly(Return(AirmassResult{0.1008f, 50.0f}));

engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;

eth.fireTriggerEventsWithDuration(20);
// still no RPM since need to cycles measure cycle duration
Expand Down

0 comments on commit b0c3357

Please sign in to comment.