mirror of https://github.com/rusefi/rusefi-1.git
Weird VAG: DC motor idle valve not ETB
#1637 Seattle we might have a problem!
This commit is contained in:
parent
86dd5cb8a9
commit
3857607fc2
|
@ -202,7 +202,9 @@ void setIdleMode(idle_mode_e value DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
showIdleInfo();
|
showIdleInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void applyIACposition(percent_t position) {
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
||||||
|
void applyIACposition(percent_t position DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
/**
|
/**
|
||||||
* currently idle level is an percent value (0-100 range), and PWM takes a float in the 0..1 range
|
* currently idle level is an percent value (0-100 range), and PWM takes a float in the 0..1 range
|
||||||
* todo: unify?
|
* todo: unify?
|
||||||
|
@ -216,8 +218,8 @@ static void applyIACposition(percent_t position) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
setEtbIdlePosition(position);
|
setEtbIdlePosition(position PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
#endif
|
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
} if (CONFIG(useStepperIdle)) {
|
} if (CONFIG(useStepperIdle)) {
|
||||||
iacMotor.setTargetPosition(duty * engineConfiguration->idleStepperTotalSteps);
|
iacMotor.setTargetPosition(duty * engineConfiguration->idleStepperTotalSteps);
|
||||||
|
@ -239,11 +241,13 @@ static void applyIACposition(percent_t position) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ! EFI_UNIT_TEST
|
||||||
|
|
||||||
percent_t getIdlePosition(void) {
|
percent_t getIdlePosition(void) {
|
||||||
return engine->engineState.idle.currentIdlePosition;
|
return engine->engineState.idle.currentIdlePosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setIdleValvePosition(int positionPercent) {
|
void setManualIdleValvePosition(int positionPercent) {
|
||||||
if (positionPercent < 1 || positionPercent > 99)
|
if (positionPercent < 1 || positionPercent > 99)
|
||||||
return;
|
return;
|
||||||
scheduleMsg(logger, "setting idle valve position %d", positionPercent);
|
scheduleMsg(logger, "setting idle valve position %d", positionPercent);
|
||||||
|
|
|
@ -20,7 +20,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
percent_t getIdlePosition(void);
|
percent_t getIdlePosition(void);
|
||||||
void setIdleValvePosition(int positionPercent);
|
|
||||||
|
void applyIACposition(percent_t position DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
void setManualIdleValvePosition(int positionPercent);
|
||||||
|
|
||||||
void startIdleThread(Logging*sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void startIdleThread(Logging*sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
void setDefaultIdleParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||||
void startIdleBench(void);
|
void startIdleBench(void);
|
||||||
|
|
|
@ -1261,7 +1261,7 @@ const command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode},
|
||||||
{"can_vss", setCanVss},
|
{"can_vss", setCanVss},
|
||||||
#endif /* EFI_CAN_SUPPORT */
|
#endif /* EFI_CAN_SUPPORT */
|
||||||
#if EFI_IDLE_CONTROL
|
#if EFI_IDLE_CONTROL
|
||||||
{"idle_position", setIdleValvePosition},
|
{"idle_position", setManualIdleValvePosition},
|
||||||
{"idle_rpm", setTargetIdleRpm},
|
{"idle_rpm", setTargetIdleRpm},
|
||||||
{"idle_dt", setIdleDT},
|
{"idle_dt", setIdleDT},
|
||||||
#endif /* EFI_IDLE_CONTROL */
|
#endif /* EFI_IDLE_CONTROL */
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "dc_motor.h"
|
#include "dc_motor.h"
|
||||||
#include "engine_controller.h"
|
#include "engine_controller.h"
|
||||||
#include "sensor.h"
|
#include "sensor.h"
|
||||||
|
#include "idle_thread.h"
|
||||||
|
|
||||||
#include "mocks.h"
|
#include "mocks.h"
|
||||||
|
|
||||||
|
@ -101,16 +102,23 @@ TEST(etb, initializationDcMotorIdleValveMode) {
|
||||||
EXPECT_CALL(mocks[0], init(SensorType::Tps2, _, 0, &engineConfiguration->etb, Ne(nullptr)));
|
EXPECT_CALL(mocks[0], init(SensorType::Tps2, _, 0, &engineConfiguration->etb, Ne(nullptr)));
|
||||||
EXPECT_CALL(mocks[0], reset);
|
EXPECT_CALL(mocks[0], reset);
|
||||||
EXPECT_CALL(mocks[0], start);
|
EXPECT_CALL(mocks[0], start);
|
||||||
|
// todo: make this work! EXPECT_CALL(mocks[0], setIdlePosition(33.0f));
|
||||||
|
|
||||||
// We do not expect throttle #2 to be initialized
|
// We do not expect throttle #2 to be initialized
|
||||||
|
|
||||||
doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE);
|
doInitElectronicThrottle(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
|
||||||
|
applyIACposition(33.0f PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(etb, idlePlumbing) {
|
TEST(etb, idlePlumbing) {
|
||||||
StrictMock<MockEtb> mocks[ETB_COUNT];
|
StrictMock<MockEtb> mocks[ETB_COUNT];
|
||||||
|
|
||||||
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
|
WITH_ENGINE_TEST_HELPER(TEST_ENGINE);
|
||||||
|
engineConfiguration->useETBforIdleControl = true;
|
||||||
|
|
||||||
|
Sensor::setMockValue(SensorType::AcceleratorPedal, 50.0f);
|
||||||
|
|
||||||
for (int i = 0; i < ETB_COUNT; i++) {
|
for (int i = 0; i < ETB_COUNT; i++) {
|
||||||
engine->etbControllers[i] = &mocks[i];
|
engine->etbControllers[i] = &mocks[i];
|
||||||
|
@ -118,7 +126,7 @@ TEST(etb, idlePlumbing) {
|
||||||
EXPECT_CALL(mocks[i], setIdlePosition(33.0f));
|
EXPECT_CALL(mocks[i], setIdlePosition(33.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
setEtbIdlePosition(33.0f PASS_ENGINE_PARAMETER_SUFFIX);
|
applyIACposition(33.0f PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(etb, testSetpointOnlyPedal) {
|
TEST(etb, testSetpointOnlyPedal) {
|
||||||
|
|
Loading…
Reference in New Issue