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

Functions

void setStepperHw ()
 
static void gmRailSensor ()
 
void setGmSbc ()
 
static void setGmGdi ()
 
static void setGmEcotec3 ()
 
static void set4CylGmEcotec3 ()
 
void setGmLcv ()
 
void setGmLnf ()
 
void setGmLtg ()
 
void setGmSbcGen5 ()
 

Function Documentation

◆ gmRailSensor()

static void gmRailSensor ( )
static

Definition at line 66 of file gm_sbc.cpp.

66 {
67 engineConfiguration->highPressureFuel.v1 = 0.5; /* volts */;
68 engineConfiguration->highPressureFuel.value1 = 0;
69 engineConfiguration->highPressureFuel.v2 = 4.5; /* volts */;
70 // fun fact: twice the range of VAG B6?
71 engineConfiguration->highPressureFuel.value2 = 25300;
72}
static constexpr engine_configuration_s * engineConfiguration

Referenced by setGmGdi().

Here is the caller graph for this function:

◆ set4CylGmEcotec3()

static void set4CylGmEcotec3 ( )
static

Definition at line 194 of file gm_sbc.cpp.

194 {
195 setGmEcotec3();
196 engineConfiguration->hpfpCamLobes = 4;
198 engineConfiguration->vvtMode[1] = VVT_BOSCH_QUICK_START;
199 setInline4();
200}
void setHpfpLobeProfileAngle(int lobes)
void setInline4()
static void setGmEcotec3()
Definition gm_sbc.cpp:187

Referenced by setGmLcv(), and setGmLtg().

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

◆ setGmEcotec3()

static void setGmEcotec3 ( )
static

Definition at line 187 of file gm_sbc.cpp.

187 {
188 setGmGdi();
190 setTPS1Inputs(EFI_ADC_NONE, EFI_ADC_NONE);
192}
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
static void setGmGdi()
Definition gm_sbc.cpp:140

Referenced by set4CylGmEcotec3(), and setGmSbcGen5().

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

◆ setGmGdi()

static void setGmGdi ( )
static

Definition at line 140 of file gm_sbc.cpp.

140 {
141 engineConfiguration->camSyncOnSecondCrankRevolution = true;
142 engineConfiguration->globalTriggerAngleOffset = 90;
143 engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START;
144 engineConfiguration->lowPressureFuel.hwChannel = EFI_ADC_NONE;
145 gmRailSensor();
146
147 // is this oddly high or OKis?
148 engineConfiguration->mc33_hpfp_i_peak = 10;
149 engineConfiguration->mc33_hpfp_i_hold = 7;
150
151#ifdef HW_HELLEN_4K_GDI
152 engineConfiguration->invertCamVVTSignal = true;
153 engineConfiguration->invertExhaustCamVVTSignal = true;
154
155 engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_SENS2; // Digital Input 3
156 engineConfiguration->camInputs[0] = Gpio::H144_IN_SENS3; // Digital Input 4
158 engineConfiguration->sentInputPins[0] = Gpio::H144_IN_AUX2_DIGITAL;
160
161 // engineConfiguration->starterControlPin = high side :()
162#endif // HW_HELLEN_4K_GDI
163
164#ifdef HW_HELLEN_8CHAN
165 engineConfiguration->sentInputPins[0] = Gpio::MM176_IN_D3;
166 engineConfiguration->starterControlPin = Gpio::MM176_IGN5; // 14C
167
168 engineConfiguration->map.sensor.hwChannel = MM176_IN_CRANK_ANALOG; // 1A Aux Analog 1. Important to use analog without muxing!
169 engineConfiguration->fuelPumpPin = Gpio::MM176_OUT_IO2; // 6C - High Side 2 orange/brown
170 engineConfiguration->hpfpValvePin = Gpio::MM176_GP17; // 19D Injector 9
171
174 config->boardUseCrankPullUp = true;
175
176 engineConfiguration->starterControlPin = Gpio::PIN_5C; // 5C - High Side 1, ignition output is not enough at least on HHR
178#endif // HW_HELLEN_8CHAN
179
180 setPPSCalibration(1, 4.25, 0.5, 2.14);
181
182 strcpy(engineConfiguration->engineMake, ENGINE_MAKE_GM);
183 engineConfiguration->etbFunctions[1] = DC_None;
185}
@ Unassigned
void setGDIFueling()
void setPPSCalibration(float primaryUp, float primaryDown, float secondaryUp, float secondaryDown)
static constexpr persistent_config_s * config
static void gmRailSensor()
Definition gm_sbc.cpp:66
void setGmCltSensor(ThermistorConf *thermistorConf)

