6G72 Trigger Pattern #5593

This commit is contained in:
Andrey 2023-12-06 23:01:28 -05:00 committed by rusefillc
parent fb406525f5
commit 540e142c28
3 changed files with 46 additions and 5 deletions

View File

@ -41,14 +41,14 @@ void initializeMitsubishi4gSymmetricalCrank(TriggerWaveform *s) {
// https://github.com/rusefi/rusefi/issues/5593
void initializeVvt6G72(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Both);
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Rise);
s->setTriggerSynchronizationGap(0.29);
s->setSecondTriggerSynchronizationGap(1.65);
int narrowWidth = 40 / 2;
s->setTriggerSynchronizationGap(0.8);
s->setSecondTriggerSynchronizationGap(1.9);
int narrowWidth = 30;
// special wider tooth
s->addToothRiseFall(90 * 1, 85.0 / 2);
s->addToothRiseFall(90 * 1, 60);
s->addToothRiseFall(90 * 2, narrowWidth);
s->addToothRiseFall(90 * 3, narrowWidth);

View File

@ -13,6 +13,7 @@ TESTS_SRC_CPP = \
tests/trigger/test_real_cranking_miata_NA.cpp \
tests/trigger/test_real_cranking_miata_na6.cpp \
tests/trigger/test_real_cranking_nissan_vq40.cpp \
tests/trigger/test_real_6g72_3000gt.cpp \
tests/trigger/test_real_cas_24_plus_1.cpp \
tests/trigger/test_trigger_skipped_wheel.cpp \
tests/trigger/test_real_4b11.cpp \

View File

@ -0,0 +1,40 @@
#include "pch.h"
#include "logicdata_csv_reader.h"
TEST(real6g72, data) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
engineConfiguration->isFasterEngineSpinUpEnabled = true;
engineConfiguration->alwaysInstantRpm = true;
engineConfiguration->invertPrimaryTriggerSignal = false;
engineConfiguration->isPhaseSyncRequiredForIgnition = true;
eth.setTriggerType(trigger_type_e::TT_VVT_MITSU_6G72);
ASSERT_FALSE(engine->triggerCentral.triggerShape.shapeDefinitionError);
engineConfiguration->vvtMode[0] = VVT_INACTIVE;
bool gotRpm = false;
CsvReader reader(/*trigger channels count*/1, /* vvtCount */ 0);
reader.flipOnRead = true;
reader.open("tests/trigger/resources/3000gt.csv");
while (reader.haveMore()) {
reader.processLine(&eth);
auto rpm = Sensor::getOrZero(SensorType::Rpm);
printf("rpm %f\n", rpm);
if (!gotRpm && rpm) {
gotRpm = true;
// EXPECT_EQ(eventCount, 7);
EXPECT_NEAR(rpm, 419.42f, 0.1);
}
}
ASSERT_TRUE(gotRpm);
}