Ford Coyote Exhaust VVT position error #6402

only:alphax-8chan
This commit is contained in:
Andrey 2024-07-04 15:37:43 -04:00
parent 9d2f48318d
commit 9e49e26fbf
4 changed files with 59 additions and 10 deletions

View File

@ -14,7 +14,7 @@ void configureFordCoyote(TriggerWaveform *s) {
s->setTriggerSynchronizationGap(3);
s->setSecondTriggerSynchronizationGap(0.5);
s->addToothRiseFall(45);
s->addToothRiseFall(45 /*, width = 10*/);
s->addToothRiseFall(90);
s->addToothRiseFall(180 - 30);
@ -25,3 +25,28 @@ void configureFordCoyote(TriggerWaveform *s) {
s->addToothRiseFall(360);
}
void addToothRiseFall2(TriggerWaveform *s, angle_t angle) {
s->addEvent360(angle - 10, TriggerValue::FALL, TriggerWheel::T_PRIMARY);
s->addEvent360(angle, TriggerValue::RISE, TriggerWheel::T_PRIMARY);
}
void configureFordCoyote2(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::RiseOnly);
s->setTriggerSynchronizationGap3(0, 0.47, 0.7);
s->setTriggerSynchronizationGap3(1, 0.95, 1.59);
s->setTriggerSynchronizationGap3(2, 0.95, 1.59);
addToothRiseFall2(s, 45);
addToothRiseFall2(s, 90);
addToothRiseFall2(s, 180 - 30);
addToothRiseFall2(s, 180);
addToothRiseFall2(s, 270 - 30);
addToothRiseFall2(s, 270);
addToothRiseFall2(s, 360);
}

View File

@ -8,4 +8,5 @@
class TriggerWaveform;
void configureFordCoyote(TriggerWaveform *s);
void configureFordCoyote(TriggerWaveform *s);
void configureFordCoyote2(TriggerWaveform *s);

View File

@ -664,6 +664,8 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
initializeMitsubishi4gSymmetricalCrank(this);
break;
case trigger_type_e::TT_DEV:
configureFordCoyote2(this);
break;
case trigger_type_e::TT_VVT_FORD_COYOTE:
configureFordCoyote(this);
break;

View File

@ -2,38 +2,59 @@
#include "logicdata_csv_reader.h"
TEST(fordCoyote, intakeCam) {
static void runCoyoteIntakeCam(bool invertPrimaryTriggerSignal, int warningCount, int rpm) {
CsvReader reader(1, /* vvtCount */ 0);
reader.open("tests/trigger/resources/ford-coyote-intake-cam.csv");
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
eth.setTriggerType(trigger_type_e::TT_VVT_FORD_COYOTE);
eth.setTriggerType(invertPrimaryTriggerSignal ? trigger_type_e::TT_DEV : trigger_type_e::TT_VVT_FORD_COYOTE);
engineConfiguration->isFasterEngineSpinUpEnabled = true;
engineConfiguration->alwaysInstantRpm = true;
reader.flipOnRead = invertPrimaryTriggerSignal;
printf("Reading intake %d...\n", invertPrimaryTriggerSignal);
while (reader.haveMore()) {
reader.processLine(&eth);
}
ASSERT_EQ( 1, eth.recentWarnings()->getCount())<< "warningCounter#intakeCam";
ASSERT_EQ( 1093, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
ASSERT_EQ( warningCount, eth.recentWarnings()->getCount())<< "warningCounter#intakeCam";
ASSERT_EQ( rpm, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
}
TEST(fordCoyote, exhaustCam) {
TEST(fordCoyote, intakeCam) {
runCoyoteIntakeCam(false, 1, 1093);
}
TEST(fordCoyote, intakeCamInverted) {
runCoyoteIntakeCam(true, 3, 1018);
}
static void runCoyoteExhaustCam(bool invertPrimaryTriggerSignal, int warningCount, int rpm) {
CsvReader reader(1, /* vvtCount */ 0);
reader.open("tests/trigger/resources/ford-coyote-exhaust-cam.csv");
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
eth.setTriggerType(trigger_type_e::TT_VVT_FORD_COYOTE);
eth.setTriggerType(invertPrimaryTriggerSignal ? trigger_type_e::TT_DEV : trigger_type_e::TT_VVT_FORD_COYOTE);
engineConfiguration->isFasterEngineSpinUpEnabled = true;
reader.flipOnRead = invertPrimaryTriggerSignal;
engineConfiguration->alwaysInstantRpm = true;
printf("Reading exhaust...\n");
while (reader.haveMore()) {
reader.processLine(&eth);
}
ASSERT_EQ( 1, eth.recentWarnings()->getCount())<< "warningCounter#exhaustCam";
ASSERT_EQ( 1093, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
ASSERT_EQ(warningCount, eth.recentWarnings()->getCount())<< "warningCounter#exhaustCam";
ASSERT_EQ(rpm, round(Sensor::getOrZero(SensorType::Rpm)))<< reader.lineIndex();
}
TEST(fordCoyote, exhaustCam) {
runCoyoteExhaustCam(false, 1, 1093);
}
TEST(fordCoyote, exhaustCamInverted) {
runCoyoteExhaustCam(true, 2, 1046);
}