Referenced by setGmEcotec3(), and setGmLnf().

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

◆ setGmLcv()

void setGmLcv ( )

Definition at line 202 of file gm_sbc.cpp.

202 {
204 engineConfiguration->displacement = 2.5;
205 engineConfiguration->map.sensor.type = MT_GM_1_BAR;
206 strcpy(engineConfiguration->engineCode, "LCV");
207}
static void set4CylGmEcotec3()
Definition gm_sbc.cpp:194

Referenced by applyEngineType().

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

◆ setGmLnf()

void setGmLnf ( )

Definition at line 209 of file gm_sbc.cpp.

209 {
210 setGmGdi();
211 engineConfiguration->displacement = 2.0;
212 strcpy(engineConfiguration->engineCode, "LNF");
213 setTPS1Calibration(880, 129, 118, 870);
214
215 engineConfiguration->hpfpPeakPos = 0;
216
217 // todo: engineConfiguration->hpfpCam = HPFP_CAM_IN1;
218#ifdef HW_HELLEN_8CHAN
219 engineConfiguration->vvtMode[1] = VVT_BOSCH_QUICK_START;
220 engineConfiguration->invertCamVVTSignal = true;
221 engineConfiguration->invertPrimaryTriggerSignal = true;
222 engineConfiguration->highPressureFuel.hwChannel = MM176_IN_MAP1_ANALOG; // 2A Aux Analog 4
223
224 engineConfiguration->vvtPins[0] = Gpio::MM176_OUT_PWM1;
225 engineConfiguration->vvtPins[1] = Gpio::MM176_OUT_PWM2;
226#endif // HW_HELLEN_8CHAN
227}
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)

Referenced by applyEngineType().

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

◆ setGmLtg()

void setGmLtg ( )

Definition at line 230 of file gm_sbc.cpp.

230 {
232 engineConfiguration->displacement = 2.0;
233#ifdef HW_HELLEN_8CHAN
234 engineConfiguration->oilPressure.hwChannel = MM176_IN_MAP1_ANALOG; // 2A Aux Analog 4
235 engineConfiguration->invertCamVVTSignal = true;
236
237 engineConfiguration->triggerInputPins[0] = Gpio::MM176_IN_D4; // 9A - Hall Input 4
238
239 engineConfiguration->luaOutputPins[0] = Gpio::MM176_OUT_IO1; // 7C - High Side 3 - unusual starter
240 engineConfiguration->luaOutputPins[1] = Gpio::MM176_OUT_IO4, // 9C - Low Side 4 - unusual starter
241#endif // HW_HELLEN_8CHAN
242 strcpy(engineConfiguration->engineCode, "LTG");
243}

Referenced by applyEngineType().

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

◆ setGmSbc()

void setGmSbc ( )

gm_sbc.h

Definition at line 74 of file gm_sbc.cpp.

