Speeduino is now on Github Sponsors (Rather than Patreon): https://github.com/sponsors/noisymime
Help with building your Speeduino, installing it, getting it to run etc.
By TZ350
Another step forward in getting a clean swap between small and big injectors with staged injection.

Initially with my changes to the code in "STAGING_MODE_AUTO" I could get it to swap. But was troubled with fluttering between the big and small injectors. Now I have some hysterias built in. Once the small injector has swapped over to the big one, in my code the fuel demand has to drop 10% before it swaps back.

I also had to add some adjustment to "inj_openTime_us" to balance the initial fuel dribble from the big injector with the small one so as they both delivered the same amount of fuel for a given pulse width.
2020-09-23 (11).png
2020-09-23 (11).png (123.42 KiB) Viewed 343 times
By TZ350
The AFR lower Yellow line stays consistent for the same VE as the injectors swap. I had to adjust the "inj_openTime_us" for the big injectors to get a smooth AFR transition.
Screenshot (383).png
Screenshot (383).png (134.13 KiB) Viewed 342 times
By TZ350
Dmitriy wrote:
Sat Sep 26, 2020 4:38 pm
Hello TZ350 Please share your code.
Hi Dmitriy. About two thirds of the way down the page in the Speeduino main block of code I copied the "STAGING_MODE_AUTO" section to modify and commented out the original.
There is not much to change and very little to add in the way of coding. You may even be able to just drop it all in by a simple copy and past from my post.

//.............................................. Rob2
//uint32_t inj_openThistime_uS = 0;
//uint32_t PWlastTime = 0; //
//uint32_t PWthisTime = 0; // these need to be coppied into the definition area near the top of the page.

else if(configPage10.stagingMode == STAGING_MODE_AUTO)
currentStatus.PW1 = tempPW1;
if(tempPW1 > pwLimit ){PWlastTime = (tempPW1 * 0.9); PWthisTime = tempPW1;}// tempPW3 has to drop 10% to avoid unwanted short term jumping between two states (ie; small and big injectors) - hysteresis
//If automatic mode, the primary injectors are used all the way up to their limit (Configured by the pulsewidth limit setting)
//If they exceed their limit, the whole duty is passed onto the secondaries

if(PWthisTime > PWlastTime)
uint32_t extraPW = tempPW1; //The open time must be added below because tempPW1 does not include an open time.
currentStatus.PW1 = 0; // Completely turn off the primary injector.
currentStatus.PW3 = ((extraPW * staged_req_fuel_mult_sec) / staged_req_fuel_mult_pri); //Swap to the secondary injector and convert the fuel amount from primary injector scaling to secondary
inj_openThistime_uS = (inj_opentime_uS * 0.5);
currentStatus.PW3 += inj_openThistime_uS; // adjustment of inj_opentime_uS because there are two injectors fired together as one logical injector. This value may need adjusting.
PWthisTime = tempPW1;
else { currentStatus.PW3 = 0; PWthisTime = 0;} //If tempPW1 and tempPW3 < pwLImit it means that the entire fuel load can be handled by the primaries. Simply set the secondaries to 0
//................................................ Rob2
By TZ350
After trying my code changes I discovered a flaw .........

I have been trying to get the staged injection to cut cleanly between the primary (Inj - 1) and the secondary injectors (Inj - 2).

This it can do and with some built in hysterias it does not flutter between primary and secondary injectors.

And I could get it to run nicely at the low end on the primary injector and ok at the top end on the secondary injectors.

But the problem is I could not get it to swap cleanly from one region to the other.

By changing the allowed "Duty Cycle" I could force Inj-1 or Inj-2 to try and run region in the middle.

But no amount of fuel mapping trickery. Fiddling with the logical injector sizing or alteration of the injector dead times helped.

As it turns out the issue seems to be in the original Speeduino code. The code may be right for when the staged injection just adds the secondary's to the primaries as needed but does not work when its a clean cut over.

I had to change the way the ratio of secondary to primary is calculated. A quick run on the Dyno looked promising but we will know for sure next week when I have time to test it properly.
Alpha-N Map.png
Alpha-N Map.png (328.51 KiB) Viewed 121 times
Last edited by TZ350 on Sat Oct 10, 2020 6:31 am, edited 5 times in total.
By TZ350
At any point of the map Inj-1 and Inj-2 would have different pulse widths for the same VE number but deliver the same fuel volume. Its obvious but it took me a while to take the step of looking at this.

My primary Inj-1 is 80cc and secondary Inj-2 is 320cc . A ratio of 4:1.

In the data log the Red line is VE. The Green line is Inj-1 and yellow for Inj-2. Previously the PW ratio in the graph was 3:1 but with the code changes the ratio now looks to be 4:1, the same as the injectors themselves.

What I am unsure about is the dead time. I am not sure if the dead time is included in the PW and PW3 as displayed or if the PW is logged before the dead time is added or after. I would like to know because it would make for a better idea of the actual ratio of fuel delivered.
Checking the PW.png
Checking the PW.png (101.86 KiB) Viewed 111 times
  • 1
  • 37
  • 38
  • 39
  • 40
  • 41
Saving the code after adjustments

Once I have the initial file loaded and setup in t[…]

76 Triumph TR6 to TBI

I've been trying to decide where to put the O2 sen[…]

Modified 3 cylinder

+1 to the other opinions. Run it as 2-cylinder od[…]

+1, that is a popular coil pack with built-n modul[…]

Still can't find what you're looking for?