mirror of https://github.com/rusefi/rusefi.git
3A92 not syncing (not happy Mitsubicha but another vehicle) #5401
This commit is contained in:
parent
8e76a82a26
commit
f4b69659b9
|
@ -59,17 +59,13 @@ void initializeMitsubishi4g63Cam(TriggerWaveform *s) {
|
||||||
initializeMitsubishi4g9xCam(s);
|
initializeMitsubishi4g9xCam(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initialize36_2_1_1(TriggerWaveform *s) {
|
static void add36_2_1_1(TriggerWaveform *s, float engineCycle, float off) {
|
||||||
s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly);
|
|
||||||
s->tdcPosition = 90;
|
|
||||||
int totalTeethCount = 36;
|
|
||||||
|
|
||||||
float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
|
|
||||||
float toothWidth = 0.5;
|
float toothWidth = 0.5;
|
||||||
|
|
||||||
float oneTooth = 720 / totalTeethCount;
|
int totalTeethCount = 36;
|
||||||
|
float oneTooth = engineCycle / totalTeethCount;
|
||||||
|
|
||||||
float offset = (36 - 11 - 12 - 11) * oneTooth;
|
float offset = off + (36 - 11 - 12 - 11) * oneTooth;
|
||||||
|
|
||||||
addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
|
addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
|
||||||
NO_LEFT_FILTER, offset + 11 * oneTooth + 1);
|
NO_LEFT_FILTER, offset + 11 * oneTooth + 1);
|
||||||
|
@ -84,6 +80,24 @@ void initialize36_2_1_1(TriggerWaveform *s) {
|
||||||
|
|
||||||
addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
|
addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
|
||||||
NO_LEFT_FILTER, offset + 10 * oneTooth + 1);
|
NO_LEFT_FILTER, offset + 10 * oneTooth + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void initialize36_2_1_1(TriggerWaveform *s) {
|
||||||
|
s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::RiseOnly);
|
||||||
|
s->tdcPosition = 90;
|
||||||
|
|
||||||
|
add36_2_1_1(s, FOUR_STROKE_ENGINE_CYCLE, 0);
|
||||||
|
s->setTriggerSynchronizationGap(3);
|
||||||
|
s->setSecondTriggerSynchronizationGap(1); // redundancy
|
||||||
|
}
|
||||||
|
|
||||||
|
void initialize36_2_1_1_3cyl(TriggerWaveform *s) {
|
||||||
|
s->initialize(FOUR_STROKE_CAM_SENSOR, SyncEdge::RiseOnly);
|
||||||
|
s->tdcPosition = 90;
|
||||||
|
s->isMitsubicha = true;
|
||||||
|
|
||||||
|
add36_2_1_1(s, 360, 0);
|
||||||
|
add36_2_1_1(s, 360, 360);
|
||||||
|
|
||||||
s->setTriggerSynchronizationGap(3);
|
s->setTriggerSynchronizationGap(3);
|
||||||
s->setSecondTriggerSynchronizationGap(1); // redundancy
|
s->setSecondTriggerSynchronizationGap(1); // redundancy
|
||||||
|
|
|
@ -17,6 +17,7 @@ void initializeMitsubishi4g9xCam(TriggerWaveform *s);
|
||||||
void configureFordAspireTriggerWaveform(TriggerWaveform * s);
|
void configureFordAspireTriggerWaveform(TriggerWaveform * s);
|
||||||
|
|
||||||
void initialize36_2_1_1(TriggerWaveform *s);
|
void initialize36_2_1_1(TriggerWaveform *s);
|
||||||
|
void initialize36_2_1_1_3cyl(TriggerWaveform *s);
|
||||||
void initialize36_2_1(TriggerWaveform *s);
|
void initialize36_2_1(TriggerWaveform *s);
|
||||||
|
|
||||||
void initializeVvt3A92(TriggerWaveform *s);
|
void initializeVvt3A92(TriggerWaveform *s);
|
||||||
|
|
|
@ -51,6 +51,7 @@ void TriggerWaveform::initialize(operation_mode_e operationMode, SyncEdge syncEd
|
||||||
isSecondWheelCam = false;
|
isSecondWheelCam = false;
|
||||||
needSecondTriggerInput = false;
|
needSecondTriggerInput = false;
|
||||||
shapeWithoutTdc = false;
|
shapeWithoutTdc = false;
|
||||||
|
isMitsubicha = false;
|
||||||
|
|
||||||
// If RiseOnly, ignore falling edges completely.
|
// If RiseOnly, ignore falling edges completely.
|
||||||
useOnlyRisingEdges = syncEdge == SyncEdge::RiseOnly;
|
useOnlyRisingEdges = syncEdge == SyncEdge::RiseOnly;
|
||||||
|
@ -648,11 +649,14 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
|
||||||
break;
|
break;
|
||||||
case trigger_type_e::TT_UNUSED_11:
|
case trigger_type_e::TT_UNUSED_11:
|
||||||
case trigger_type_e::TT_UNUSED_75:
|
case trigger_type_e::TT_UNUSED_75:
|
||||||
case trigger_type_e::TT_UNUSED_78:
|
|
||||||
case trigger_type_e::TT_MITSU_4G63_CAM:
|
case trigger_type_e::TT_MITSU_4G63_CAM:
|
||||||
initializeMitsubishi4g63Cam(this);
|
initializeMitsubishi4g63Cam(this);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case trigger_type_e::TT_UNUSED_78:
|
||||||
|
initialize36_2_1_1_3cyl(this);
|
||||||
|
break;
|
||||||
|
|
||||||
case trigger_type_e::TT_MITSU_4G9x_CAM:
|
case trigger_type_e::TT_MITSU_4G9x_CAM:
|
||||||
initializeMitsubishi4g9xCam(this);
|
initializeMitsubishi4g9xCam(this);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -82,6 +82,14 @@ public:
|
||||||
* For example pick-up in distributor with mechanical ignition firing order control.
|
* For example pick-up in distributor with mechanical ignition firing order control.
|
||||||
*/
|
*/
|
||||||
bool shapeWithoutTdc = false;
|
bool shapeWithoutTdc = false;
|
||||||
|
|
||||||
|
// 3 cylinder negatively affects sync on crank patter, let's handle it as a special kind of cam
|
||||||
|
bool isMitsubicha = false;
|
||||||
|
|
||||||
|
int getMitsubichaMult() const {
|
||||||
|
return isMitsubicha ? 2 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this flag tells us if we should ignore events on second input channel
|
* this flag tells us if we should ignore events on second input channel
|
||||||
* that's the way to ignore noise from the disconnected wire
|
* that's the way to ignore noise from the disconnected wire
|
||||||
|
|
|
@ -304,7 +304,7 @@ bool TriggerDecoderBase::validateEventCounters(const TriggerWaveform& triggerSha
|
||||||
// We can check if things are fine by comparing the number of events in a cycle with the expected number of event.
|
// We can check if things are fine by comparing the number of events in a cycle with the expected number of event.
|
||||||
bool isDecodingError = false;
|
bool isDecodingError = false;
|
||||||
for (int i = 0;i < PWM_PHASE_MAX_WAVE_PER_PWM;i++) {
|
for (int i = 0;i < PWM_PHASE_MAX_WAVE_PER_PWM;i++) {
|
||||||
isDecodingError |= (currentCycle.eventCount[i] != triggerShape.getExpectedEventCount((TriggerWheel)i));
|
isDecodingError |= (triggerShape.getMitsubichaMult() * currentCycle.eventCount[i] != triggerShape.getExpectedEventCount((TriggerWheel)i));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
|
|
|
@ -107,7 +107,7 @@ void TriggerStimulatorHelper::assertSyncPosition(
|
||||||
}
|
}
|
||||||
|
|
||||||
int revolutionCounter = state.getCrankSynchronizationCounter();
|
int revolutionCounter = state.getCrankSynchronizationCounter();
|
||||||
if (revolutionCounter != TEST_REVOLUTIONS) {
|
if (revolutionCounter != TEST_REVOLUTIONS * shape.getMitsubichaMult()) {
|
||||||
warning(ObdCode::CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d",
|
warning(ObdCode::CUSTOM_OBD_TRIGGER_WAVEFORM, "sync failed/wrong gap parameters trigger=%s revolutionCounter=%d",
|
||||||
getTrigger_type_e(triggerConfiguration.TriggerType.type),
|
getTrigger_type_e(triggerConfiguration.TriggerType.type),
|
||||||
revolutionCounter);
|
revolutionCounter);
|
||||||
|
|
Loading…
Reference in New Issue