74 {
75 engineConfiguration->cylindersCount = 8;
76 // that's original firing order before gen 3
77 engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2;
78 engineConfiguration->displacement = 5.2;
79
80 // see engine sniffer at https://github.com/rusefi/rusefi/issues/5353
81 // if injectors are wired in groups of four best to use channels 1 and 4
82 engineConfiguration->crankingInjectionMode = IM_BATCH;
83 engineConfiguration->injectionMode = IM_BATCH;
84
85 strcpy(engineConfiguration->engineMake, ENGINE_MAKE_GM);
86 strcpy(engineConfiguration->engineCode, "SBC");
87 // white wire "HEI E" plug pin D
88 engineConfiguration->ignitionMode = IM_ONE_COIL;
89 engineConfiguration->globalTriggerAngleOffset = 24;
90
91 gppwm_channel *ignOverride = &engineConfiguration->gppwm[0];
92 ignOverride->pwmFrequency = 0;
93 strcpy(engineConfiguration->gpPwmNote[0], "ign ovrrd B");
94 setTable(ignOverride->table, 100);
95
96#ifdef HW_HELLEN_UAEFI121
97 // coil control plug pin A
98
99 // tan wire with a black trace - "HEI B", plug pin B (we use yellow)
100 ignOverride->pin = Gpio::MM100_IGN2; // 12a Coil 2
101 // tach plug pin C
102 engineConfiguration->triggerInputPins[0] = Gpio::MM100_IN_D2; // 35a HALL2 red wire
105 engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
106#endif // HW_HELLEN_UAEFI121
107
108#if HW_PROTEUS
109 // tan wire with a black trace - "HEI B", plug pin B
110 ignOverride->pin = Gpio::PROTEUS_IGN_12;
112 // reminder about D101
113 engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_14; // #1
114 // reminder about D104
115 engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_15; // #4
116
117 // wow high side relay control on MEFI1 ELECTRONIC-FUEL-INJECTION-MEFI-1-2-5.7L-350CID-8.2L-502CID.pdf page 46
118 engineConfiguration->fuelPumpPin = Gpio::PROTEUS_HS_1;
119 // low side on MEFI3 ELECTRONIC-FUEL-INJECTION-MEFI-3-5.7L-350CID-8.2L-502CID.pdf page 487
120
122#endif // HW_PROTEUS
123 engineConfiguration->mainRelayPin = Gpio::Unassigned; // vehicle controls main relay
124
125 // for instance IWP069
126 engineConfiguration->injector.flow = 482.5;
127
128 setStepperHw();
129
130 // 8 cylinders one coil HEI trigger
132 engineConfiguration->trigger.customTotalToothCount = 8;
133 engineConfiguration->trigger.customSkippedToothCount = 0;
134 engineConfiguration->skippedWheelOnCam = true;
135 // Proteus Digital 1 is Tach input "HEI R", plug pin C
136
137 engineConfiguration->map.sensor.type = MT_GM_1_BAR;
138}
void setStepperHw()
Definition gm_sbc.cpp:15
constexpr void setTable(TElement(&dest)[N][M], const VElement value)

Referenced by applyEngineType().

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

◆ setGmSbcGen5()

void setGmSbcGen5 ( )

Definition at line 245 of file gm_sbc.cpp.

245 {
246 setGmEcotec3();
247 engineConfiguration->hpfpCamLobes = 3;
248 engineConfiguration->displacement = 5.3;
249 engineConfiguration->cylindersCount = 8;
250 engineConfiguration->firingOrder = FO_1_8_7_2_6_5_4_3;
251 engineConfiguration->map.sensor.type = MT_GM_1_BAR;
252
253 // engineConfiguration->hpfpPumpVolume = 0.623; // LT4
254 engineConfiguration->hpfpPumpVolume = 0.49; // cc per stroke
255
256 // LT 17.7 g/sec at 100bar which 1440
257 // todo: real flow!
258 engineConfiguration->injector.flow = 990; // 12.6g/sec
259
260#ifdef HW_HELLEN_8CHAN
261 engineConfiguration->mc33_hpfp_i_peak = 15;
262 engineConfiguration->mc33_hpfp_i_hold = 7;
263
264 engineConfiguration->injectionPins[4] = Gpio::MM176_INJ5;
265 engineConfiguration->injectionPins[5] = Gpio::MM176_INJ6;
266 engineConfiguration->injectionPins[6] = Gpio::MM176_INJ7;
267 engineConfiguration->injectionPins[7] = Gpio::MM176_INJ8;
268
269 engineConfiguration->ignitionPins[4] = Gpio::MM176_IGN5;
270 engineConfiguration->ignitionPins[5] = Gpio::MM176_IGN6;
271 engineConfiguration->ignitionPins[6] = Gpio::MM176_IGN7;
272 engineConfiguration->ignitionPins[7] = Gpio::MM176_IGN8;
273
274 engineConfiguration->starterControlPin = Gpio::MM176_SPI3_SCK; // 29C - Ignition 9
275
276 engineConfiguration->invertCamVVTSignal = true;
277 engineConfiguration->invertPrimaryTriggerSignal = true;
278 engineConfiguration->vvtMode[1] = VVT_INACTIVE;
280
281 // early models before SENT
282 // todo: early gen5 LS engines have redundant high pressure sensors #7364
283 engineConfiguration->highPressureFuel.v1 = 0.57; /* volts */;
284 engineConfiguration->highPressureFuel.value1 = 500;
285 engineConfiguration->highPressureFuel.v2 = 2.25; /* volts */;
286 engineConfiguration->highPressureFuel.value2 = 10900;
287
288 engineConfiguration->lowPressureFuel.v1 = 2.9; /* volts */;
289 engineConfiguration->lowPressureFuel.value1 = 435;
290 engineConfiguration->lowPressureFuel.v2 = 3.7; /* volts */;
291 engineConfiguration->lowPressureFuel.value2 = 576;
292
293 engineConfiguration->oilPressure.v1 = 0.6;
294 engineConfiguration->oilPressure.value1 = 0; // 100 kPa absolute
295 engineConfiguration->oilPressure.v2 = 2.6f;
296 engineConfiguration->oilPressure.value2 = 420; // 520 kPa absolute
297
298 engineConfiguration->oilPressure.hwChannel = MM176_IN_MAP1_ANALOG; // 2A Aux Analog 4
299 engineConfiguration->fuelLevelSensor = MM176_IN_O2S_ANALOG; // 3A - Aux Analog 2
300 engineConfiguration->lowPressureFuel.hwChannel = MM176_IN_AUX2_ANALOG; // 4A - Aux Analog 7
301 engineConfiguration->acPressure.hwChannel = MM176_IN_MAP2_ANALOG;// 10A - Aux Analog 5
302 engineConfiguration->flexSensorPin = Gpio::MM176_IN_SENS3;
303#endif // HW_HELLEN_8CHAN
304}

