2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file dodge_neon.cpp
|
|
|
|
*
|
|
|
|
* DODGE_NEON_1995 = 2
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 2
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* DODGE_NEON_2003 = 23
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 23
|
2015-12-26 12:01:49 -08:00
|
|
|
* http://rusefi.com/wiki/index.php?title=Vehicle:Dodge_Neon_2003
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* @date Dec 16, 2013
|
2020-01-13 18:57:43 -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 "dodge_neon.h"
|
|
|
|
|
2016-04-03 16:01:59 -07:00
|
|
|
#include "custom_engine.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setDodgeNeon1995EngineConfiguration() {
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->trigger.type = TT_DODGE_NEON_1995;
|
|
|
|
|
2020-11-27 12:44:31 -08:00
|
|
|
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-08-04 21:02:47 -07:00
|
|
|
// engineConfiguration->spi2SckMode = PAL_STM32_OTYPE_OPENDRAIN; // 4
|
|
|
|
// engineConfiguration->spi2MosiMode = PAL_STM32_OTYPE_OPENDRAIN; // 4
|
|
|
|
// engineConfiguration->spi2MisoMode = PAL_STM32_PUDR_PULLUP; // 32
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
// engineConfiguration->spi2mosiPin = Gpio::B15;
|
|
|
|
// engineConfiguration->spi2misoPin = Gpio::B14;
|
|
|
|
// engineConfiguration->spi2sckPin = Gpio::B13;
|
|
|
|
engineConfiguration->cj125CsPin = Gpio::B0; // rev 0.4
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->isCJ125Enabled = true;
|
|
|
|
engineConfiguration->is_enabled_spi_2 = true;
|
2016-08-01 19:04:24 -07:00
|
|
|
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
// set_rpm_hard_limit 4000
|
|
|
|
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
|
|
|
|
|
|
|
|
/**
|
|
|
|
* that's 1995 config
|
|
|
|
*/
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
setWholeTimingTable_d(12);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_injection_mode 0
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
2017-01-06 06:03:33 -08:00
|
|
|
// set injection_mode 1
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
|
2016-09-14 18:03:26 -07:00
|
|
|
// this is needed for injector lag auto-tune research if switching to batch
|
|
|
|
// enable two_wire_batch_injection
|
|
|
|
engineConfiguration->twoWireBatchInjection = true;
|
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set ignition_mode 2
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
// set_firing_order 2
|
2016-07-20 16:04:27 -07:00
|
|
|
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set global_trigger_offset_angle 497
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->globalTriggerAngleOffset = 497;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* that's 1995 config
|
|
|
|
*/
|
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_timing_angle 0
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->crankingTimingAngle = 0;
|
|
|
|
|
|
|
|
// Frankenstein: low side - out #1: PC14
|
|
|
|
// Frankenstein: low side - out #2: PC15
|
|
|
|
// Frankenstein: low side - out #3: PE6
|
|
|
|
// Frankenstein: low side - out #4: PC13
|
|
|
|
// Frankenstein: low side - out #5: PE4
|
|
|
|
// Frankenstein: low side - out #6: PE5
|
|
|
|
// Frankenstein: low side - out #7: PE2
|
|
|
|
// Frankenstein: low side - out #8: PE3
|
|
|
|
// Frankenstein: low side - out #9: PE0
|
|
|
|
// Frankenstein: low side - out #10: PE1
|
|
|
|
// Frankenstein: low side - out #11: PB8
|
|
|
|
// Frankenstein: low side - out #12: PB9
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->injectionPins[0] = Gpio::B9; // Frankenstein: low side - out #12
|
|
|
|
engineConfiguration->injectionPins[1] = Gpio::B8; // Frankenstein: low side - out #11
|
|
|
|
engineConfiguration->injectionPins[2] = Gpio::E3; // Frankenstein: low side - out #8
|
|
|
|
engineConfiguration->injectionPins[3] = Gpio::E5; // Frankenstein: low side - out #6
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->fuelPumpPin = Gpio::C13; // Frankenstein: low side - out #4
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-01-08 08:01:40 -08:00
|
|
|
engineConfiguration->mapErrorDetectionTooHigh = 120;
|
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set injection_pin_mode 0
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->injectionPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
// Frankenstein: high side #1: PE8
|
|
|
|
// Frankenstein: high side #2: PE10
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->ignitionPins[0] = Gpio::E8; // Frankenstein: high side #1
|
|
|
|
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
|
|
|
engineConfiguration->ignitionPins[2] = Gpio::E10; // // Frankenstein: high side #2
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set ignition_pin_mode 0
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->ignitionPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-10-02 18:00:10 -07:00
|
|
|
engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700};
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void setDodgeNeonNGCEngineConfiguration() {
|
2016-09-21 09:03:07 -07:00
|
|
|
engineConfiguration->trigger.type = TT_DODGE_NEON_2003_CAM;
|
2023-02-10 16:09:39 -08:00
|
|
|
setFrankenso_01_LCD();
|
|
|
|
setFrankenso0_1_joystick();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set global_trigger_offset_angle 38
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->globalTriggerAngleOffset = 38;
|
|
|
|
|
|
|
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
engineConfiguration->specs.displacement = 1.996;
|
|
|
|
engineConfiguration->specs.cylindersCount = 4;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 77C
|
|
|
|
* 1200 rpm
|
|
|
|
* fuel 3
|
|
|
|
*
|
|
|
|
* 88C
|
|
|
|
* fuel 2.8
|
|
|
|
*
|
|
|
|
*/
|
2021-11-16 01:15:29 -08:00
|
|
|
//setWholeTimingTable_d(12);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2016-01-31 19:02:01 -08:00
|
|
|
//setMap(config->veTable, 50);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_timing_angle 710
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->crankingTimingAngle = -710;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* bosch 4G1139
|
|
|
|
* http://forum.2gn.org/viewtopic.php?t=21657
|
2016-01-22 07:01:37 -08:00
|
|
|
* or is it 225 as mentioned at http://turbobazar.ru/showpost.php?p=750815&postcount=796 ?
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
engineConfiguration->injector.flow = 199;
|
|
|
|
|
2019-11-22 20:27:24 -08:00
|
|
|
setLinearCurve(config->ignitionLoadBins, 20, 120, 1);
|
2016-01-21 13:01:34 -08:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
setAlgorithm(LM_SPEED_DENSITY);
|
2016-01-21 13:01:34 -08:00
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
setFuelTablesLoadBin(20, 120);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->malfunctionIndicatorPin = Gpio::Unassigned;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* PA4 Wideband O2 Sensor
|
|
|
|
*/
|
|
|
|
engineConfiguration->afr.hwChannel = EFI_ADC_4;
|
|
|
|
|
2023-02-10 16:09:39 -08:00
|
|
|
commonFrankensoAnalogInputs();
|
2016-03-07 19:03:19 -08:00
|
|
|
engineConfiguration->vbattDividerCoeff = 9.75;// ((float) (8.2 + 33)) / 8.2 * 2;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board
|
|
|
|
*/
|
|
|
|
// Frankenso low out #1: PE6 main relay
|
2016-07-02 15:02:12 -07:00
|
|
|
// Frankenso low out #2: PE5
|
2015-07-10 06:01:56 -07:00
|
|
|
// Frankenso low out #3: PD7 coolant fan relay
|
|
|
|
// Frankenso low out #4: PC13 idle valve solenoid
|
|
|
|
// Frankenso low out #5: PE3 fuel pump relay
|
|
|
|
// Frankenso low out #6: PE4
|
|
|
|
// Frankenso low out #7: PE1 (do not use with discovery!)
|
|
|
|
// Frankenso low out #8: PE2 injector #3
|
|
|
|
// Frankenso low out #9: PB9 injector #2
|
|
|
|
// Frankenso low out #10: PE0 (do not use with discovery!)
|
|
|
|
// Frankenso low out #11: PB8 injector #1
|
|
|
|
// Frankenso low out #12: PB7 injector #4
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->fanPin = Gpio::D7;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->injectionPins[0] = Gpio::B8;
|
|
|
|
engineConfiguration->injectionPins[1] = Gpio::B9;
|
|
|
|
engineConfiguration->injectionPins[2] = Gpio::E2;
|
|
|
|
engineConfiguration->injectionPins[3] = Gpio::B7;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->ignitionPins[0] = Gpio::C9;
|
|
|
|
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
|
|
|
engineConfiguration->ignitionPins[2] = Gpio::E8;
|
|
|
|
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->mainRelayPin = Gpio::E6;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->idle.solenoidPin = Gpio::C13;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->idle.solenoidFrequency = 300;
|
|
|
|
engineConfiguration->manIdlePosition = 36;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->fuelPumpPin = Gpio::E3;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->triggerInputPins[0] = Gpio::A5;
|
|
|
|
engineConfiguration->triggerInputPins[1] = Gpio::C6;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Frankenso analog #1 PC2 ADC12 CLT
|
|
|
|
* Frankenso analog #2 PC1 ADC11 IAT
|
|
|
|
* Frankenso analog #3 PA0 ADC0 MAP
|
|
|
|
* Frankenso analog #4 PC3 ADC13
|
|
|
|
* Frankenso analog #5 PA2 ADC2 TPS
|
|
|
|
* Frankenso analog #6 PA1 ADC1
|
|
|
|
* Frankenso analog #7 PA4 ADC4 WBO AFR
|
|
|
|
* Frankenso analog #8 PA3 ADC3
|
|
|
|
* Frankenso analog #9 PA7 ADC7
|
|
|
|
* Frankenso analog #10 PA6 ADC6
|
|
|
|
* Frankenso analog #11 PC5 ADC15
|
|
|
|
* Frankenso analog #12 PC4 ADC14 VBatt
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2019-10-02 18:00:10 -07:00
|
|
|
setDodgeSensor(&engineConfiguration->clt, 10000);
|
|
|
|
setDodgeSensor(&engineConfiguration->iat, 10000);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MAP PA0
|
|
|
|
*/
|
|
|
|
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0; // PA0
|
|
|
|
|
|
|
|
// rev 0.1 green board
|
|
|
|
// engineConfiguration->map.sensor.hwChannel = EFI_ADC_6; // PA6
|
2019-06-30 11:28:47 -07:00
|
|
|
// engineConfiguration->tps1_1AdcChannel = EFI_ADC_15; // PC5
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TPS
|
|
|
|
*/
|
2019-06-30 11:28:47 -07:00
|
|
|
engineConfiguration->tps1_1AdcChannel = EFI_ADC_2;
|
2016-09-10 19:03:38 -07:00
|
|
|
engineConfiguration->tpsMax = 625; // convert 12to10 bit (ADC/4)
|
|
|
|
engineConfiguration->tpsMin = 125; // convert 12to10 bit (ADC/4)
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* IAT D15/W7
|
|
|
|
*/
|
|
|
|
engineConfiguration->iat.adcChannel = EFI_ADC_11;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CLT D13/W9
|
|
|
|
*/
|
|
|
|
engineConfiguration->clt.adcChannel = EFI_ADC_12;
|
|
|
|
|
|
|
|
engineConfiguration->map.sensor.type = MT_DODGE_NEON_2003;
|
|
|
|
|
2019-01-04 14:18:43 -08:00
|
|
|
engineConfiguration->hip9011Gain = 0.3;
|
2016-01-01 16:02:59 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->cylinderBore = 87.5;
|
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
engineConfiguration->clutchDownPin = Gpio::C12;
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->clutchDownPinMode = PI_PULLUP;
|
2022-04-28 14:32:39 -07:00
|
|
|
// engineConfiguration->clutchUpPin = Gpio::A14; // note SWCLK - conflict with SWD
|
2019-11-30 07:24:37 -08:00
|
|
|
engineConfiguration->clutchUpPinMode = PI_PULLUP;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
// engineConfiguration->vehicleSpeedSensorInputPin = Gpio::A8;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2015-12-26 20:03:07 -08:00
|
|
|
engineConfiguration->fanOnTemperature = 92;
|
|
|
|
engineConfiguration->fanOffTemperature = 89;
|
2016-02-27 10:01:45 -08:00
|
|
|
// engineConfiguration->fanOnTemperature = 115; // knock testing - value is a bit high
|
|
|
|
// engineConfiguration->fanOffTemperature = 100;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
// engineConfiguration->tunerStudioSerialSpeed = 9600;
|
|
|
|
engineConfiguration->tunerStudioSerialSpeed = 19200;
|
2021-11-16 01:15:29 -08:00
|
|
|
setAlgorithm(LM_SPEED_DENSITY);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
//temp engineConfiguration->alternatorControlPin = Gpio::D5;
|
2016-09-19 19:03:52 -07:00
|
|
|
engineConfiguration->targetVBatt = 14.0;
|
|
|
|
engineConfiguration->alternatorControl.offset = 20;
|
|
|
|
engineConfiguration->alternatorControl.pFactor = 20;
|
|
|
|
engineConfiguration->alternatorControl.iFactor = 0.2;
|
2016-02-27 10:01:45 -08:00
|
|
|
engineConfiguration->alternatorControl.dFactor = 0.1;
|
2019-02-10 19:47:49 -08:00
|
|
|
engineConfiguration->alternatorControl.periodMs = 10;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
engineConfiguration->canWriteEnabled = true;
|
|
|
|
engineConfiguration->canNbcType = CAN_BUS_NBC_BMW;
|
|
|
|
|
|
|
|
engineConfiguration->tpsAccelEnrichmentThreshold = 10;
|
|
|
|
|
2019-01-06 17:45:51 -08:00
|
|
|
engineConfiguration->wwaeTau = 1.0f;
|
|
|
|
engineConfiguration->wwaeBeta = 0.40f;
|
2015-08-23 20:02:37 -07:00
|
|
|
|
2019-01-06 17:45:51 -08:00
|
|
|
engineConfiguration->wwaeTau = 0;
|
|
|
|
engineConfiguration->wwaeBeta = 0;
|
2016-01-30 19:03:36 -08:00
|
|
|
|
2019-12-11 14:48:55 -08:00
|
|
|
engineConfiguration->isSdCardEnabled = false;
|
|
|
|
engineConfiguration->manIdlePosition = 36; // set_idle_pwm 40
|
2016-01-18 18:01:34 -08:00
|
|
|
|
2016-01-31 19:02:01 -08:00
|
|
|
engineConfiguration->slowAdcAlpha = 0.33333;
|
|
|
|
|
2016-01-21 13:01:34 -08:00
|
|
|
// end of setDodgeNeonNGCEngineConfiguration
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|