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
|
|
|
*/
|
|
|
|
|
2018-09-16 19:25:17 -07:00
|
|
|
#include "global.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
#include "vw.h"
|
|
|
|
#include "custom_engine.h"
|
|
|
|
#include "ego.h"
|
2015-09-01 15:01:24 -07:00
|
|
|
#include "engine_math.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-04-22 22:26:30 -07:00
|
|
|
// VW_ABA
|
2020-11-14 15:05:27 -08:00
|
|
|
// set engine_type 32
|
2019-05-03 15:41:43 -07:00
|
|
|
void setVwAba(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
2019-08-06 14:12:15 -07:00
|
|
|
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-10 18:10:46 -08:00
|
|
|
setWholeTimingTable_d(20 PASS_CONFIG_PARAMETER_SUFFIX);
|
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
|
|
|
|
2016-07-05 08:03:11 -07:00
|
|
|
engineConfiguration->isCylinderCleanupEnabled = true;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
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
|
2019-01-10 16:25:07 -08:00
|
|
|
setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->map.sensor.type = MT_GM_3_BAR;
|
|
|
|
|
|
|
|
engineConfiguration->ignitionMode = IM_ONE_COIL;
|
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->ignitionPins[0] = GPIOE_14; // Frankenso high side - pin 1G
|
|
|
|
engineConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->ignitionPins[2] = GPIO_UNASSIGNED;
|
|
|
|
engineConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
|
|
|
|
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;
|
|
|
|
|
2019-05-03 15:41:43 -07:00
|
|
|
setEgoSensor(ES_PLX PASS_CONFIG_PARAMETER_SUFFIX);
|
2019-01-10 16:25:07 -08:00
|
|
|
setFuelTablesLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);
|
|
|
|
setTimingLoadBin(20, mapRange PASS_CONFIG_PARAMETER_SUFFIX);
|
2016-06-12 20:03:12 -07:00
|
|
|
|
2020-02-25 18:35:21 -08:00
|
|
|
CONFIG(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
|
|
|
|
|
|
|
void setHellen121Vag_5_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
|
|
engineConfiguration->specs.cylindersCount = 5;
|
|
|
|
engineConfiguration->specs.displacement = 2.5;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_2_4_5_3;
|
|
|
|
}
|
|
|
|
|
2021-07-08 17:42:35 -07:00
|
|
|
void setHellen121Vag_vr6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
|
|
engineConfiguration->specs.cylindersCount = 6;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_5_3_6_2_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setHellen121Vag_v6_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
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
|
|
|
|
|
|
|
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = GPIOA_7; // 87a
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void setHellen121Vag_8_cyl(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|
|
|
engineConfiguration->specs.cylindersCount = 8;
|
|
|
|
engineConfiguration->specs.displacement = 4.2;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_5_4_8_6_3_7_2;
|
|
|
|
}
|