get rid of hysteresis functionality - see https://github.com/rusefi/rusefi/issues/6566#issuecomment-2166719232 (#6566)
This commit is contained in:
parent
ea1df222c4
commit
23f1466a85
|
@ -77,13 +77,11 @@ LaunchCondition LaunchControlBase::calculateRPMLaunchCondition(const int rpm) {
|
|||
const int launchRpm = engineConfiguration->launchRpm;
|
||||
const int preLaunchRpm = launchRpm - engineConfiguration->launchRpmWindow;
|
||||
if (rpm < preLaunchRpm) {
|
||||
isAfterLaunch = false;
|
||||
return LaunchCondition::NotMet;
|
||||
} else if (launchRpm <= rpm) {
|
||||
isAfterLaunch = true;
|
||||
return LaunchCondition::Launch;
|
||||
} else {
|
||||
return (isAfterLaunch ? LaunchCondition::Launch : LaunchCondition::PreLaunch);
|
||||
return LaunchCondition::PreLaunch;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ bit isLaunchCondition
|
|||
bit isSwitchActivated
|
||||
bit isClutchActivated
|
||||
bit isValidInputPin
|
||||
bit isAfterLaunch
|
||||
|
||||
bit activateSwitchCondition;
|
||||
bit rpmLaunchCondition;
|
||||
|
|
|
@ -20,34 +20,34 @@ static void updateRpm(const int rpm) {
|
|||
engine->launchController.update();
|
||||
}
|
||||
|
||||
TEST(rpmCondition, IncreasingRpm) {
|
||||
TEST(rpmCondition, increasingRpm) {
|
||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
|
||||
setUpTestParameters();
|
||||
|
||||
/* RPM hasn't reached Launch RPM parameter - rpmCondition isn't satisfied: */
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition); // check default value
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch); // check default value
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition); // check default value
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM - 1);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM - 1);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM);
|
||||
/* RPM reached Launch RPM parameter - now rpmCondition is satisfied: */
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
}
|
||||
|
||||
TEST(rpmCondition, HysterisisOnDecreasingRpm) {
|
||||
TEST(rpmCondition, decreasingRpm) {
|
||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
|
||||
setUpTestParameters();
|
||||
|
@ -55,24 +55,24 @@ TEST(rpmCondition, HysterisisOnDecreasingRpm) {
|
|||
updateRpm(TEST_LAUNCH_RPM);
|
||||
/* RPM reached Launch RPM parameter - rpmCondition is satisfied: */
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM - 1);
|
||||
/* RPM is below Launch RPM parameter, but still in Launch Control Window - so rpmCondition is still satisfied: */
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM - 1);
|
||||
/* RPM went down below Launch Control Window parameter - now rpmCondition is not satisfied: */
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
}
|
||||
|
||||
TEST(rpmCondition, HysterisisRpmOscillation) {
|
||||
TEST(rpmCondition, rpmOscillation) {
|
||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
|
||||
setUpTestParameters();
|
||||
|
@ -80,39 +80,39 @@ TEST(rpmCondition, HysterisisRpmOscillation) {
|
|||
updateRpm(TEST_LAUNCH_RPM);
|
||||
/* RPM reached Launch RPM parameter - rpmCondition is satisfied: */
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM - 1);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM + 1);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM + 2);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM - 1);
|
||||
/* RPM went down below Launch Control Window parameter - now rpmCondition is not satisfied: */
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_PRELAUNCH_RPM);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
updateRpm(TEST_LAUNCH_RPM - 1);
|
||||
EXPECT_FALSE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_FALSE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_TRUE(engine->launchController.rpmPreLaunchCondition);
|
||||
|
||||
/* RPM reached Launch RPM parameter again - now rpmCondition is satisfied: */
|
||||
updateRpm(TEST_LAUNCH_RPM);
|
||||
EXPECT_TRUE(engine->launchController.rpmLaunchCondition);
|
||||
EXPECT_TRUE(engine->launchController.isAfterLaunch);
|
||||
EXPECT_FALSE(engine->launchController.rpmPreLaunchCondition);
|
||||
}
|
Loading…
Reference in New Issue