rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
trigger_mitsubishi.cpp
Go to the documentation of this file.
1/**
2 * @file trigger_mitsubishi.cpp
3 *
4 * @date Aug 5, 2014
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#include "pch.h"
9
10#include "trigger_mitsubishi.h"
11#include "trigger_universal.h"
12
33
35 initializeSkippedToothTrigger(s, /* reality */2 * /* symmetrical*/0.5,
37#if EFI_UNIT_TEST
38 s->knownOperationMode = true; // this is always placed on crank, overriding 'initializeSkippedToothTrigger' value
39#endif
40}
41
42// https://github.com/rusefi/rusefi/issues/5593
45
46 //happy ratio 0.548387 @ 0
47 //happy ratio 0.941176 @ 1
48 //happy ratio 0.500000 @ 2
49 //happy ratio 3.750002 @ 3
50 //happy ratio 0.266667 @ 4
51 //happy ratio 3.250000 @ 5
52 //happy ratio 0.307692 @ 6
53 //happy ratio 3.875000 @ 7
54
55 // real working ranges for all of the engine states
56 s->setTriggerSynchronizationGap3(0, 1.3, 3.2);
57 s->setTriggerSynchronizationGap3(1, 0.3, 0.66);
58 s->setTriggerSynchronizationGap3(2, 1.3, 3.2);
59 s->setTriggerSynchronizationGap3(3, 0.3, 0.66);
60 s->setTriggerSynchronizationGap3(4, 1.3, 3.2);
61
70}
71
74
75 // nominal gap 0.5
77
78 // nominal gap 3.0
79 s->setTriggerSynchronizationGap2(2.0f, 5.0f);
80
81 // 131 deg before #1 TDC
82 // 49 deg after #1 TDC
83 s->addToothRiseFall(225, /*width*/90);
84
85 // 131 deg before #4 TDC
86 // 41 deg before #4 TDC
87 s->addToothRiseFall(360, /*width*/45);
88}
89
92 s->tdcPosition = 90;
93 int totalTeethCount = 36;
94
95 float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
96 float toothWidth = 0.5;
97
98 float oneTooth = 720 / totalTeethCount;
99
100 float offset = (36 - 11 - 12 - 11) * oneTooth;
101
102 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
103 NO_LEFT_FILTER, offset + 11 * oneTooth + 1);
104
105 offset += (11 + 1) * oneTooth;
106
107 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
108 NO_LEFT_FILTER, offset + 11 * oneTooth + 1);
109
110
111 offset += (11 + 1) * oneTooth;
112
113 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
114 NO_LEFT_FILTER, offset + 10 * oneTooth + 1);
115
117 s->setSecondTriggerSynchronizationGap(1); // redundancy
118}
119
120// Mitsubishi 4B11
121// https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#36-2-1
124 s->tdcPosition = 90;
125 int totalTeethCount = 36;
126
127 float engineCycle = FOUR_STROKE_ENGINE_CYCLE;
128 float toothWidth = 0.5;
129
130 float oneTooth = 720 / totalTeethCount;
131
132 float offset = (36 - 16 - 2 - 17) * oneTooth;
133
134 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
135 NO_LEFT_FILTER, offset + 16 * oneTooth + 1);
136
137 offset += (16 + 2) * oneTooth;
138
139 addSkippedToothTriggerEvents(TriggerWheel::T_PRIMARY, s, totalTeethCount, 0, toothWidth, /*offset*/offset, engineCycle,
140 NO_LEFT_FILTER, offset + 17 * oneTooth + 1);
141
142
144 s->setSecondTriggerSynchronizationGap(1); // redundancy
145}
146
149
150 int w = 5;
151 s->addToothRiseFall(120, w);
152
153 s->addToothRiseFall(12 + 120, w);
154
155 s->addToothRiseFall(240, w);
156
157 s->addToothRiseFall(360, w);
158
160 s->setSecondTriggerSynchronizationGap(0.11); // redundancy
161}
162
Trigger shape has all the fields needed to describe and decode trigger signal.
void initialize(operation_mode_e operationMode, SyncEdge syncEdge)
void setSecondTriggerSynchronizationGap(float syncRatio)
void setTriggerSynchronizationGap(float syncRatio)
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 addEvent360(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_SYMMETRICAL_CRANK_SENSOR
@ FOUR_STROKE_CRANK_SENSOR
@ FOUR_STROKE_CAM_SENSOR
void initializeVvt6G72(TriggerWaveform *s)
void initialize36_2_1(TriggerWaveform *s)
void initializeMitsubishi4gSymmetricalCrank(TriggerWaveform *s)
void initializeVvt3A92(TriggerWaveform *s)
void initializeMitsubishi4g63Cam(TriggerWaveform *s)
void initializeMitsubishi4G69Cam(TriggerWaveform *s)
void configureFordAspireTriggerWaveform(TriggerWaveform *s)
void initialize36_2_1_1(TriggerWaveform *s)
void addSkippedToothTriggerEvents(TriggerWheel wheel, TriggerWaveform *s, int totalTeethCount, int skippedCount, float toothWidthPercentage, float offset, float engineCycle, float filterLeft, float filterRight)
void initializeSkippedToothTrigger(TriggerWaveform *s, int totalTeethCount, int skippedCount, operation_mode_e operationMode, SyncEdge syncEdge)
uint16_t offset
Definition tunerstudio.h:0