maximumIgnitionTiming does not account timing_offset_cylinder #5894
only: TDD first steps
This commit is contained in:
parent
41d5b527cc
commit
98dcca20b1
|
@ -32,7 +32,6 @@ void fuelBenchMode();
|
|||
void proteusBoardTest();
|
||||
void proteusLuaDemo();
|
||||
void proteusStimQc();
|
||||
void setHarley();
|
||||
void proteusDcWastegateTest();
|
||||
|
||||
void setTest33816EngineConfiguration();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "pch.h"
|
||||
#include "proteus_meta.h"
|
||||
#include "harley_canned.cpp"
|
||||
#include "harley.h"
|
||||
|
||||
static void harleyEngine() {
|
||||
engineConfiguration->cylindersCount = 2;
|
||||
|
@ -30,8 +31,8 @@ void setHarley() {
|
|||
engineConfiguration->enableAemXSeries = true;
|
||||
|
||||
// total 45 degree odd fire, split across two cylinders mostly for fun
|
||||
engineConfiguration->timing_offset_cylinder[0] = 45.0 / 2;
|
||||
engineConfiguration->timing_offset_cylinder[1] = -45.0 / 2;
|
||||
engineConfiguration->timing_offset_cylinder[0] = HARLEY_V_TWIN / 2;
|
||||
engineConfiguration->timing_offset_cylinder[1] = -HARLEY_V_TWIN / 2;
|
||||
|
||||
// work-around for https://github.com/rusefi/rusefi/issues/5894 todo: fix it!
|
||||
engineConfiguration->maximumIgnitionTiming = 90;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#define HARLEY_V_TWIN 45.0
|
||||
|
||||
void setHarley();
|
|
@ -73,6 +73,7 @@
|
|||
#include "slingshot.h"
|
||||
#include "test_engine.h"
|
||||
#include "sachs.h"
|
||||
#include "harley.h"
|
||||
#include "vw.h"
|
||||
#include "vw_b6.h"
|
||||
#include "toyota_jz.h"
|
||||
|
|
|
@ -1,5 +1,38 @@
|
|||
#include "pch.h"
|
||||
#include "spark_logic.h"
|
||||
#include "harley.h"
|
||||
|
||||
TEST(OddFire, hd) {
|
||||
EngineTestHelper eth(engine_type_e::HARLEY);
|
||||
engineConfiguration->cranking.rpm = 100;
|
||||
float cylinderOne = 19;
|
||||
float cylinderTwo = 13;
|
||||
engineConfiguration->timing_offset_cylinder[0] = cylinderOne;
|
||||
engineConfiguration->timing_offset_cylinder[1] = -cylinderTwo;
|
||||
angle_t timing = 1;
|
||||
setTable(config->ignitionTable, timing);
|
||||
|
||||
engineConfiguration->crankingTimingAngle = timing;
|
||||
engine->tdcMarkEnabled = false;
|
||||
engineConfiguration->camInputs[0] = Gpio::Unassigned;
|
||||
eth.setTriggerType(trigger_type_e::TT_HALF_MOON);
|
||||
|
||||
eth.fireTriggerEvents2(2 /* count */ , 60 /* ms */);
|
||||
|
||||
float expectedAngle = 180 - cylinderOne - timing;
|
||||
|
||||
ASSERT_EQ( 2, engine->executor.size());
|
||||
eth.assertEvent5("spark down#0", 1, (void*)fireSparkAndPrepareNextSchedule, eth.angleToTimeUs(expectedAngle));
|
||||
|
||||
eth.assertRpm( 500, "spinning-RPM#1");
|
||||
|
||||
engine->executor.executeAll(eth.getTimeNowUs() + MS2US(1000000));
|
||||
|
||||
ASSERT_NEAR(-200.0, eth.timeToAngle(-66.66666), EPS3D);
|
||||
ASSERT_NEAR(160.0, eth.timeToAngle(53.333333), EPS3D);
|
||||
|
||||
expectedAngle = 180 - cylinderOne - timing;
|
||||
eth.fireTriggerEvents2(2 /* count */ , 60 /* ms */);
|
||||
ASSERT_EQ( 2, engine->executor.size());
|
||||
eth.assertEvent5("spark down#0", 1, (void*)fireSparkAndPrepareNextSchedule, eth.angleToTimeUs(expectedAngle));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue