[was: 3/0 trigger syncs faster with Single Tooth than 6G72 Cam] 6G72 Cam is not well #6798
This commit is contained in:
parent
874c577c87
commit
ebc5f513ce
|
@ -41,18 +41,20 @@ void initializeMitsubishi4gSymmetricalCrank(TriggerWaveform *s) {
|
|||
|
||||
// https://github.com/rusefi/rusefi/issues/5593
|
||||
void initializeVvt6G72(TriggerWaveform *s) {
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Rise);
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::Both);
|
||||
|
||||
s->setTriggerSynchronizationGap(0.8);
|
||||
s->setSecondTriggerSynchronizationGap(1.9);
|
||||
int narrowWidth = 30;
|
||||
s->setTriggerSynchronizationGap3(0, 0.3f, 0.95f);
|
||||
s->setTriggerSynchronizationGap3(1, 0.5f, 0.7f);
|
||||
s->setTriggerSynchronizationGap3(2, 0.55f, 1.1f);
|
||||
|
||||
// special wider tooth
|
||||
s->addToothRiseFall(90 * 1, 60);
|
||||
|
||||
s->addToothRiseFall(90 * 2, narrowWidth);
|
||||
s->addToothRiseFall(90 * 3, narrowWidth);
|
||||
s->addToothRiseFall(90 * 4, narrowWidth);
|
||||
s->addEvent360(25.548325, TriggerValue::RISE);
|
||||
s->addEvent360(87.945659, TriggerValue::FALL);
|
||||
s->addEvent360(117.753483, TriggerValue::RISE);
|
||||
s->addEvent360(178.618554, TriggerValue::FALL);
|
||||
s->addEvent360(204.233855, TriggerValue::RISE);
|
||||
s->addEvent360(266.592641, TriggerValue::FALL);
|
||||
s->addEvent360(326.382236, TriggerValue::RISE);
|
||||
s->addEvent360(360.000000, TriggerValue::FALL);
|
||||
}
|
||||
|
||||
void initializeMitsubishi4g9xCam(TriggerWaveform *s) {
|
||||
|
|
|
@ -92,6 +92,7 @@ void CsvReader::processLine(EngineTestHelper *eth) {
|
|||
}
|
||||
|
||||
double timeStamp = std::stod(timeStampstr);
|
||||
history.add(timeStamp);
|
||||
|
||||
timeStamp += m_timestampOffset;
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
return m_lineIndex;
|
||||
}
|
||||
|
||||
cyclic_buffer<double, 720> history;
|
||||
|
||||
private:
|
||||
const size_t m_triggerCount;
|
||||
const size_t m_vvtCount;
|
||||
|
|
|
@ -17,6 +17,36 @@ static void prepare(EngineTestHelper *eth, trigger_type_e trigger) {
|
|||
engineConfiguration->vvtMode[0] = VVT_INACTIVE;
|
||||
}
|
||||
|
||||
static void constructTriggerFromRecording(CsvReader *reader) {
|
||||
int magic = 20;
|
||||
|
||||
if (reader->lineIndex() == magic) {
|
||||
|
||||
int len = 8;
|
||||
double last = reader->history.get(magic - 1);
|
||||
printf("last=%f\n", last);
|
||||
|
||||
double time360 = last - reader->history.get(magic - 1 - 8);
|
||||
|
||||
float current = 0;
|
||||
|
||||
for (int i=len - 1;i>=0;i--) {
|
||||
double tooth = last - reader->history.get(magic - 1 - i);
|
||||
// printf("index=%d width=%f\n", i, tooth);
|
||||
double angle = 360 - (360 * tooth / time360);
|
||||
//printf("index=%d, to=%f\n", i, angle);
|
||||
|
||||
bool isRise = (i % 2) == 1;
|
||||
const char * front = isRise ? "RISE" : "FALL";
|
||||
|
||||
printf("\ts->addEvent360(%f, TriggerValue::%s);\n", angle, front);
|
||||
current += tooth;
|
||||
}
|
||||
|
||||
// printf("time360=%f\n", time360);
|
||||
}
|
||||
}
|
||||
|
||||
static void runTriggerTest(const char *fileName, int totalErrors, int syncCounter, float firstRpm) {
|
||||
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
|
||||
|
||||
|
@ -30,6 +60,10 @@ static void runTriggerTest(const char *fileName, int totalErrors, int syncCounte
|
|||
reader.open(fileName);
|
||||
while (reader.haveMore()) {
|
||||
reader.processLine(ð);
|
||||
|
||||
constructTriggerFromRecording(&reader);
|
||||
|
||||
|
||||
auto rpm = Sensor::getOrZero(SensorType::Rpm);
|
||||
// printf("rpm %f\n", rpm);
|
||||
|
||||
|
@ -46,10 +80,10 @@ static void runTriggerTest(const char *fileName, int totalErrors, int syncCounte
|
|||
}
|
||||
|
||||
|
||||
TEST(real6g72, data) {
|
||||
runTriggerTest("tests/trigger/resources/3000gt.csv", 0, 16, 419.42f);
|
||||
TEST(real6g72, data1) {
|
||||
runTriggerTest("tests/trigger/resources/3000gt.csv", 0, 15, 195.515f);
|
||||
}
|
||||
|
||||
TEST(real6g72, data2) {
|
||||
runTriggerTest("tests/trigger/resources/3000gt_cranking_cam_first_crank_second_only_cam.csv", 4, 0, 376.20f);
|
||||
runTriggerTest("tests/trigger/resources/3000gt_cranking_cam_first_crank_second_only_cam.csv", 2, 9, 157.843f);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue