2015-07-10 06:01:56 -07:00
|
|
|
/*
|
|
|
|
* @file vw.cpp
|
|
|
|
*
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 32
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* @date May 24, 2015
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2021-08-03 19:05:01 -07:00
|
|
|
#include "pch.h"
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "vw.h"
|
|
|
|
#include "custom_engine.h"
|
|
|
|
|
2020-04-22 22:26:30 -07:00
|
|
|
// VW_ABA
|
2020-11-14 15:05:27 -08:00
|
|
|
// set engine_type 32
|
2021-11-16 01:15:29 -08:00
|
|
|
void setVwAba() {
|
|
|
|
setFrankensoConfiguration();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
setWholeTimingTable_d(20);
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_timing_angle 10
|
2016-06-13 07:03:46 -07:00
|
|
|
engineConfiguration->crankingTimingAngle = 10;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set global_trigger_offset_angle 93
|
2016-06-13 07:03:46 -07:00
|
|
|
engineConfiguration->globalTriggerAngleOffset = 93;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
|
2022-04-02 23:21:37 -07:00
|
|
|
setCrankOperationMode();
|
2020-10-16 10:54:12 -07:00
|
|
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
|
|
|
|
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
|
|
|
|
|
|
|
|
|
|
|
//Base engine setting
|
|
|
|
engineConfiguration->specs.cylindersCount = 4;
|
2016-06-12 20:03:12 -07:00
|
|
|
engineConfiguration->specs.displacement = 2.0;
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->injector.flow = 320; // 30lb/h
|
2017-01-06 07:04:41 -08:00
|
|
|
// set algorithm 3
|
2021-11-16 01:15:29 -08:00
|
|
|
setAlgorithm(LM_SPEED_DENSITY);
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->map.sensor.type = MT_GM_3_BAR;
|
|
|
|
|
|
|
|
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->ignitionPins[0] = Gpio::E14; // Frankenso high side - pin 1G
|
|
|
|
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
|
|
|
engineConfiguration->ignitionPins[2] = Gpio::Unassigned;
|
|
|
|
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->ignitionPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-11-14 15:05:27 -08:00
|
|
|
engineConfiguration->idlePositionSensor = EFI_ADC_3; // PA3
|
|
|
|
engineConfiguration->wastegatePositionSensor = EFI_ADC_4; // PA4
|
|
|
|
|
2016-05-29 13:01:43 -07:00
|
|
|
float mapRange = 110;
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
setEgoSensor(ES_PLX);
|
|
|
|
setFuelTablesLoadBin(20, mapRange);
|
|
|
|
setTimingLoadBin(20, mapRange);
|
2016-06-12 20:03:12 -07:00
|
|
|
|
2021-11-17 00:54:21 -08:00
|
|
|
engineConfiguration->isSdCardEnabled = false;
|
2016-06-12 20:03:12 -07:00
|
|
|
engineConfiguration->tpsMin = 740;
|
|
|
|
engineConfiguration->tpsMax = 135;
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
2021-07-08 13:35:58 -07:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setHellen121Vag_5_cyl() {
|
2021-07-08 13:35:58 -07:00
|
|
|
engineConfiguration->specs.cylindersCount = 5;
|
|
|
|
engineConfiguration->specs.displacement = 2.5;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_2_4_5_3;
|
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setHellen121Vag_vr6_cyl() {
|
2021-07-08 17:42:35 -07:00
|
|
|
engineConfiguration->specs.cylindersCount = 6;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setHellen121Vag_v6_cyl() {
|
2021-07-08 13:35:58 -07:00
|
|
|
engineConfiguration->specs.cylindersCount = 6;
|
|
|
|
engineConfiguration->specs.displacement = 2.7;
|
2021-07-09 10:23:29 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = Gpio::A7; // 87a
|
2021-07-09 10:23:29 -07:00
|
|
|
|
2021-07-08 19:55:45 -07:00
|
|
|
engineConfiguration->specs.firingOrder = FO_1_4_3_6_2_5;
|
2021-07-08 13:35:58 -07:00
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setHellen121Vag_8_cyl() {
|
2021-07-08 13:35:58 -07:00
|
|
|
engineConfiguration->specs.cylindersCount = 8;
|
|
|
|
engineConfiguration->specs.displacement = 4.2;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_5_4_8_6_3_7_2;
|
|
|
|
}
|