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

Functions

static void commonPassatB6 ()
 
void setProteusVwPassatB6 ()
 
void setMreVwPassatB6 ()
 

Variables

static const float hardCodedFreqBins []
 
static const float hardCodedGperSValues []
 

Function Documentation

◆ commonPassatB6()

static void commonPassatB6 ( )
inlinestatic

PSS-140

Definition at line 18 of file vw_b6.cpp.

18 {
21 engineConfiguration->vvtMode[0] = VVT_BOSCH_QUICK_START;
22 engineConfiguration->map.sensor.type = MT_BOSCH_2_5;
23
25
28
29 setInline4();
30
32
33
34 for (int i = 4; i < MAX_CYLINDER_COUNT;i++) {
37 }
38
39 // Injectors flow 1214 cc/min at 100 bar pressure
42
43 strcpy(engineConfiguration->engineMake, ENGINE_MAKE_VAG);
44 strcpy(engineConfiguration->engineCode, "BPY");
45 strcpy(engineConfiguration->vehicleName, "test");
46
47 setPPSCalibration(0.36, 2.13, 0.73, 4.30);
48
50
51 /**
52 * PSS-140
53 */
54 // todo: calibration
55 engineConfiguration->highPressureFuel.v1 = 0.5; /* volts */;
57 engineConfiguration->highPressureFuel.v2 = 4.5; /* volts */;
59
60 engineConfiguration->lowPressureFuel.v1 = 0.5; /* volts */;
62 engineConfiguration->lowPressureFuel.v2 = 4.5; /* volts */;
63 // todo: what's the proper calibration of this Bosch sensor? is it really 200psi?
65
66 gppwm_channel *lowPressureFuelPumpControl = &engineConfiguration->gppwm[1];
67 strcpy(engineConfiguration->gpPwmNote[1], "LPFP");
68 lowPressureFuelPumpControl->pwmFrequency = 20;
69 lowPressureFuelPumpControl->loadAxis = GPPWM_FuelLoad;
70 lowPressureFuelPumpControl->dutyIfError = 50;
71 setTable(lowPressureFuelPumpControl->table, (uint8_t)50);
72
73 gppwm_channel *coolantControl = &engineConfiguration->gppwm[0];
74 strcpy(engineConfiguration->gpPwmNote[0], "Rad Fan");
75 coolantControl->loadAxis = GPPWM_Clt;
76
77 coolantControl->pwmFrequency = 25;
78 coolantControl->loadAxis = GPPWM_FuelLoad;
79 // Volkswage wants 10% for fan to be OFF, between pull-up and low side control we need to invert that value
80 // todo system lua for duty driven by CLT? (3, Gpio::E0, "0.15 90 coolant 120 min max 90 - 30 / 0.8 * +", 25);
81 int value = 100 - 10;
82 coolantControl->dutyIfError = value;
83 setTable(coolantControl->table, (uint8_t)value);
84 // for now I just want to stop radiator whine
85 // todo: enable cooling!
86 /*
87 for (int load = 0; load < GPPWM_LOAD_COUNT; load++) {
88 for (int r = 0; r < GPPWM_RPM_COUNT; r++) {
89 engineConfiguration->gppwm[0].table[load][r] = value;
90 }
91 }
92*/
93
95#if EFI_ELECTRONIC_THROTTLE_BODY
97#endif //EFI_ELECTRONIC_THROTTLE_BODY
98
99 // random number just to take position away from zero
101
102 // https://rusefi.com/forum/viewtopic.php?p=38235#p38235
104
107}
@ Unassigned
void setGDIFueling()
void setInline4()
void setPPSCalibration(float primaryUp, float primaryDown, float secondaryUp, float secondaryDown)
void setBoschVAGETB()
void setCrankOperationMode()
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
scaled_channel< uint8_t, 2, 1 > table[GPPWM_LOAD_COUNT][GPPWM_RPM_COUNT]
scaled_channel< uint16_t, 10, 1 > veTable[VE_LOAD_COUNT][VE_RPM_COUNT]
constexpr void setTable(TElement(&dest)[N][M], const VElement value)

Referenced by setMreVwPassatB6(), and setProteusVwPassatB6().

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

◆ setMreVwPassatB6()

void setMreVwPassatB6 ( )

set engine_type 62 VW_B6 has to be microRusEFI 0.5.2

Definition at line 188 of file vw_b6.cpp.

