Override trigger gaps feature #2734

This commit is contained in:
Andrey 2021-05-23 20:52:18 -04:00
parent 15aa2c40f8
commit 9865b04bf7
4 changed files with 29 additions and 3 deletions

View File

@ -146,6 +146,17 @@ void Engine::initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engineConfiguration->ambiguousOperationMode, engineConfiguration->ambiguousOperationMode,
engineConfiguration->useOnlyRisingEdgeForTrigger, &engineConfiguration->trigger)); engineConfiguration->useOnlyRisingEdgeForTrigger, &engineConfiguration->trigger));
/**
* this is only useful while troubleshooting a new trigger shape in the field
* in very VERY rare circumstances
*/
if (CONFIG(overrideTriggerGaps)) {
for (int gapIndex = 0;gapIndex<GAP_TRACKING_LENGTH;gapIndex++) {
float gapOverride = CONFIG(triggerGapOverride[gapIndex]);
TRIGGER_WAVEFORM(setTriggerSynchronizationGap3(/*gapIndex*/gapIndex, gapOverride * TRIGGER_GAP_DEVIATION_LOW, gapOverride * TRIGGER_GAP_DEVIATION_HIGH));
}
}
if (!TRIGGER_WAVEFORM(shapeDefinitionError)) { if (!TRIGGER_WAVEFORM(shapeDefinitionError)) {
/** /**
* 'initState' instance of TriggerState is used only to initialize 'this' TriggerWaveform instance * 'initState' instance of TriggerState is used only to initialize 'this' TriggerWaveform instance
@ -159,8 +170,9 @@ void Engine::initializeTriggerWaveform(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
} }
initVvtShape(0, initState PASS_ENGINE_PARAMETER_SUFFIX); for (int camIndex = 0;camIndex < CAMS_PER_BANK;camIndex++) {
initVvtShape(1, initState PASS_ENGINE_PARAMETER_SUFFIX); initVvtShape(camIndex, initState PASS_ENGINE_PARAMETER_SUFFIX);
}
if (!TRIGGER_WAVEFORM(shapeDefinitionError)) { if (!TRIGGER_WAVEFORM(shapeDefinitionError)) {

View File

@ -174,7 +174,7 @@ void configureMazdaProtegeLx(TriggerWaveform *s) {
void initializeMazdaMiataVVtCamShape(TriggerWaveform *s) { void initializeMazdaMiataVVtCamShape(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR); s->initialize(FOUR_STROKE_CAM_SENSOR);
s->setTriggerSynchronizationGap2(8.50 * 0.75, 14.0); s->setTriggerSynchronizationGap2(8.50 * TRIGGER_GAP_DEVIATION_LOW, 14.0);
s->addEvent720(325, T_PRIMARY, TV_FALL); s->addEvent720(325, T_PRIMARY, TV_FALL);

View File

@ -689,6 +689,10 @@ void onConfigurationChangeTriggerCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
changed |= isConfigurationChanged(camInputs[i]); changed |= isConfigurationChanged(camInputs[i]);
} }
for (int i = 0; i < GAP_TRACKING_LENGTH; i++) {
changed |= isConfigurationChanged(triggerGapOverride[i]);
}
changed |= changed |=
isConfigurationChanged(trigger.type) || isConfigurationChanged(trigger.type) ||
isConfigurationChanged(ambiguousOperationMode) || isConfigurationChanged(ambiguousOperationMode) ||

View File

@ -1376,6 +1376,7 @@ menuDialog = main
subMenu = limitsAndFallback, "Limits and fallbacks" subMenu = limitsAndFallback, "Limits and fallbacks"
subMenu = triggerConfiguration, "Trigger" subMenu = triggerConfiguration, "Trigger"
subMenu = triggerConfiguration_IO, "Advanced Trigger" subMenu = triggerConfiguration_IO, "Advanced Trigger"
subMenu = triggerConfiguration_gap, "Trigger Gap Override"
subMenu = std_separator subMenu = std_separator
subMenu = energySystems, "Battery and alternator" subMenu = energySystems, "Battery and alternator"
subMenu = std_separator subMenu = std_separator
@ -1835,6 +1836,15 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "Trigger Angle Advance", globalTriggerAngleOffset field = "Trigger Angle Advance", globalTriggerAngleOffset
field = "Display logic signals", displayLogicLevelsInEngineSniffer field = "Display logic signals", displayLogicLevelsInEngineSniffer
dialog = triggerConfiguration_gap, "Trigger Gap Override"
field = "!This is a pretty advanced feature for when you are debugging trigger syncronizaion"
field = "Override well known trigger gaps", overrideTriggerGaps
field = gapTrackingLengthOverride, gapTrackingLengthOverride
field = "First gap", triggerGapOverride1
field = "Second gap", triggerGapOverride2
field = "Third gap", triggerGapOverride3
dialog = triggerConfiguration_IO, "Advanced Trigger" dialog = triggerConfiguration_IO, "Advanced Trigger"
field = "!https://rusefi.com/s/vvt" field = "!https://rusefi.com/s/vvt"
; todo: code generator to hard-code all triggers not requiring VVT? ; todo: code generator to hard-code all triggers not requiring VVT?