rusefi/firmware/config/engines/honda_k_dbc.cpp

115 lines
3.8 KiB
C++
Raw Normal View History

2021-10-02 10:25:40 -07:00
/*
* honda_k_dbc.cpp
*
* @date Oct 2, 2021
* @author Andrey Belomutskiy, (c) 2012-2021
*/
#include "honda_k_dbc.h"
#include "table_helper.h"
2021-10-02 10:25:40 -07:00
2021-10-12 15:24:45 -07:00
#if HW_PROTEUS & EFI_PROD_CODE
#include "proteus_meta.h"
2021-10-23 13:19:28 -07:00
#endif // HW_PROTEUS
2021-10-12 15:24:45 -07:00
2022-12-05 18:44:45 -08:00
void setHondaK() {
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 2.4;
engineConfiguration->firingOrder = FO_1_3_4_2;
2023-01-21 05:56:21 -08:00
engineConfiguration->engineSyncCam = SC_Exhaust_First;
engineConfiguration->trigger.type = trigger_type_e::TT_HONDA_K_CRANK_12_1;
2023-07-14 23:44:16 -07:00
int magic = 0; // note that offset and VVT are related
engineConfiguration->globalTriggerAngleOffset = 663 - magic;
2023-03-28 17:31:40 -07:00
// VVT is here just single tooth? and we do not even use it!?
2022-09-24 20:25:36 -07:00
engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
2023-03-28 17:31:40 -07:00
// also known as 'CAM sync'? i am pretty confused at this point
2022-09-24 21:26:42 -07:00
engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST;
2023-03-29 19:57:31 -07:00
engineConfiguration->vvtOffsets[0] = -21;
2023-07-14 23:44:16 -07:00
engineConfiguration->vvtOffsets[1] = 183 + magic;
2021-10-23 12:49:02 -07:00
2022-12-05 18:44:45 -08:00
// set cranking_fuel 15
engineConfiguration->cranking.baseFuel = 75;
2021-10-26 12:19:09 -07:00
engineConfiguration->map.sensor.type = MT_DENSO183;
2023-07-14 23:44:16 -07:00
// todo: quote some source?
2021-10-26 12:19:09 -07:00
engineConfiguration->injector.flow = 270;
2023-03-03 10:33:48 -08:00
engineConfiguration->injector.flow = 310;
2021-10-26 14:15:24 -07:00
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
engineConfiguration->fuelReferencePressure = 350; // TODO: what is real value?!
2021-10-26 12:19:09 -07:00
2023-01-21 05:24:18 -08:00
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_SEQUENTIAL;
2023-07-14 23:44:16 -07:00
engineConfiguration->crankingIACposition = 70;
static const uint16_t defaultPostCrankinDurationBins[] = {
0, 65, 100, 125, 150, 250
};
copyArray(engineConfiguration->postCrankingDurationBins, defaultPostCrankinDurationBins);
setTable(engineConfiguration->postCrankingFactor, 1.25f);
2023-07-14 23:44:16 -07:00
engineConfiguration->useRunningMathForCranking = true;
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_HONDA);
strcpy(engineConfiguration->engineCode, "K24");
2022-12-05 18:44:45 -08:00
engineConfiguration->tpsMin = 100;
engineConfiguration->tpsMax = 830;
engineConfiguration->displayLogicLevelsInEngineSniffer = true;
2021-10-23 12:49:02 -07:00
2021-11-02 14:00:08 -07:00
gppwm_channel *vtsControl = &engineConfiguration->gppwm[0];
vtsControl->pwmFrequency = 0;
strcpy(engineConfiguration->gpPwmNote[0], "VTS");
2022-12-05 18:44:45 -08:00
}
2021-11-02 14:00:08 -07:00
2022-12-05 18:44:45 -08:00
/**
* K24A4 engine
* PROTEUS_HONDA_K
*/
void setProteusHondaElement2003() {
setHondaK();
strcpy(engineConfiguration->vehicleName, "test");
gppwm_channel *vtsControl = &engineConfiguration->gppwm[0];
2021-10-29 09:16:19 -07:00
2021-10-23 12:49:02 -07:00
#if HW_PROTEUS & EFI_PROD_CODE
2021-10-26 09:04:35 -07:00
// engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_2; // crank
// engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake
// engineConfiguration->camInputs[1 * CAMS_PER_BANK] = PROTEUS_DIGITAL_1; // exhaust
engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_1; // exhaust
2021-10-29 09:16:19 -07:00
engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake
2021-11-02 14:11:34 -07:00
// inverted
// offset -41
2021-10-23 13:19:28 -07:00
engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_8;
engineConfiguration->injectionPins[1] = Gpio::PROTEUS_LS_7;
engineConfiguration->injectionPins[2] = Gpio::PROTEUS_LS_6;
engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_5;
2021-10-23 13:19:28 -07:00
vtsControl->pin = Gpio::PROTEUS_HS_1;
engineConfiguration->vvtPins[0] = Gpio::PROTEUS_HS_2;
2021-10-28 19:18:41 -07:00
engineConfiguration->malfunctionIndicatorPin = Gpio::PROTEUS_LS_10;
engineConfiguration->idle.solenoidPin = Gpio::PROTEUS_LS_15;
engineConfiguration->fanPin = Gpio::PROTEUS_LS_1;
2021-10-23 13:19:28 -07:00
2021-10-26 08:52:52 -07:00
engineConfiguration->iat.adcChannel = PROTEUS_IN_ANALOG_TEMP_1;
engineConfiguration->clt.adcChannel = PROTEUS_IN_ANALOG_TEMP_2;
engineConfiguration->tps1_1AdcChannel = PROTEUS_IN_ANALOG_VOLT_3;
engineConfiguration->map.sensor.hwChannel = PROTEUS_IN_ANALOG_VOLT_6;
engineConfiguration->fanPin = Gpio::Unassigned;
2021-10-26 08:52:52 -07:00
engineConfiguration->mainRelayPin = Gpio::PROTEUS_LS_9;
engineConfiguration->fuelPumpPin = Gpio::PROTEUS_LS_11;
2021-10-23 13:19:28 -07:00
#endif // HW_PROTEUS
2021-10-12 15:24:45 -07:00
}
void setProteusHondaOBD2A() {
2021-10-02 10:25:40 -07:00
}