rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_chrysler.cpp
Go to the documentation of this file.
1/**
2 * @file trigger_chrysler.cpp
3 *
4 * @date Mar 24, 2014
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#include "pch.h"
9
10#include "trigger_chrysler.h"
11#include "trigger_universal.h"
12
27
30
32
66 // gap 25
98}
99
101// todo: move sync point so that two channel does not have false trigger issues
102 bool useOnlyPrimary = true;
103
105
106 s->tdcPosition = 496;
107
108 /**
109 * ratio sequence is:
110gap=2.17/1.46
111gap=0.33/2.17
112gap=1.06/0.33
113gap=2.73/1.06
114gap=0.47/2.73
115gap=0.71/0.47
116gap=1.43/0.71
117 *
118 */
119
120 // these values only work well for 'useFronOnly' mode!!!
121 s->setTriggerSynchronizationGap2(0.75, 1.5);
122 s->setTriggerSynchronizationGap3(1, 0.65, 1.25);
123
124 float EPS_ANGLE = 0.3;
125
126
127 if (useOnlyPrimary) {
130
133
136
145
146 } else {
147 /**
148 * 7 primary (four narrow + one wide + two narrow)
149 * 64 secondary (one wide + 15 narrow + 16 narrow + one wide + 15 narrow + 16 narrow)
150 *
151 */
152
153 s->useOnlyPrimaryForSync = true;
154
179
181
190
192
196
198
206
208
210
217
219
227
229
238
240
265
267
276
278
282
291
300
309
320 }
321}
322
325 s->tdcPosition = 150;
326
327 float w = 7;
328 float g = 20;
329 s->setTriggerSynchronizationGap2(CHRYSLER_NGC6_GAP - 0.25,
330 CHRYSLER_NGC6_GAP + 0.4);
331
332 float base = 0;
333 // 2 teeth
334 float angle = base + 120.0 - w;
337 angle += g;
340
341 base += 120;
342 // 3 teeth
343 angle = base + 120.0 - w;
346 angle += g;
349 angle += g;
352
353 base += 120;
354 // 2 teeth
355 angle = base + 120.0 - w;
358 angle += g;
361
362 base += 120;
363 // just one
364 angle = base + 120.0 - w;
367
368 base += 120;
369 // 3 teeth
370 angle = base + 120.0 - w;
373 angle += g;
376 angle += g;
379
380 base += 120;
381 // just one again
382 angle = base + 120.0 - w;
385}
386
389
390 // Nominal gap 3.25
391 s->setTriggerSynchronizationGap3(0, 1.6, 4.5);
392
393 // Nominal gap 1.0
394 s->setTriggerSynchronizationGap3(1, 0.5, 1.5);
395 s->setTriggerSynchronizationGap3(2, 0.5, 1.5);
396
397 // Nominal gap 0.168
398 s->setTriggerSynchronizationGap3(3, 0.1, 0.3);
399
400 s->tdcPosition = 279;
401
402 // voodoo magic - we always need 720 at the end
403 int base = 59;
404
413
422}
423
426 s->isSynchronizationNeeded = false;
427 s->tdcPosition = 581;
428
429 float off = 212;
430
439
448
449
458
460
469
478
487
489
490}
491
505
506// TT_JEEP_4_CYL
509 s->isSynchronizationNeeded = false;
510 s->tdcPosition = 720 - 236;
511
512 float offset = 124;
513
514 add4cylblock(offset - 180, s);
516
518
519 add4cylblock(offset + 180, s);
520 add4cylblock(offset + 360, s);
521
523
524}
525
528
529 float wide = 30 * 2;
530 float narrow = 10 * 2;
531
533 for (int i = 1; i < 15; i++) {
534 s->setTriggerSynchronizationGap4(/*gapIndex*/i, 1);
535 }
536 s->setTriggerSynchronizationGap4(/*gapIndex*/15, 0.4);
537
538 float base = 0;
539
540 for (int i = 0; i < 14; i++) {
543 base += narrow;
544 }
545
547 base += narrow / 2;
549 base += wide;
550
551 for (int i = 0; i < 16; i++) {
554 base += narrow;
555 }
556
557 // one small tooth at the end of the engine cycle
560}
561
564
565 float wide = 15 * 2;
566 float narrow = 5 * 2;
567
568 /* Last falling edge before big gap */
569 s->tdcPosition = 13.5 * narrow;
570
571 s->setTriggerSynchronizationGap3(/*gapIndex*/0, 0.2, 0.6);
572 s->setTriggerSynchronizationGap3(/*gapIndex*/1, 2.2, 3.8);
573
574 for (int i = 2; i < 17; i++) {
575 s->setTriggerSynchronizationGap3(/*gapIndex*/i, 0.7, 1.6);
576 }
577
578 /* Starting with big gap */
579 float base = wide - narrow / 2;
580
581 for (int i = 0; i < 16; i++) {
584 base += narrow;
585 }
586
587 /* Big tooth */
589 s->addEventAngle(base + wide - narrow / 2, TriggerValue::FALL, TriggerWheel::T_PRIMARY);
590 base += wide;
591
592 for (int i = 0; i < 15; i++) {
595 base += narrow;
596 }
597}
598
601 int width = 5;
602
603 s->addToothRiseFall(37 + width, width);
604 s->addToothRiseFall(47 + width, width);
605
606 s->addToothRiseFall(81 + width, width);
607 s->addToothRiseFall(93 + width, width);
608 s->addToothRiseFall(105 + width, width);
609
610 s->addToothRiseFall(129 + width, width);
611 s->addToothRiseFall(139 + width, width);
612
613 s->addToothRiseFall(174 + width, width);
614 s->addToothRiseFall(186 + width, width);
615
616 s->addToothRiseFall(211 + width, width);
617
618 s->addToothRiseFall(265 + width, width);
619 s->addToothRiseFall(276 + width, width);
620 s->addToothRiseFall(286 + width, width);
621
622 s->addToothRiseFall(309 + width, width);
623
624 s->addToothRiseFall(360, width);
625
626 s->setTriggerSynchronizationGap4(/*gapIndex*/0, 2.16);
627 s->setTriggerSynchronizationGap4(/*gapIndex*/1, 2.08);
628 s->setTriggerSynchronizationGap4(/*gapIndex*/2, 0.34);
629}
beuint16_t off
Trigger shape has all the fields needed to describe and decode trigger signal.
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
angle_t getCycleDuration() const
void setTriggerSynchronizationGap(float syncRatio)
void addToothRiseFall(angle_t angle, angle_t width=10, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void addEventAngle(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void addEvent720(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void addEvent360(angle_t angle, TriggerValue const state, TriggerWheel const channelIndex=TriggerWheel::T_PRIMARY)
void setTriggerSynchronizationGap4(int index, float syncRatio)
void setTriggerSynchronizationGap2(float syncRatioFrom, float syncRatioTo)
void setTriggerSynchronizationGap3(int index, float syncRatioFrom, float syncRatioTo)
@ FOUR_STROKE_CRANK_SENSOR
@ FOUR_STROKE_CAM_SENSOR
void configureChryslerVtt15(TriggerWaveform *s)
static void add4cylblock(int off, TriggerWaveform *s)
void configureDodgeStratusTriggerWaveform(TriggerWaveform *s)
void configureChryslerNGC_36_2_2(TriggerWaveform *s)
void initJeep18_2_2_2(TriggerWaveform *s)
void initJeep_XJ_4cyl_2500(TriggerWaveform *s)
void configureNeon2003TriggerWaveformCam(TriggerWaveform *s)
void configureNeon1995TriggerWaveformOnlyCrank(TriggerWaveform *s)
void configureJeepEVD_36_2_2(TriggerWaveform *s)
void configureNeon2003TriggerWaveformCrank(TriggerWaveform *s)
void initDodgeRam(TriggerWaveform *s)
void addSkippedToothTriggerEvents(TriggerWheel wheel, TriggerWaveform *s, int totalTeethCount, int skippedCount, float toothWidthPercentage, float offset, float engineCycle, float filterLeft, float filterRight)
uint16_t offset
Definition tunerstudio.h:0