Skip to content

Commit

Permalink
Cosmetic: added usefull notions from #5347
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Sobchuk committed Jun 23, 2023
1 parent 19acfcc commit 23488ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions firmware/controllers/trigger/decoders/trigger_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,25 @@ void configureBenelli(TriggerWaveform *s) {
}

void configure60degSingleTooth(TriggerWaveform *s) {
/** @todo
* My approach was to utilize ::Both especially for single
* tooth and manual kikstarter, to be ready on both sides of blind.
* But unfortuneally, my experiments show me the Trigger can't
* become syncronized by 'last' and folowed 'first' events only.
* Also I observe phase-aligment mehanism is trying to consume a
* longer side of trigger as latest before TDC.
* I wish to setup SyncEdge::Both for my TT_60DEG_TOOTH after
* this case of scenario become work well. For now, ::Rise work
* well for my 60 degree trigger and both edges phase sync work
* as mush as expected for my engine startup. */

s->initialize(FOUR_STROKE_CRANK_SENSOR, SyncEdge::Rise);

s->addEvent360(300, TriggerValue::RISE);
s->addEvent360(360, TriggerValue::FALL);

s->tdcPosition = 60;

s->isSynchronizationNeeded = false;
s->useOnlyPrimaryForSync = true;
}
9 changes: 9 additions & 0 deletions firmware/controllers/trigger/decoders/trigger_structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,9 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
break;

case trigger_type_e::TT_ONE:
/** @note TT_ONE setup events as 180 and 360 degrees. It uses SyncEdge::Rise
* for additionaly phase align on falling edge and will not work with non-
* symmetrical blind type where open and closed sections are not qual */
initializeSkippedToothTrigger(this, 1, 0, triggerOperationMode, SyncEdge::Rise);
break;

Expand Down Expand Up @@ -635,6 +638,12 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
configureFordCoyote(this);
break;
case trigger_type_e::TT_60DEG_TOOTH:
/** @note
* Have a something like TT_ONE_PHASED trigger with
* externally setuped blind width will be a good
* approach to utilize ::Rise(and::Both in future)
* with both edges phase-sync, but to stay simple I suggest
* just to use another enum for each trigger type. */
configure60degSingleTooth(this);
break;
case trigger_type_e::TT_UNUSED_11:
Expand Down

0 comments on commit 23488ff

Please sign in to comment.