188 {
189#if HW_MICRO_RUSEFI
191
192// engineConfiguration->afr.hwChannel = MRE_IN_ANALOG_VOLT_10;
193
194 engineConfiguration->tps1_2AdcChannel = MRE_IN_ANALOG_VOLT_9;
195
196
197
198 // EFI_ADC_7: "31 - AN volt 3" - PA7
199 // 36 - AN volt 8
200 setPPSInputs(MRE_IN_ANALOG_VOLT_3, MRE_IN_ANALOG_VOLT_8);
201
202 // "26 - AN volt 2"
203 engineConfiguration->highPressureFuel.hwChannel = MRE_IN_ANALOG_VOLT_2;
204
205
206 // "19 - AN volt 4"
208
210
212 // RED
214 // YELLOW
216 // BROWN
220
221
222 // J8 orange
224 // J8 Grey
226 // J8 Dark BLUE
228 // J9 violet
230
231 // J10 Dark BLUE
233 // J11 green
235 // J18 grey
237 // J6 white
239
240
241 gppwm_channel *lowPressureFuelPumpControl = &engineConfiguration->gppwm[1];
242
243 // "42 - Injector 4", somehow GP4 did not work? not enough current? not happy with diode?
244 lowPressureFuelPumpControl->pin = MRE_INJ_4;
245
246
247 gppwm_channel *coolantControl = &engineConfiguration->gppwm[0];
248
249 coolantControl->pin = MRE_LS_2;
250 // "7 - Lowside 1"
251 //engineConfiguration->hpfpValvePin = MRE_LS_1;
253
254
255#endif /* HW_MICRO_RUSEFI */
256}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
static void commonPassatB6()
Definition vw_b6.cpp:18

Referenced by applyEngineType().

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

◆ setProteusVwPassatB6()

void setProteusVwPassatB6 ( )

set engine_type 39

Definition at line 134 of file vw_b6.cpp.

134 {
135#if HW_PROTEUS
136 static_assert(sizeof(hardCodedFreqBins) == sizeof(hardCodedGperSValues));
137#if SCRIPT_CURVE_16 == 16
138 {
139 size_t mi = 0;
140 for (; mi < efi::size(hardCodedFreqBins); mi++) {
143 }
144
145 for (; mi < SCRIPT_CURVE_16; mi++) {
146 config->scriptCurve1Bins[mi] = 3650 + mi;
147 config->scriptCurve1[mi] = 4000;
148 }
149 }
150 strcpy(engineConfiguration->scriptCurveName[0], "MAFcurve");
151#endif
152
154 engineConfiguration->triggerInputPins[0] = PROTEUS_VR_1;
155 engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_2;
156
157 engineConfiguration->auxSpeedSensorInputPin[0] = PROTEUS_DIGITAL_5;
158
159 engineConfiguration->lowPressureFuel.hwChannel = PROTEUS_IN_ANALOG_VOLT_5;
160 engineConfiguration->highPressureFuel.hwChannel = PROTEUS_IN_ANALOG_VOLT_4;
161
162 gppwm_channel *coolantControl = &engineConfiguration->gppwm[0];
163 coolantControl->pin = Gpio::PROTEUS_LS_5;
164
165 engineConfiguration->mainRelayPin = Gpio::PROTEUS_LS_6;
166
167 gppwm_channel *lowPressureFuelPumpControl = &engineConfiguration->gppwm[1];
168 lowPressureFuelPumpControl->pin = Gpio::PROTEUS_LS_7;
169
170 //engineConfiguration->boostControlPin = Gpio::PROTEUS_LS_8;
171 engineConfiguration->vvtPins[0] = Gpio::PROTEUS_LS_9;
172 engineConfiguration->hpfpValvePin = Gpio::PROTEUS_LS_15;
173
175
176#if EFI_PROD_CODE
177 #include "vw_b6.lua"
178#endif
179
180#endif // HW_PROTEUS
181}
void setProteusEtbIO()
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
brain_input_pin_e auxSpeedSensorInputPin[AUX_SPEED_SENSOR_COUNT]
static const float hardCodedFreqBins[]
Definition vw_b6.cpp:112
static const float hardCodedGperSValues[]
Definition vw_b6.cpp:121

Referenced by applyEngineType().

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

Variable Documentation

◆ hardCodedFreqBins

const float hardCodedFreqBins[]
static
Initial value:
= {139,
152,
180,
217,
280,
300,
365}

Definition at line 112 of file vw_b6.cpp.

112 {139,
113 152,
114 180,
115 217,
116 280,
117 300,
118 365};

Referenced by setProteusVwPassatB6().

◆ hardCodedGperSValues

const float hardCodedGperSValues[]
static
Initial value:
{
3.58,
4.5,
6.7,
11,
22,
25,
40
}

Definition at line 121 of file vw_b6.cpp.

121 {
122 3.58,
123 4.5,
124 6.7,
125 11,
126 22,
127 25,
128 40
129};

Referenced by setProteusVwPassatB6().

Go to the source code of this file.