rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions
trigger_nissan.cpp File Reference

Detailed Description

https://rusefi.com/forum/viewtopic.php?f=3&t=1194&start=150#p27784

Date
Sep 19, 2015
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file trigger_nissan.cpp.

Functions

void initializeNissanK11 (TriggerWaveform *s)
 
void initializeNissanSR20VE_4 (TriggerWaveform *s)
 
void initializeNissanVQvvt (TriggerWaveform *s)
 
void makeNissanPattern (TriggerWaveform *s, size_t halfCylinderCount, size_t totalWheel, size_t missing)
 
void initializeNissanVQ35crank (TriggerWaveform *s)
 
void initializeNissanMR18crank (TriggerWaveform *s)
 
void initializeNissanQR25crank (TriggerWaveform *s)
 
static void addvq30tooth (TriggerWaveform *s, float angle)
 
void initializeNissanVQ30cam (TriggerWaveform *s)
 
void initializeNissanMRvvt (TriggerWaveform *s)
 
void initialize_one_of_36_2_2 (TriggerWaveform *s, int firstCount, int secondCount)
 
void initializeNissanHRcrank (TriggerWaveform *s)
 
void initializeNissanHRvvtIn (TriggerWaveform *s)
 

Function Documentation

◆ addvq30tooth()

static void addvq30tooth ( TriggerWaveform s,
float  angle 
)
static

Definition at line 131 of file trigger_nissan.cpp.

131 {
132 s->addEvent360(angle - 4, TriggerValue::RISE);
134}
void addEvent360(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)

Referenced by initializeNissanMRvvt(), and initializeNissanVQ30cam().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize_one_of_36_2_2()

void initialize_one_of_36_2_2 ( TriggerWaveform s,
int  firstCount,
int  secondCount 
)

Definition at line 214 of file trigger_nissan.cpp.

214 {
216
217 float narrow = 360 / 36;
218 float wide = narrow * 3;
219
220 float base = 0;
221
222 for (int i = 0; i < firstCount; i++) {
223 s->addToothFallRise(base + narrow, narrow / 2);
224 base += narrow;
225 }
226
227 s->addToothFallRise(base + wide, wide / 2);
228 base += wide;
229
230 for (int i = 0; i < secondCount; i++) {
231 s->addToothFallRise(base + narrow, narrow / 2);
232 base += narrow;
233 }
234
235 s->addToothFallRise(360, narrow/2);
236}
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
void addToothFallRise(angle_t angle, angle_t width=10, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
@ FOUR_STROKE_CRANK_SENSOR

Referenced by initializeNissanHRcrank().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanHRcrank()

void initializeNissanHRcrank ( TriggerWaveform s)

Definition at line 238 of file trigger_nissan.cpp.

238 {
239 initialize_one_of_36_2_2(s, 9, 21);
240
241 size_t count = 9;
242
243 s->tdcPosition = 155 + 360;
244
245 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 1.7, 5);
246 for (size_t i = 1 ; i < count ; i++) {
247 s->setTriggerSynchronizationGap3(/*gapIndex*/i, 0.6, 1.5);
248 }
249 s->setTriggerSynchronizationGap3(/*gapIndex*/count, 0.1, 0.5);
250 }
void setTriggerSynchronizationGap3(int index, float syncRatioFrom, float syncRatioTo)
void initialize_one_of_36_2_2(TriggerWaveform *s, int firstCount, int secondCount)
uint16_t count
Definition tunerstudio.h:1

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanHRvvtIn()

void initializeNissanHRvvtIn ( TriggerWaveform s)

Definition at line 253 of file trigger_nissan.cpp.