Referenced by applyEngineType().

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

◆ setStepperHw()

void setStepperHw ( )

Definition at line 15 of file gm_sbc.cpp.

15 {
16 engineConfiguration->useStepperIdle = true;
17 engineConfiguration->useHbridgesToDriveIdleStepper = true;
18 engineConfiguration->stepper_dc_use_two_wires = false;
19 engineConfiguration->stepperDcInvertedPins = false;
20
21 for (size_t i = 0;i<ETB_COUNT;i++) {
22 engineConfiguration->etbFunctions[i] = DC_None;
23 }
24
25 setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
26
27#ifdef HW_HELLEN_8CHAN
30#endif // HW_HELLEN_8CHAN
31
32#ifdef HW_HELLEN_UAEFI
35#endif // HW_HELLEN_UAEFI
36
37#ifdef HW_PROTEUS
38//Coil 1 - Pin 15 DC2 positive Pin A Toyota iac pin 4
39//Coil 1 - Pin 8 DC2 negative Pin B Toyota iac pin 6
40//Coil 2 - Pin 7 DC1 positive Pin C Toyota iac pin 1
41//Coil 2 - Pin 6 DC1 negative Pin D Toyota iac pin 3
42
43 // coil #1 = proteus pin 15 (DC2 positive) to BL pin "A", pin B to pin 8 (DC2 negative)
44 // PWM pin
45 engineConfiguration->stepperDcIo[0].controlPin = Gpio::D13;
46 // DIR pin
47 engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::D9;
48 // Disable pin
49 engineConfiguration->stepperDcIo[0].disablePin = Gpio::D8;
50 // Unused
51 engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
52
53 // coil #2 - proteus pin 7 (DC1 positive) to AH pin "D", pin C to pin 6 (DC1 negative)
54 // PWM pin
55 engineConfiguration->stepperDcIo[1].controlPin = Gpio::D12;
56 // DIR pin
57 engineConfiguration->stepperDcIo[1].directionPin1 = Gpio::D10;
58 // Disable pin
59 engineConfiguration->stepperDcIo[1].disablePin = Gpio::D11;
60 // Unused
61 engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
62
63#endif // HW_PROTEUS
64}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void set8chanDefaultETBPins()
void setUaefiDefaultETBPins()

Referenced by handleCommandX14(), and setGmSbc().

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

Go to the source code of this file.