rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_vw.cpp
Go to the documentation of this file.
1/*
2 * @file trigger_vw.cpp
3 *
4 * @date Aug 25, 2018
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#include "pch.h"
9#include "trigger_vw.h"
10#include "trigger_universal.h"
11
27
30
31 int totalTeethCount = 60;
32 int skippedCount = 2;
33
34 float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
35 float toothWidth = 0.5;
36
37 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, 60, 2, toothWidth, 0, engineCycle,
38 NO_LEFT_FILTER, 690);
39
40 float angleDown = engineCycle / totalTeethCount * (totalTeethCount - skippedCount - 1 + (1 - toothWidth) );
41 s->addEventClamped(0 + angleDown + 12, TriggerValue::RISE, TriggerWheel::T_PRIMARY, NO_LEFT_FILTER, NO_RIGHT_FILTER);
42 s->addEventClamped(0 + engineCycle, TriggerValue::FALL, TriggerWheel::T_PRIMARY, NO_LEFT_FILTER, NO_RIGHT_FILTER);
43
45 s->setSecondTriggerSynchronizationGap(1); // this gap is not required to synch on perfect signal but is needed to handle to reject cranking transition noise
47}
Trigger shape has all the fields needed to describe and decode trigger signal.
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
void setSecondTriggerSynchronizationGap(float syncRatio)
void addEvent360(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void setThirdTriggerSynchronizationGap(float syncRatio)
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
void setTriggerSynchronizationGap3(int index, float syncRatioFrom, float syncRatioTo)
void addEventClamped(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex, float filterLeft, float filterRight)
@ FOUR_STROKE_CRANK_SENSOR
void addSkippedToothTriggerEvents(TriggerWheel wheel, TriggerWaveform *s, int totalTeethCount, int skippedCount, float toothWidthPercentage, float offset, float engineCycle, float filterLeft, float filterRight)
void setVwConfiguration(TriggerWaveform *s)
void setSkodaFavorit(TriggerWaveform *s)