impruv
This commit is contained in:
parent
a92a8ba262
commit
1da7be3f67
|
@ -10,19 +10,19 @@
|
||||||
static void doRevolution(EngineTestHelper& eth, int periodMs) {
|
static void doRevolution(EngineTestHelper& eth, int periodMs) {
|
||||||
float halfToothTime = (periodMs / 6.0f) / 2;
|
float halfToothTime = (periodMs / 6.0f) / 2;
|
||||||
|
|
||||||
eth.fireRise(halfToothTime);
|
eth.smartFireRise(halfToothTime);
|
||||||
eth.fireFall(halfToothTime);
|
eth.fireFall(halfToothTime);
|
||||||
eth.fireRise(halfToothTime);
|
eth.smartFireRise(halfToothTime);
|
||||||
eth.fireFall(halfToothTime);
|
eth.fireFall(halfToothTime);
|
||||||
eth.fireRise(halfToothTime);
|
eth.smartFireRise(halfToothTime);
|
||||||
eth.fireFall(halfToothTime);
|
eth.fireFall(halfToothTime);
|
||||||
|
|
||||||
// now missing tooth
|
// now missing tooth
|
||||||
eth.fireRise(halfToothTime);
|
eth.smartFireRise(halfToothTime);
|
||||||
eth.fireFall(3 * halfToothTime);
|
eth.fireFall(3 * halfToothTime);
|
||||||
|
|
||||||
// This tooth is the sync point!
|
// This tooth is the sync point!
|
||||||
eth.fireRise(halfToothTime);
|
eth.smartFireRise(halfToothTime);
|
||||||
eth.fireFall(halfToothTime);
|
eth.fireFall(halfToothTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ TEST(fuelControl, transitionIssue1592) {
|
||||||
fuelMap.setAll(13);
|
fuelMap.setAll(13);
|
||||||
extern fuel_Map3D_t fuelPhaseMap;
|
extern fuel_Map3D_t fuelPhaseMap;
|
||||||
fuelPhaseMap.setAll(0);
|
fuelPhaseMap.setAll(0);
|
||||||
|
setArrayValues(config->crankingFuelCoef, 1.0f);
|
||||||
|
setArrayValues(config->crankingCycleCoef, 1.0f);
|
||||||
|
|
||||||
engineConfiguration->globalTriggerAngleOffset = 20;
|
engineConfiguration->globalTriggerAngleOffset = 20;
|
||||||
|
|
||||||
|
@ -76,37 +78,22 @@ TEST(fuelControl, transitionIssue1592) {
|
||||||
ASSERT_EQ(sched_close->action.getCallback(), &turnInjectionPinLow);
|
ASSERT_EQ(sched_close->action.getCallback(), &turnInjectionPinLow);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the first of those two events - the injector opens, but doesn't yet close.
|
// Run the engine for some revs
|
||||||
engine->executor.executeAll(getTimeNowUs() + MS2US(35));
|
for (size_t i = 0; i < 10; i++) {
|
||||||
|
doRevolution(eth, 150);
|
||||||
// Check that queue got shorter, and overlap counters were incremented on injectors 2/3 (batch mode, remember?)
|
|
||||||
{
|
|
||||||
// Check that it was exec'd
|
|
||||||
ASSERT_EQ(engine->executor.size(), 1);
|
|
||||||
|
|
||||||
// Injectors 2/3 should currently be open
|
|
||||||
EXPECT_EQ(enginePins.injectors[0].getOverlappingCounter(), 0);
|
|
||||||
EXPECT_EQ(enginePins.injectors[1].getOverlappingCounter(), 1);
|
|
||||||
EXPECT_EQ(enginePins.injectors[2].getOverlappingCounter(), 1);
|
|
||||||
EXPECT_EQ(enginePins.injectors[3].getOverlappingCounter(), 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second sync point will transition to running
|
// Check that no injectors are stuck open
|
||||||
// This needs to reset overlapping state as it may reschedule injector openings
|
// Only injector 1 should currently be open
|
||||||
doRevolution(eth, 150);
|
EXPECT_EQ(enginePins.injectors[0].getOverlappingCounter(), 1);
|
||||||
|
EXPECT_EQ(enginePins.injectors[1].getOverlappingCounter(), 0);
|
||||||
// Injectors should all be closed immediately after mode change
|
|
||||||
EXPECT_EQ(enginePins.injectors[0].getOverlappingCounter(), 0);
|
|
||||||
|
|
||||||
// !!!!!!!!! BUG !!!!!!!!!!!!!!!
|
// !!!!!!!!! BUG !!!!!!!!!!!!!!!
|
||||||
// These next two should be equal to 0, not 1
|
// Injector #3 gets stuck open!
|
||||||
EXPECT_EQ(enginePins.injectors[1].getOverlappingCounter(), 1);
|
EXPECT_EQ(enginePins.injectors[2].getOverlappingCounter(), 0);
|
||||||
EXPECT_EQ(enginePins.injectors[2].getOverlappingCounter(), 1);
|
|
||||||
// !!!!!!!!! BUG !!!!!!!!!!!!!!!
|
// !!!!!!!!! BUG !!!!!!!!!!!!!!!
|
||||||
|
|
||||||
EXPECT_EQ(enginePins.injectors[3].getOverlappingCounter(), 0);
|
EXPECT_EQ(enginePins.injectors[3].getOverlappingCounter(), 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
eth.writeEvents("fuel_schedule_transition_issue_1592.logicdata");
|
eth.writeEvents("fuel_schedule_transition_issue_1592.logicdata");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue