miata vvt trigger decoding is broken #1145

This commit is contained in:
rusefi 2020-02-14 00:37:36 -05:00
parent d03135aa13
commit 75d9417131
3 changed files with 70 additions and 0 deletions

View File

@ -95,7 +95,9 @@ void initializeMazdaMiataNb2Crank(TriggerWaveform *s) {
s->tdcPosition = 60 + 655;
s->setTriggerSynchronizationGap2(0.35f, 0.98f);
// 384
s->addEvent720(o + 4 * 56.0f, T_PRIMARY, TV_FALL);
// 400
s->addEvent720(o + 4 * 60.0f, T_PRIMARY, TV_RISE);
s->addEvent720(o + 4 * 136.0f, T_PRIMARY, TV_FALL);
s->addEvent720(o + 4 * 140.0f, T_PRIMARY, TV_RISE);

View File

@ -0,0 +1,67 @@
/*
* @file test_symmetrical_crank.cpp
*
* @date Feb 14, 2020
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "engine_test_helper.h"
TEST(engine, testSymmetricalCrank) {
WITH_ENGINE_TEST_HELPER(MAZDA_MIATA_2003);
float x = 0.02;
ASSERT_EQ( 0, GET_RPM()) << "RPM#0";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 0, GET_RPM()) << "RPM#1";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 0, GET_RPM()) << "RPM#2";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
ASSERT_EQ( 549, GET_RPM()) << "RPM#2.5";
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 549, GET_RPM()) << "RPM#3";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 549, GET_RPM()) << "RPM#4";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 549, GET_RPM()) << "RPM#5";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 549, GET_RPM()) << "RPM#6";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 374, GET_RPM()) << "RPM#7";
eth.fireFall(x * 384);
eth.fireRise(x * 16);
eth.fireFall(x * 304);
eth.fireRise(x * 16);
ASSERT_EQ( 374, GET_RPM()) << "RPM#8";
}

View File

@ -11,6 +11,7 @@ TESTS_SRC_CPP = \
tests/test_miata_na6_real_cranking.cpp \
tests/test_fasterEngineSpinningUp.cpp \
tests/test_dwell_corner_case_issue_796.cpp \
tests/test_symmetrical_crank.cpp \
tests/test_idle_controller.cpp \
tests/test_trigger_decoder.cpp \
tests/test_trigger_noiseless.cpp \