rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_honda.cpp
Go to the documentation of this file.
1/*
2 * @file trigger_honda.cpp
3 *
4 * @date May 27, 2016
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#include "pch.h"
9
10#include "trigger_honda.h"
11#include "trigger_universal.h"
12
15
16 s->tdcPosition = 0; // todo: hard-code TDC position once we know it
17 s->setTriggerSynchronizationGap2(/*from*/3.9, /*to*/8);
18
21
24
27}
28
29// TT_HONDA_K_CRANK_12_1
32
33 // nominal gap 0.33
35 // nominal gap 2.0
36 s->setTriggerSynchronizationGap2(1.1f, 2.4f);
37
38 int count = 12;
39 float tooth = 360 / count; // hint: tooth = 30
40
41 // for VR we only handle rises so width does not matter much
42 int width = 4;
43
44 // Extra "+1" tooth happens 1/3 of the way between first two teeth
45 s->addToothRiseFall(tooth / 3, width);
46
47 for (int i = 1; i <= count; i++) {
48 s->addToothRiseFall(tooth * i, width);
49 }
50}
51
52/**
53 * Exhaust cam shaft, not variable on Honda K
54 * 2003 Honda Element
55 */
58
59 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 1.5, 4.5); // nominal 2.27
60 s->setTriggerSynchronizationGap3(/*gapIndex*/1, 0.1, 0.5); // nominal 0.28
61
62 angle_t end = 70.5;
63 int w = 15;
64 s->addToothRiseFall(end + 90 * 0, w);
65 s->addToothRiseFall(end + 90 * 1, w);
66 s->addToothRiseFall(end + 90 * 2, w);
67 s->addToothRiseFall(end + 90 * 3, w);
68
69 s->addToothRiseFall(360, 7);
70}
71
72void initialize_one_of_24_2_2(TriggerWaveform *s, int firstCount, int secondCount) {
74
75 float narrow = 360 / 24;
76 float wide = narrow * 2;
77
78 float base = 0;
79
80 for (int i = 0; i < firstCount; i++) {
81 s->addToothFallRise(base + narrow, narrow / 2);
82 base += narrow;
83 }
84
85 s->addToothFallRise(base + wide, wide / 2);
86 base += wide;
87
88 for (int i = 0; i < secondCount; i++) {
89 s->addToothFallRise(base + narrow, narrow / 2);
90 base += narrow;
91 }
92
93 s->addToothFallRise(360, narrow/2);
94}
95
98
99 size_t count = 6;
100
101 s->tdcPosition = 0;
102
103 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 1.6, 4);
104 for (size_t i = 1 ; i < count ; i++) {
105 s->setTriggerSynchronizationGap3(/*gapIndex*/i, 0.65, 1.4);
106 }
107 s->setTriggerSynchronizationGap3(/*gapIndex*/count, 0.2, 0.55);
108 }
Trigger shape has all the fields needed to describe and decode trigger signal.
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
void addToothFallRise(angle_t angle, angle_t width=10, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void addToothRiseFall(angle_t angle, angle_t width=10, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void addEvent720(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void setSecondTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
void setTriggerSynchronizationGap3(int index, float syncRatioFrom, float syncRatioTo)
@ FOUR_STROKE_CRANK_SENSOR
@ FOUR_STROKE_CAM_SENSOR
float angle_t
void configureHondaCbr600(TriggerWaveform *s)
void configureHondaK_12_1(TriggerWaveform *s)
void configureHondaJ30A2_24_1_1(TriggerWaveform *s)
void configureHondaK_4_1(TriggerWaveform *s)
void initialize_one_of_24_2_2(TriggerWaveform *s, int firstCount, int secondCount)
uint16_t count
Definition tunerstudio.h:1