| Line | Branch | Decision | Exec | Source |
|---|---|---|---|---|
| 1 | /** | |||
| 2 | * @file dodge_neon.cpp | |||
| 3 | * | |||
| 4 | * DODGE_NEON_1995 = 2 | |||
| 5 | * set engine_type 2 | |||
| 6 | * | |||
| 7 | * DODGE_NEON_2003 = 23 | |||
| 8 | * set engine_type 23 | |||
| 9 | * http://rusefi.com/wiki/index.php?title=Vehicle:Dodge_Neon_2003 | |||
| 10 | * | |||
| 11 | * @date Dec 16, 2013 | |||
| 12 | * @author Andrey Belomutskiy, (c) 2012-2020 | |||
| 13 | */ | |||
| 14 | ||||
| 15 | #include "pch.h" | |||
| 16 | ||||
| 17 | #include "dodge_neon.h" | |||
| 18 | ||||
| 19 | #include "custom_engine.h" | |||
| 20 | ||||
| 21 | 3 | void setDodgeNeon1995EngineConfiguration() { | ||
| 22 | 3 | engineConfiguration->trigger.type = trigger_type_e::TT_DODGE_NEON_1995; | ||
| 23 | ||||
| 24 | 3 | engineConfiguration->fuelAlgorithm = engine_load_mode_e::LM_ALPHA_N; | ||
| 25 | ||||
| 26 | 3 | setWholeTimingTable(12); | ||
| 27 | ||||
| 28 | 3 | engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; | ||
| 29 | // set injection_mode 1 | |||
| 30 | 3 | engineConfiguration->injectionMode = IM_SEQUENTIAL; | ||
| 31 | ||||
| 32 | // set ignition_mode 2 | |||
| 33 | 3 | engineConfiguration->ignitionMode = IM_WASTED_SPARK; | ||
| 34 | 3 | engineConfiguration->firingOrder = FO_1_3_4_2; | ||
| 35 | ||||
| 36 | // set global_trigger_offset_angle 137 | |||
| 37 | 3 | engineConfiguration->camSyncOnSecondCrankRevolution = true; | ||
| 38 | 3 | engineConfiguration->globalTriggerAngleOffset = 137; | ||
| 39 | ||||
| 40 | // set cranking_timing_angle 0 | |||
| 41 | 3 | engineConfiguration->crankingTimingAngle = 0; | ||
| 42 | ||||
| 43 | 3 | engineConfiguration->mapErrorDetectionTooHigh = 120; | ||
| 44 | ||||
| 45 | 3 | engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700}; | ||
| 46 | 3 | } | ||
| 47 | ||||
| 48 | 2 | void setDodgeNeonNGCEngineConfiguration() { | ||
| 49 | 2 | engineConfiguration->trigger.type = trigger_type_e::TT_DODGE_NEON_2003_CAM; | ||
| 50 | ||||
| 51 | // set global_trigger_offset_angle 38 | |||
| 52 | 2 | engineConfiguration->globalTriggerAngleOffset = 38; | ||
| 53 | ||||
| 54 | 2 | engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; | ||
| 55 | 2 | engineConfiguration->injectionMode = IM_SEQUENTIAL; | ||
| 56 | 2 | engineConfiguration->ignitionMode = IM_WASTED_SPARK; | ||
| 57 | 2 | engineConfiguration->displacement = 1.996; | ||
| 58 | 2 | engineConfiguration->cylindersCount = 4; | ||
| 59 | ||||
| 60 | /** | |||
| 61 | * 77C | |||
| 62 | * 1200 rpm | |||
| 63 | * fuel 3 | |||
| 64 | * | |||
| 65 | * 88C | |||
| 66 | * fuel 2.8 | |||
| 67 | * | |||
| 68 | */ | |||
| 69 | //setWholeTimingTable(12); | |||
| 70 | ||||
| 71 | //setMap(config->veTable, 50); | |||
| 72 | ||||
| 73 | // set cranking_timing_angle 710 | |||
| 74 | 2 | engineConfiguration->crankingTimingAngle = -710; | ||
| 75 | ||||
| 76 | /** | |||
| 77 | * bosch 4G1139 | |||
| 78 | * http://forum.2gn.org/viewtopic.php?t=21657 | |||
| 79 | * or is it 225 as mentioned at http://turbobazar.ru/showpost.php?p=750815&postcount=796 ? | |||
| 80 | */ | |||
| 81 | 2 | engineConfiguration->injector.flow = 199; | ||
| 82 | ||||
| 83 | 2 | setLinearCurve(config->ignitionLoadBins, 20, 120, 1); | ||
| 84 | ||||
| 85 | 2 | setAlgorithm(engine_load_mode_e::LM_SPEED_DENSITY); | ||
| 86 | ||||
| 87 | 2 | setFuelTablesLoadBin(20, 120); | ||
| 88 | ||||
| 89 | 2 | engineConfiguration->malfunctionIndicatorPin = Gpio::Unassigned; | ||
| 90 | ||||
| 91 | /** | |||
| 92 | * PA4 Wideband O2 Sensor | |||
| 93 | */ | |||
| 94 | 2 | engineConfiguration->afr.hwChannel = EFI_ADC_4; | ||
| 95 | ||||
| 96 | 2 | commonFrankensoAnalogInputs(); | ||
| 97 | 2 | engineConfiguration->vbattDividerCoeff = 9.75;// ((float) (8.2 + 33)) / 8.2 * 2; | ||
| 98 | ||||
| 99 | /** | |||
| 100 | * http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board | |||
| 101 | */ | |||
| 102 | ||||
| 103 | 2 | setDodgeSensor(&engineConfiguration->clt, 10000); | ||
| 104 | 2 | setDodgeSensor(&engineConfiguration->iat, 10000); | ||
| 105 | ||||
| 106 | /** | |||
| 107 | * MAP PA0 | |||
| 108 | */ | |||
| 109 | 2 | engineConfiguration->map.sensor.hwChannel = EFI_ADC_0; // PA0 | ||
| 110 | ||||
| 111 | // rev 0.1 green board | |||
| 112 | // engineConfiguration->map.sensor.hwChannel = EFI_ADC_6; // PA6 | |||
| 113 | // engineConfiguration->tps1_1AdcChannel = EFI_ADC_15; // PC5 | |||
| 114 | ||||
| 115 | ||||
| 116 | /** | |||
| 117 | * TPS | |||
| 118 | */ | |||
| 119 | 2 | engineConfiguration->tps1_1AdcChannel = EFI_ADC_2; | ||
| 120 | 2 | engineConfiguration->tpsMax = 625; // convert 12to10 bit (ADC/4) | ||
| 121 | 2 | engineConfiguration->tpsMin = 125; // convert 12to10 bit (ADC/4) | ||
| 122 | ||||
| 123 | /** | |||
| 124 | * IAT D15/W7 | |||
| 125 | */ | |||
| 126 | 2 | engineConfiguration->iat.adcChannel = EFI_ADC_11; | ||
| 127 | ||||
| 128 | /** | |||
| 129 | * CLT D13/W9 | |||
| 130 | */ | |||
| 131 | 2 | engineConfiguration->clt.adcChannel = EFI_ADC_12; | ||
| 132 | ||||
| 133 | 2 | engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003; | ||
| 134 | ||||
| 135 | 2 | engineConfiguration->cylinderBore = 87.5; | ||
| 136 | ||||
| 137 | 2 | engineConfiguration->clutchDownPin = Gpio::C12; | ||
| 138 | 2 | engineConfiguration->clutchDownPinMode = PI_PULLUP; | ||
| 139 | // engineConfiguration->clutchUpPin = Gpio::A14; // note SWCLK - conflict with SWD | |||
| 140 | 2 | engineConfiguration->clutchUpPinMode = PI_PULLUP; | ||
| 141 | ||||
| 142 | // engineConfiguration->vehicleSpeedSensorInputPin = Gpio::A8; | |||
| 143 | ||||
| 144 | 2 | engineConfiguration->fanOnTemperature = 92; | ||
| 145 | 2 | engineConfiguration->fanOffTemperature = 89; | ||
| 146 | // engineConfiguration->fanOnTemperature = 115; // knock testing - value is a bit high | |||
| 147 | // engineConfiguration->fanOffTemperature = 100; | |||
| 148 | ||||
| 149 | 2 | setAlgorithm(engine_load_mode_e::LM_SPEED_DENSITY); | ||
| 150 | ||||
| 151 | //temp engineConfiguration->alternatorControlPin = Gpio::D5; | |||
| 152 | 2 | setTable(config->alternatorVoltageTargetTable, 14.0); | ||
| 153 | 2 | engineConfiguration->alternatorControl.offset = 20; | ||
| 154 | 2 | engineConfiguration->alternatorControl.pFactor = 20; | ||
| 155 | 2 | engineConfiguration->alternatorControl.iFactor = 0.2; | ||
| 156 | 2 | engineConfiguration->alternatorControl.dFactor = 0.1; | ||
| 157 | 2 | engineConfiguration->alternatorControl.periodMs = 10; | ||
| 158 | ||||
| 159 | 2 | engineConfiguration->tpsAccelEnrichmentThreshold = 10; | ||
| 160 | ||||
| 161 | 2 | engineConfiguration->wwaeTau = 1.0f; | ||
| 162 | 2 | engineConfiguration->wwaeBeta = 0.40f; | ||
| 163 | ||||
| 164 | 2 | engineConfiguration->wwaeTau = 0; | ||
| 165 | 2 | engineConfiguration->wwaeBeta = 0; | ||
| 166 | ||||
| 167 | 2 | engineConfiguration->isSdCardEnabled = false; | ||
| 168 | 2 | setTable(config->cltIdleCorrTable, 36.0); | ||
| 169 | ||||
| 170 | // end of setDodgeNeonNGCEngineConfiguration | |||
| 171 | 2 | } | ||
| 172 |