2015-12-27 12:02:51 -08:00
|
|
|
/*
|
|
|
|
* @file trigger_rover.cpp
|
|
|
|
*
|
|
|
|
* @date Dec 27, 2015
|
2015-12-31 13:02:30 -08:00
|
|
|
* @author PhilTheGeek
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-12-27 12:02:51 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "trigger_rover.h"
|
|
|
|
|
2017-01-14 10:06:21 -08:00
|
|
|
/**
|
|
|
|
* https://en.wikipedia.org/wiki/Rover_K-series_engine
|
|
|
|
*/
|
2019-12-07 22:09:39 -08:00
|
|
|
void initializeRoverK(TriggerWaveform *s) {
|
2020-01-12 07:43:02 -08:00
|
|
|
s->initialize(FOUR_STROKE_CRANK_SENSOR);
|
2015-12-27 12:02:51 -08:00
|
|
|
|
|
|
|
float tooth = 20;
|
|
|
|
|
2015-12-27 13:02:44 -08:00
|
|
|
s->setTriggerSynchronizationGap(2.0);
|
|
|
|
s->setThirdTriggerSynchronizationGap(2);
|
2015-12-27 12:02:51 -08:00
|
|
|
|
|
|
|
float base = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; i++) {
|
2018-12-25 08:51:49 -08:00
|
|
|
s->addEvent720(base + tooth / 2, T_PRIMARY, TV_RISE);
|
|
|
|
s->addEvent720(base + tooth, T_PRIMARY, TV_FALL);
|
2015-12-27 12:02:51 -08:00
|
|
|
base += tooth;
|
|
|
|
}
|
|
|
|
base += tooth;
|
|
|
|
for (int i = 0; i < 2; i++) {
|
2018-12-25 08:51:49 -08:00
|
|
|
s->addEvent720(base + tooth / 2, T_PRIMARY, TV_RISE);
|
|
|
|
s->addEvent720(base + tooth, T_PRIMARY, TV_FALL);
|
2015-12-27 12:02:51 -08:00
|
|
|
base += tooth;
|
|
|
|
}
|
|
|
|
base += tooth;
|
|
|
|
for (int i = 0; i < 14; i++) {
|
2018-12-25 08:51:49 -08:00
|
|
|
s->addEvent720(base + tooth / 2, T_PRIMARY, TV_RISE);
|
|
|
|
s->addEvent720(base + tooth, T_PRIMARY, TV_FALL);
|
2015-12-27 12:02:51 -08:00
|
|
|
base += tooth;
|
|
|
|
}
|
|
|
|
base += tooth;
|
|
|
|
for (int i = 0; i < 3; i++) {
|
2018-12-25 08:51:49 -08:00
|
|
|
s->addEvent720(base + tooth / 2, T_PRIMARY, TV_RISE);
|
|
|
|
s->addEvent720(base + tooth, T_PRIMARY, TV_FALL);
|
2015-12-27 12:02:51 -08:00
|
|
|
base += tooth;
|
|
|
|
}
|
|
|
|
base += tooth;
|
|
|
|
for (int i = 0; i < 11; i++) {
|
2018-12-25 08:51:49 -08:00
|
|
|
s->addEvent720(base + tooth / 2, T_PRIMARY, TV_RISE);
|
|
|
|
s->addEvent720(base + tooth, T_PRIMARY, TV_FALL);
|
2015-12-27 12:02:51 -08:00
|
|
|
base += tooth;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|