I'm working on getting an engine running, and besides a bunch of other stupid problems, I found some odd behavior in the injector staging function using the stim (as other stupid problems prevent the actual engine from running). I'm using the latest stable release of the Extra code, 1.0.0. I set up all the triggers and everything starts to trigger fine. Using the smoothing option, I can watch the PW1 fall while the PW2 rises. But as the transistion completes, both values jump to some smaller value, lower than what the PW2 was transitioning up to. Both PW1 and PW2 become identical, and respond properly to sensor inputs. But I was confused as to why the primary injector would still run once the staging transition was complete. I looked in the staging code (I'm a coding noob, mind you) and found this at the end:
Code: Select all
if (transition_done) {
calculated_pw2 = calculated_pw1 = calculated_base_pw;
}
} else {
calculated_pw2 = calculated_pw1 = calculated_base_pw;
}
So after staging is complete, PW1 and PW2 are set equal to each other? Yet at the very end of the whole staging routine, if the staging should be off, the pulsewidths are set as follows:
Code: Select all
pw_staged1 = base_pw;
pw_staged2 = 0;
In this case, PW2 is disabled, and PW1 does it's thing. I would think the opposite would be true if staging was in effect: PW1 would be disabled, and all injection would rely on PW2. Otherwise, it would give staging_percent % extra fuel.
I'm going to run through the math in the code to see if this lower pulsewidth that they jump to is the right one for the larger injector. If so, it should be safe to change the code to set the PW1 to zero after staging is complete. But then again, I'm a programming doofus, so who's got the real answer?