253 {
255
256
257 s->addToothRiseFall(120);
258 s->addToothRiseFall(120 + 22);
259 s->addToothRiseFall(240);
260 s->addToothRiseFall(360);
261
262 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 0.1, 0.3);
263}
void addToothRiseFall(angle_t angle, angle_t width=10, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
@ FOUR_STROKE_CAM_SENSOR

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanK11()

void initializeNissanK11 ( TriggerWaveform s)

Definition at line 16 of file trigger_nissan.cpp.

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanMR18crank()

void initializeNissanMR18crank ( TriggerWaveform s)

Definition at line 106 of file trigger_nissan.cpp.

106 {
108
109 s->tdcPosition = 80;
110
111 // 4 cylinder = 36 tooth wheel, missing 2 teeth in 2 spots
112 makeNissanPattern(s, 2, 36, 2);
114}
void setTriggerSynchronizationGap(float syncRatio)
@ FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR
void makeNissanPattern(TriggerWaveform *s, size_t halfCylinderCount, size_t totalWheel, size_t missing)

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanMRvvt()

void initializeNissanMRvvt ( TriggerWaveform s)

Definition at line 177 of file trigger_nissan.cpp.

177 {
179 s->tdcPosition = 0;
180
181 int x = 73;
182
183 // All "groups" start every 90 degrees of cam rotation
184 // The groups have 1, 3, 4, 2 teeth each (which is the firing order?)
185
186 // Teeth within a group are spaced 17 cam degrees apart
187 int toothSpacing = 17;
188
189 // "1"
190 addvq30tooth(s, x + 0); // <-- sync point here
191
192 // "3"
193 addvq30tooth(s, x + 90 + 0 * toothSpacing);
194 addvq30tooth(s, x + 90 + 1 * toothSpacing);
195 addvq30tooth(s, x + 90 + 2 * toothSpacing);
196
197 // "4"
198 addvq30tooth(s, x + 180 + 0 * toothSpacing);
199 addvq30tooth(s, x + 180 + 1 * toothSpacing);
200 addvq30tooth(s, x + 180 + 2 * toothSpacing);
201 addvq30tooth(s, x + 180 + 3 * toothSpacing);
202
203 // "2"
204 addvq30tooth(s, x + 270 + 0 * toothSpacing);
205 addvq30tooth(s, x + 270 + 1 * toothSpacing);
206
207 // nominal gap 4.31
209
210 // nominal gap 0.44
212}
void setSecondTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
static void addvq30tooth(TriggerWaveform *s, float angle)

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanQR25crank()

void initializeNissanQR25crank ( TriggerWaveform s)

Definition at line 116 of file trigger_nissan.cpp.

116 {
120
121 s->tdcPosition = 585;
122
123 float currentAngle = 20;
124 for (int i = 0;i < 16;i++) {
125 currentAngle += 10;
126 s->addEventAngle(currentAngle - 5, TriggerValue::RISE);
127 s->addEventAngle(currentAngle, TriggerValue::FALL);
128 }
129}
void setSecondTriggerSynchronizationGap(float syncRatio)
void addEventAngle(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanSR20VE_4()

void initializeNissanSR20VE_4 ( TriggerWaveform s)

8,2,2,2 Nissan pattern

Definition at line 41 of file trigger_nissan.cpp.

41 {
43
44 s->tdcPosition = 630;
45
46 s->setTriggerSynchronizationGap2(9.67 * 0.75, 16);
47
48 float width = 4;
49
50 s->addEvent720(1 * 180 - 4 * width, TriggerValue::RISE);
52
53 s->addEvent720(2 * 180 - width, TriggerValue::RISE);
55
56 s->addEvent720(3 * 180 - width, TriggerValue::RISE);
58
59 s->addEvent720(4 * 180 - width, TriggerValue::RISE);
61}

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanVQ30cam()

void initializeNissanVQ30cam ( TriggerWaveform s)

Definition at line 138 of file trigger_nissan.cpp.

138 {
140
141 s->tdcPosition = 120;
142
143 int x = 360 + 52;
144
145 addvq30tooth(s, x - (360 - 9 * 0));
146 addvq30tooth(s, x - (360 - 9 * 1));
147 addvq30tooth(s, x - (360 - 9 * 2));
148
149 addvq30tooth(s, x - (252 + 9 * 5));
150 addvq30tooth(s, x - (252 + 9 * 4));
151 addvq30tooth(s, x - (252 + 9 * 3));
152 addvq30tooth(s, x - (252 + 9 * 2));
153 addvq30tooth(s, x - (252 + 9 * 1));
154 addvq30tooth(s, x - (252 + 9 * 0));
155
156 addvq30tooth(s, x - (236 ));
157
158 addvq30tooth(s, x - (152 + 9 * 3));
159 addvq30tooth(s, x - (152 + 9 * 2));
160 addvq30tooth(s, x - (152 + 9 * 1));
161 addvq30tooth(s, x - (152 + 9 * 0));
162
163 addvq30tooth(s, x - (85 + 9 * 4));
164 addvq30tooth(s, x - (85 + 9 * 3));
165 addvq30tooth(s, x - (85 + 9 * 2));
166 addvq30tooth(s, x - (85 + 9 * 1));
167 addvq30tooth(s, x - (85 + 9 * 0));
168
169 addvq30tooth(s, x - (52 + 9 * 1));
170 addvq30tooth(s, x - (52 + 9 * 0));
171
172 s->setTriggerSynchronizationGap4(/*gapIndex*/0, 5.78);
173 s->setTriggerSynchronizationGap4(/*gapIndex*/1, 0.38);
174 s->setTriggerSynchronizationGap4(/*gapIndex*/2, 2.67);
175}
void setTriggerSynchronizationGap4(int index, float syncRatio)

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanVQ35crank()

void initializeNissanVQ35crank ( TriggerWaveform s)

Definition at line 94 of file trigger_nissan.cpp.

94 {
96
97 s->tdcPosition = 675;
98
99 // 6 cylinder = 36 tooth wheel, missing 2 teeth in 3 spots
100 makeNissanPattern(s, 3, 36, 2);
101 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 0.2, 0.5);
102 s->setTriggerSynchronizationGap3(/*gapIndex*/1, 2, 4);
103 s->setTriggerSynchronizationGap3(/*gapIndex*/2, 0.6, 1.4);
104}
@ FOUR_STROKE_THREE_TIMES_CRANK_SENSOR

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeNissanVQvvt()

void initializeNissanVQvvt ( TriggerWaveform s)

Definition at line 63 of file trigger_nissan.cpp.

63 {
65
66 int offset = 360 - 260;
67
68 s->addToothRiseFall(offset + 20);
69 s->addToothRiseFall(offset + 80);
70 s->addToothRiseFall(offset + 100);
71 s->addToothRiseFall(offset + 140);
72 s->addToothRiseFall(offset + 160);
73 s->addToothRiseFall(offset + 260);
74
77}
uint16_t offset
Definition tunerstudio.h:0

Referenced by TriggerWaveform::initializeTriggerWaveform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeNissanPattern()

void makeNissanPattern ( TriggerWaveform s,
size_t  halfCylinderCount,
size_t  totalWheel,
size_t  missing 
)

Definition at line 79 of file trigger_nissan.cpp.

79 {
80
81 auto toothAngle = 360.0f / totalWheel;
82
83 auto patternTeeth = totalWheel / halfCylinderCount;
84 auto toothCount = patternTeeth - missing;
85
86 float currentAngle = missing * toothAngle;
87 for (size_t i = 0; i < toothCount; i++) {
88 currentAngle += toothAngle;
89 s->addEventAngle(currentAngle - 5, TriggerValue::RISE);
90 s->addEventAngle(currentAngle, TriggerValue::FALL);
91 }
92}

Referenced by initializeNissanMR18crank(), and initializeNissanVQ35crank().

Here is the call graph for this function:
Here is the caller graph for this function:

Go to the source code of this file.