only: docs
This commit is contained in:
parent
608aba4e79
commit
dcb0d7ffdb
|
@ -36,11 +36,21 @@ private:
|
||||||
angle_t enginePhase;
|
angle_t enginePhase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// this is related to wasted spark idea where engines fire each spark twice per 4 stroke 720 degree cycle of operations
|
||||||
|
// first spark is happens on intake stroke and actually ignites fuel mixture, that's the useful one
|
||||||
|
// the other spark 360 degrees later happens during exhaust stroke meaning there is nothing to ignite, that spark is known as "wasted" spark
|
||||||
|
// historically this was about sharing ignition coils between opposite cylinders and having two high voltage wire coming from one physical coil
|
||||||
|
// more recently same idea happens with two individual physical coils (meaning two outputs) since wasted spark of operation is useful
|
||||||
|
// while exact engine phase is either not known YET (cranking) or just not known (broken cam sensor)
|
||||||
|
// so, while in wasted spark we manage half of cylinder count _events_ potentially with each event having two outputs
|
||||||
|
//
|
||||||
|
// an interesting corner case is when we transition from wasted spark mode into individual/sequential mode
|
||||||
#define MAX_OUTPUTS_FOR_IGNITION 2
|
#define MAX_OUTPUTS_FOR_IGNITION 2
|
||||||
|
|
||||||
class IgnitionEvent {
|
class IgnitionEvent {
|
||||||
public:
|
public:
|
||||||
IgnitionEvent();
|
IgnitionEvent();
|
||||||
|
// IgnitionEvent to IgnitionOutputPin is either 1 to 1 or 1 to 2 relationship, see large comment at 'MAX_OUTPUTS_FOR_IGNITION'
|
||||||
IgnitionOutputPin *outputs[MAX_OUTPUTS_FOR_IGNITION];
|
IgnitionOutputPin *outputs[MAX_OUTPUTS_FOR_IGNITION];
|
||||||
scheduling_s dwellStartTimer;
|
scheduling_s dwellStartTimer;
|
||||||
AngleBasedEvent sparkEvent;
|
AngleBasedEvent sparkEvent;
|
||||||
|
|
|
@ -38,7 +38,6 @@ static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *ou
|
||||||
*
|
*
|
||||||
* 2) we have an un-matched low followed by legit pairs
|
* 2) we have an un-matched low followed by legit pairs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
output->signalFallSparkId = event->sparkCounter;
|
output->signalFallSparkId = event->sparkCounter;
|
||||||
|
|
||||||
if (!output->currentLogicValue && !event->wasSparkLimited) {
|
if (!output->currentLogicValue && !event->wasSparkLimited) {
|
||||||
|
@ -182,6 +181,9 @@ static void overFireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
||||||
fireSparkAndPrepareNextSchedule(event);
|
fireSparkAndPrepareNextSchedule(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TL,DR: each IgnitionEvent is in charge of it's own scheduling forever, we plant next event while finishing handling of the current one
|
||||||
|
*/
|
||||||
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
||||||
#if EFI_UNIT_TEST
|
#if EFI_UNIT_TEST
|
||||||
if (engine->onIgnitionEvent) {
|
if (engine->onIgnitionEvent) {
|
||||||
|
@ -323,6 +325,10 @@ void turnSparkPinHighStartCharging(IgnitionEvent *event) {
|
||||||
for (int i = 0; i< MAX_OUTPUTS_FOR_IGNITION;i++) {
|
for (int i = 0; i< MAX_OUTPUTS_FOR_IGNITION;i++) {
|
||||||
IgnitionOutputPin *output = event->outputs[i];
|
IgnitionOutputPin *output = event->outputs[i];
|
||||||
if (output != NULL) {
|
if (output != NULL) {
|
||||||
|
// at the moment we have a funny xor as if outputs could have different destiny. That's probably an over exaggeration,
|
||||||
|
// realistically it should be enough to check the sequencing of only the first output but that would be less elegant
|
||||||
|
//
|
||||||
|
// maybe it would have need nicer if instead of an array of outputs we had a linked list of outputs? but that's just daydreaming.
|
||||||
skippedDwellDueToTriggerNoised |= startDwellByTurningSparkPinHigh(event, output);
|
skippedDwellDueToTriggerNoised |= startDwellByTurningSparkPinHigh(event, output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue