Honda K 12+1 decoder adjustment (#3694)

* adjust trigger

* real cranking

* mk
This commit is contained in:
Matthew Kennedy 2021-12-14 18:10:01 -08:00 committed by GitHub
parent adc93eb51b
commit 256df56fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 547 additions and 7 deletions

View File

@ -253,22 +253,29 @@ void configureOnePlus16(TriggerWaveform *s) {
s->isSynchronizationNeeded = false;
}
static void kseriesTooth(TriggerWaveform* s, float end) {
// for VR we only handle rises so width does not matter much
s->addEvent360(end - 4, T_PRIMARY, TV_RISE);
s->addEvent360(end , T_PRIMARY, TV_FALL);
}
// TT_HONDA_K_12_1
void configureHondaK_12_1(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CRANK_SENSOR);
s->setTriggerSynchronizationGap(3);
// nominal gap 0.33
s->setSecondTriggerSynchronizationGap2(0.2f, 0.5f);
// nominal gap 2.0
s->setTriggerSynchronizationGap2(1.6f, 2.4f);
int count = 12;
float tooth = s->getCycleDuration() / count; // hint: tooth = 30
float width = 4; // for VR we only handle rises so width does not matter much
float tooth = 360 / count; // hint: tooth = 30
s->addEventAngle(20 - width, T_PRIMARY, TV_RISE);
s->addEventAngle(20, T_PRIMARY, TV_FALL);
// Extra "+1" tooth happens 1/3 of the way between first two teeth
kseriesTooth(s, tooth / 3);
for (int i = 1; i <= count; i++) {
s->addEventAngle(tooth * i - width, T_PRIMARY, TV_RISE);
s->addEventAngle(tooth * i, T_PRIMARY, TV_FALL);
kseriesTooth(s, tooth * i);
}
}

View File

@ -13,6 +13,7 @@ TESTS_SRC_CPP = \
tests/trigger/test_real_volkswagen.cpp \
tests/trigger/test_real_nb2_cranking.cpp \
tests/trigger/test_real_gm_24x.cpp \
tests/trigger/test_real_k24a2.cpp \
tests/trigger/test_map_cam.cpp \
tests/trigger/test_rpm_multiplier.cpp \
tests/trigger/test_quad_cam.cpp \

View File

@ -0,0 +1,251 @@
time, crank
55.880562, 1
55.894715, 0
55.92862, 1
55.93978, 0
55.967227, 1
55.977273, 0
56.002086, 1
56.011645, 0
56.035074, 1
56.04431, 0
56.06672, 1
56.07569, 0
56.097082, 1
56.105754, 0
56.12635, 1
56.134863, 0
56.15483, 1
56.160254, 0
56.164395, 1
56.171707, 0
56.183027, 1
56.191016, 0
56.21092, 1
56.219316, 0
56.23883, 1
56.247164, 0
56.26631, 1
56.27453, 0
56.29334, 1
56.301445, 0
56.32006, 1
56.32804, 0
56.346668, 1
56.354676, 0
56.373434, 1
56.381477, 0
56.400293, 1
56.40835, 0
56.427023, 1
56.435008, 0
56.45343, 1
56.461418, 0
56.479637, 1
56.4847, 0
56.48856, 1
56.495496, 0
56.50603, 1
56.513652, 0
56.532445, 1
56.540547, 0
56.55914, 1
56.567227, 0
56.58568, 1
56.59369, 0
56.611973, 1
56.619938, 0
56.63812, 1
56.64601, 0
56.664305, 1
56.67224, 0
56.69071, 1
56.698688, 0
56.71726, 1
56.72527, 0
56.743742, 1
56.751695, 0
56.77003, 1
56.777996, 0
56.79618, 1
56.801215, 0
56.805055, 1
56.811996, 0
56.82252, 1
56.830113, 0
56.8489, 1
56.85697, 0
56.87554, 1
56.883617, 0
56.902027, 1
56.910027, 0
56.92827, 1
56.93623, 0
56.95437, 1
56.96225, 0
56.98053, 1
56.988465, 0
57.006973, 1
57.014957, 0
57.033586, 1
57.041605, 0
57.06014, 1
57.068117, 0
57.086492, 1
57.094473, 0
57.112688, 1
57.117727, 0
57.121574, 1
57.128527, 0
57.139047, 1
57.146652, 0
57.16546, 1
57.17354, 0
57.192164, 1
57.200254, 0
57.21877, 1
57.226805, 0
57.245207, 1
57.253195, 0
57.271508, 1
57.279434, 0
57.29786, 1
57.305844, 0
57.324477, 1
57.332492, 0
57.351234, 1
57.359266, 0
57.377906, 1
57.385902, 0
57.404355, 1
57.41236, 0
57.430656, 1
57.435723, 0
57.4396, 1
57.44657, 0
57.45715, 1
57.46481, 0
57.48368, 1
57.491812, 0
57.510504, 1
57.518633, 0
57.537168, 1
57.54521, 0
57.563605, 1
57.571574, 0
57.58988, 1
57.597777, 0
57.616156, 1
57.62412, 0
57.642695, 1
57.6507, 0
57.66941, 1
57.677438, 0
57.69608, 1
57.704062, 0
57.7225, 1
57.7305, 0
57.748777, 1
57.75385, 0
57.757723, 1
57.764668, 0
57.775242, 1
57.782883, 0
57.801727, 1
57.80983, 0
57.828484, 1
57.836598, 0
57.855086, 1
57.86314, 0
57.88147, 1
57.88946, 0
57.907734, 1
57.915637, 0
57.934016, 1
57.941977, 0
57.960555, 1
57.968547, 0
57.98721, 1
57.995227, 0
58.01378, 1
58.021734, 0
58.04014, 1
58.048133, 0
58.06636, 1
58.071418, 0
58.07528, 1
58.082242, 0
58.092805, 1
58.10043, 0
58.119297, 1
58.127387, 0
58.14608, 1
58.154184, 0
58.17271, 1
58.180746, 0
58.199074, 1
58.207047, 0
58.225277, 1
58.23318, 0
58.251484, 1
58.259426, 0
58.27796, 1
58.285957, 0
58.30461, 1
58.31266, 0
58.331207, 1
58.339176, 0
58.357625, 1
58.365613, 0
58.38389, 1
58.38895, 0
58.392805, 1
58.39977, 0
58.410336, 1
58.41796, 0
58.436793, 1
58.44488, 0
58.46353, 1
58.47162, 0
58.4901, 1
58.498125, 0
58.51648, 1
58.524453, 0
58.54273, 1
58.550637, 0
58.56901, 1
58.576977, 0
58.595566, 1
58.603582, 0
58.622293, 1
58.630336, 0
58.64892, 1
58.656906, 0
58.67534, 1
58.683324, 0
58.701598, 1
58.706645, 0
58.710504, 1
58.71747, 0
58.72804, 1
58.735676, 0
58.754508, 1
58.762617, 0
58.7813, 1
58.789426, 0
58.80797, 1
58.816, 0
58.834438, 1
58.84242, 0
58.860758, 1
58.868676, 0
58.887074, 1
58.895035, 0
58.91365, 1
58.921656, 0
58.940387, 1
58.94842, 0
58.967062, 1
58.975047, 0
58.99351, 1
59.001523, 0
1 time crank
2 55.880562 1
3 55.894715 0
4 55.92862 1
5 55.93978 0
6 55.967227 1
7 55.977273 0
8 56.002086 1
9 56.011645 0
10 56.035074 1
11 56.04431 0
12 56.06672 1
13 56.07569 0
14 56.097082 1
15 56.105754 0
16 56.12635 1
17 56.134863 0
18 56.15483 1
19 56.160254 0
20 56.164395 1
21 56.171707 0
22 56.183027 1
23 56.191016 0
24 56.21092 1
25 56.219316 0
26 56.23883 1
27 56.247164 0
28 56.26631 1
29 56.27453 0
30 56.29334 1
31 56.301445 0
32 56.32006 1
33 56.32804 0
34 56.346668 1
35 56.354676 0
36 56.373434 1
37 56.381477 0
38 56.400293 1
39 56.40835 0
40 56.427023 1
41 56.435008 0
42 56.45343 1
43 56.461418 0
44 56.479637 1
45 56.4847 0
46 56.48856 1
47 56.495496 0
48 56.50603 1
49 56.513652 0
50 56.532445 1
51 56.540547 0
52 56.55914 1
53 56.567227 0
54 56.58568 1
55 56.59369 0
56 56.611973 1
57 56.619938 0
58 56.63812 1
59 56.64601 0
60 56.664305 1
61 56.67224 0
62 56.69071 1
63 56.698688 0
64 56.71726 1
65 56.72527 0
66 56.743742 1
67 56.751695 0
68 56.77003 1
69 56.777996 0
70 56.79618 1
71 56.801215 0
72 56.805055 1
73 56.811996 0
74 56.82252 1
75 56.830113 0
76 56.8489 1
77 56.85697 0
78 56.87554 1
79 56.883617 0
80 56.902027 1
81 56.910027 0
82 56.92827 1
83 56.93623 0
84 56.95437 1
85 56.96225 0
86 56.98053 1
87 56.988465 0
88 57.006973 1
89 57.014957 0
90 57.033586 1
91 57.041605 0
92 57.06014 1
93 57.068117 0
94 57.086492 1
95 57.094473 0
96 57.112688 1
97 57.117727 0
98 57.121574 1
99 57.128527 0
100 57.139047 1
101 57.146652 0
102 57.16546 1
103 57.17354 0
104 57.192164 1
105 57.200254 0
106 57.21877 1
107 57.226805 0
108 57.245207 1
109 57.253195 0
110 57.271508 1
111 57.279434 0
112 57.29786 1
113 57.305844 0
114 57.324477 1
115 57.332492 0
116 57.351234 1
117 57.359266 0
118 57.377906 1
119 57.385902 0
120 57.404355 1
121 57.41236 0
122 57.430656 1
123 57.435723 0
124 57.4396 1
125 57.44657 0
126 57.45715 1
127 57.46481 0
128 57.48368 1
129 57.491812 0
130 57.510504 1
131 57.518633 0
132 57.537168 1
133 57.54521 0
134 57.563605 1
135 57.571574 0
136 57.58988 1
137 57.597777 0
138 57.616156 1
139 57.62412 0
140 57.642695 1
141 57.6507 0
142 57.66941 1
143 57.677438 0
144 57.69608 1
145 57.704062 0
146 57.7225 1
147 57.7305 0
148 57.748777 1
149 57.75385 0
150 57.757723 1
151 57.764668 0
152 57.775242 1
153 57.782883 0
154 57.801727 1
155 57.80983 0
156 57.828484 1
157 57.836598 0
158 57.855086 1
159 57.86314 0
160 57.88147 1
161 57.88946 0
162 57.907734 1
163 57.915637 0
164 57.934016 1
165 57.941977 0
166 57.960555 1
167 57.968547 0
168 57.98721 1
169 57.995227 0
170 58.01378 1
171 58.021734 0
172 58.04014 1
173 58.048133 0
174 58.06636 1
175 58.071418 0
176 58.07528 1
177 58.082242 0
178 58.092805 1
179 58.10043 0
180 58.119297 1
181 58.127387 0
182 58.14608 1
183 58.154184 0
184 58.17271 1
185 58.180746 0
186 58.199074 1
187 58.207047 0
188 58.225277 1
189 58.23318 0
190 58.251484 1
191 58.259426 0
192 58.27796 1
193 58.285957 0
194 58.30461 1
195 58.31266 0
196 58.331207 1
197 58.339176 0
198 58.357625 1
199 58.365613 0
200 58.38389 1
201 58.38895 0
202 58.392805 1
203 58.39977 0
204 58.410336 1
205 58.41796 0
206 58.436793 1
207 58.44488 0
208 58.46353 1
209 58.47162 0
210 58.4901 1
211 58.498125 0
212 58.51648 1
213 58.524453 0
214 58.54273 1
215 58.550637 0
216 58.56901 1
217 58.576977 0
218 58.595566 1
219 58.603582 0
220 58.622293 1
221 58.630336 0
222 58.64892 1
223 58.656906 0
224 58.67534 1
225 58.683324 0
226 58.701598 1
227 58.706645 0
228 58.710504 1
229 58.71747 0
230 58.72804 1
231 58.735676 0
232 58.754508 1
233 58.762617 0
234 58.7813 1
235 58.789426 0
236 58.80797 1
237 58.816 0
238 58.834438 1
239 58.84242 0
240 58.860758 1
241 58.868676 0
242 58.887074 1
243 58.895035 0
244 58.91365 1
245 58.921656 0
246 58.940387 1
247 58.94842 0
248 58.967062 1
249 58.975047 0
250 58.99351 1
251 59.001523 0

View File

@ -0,0 +1,250 @@
16.092467,0
16.129099,1
16.140876,0
16.170595,1
16.1812,0
16.207619,1
16.217553,0
16.241685,1
16.251077,0
16.273669,1
16.282752,0
16.30429,1
16.310149,0
16.314592,1
16.322242,0
16.334342,1
16.342746,0
16.363893,1
16.372639,0
16.393271,1
16.401918,0
16.422074,1
16.430586,0
16.450299,1
16.458668,0
16.478137,1
16.486387,0
16.505818,1
16.51409,0
16.53363,1
16.541914,0
16.56152,1
16.569807,0
16.58923,1
16.59743,0
16.616627,1
16.624816,0
16.643756,1
16.649004,0
16.652982,1
16.66009,0
16.671053,1
16.678889,0
16.698408,1
16.706723,0
16.72606,1
16.734361,0
16.753527,1
16.761756,0
16.780754,1
16.788928,0
16.807816,1
16.815912,0
16.834887,1
16.843025,0
16.862182,1
16.870371,0
16.889646,1
16.897854,0
16.917012,1
16.925146,0
16.944205,1
16.952367,0
16.971277,1
16.97649,0
16.980459,1
16.98759,0
16.998557,1
17.006371,0
17.025857,1
17.034146,0
17.053393,1
17.061652,0
17.08073,1
17.08892,0
17.107777,1
17.115904,0
17.134643,1
17.142701,0
17.161531,1
17.169627,0
17.188646,1
17.196781,0
17.2159,1
17.22407,0
17.24307,1
17.25117,0
17.270018,1
17.278139,0
17.296816,1
17.301984,0
17.30593,1
17.313002,0
17.323791,1
17.331555,0
17.350818,1
17.359066,0
17.378125,1
17.386375,0
17.405322,1
17.413479,0
17.432305,1
17.440406,0
17.459078,1
17.467117,0
17.485883,1
17.493953,0
17.512928,1
17.52104,0
17.540127,1
17.548277,0
17.567234,1
17.575326,0
17.594143,1
17.60226,0
17.620906,1
17.626072,0
17.63002,1
17.63707,0
17.647848,1
17.655613,0
17.674854,1
17.683096,0
17.702148,1
17.710389,0
17.729258,1
17.73742,0
17.756193,1
17.764277,0
17.78292,1
17.790938,0
17.809691,1
17.817764,0
17.836738,1
17.844863,0
17.863994,1
17.872143,0
17.891188,1
17.899275,0
17.918115,1
17.926223,0
17.944855,1
17.950025,0
17.953965,1
17.961,0
17.971781,1
17.979537,0
17.998756,1
18.00698,0
18.026021,1
18.034248,0
18.053146,1
18.061307,0
18.08007,1
18.088168,0
18.106863,1
18.114902,0
18.133697,1
18.141799,0
18.16078,1
18.168914,0
18.188043,1
18.196207,0
18.21522,1
18.223299,0
18.24214,1
18.250246,0
18.2689,1
18.274066,0
18.277998,1
18.285062,0
18.29586,1
18.303602,0
18.322867,1
18.331092,0
18.350197,1
18.358418,0
18.377404,1
18.385566,0
18.404361,1
18.41248,0
18.431152,1
18.43919,0
18.457994,1
18.466074,0
18.4851,1
18.493246,0
18.512371,1
18.520537,0
18.539574,1
18.547684,0
18.566559,1
18.574678,0
18.593396,1
18.598566,0
18.602512,1
18.609592,0
18.620424,1
18.628184,0
18.647494,1
18.65573,0
18.674836,1
18.683078,0
18.702045,1
18.710195,0
18.729035,1
18.737143,0
18.755842,1
18.763895,0
18.782693,1
18.790781,0
18.809799,1
18.817928,0
18.837037,1
18.845195,0
18.864191,1
18.872303,0
18.891137,1
18.899238,0
18.917932,1
18.9231,0
18.927045,1
18.934115,0
18.944906,1
18.952668,0
18.971945,1
18.980188,0
18.999287,1
19.007523,0
19.026447,1
19.034607,0
19.05341,1
19.061496,0
19.080162,1
19.088186,0
19.106943,1
19.115027,0
19.133994,1
19.142104,0
19.161229,1
19.169377,0
19.18841,1
19.196508,0
19.21537,1
19.223494,0
19.242207,1
19.247396,0
19.251354,1
19.258414,0
19.26924,1
1 16.092467 0
2 16.129099 1
3 16.140876 0
4 16.170595 1
5 16.1812 0
6 16.207619 1
7 16.217553 0
8 16.241685 1
9 16.251077 0
10 16.273669 1
11 16.282752 0
12 16.30429 1
13 16.310149 0
14 16.314592 1
15 16.322242 0
16 16.334342 1
17 16.342746 0
18 16.363893 1
19 16.372639 0
20 16.393271 1
21 16.401918 0
22 16.422074 1
23 16.430586 0
24 16.450299 1
25 16.458668 0
26 16.478137 1
27 16.486387 0
28 16.505818 1
29 16.51409 0
30 16.53363 1
31 16.541914 0
32 16.56152 1
33 16.569807 0
34 16.58923 1
35 16.59743 0
36 16.616627 1
37 16.624816 0
38 16.643756 1
39 16.649004 0
40 16.652982 1
41 16.66009 0
42 16.671053 1
43 16.678889 0
44 16.698408 1
45 16.706723 0
46 16.72606 1
47 16.734361 0
48 16.753527 1
49 16.761756 0
50 16.780754 1
51 16.788928 0
52 16.807816 1
53 16.815912 0
54 16.834887 1
55 16.843025 0
56 16.862182 1
57 16.870371 0
58 16.889646 1
59 16.897854 0
60 16.917012 1
61 16.925146 0
62 16.944205 1
63 16.952367 0
64 16.971277 1
65 16.97649 0
66 16.980459 1
67 16.98759 0
68 16.998557 1
69 17.006371 0
70 17.025857 1
71 17.034146 0
72 17.053393 1
73 17.061652 0
74 17.08073 1
75 17.08892 0
76 17.107777 1
77 17.115904 0
78 17.134643 1
79 17.142701 0
80 17.161531 1
81 17.169627 0
82 17.188646 1
83 17.196781 0
84 17.2159 1
85 17.22407 0
86 17.24307 1
87 17.25117 0
88 17.270018 1
89 17.278139 0
90 17.296816 1
91 17.301984 0
92 17.30593 1
93 17.313002 0
94 17.323791 1
95 17.331555 0
96 17.350818 1
97 17.359066 0
98 17.378125 1
99 17.386375 0
100 17.405322 1
101 17.413479 0
102 17.432305 1
103 17.440406 0
104 17.459078 1
105 17.467117 0
106 17.485883 1
107 17.493953 0
108 17.512928 1
109 17.52104 0
110 17.540127 1
111 17.548277 0
112 17.567234 1
113 17.575326 0
114 17.594143 1
115 17.60226 0
116 17.620906 1
117 17.626072 0
118 17.63002 1
119 17.63707 0
120 17.647848 1
121 17.655613 0
122 17.674854 1
123 17.683096 0
124 17.702148 1
125 17.710389 0
126 17.729258 1
127 17.73742 0
128 17.756193 1
129 17.764277 0
130 17.78292 1
131 17.790938 0
132 17.809691 1
133 17.817764 0
134 17.836738 1
135 17.844863 0
136 17.863994 1
137 17.872143 0
138 17.891188 1
139 17.899275 0
140 17.918115 1
141 17.926223 0
142 17.944855 1
143 17.950025 0
144 17.953965 1
145 17.961 0
146 17.971781 1
147 17.979537 0
148 17.998756 1
149 18.00698 0
150 18.026021 1
151 18.034248 0
152 18.053146 1
153 18.061307 0
154 18.08007 1
155 18.088168 0
156 18.106863 1
157 18.114902 0
158 18.133697 1
159 18.141799 0
160 18.16078 1
161 18.168914 0
162 18.188043 1
163 18.196207 0
164 18.21522 1
165 18.223299 0
166 18.24214 1
167 18.250246 0
168 18.2689 1
169 18.274066 0
170 18.277998 1
171 18.285062 0
172 18.29586 1
173 18.303602 0
174 18.322867 1
175 18.331092 0
176 18.350197 1
177 18.358418 0
178 18.377404 1
179 18.385566 0
180 18.404361 1
181 18.41248 0
182 18.431152 1
183 18.43919 0
184 18.457994 1
185 18.466074 0
186 18.4851 1
187 18.493246 0
188 18.512371 1
189 18.520537 0
190 18.539574 1
191 18.547684 0
192 18.566559 1
193 18.574678 0
194 18.593396 1
195 18.598566 0
196 18.602512 1
197 18.609592 0
198 18.620424 1
199 18.628184 0
200 18.647494 1
201 18.65573 0
202 18.674836 1
203 18.683078 0
204 18.702045 1
205 18.710195 0
206 18.729035 1
207 18.737143 0
208 18.755842 1
209 18.763895 0
210 18.782693 1
211 18.790781 0
212 18.809799 1
213 18.817928 0
214 18.837037 1
215 18.845195 0
216 18.864191 1
217 18.872303 0
218 18.891137 1
219 18.899238 0
220 18.917932 1
221 18.9231 0
222 18.927045 1
223 18.934115 0
224 18.944906 1
225 18.952668 0
226 18.971945 1
227 18.980188 0
228 18.999287 1
229 19.007523 0
230 19.026447 1
231 19.034607 0
232 19.05341 1
233 19.061496 0
234 19.080162 1
235 19.088186 0
236 19.106943 1
237 19.115027 0
238 19.133994 1
239 19.142104 0
240 19.161229 1
241 19.169377 0
242 19.18841 1
243 19.196508 0
244 19.21537 1
245 19.223494 0
246 19.242207 1
247 19.247396 0
248 19.251354 1
249 19.258414 0
250 19.26924 1

View File

@ -0,0 +1,31 @@
#include "pch.h"
#include "logicdata_csv_reader.h"
static void doTest(const char* testFile, int expectedRpm) {
CsvReader reader(1, /* vvtCount */ 0);
int indeces[1] = {0};
reader.open(testFile, indeces);
EngineTestHelper eth(TEST_ENGINE);
engineConfiguration->isFasterEngineSpinUpEnabled = true;
eth.setTriggerType(TT_HONDA_K_12_1);
while (reader.haveMore()) {
reader.processLine(&eth);
engine->rpmCalculator.onSlowCallback();
}
ASSERT_EQ(0, eth.recentWarnings()->getCount())<< "warningCounter#vwRealCranking";
ASSERT_EQ(expectedRpm, GET_RPM())<< reader.lineIndex();
}
TEST(realk24, crankingNoPlugs1) {
doTest("tests/trigger/resources/cranking_honda_k24a2_no_plugs.csv", 189);
}
TEST(realk24, crankingNoPlugs2) {
doTest("tests/trigger/resources/cranking_honda_k24a2_no_plugs_2.csv", 185);
}