Remove third trigger channel (#4226)

* remove third trigger

* clean up the honda mess

* there was nothing novel about this engine config

* include

* missed a few

* s

* x

* changelog

* don't set the third trigger input

* don't redefine the same thing 3 times

* only two inputs!

* test
This commit is contained in:
Matthew Kennedy 2022-06-01 18:24:20 -07:00 committed by GitHub
parent fc3677a53f
commit 4ada633206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 33 additions and 492 deletions

View File

@ -37,6 +37,9 @@ Release template (copy/paste this for new release):
- Make 36-2 trigger sync parameters more generous #4132
- Synchronized Phase handling fixes #4099
### Removed
- Various Honda 24/4/1 trigger modes (that didn't work very well), replaced with "12 tooth crank" mode.
## April 20202 Release - "Day 58"
All notable user-facing or behavior-altering changes will be documented in this file.

View File

@ -72,7 +72,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = H144_IN_CAM;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;

View File

@ -97,7 +97,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = H144_IN_CAM;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;

View File

@ -97,7 +97,6 @@ void setBoardDefaultConfiguration() {
engineConfiguration->acSwitch = Gpio::Unassigned;
engineConfiguration->triggerInputPins[0] = Gpio::B0;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
#if 0

View File

@ -90,7 +90,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_SENS4;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
engineConfiguration->vehicleSpeedSensorInputPin = H144_IN_VSS;

View File

@ -69,7 +69,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_SENS2;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = H144_IN_SENS4;
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;

View File

@ -65,7 +65,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = H144_IN_CAM;
engineConfiguration->tps1_1AdcChannel = H144_IN_TPS;

View File

@ -65,7 +65,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = H144_IN_CAM;
// todo: remove from default since 4 cylinder does not use it

View File

@ -66,7 +66,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = Gpio::B1; // 82 - VR
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = Gpio::A6; // 86 - CAM1

View File

@ -70,7 +70,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = Gpio::B1;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = Gpio::A6;

View File

@ -61,7 +61,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = H144_IN_CAM;
engineConfiguration->camInputs[1 * CAMS_PER_BANK] = H144_IN_D_AUX4;

View File

@ -70,7 +70,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = Gpio::A6;
engineConfiguration->triggerInputPins[1] = Gpio::B1;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;

View File

@ -70,7 +70,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = Gpio::B1;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = Gpio::A6;

View File

@ -78,7 +78,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = Gpio::B1;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = Gpio::A6;

View File

@ -64,7 +64,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs
engineConfiguration->triggerInputPins[0] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = H144_IN_CAM;

View File

@ -65,7 +65,6 @@ static void setupDefaultSensorInputs() {
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = H144_IN_CAM;
engineConfiguration->triggerInputPins[1] = H144_IN_CRANK;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;

View File

@ -65,7 +65,6 @@ void setBoardOverrides() {
engineConfiguration->triggerInputPins[0] = Gpio::E7;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->tle6240spiDevice = SPI_DEVICE_1;
engineConfiguration->tle6240_cs = Gpio::B0;

View File

@ -121,7 +121,6 @@ static void setupDefaultSensorInputs() {
// tle8888 VR conditioner
engineConfiguration->triggerInputPins[0] = Gpio::C6;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
// Direct hall-only cam input
engineConfiguration->camInputs[0] = Gpio::A5;

View File

@ -164,7 +164,6 @@ void setBoardDefaultConfiguration() {
engineConfiguration->triggerInputPins[0] = Gpio::A5;
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->camInputs[0] = is469 ? Gpio::E9 : Gpio::A6;
engineConfiguration->tachOutputPin = Gpio::C8;

View File

@ -116,7 +116,6 @@ static void setupDefaultSensorInputs() {
#endif
engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
engineConfiguration->triggerInputPins[2] = Gpio::Unassigned;
engineConfiguration->clt.adcChannel = PROTEUS_IN_CLT;

View File

@ -109,7 +109,6 @@ void setBoardDefaultConfiguration() {
* camshaft is always trigger#1 input and then crankshaft is trigger#2. */
engineConfiguration->triggerInputPins[0] = Gpio::H12; /* cam */
engineConfiguration->triggerInputPins[1] = Gpio::H10; /* crank pos #1 */
engineConfiguration->triggerInputPins[2] = Gpio::E9; /* crank pos #2 */
engineConfiguration->camInputs[0] = Gpio::Unassigned;
/* SPI devices: mess of board and engine configurations */

View File

@ -18,7 +18,6 @@ ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
$(PROJECT_DIR)/config/engines/harley.cpp \
$(PROJECT_DIR)/config/engines/mazda_miata_nb.cpp \
$(PROJECT_DIR)/config/engines/mercedes.cpp \
$(PROJECT_DIR)/config/engines/honda_accord.cpp \
$(PROJECT_DIR)/config/engines/honda_600.cpp \
$(PROJECT_DIR)/config/engines/honda_k_dbc.cpp \
$(PROJECT_DIR)/config/engines/hyundai.cpp \

View File

@ -1,163 +0,0 @@
/**
* @file honda_accord.cpp
*
* 1993 Honda Prelude 1993
* http://rusefi.com/wiki/index.php?title=Vehicle:Honda_Prelude_1993
* http://rusefi.com/forum/viewtopic.php?f=3&t=887
*
* 1995 Honda Accord EX
* http://rusefi.com/wiki/index.php?title=Vehicle:Honda_Accord_1995
* http://rusefi.com/forum/viewtopic.php?f=3&t=621
*
* set engine_type 6
*
* set engine_type 17
* 1+24 signal, JM Predule
*
*
* set engine_type 48
* debug configuration to reproduce https://sourceforge.net/p/rusefi/tickets/319/
*
*
* set engine_type 50
* set engine_type 51
* debug configurations to reproduce https://github.com/rusefi/rusefi/issues/363
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "honda_accord.h"
#include "advance_map.h"
#include "custom_engine.h"
static void setHondaAccordConfigurationCommon() {
engineConfiguration->map.sensor.type = MT_DENSO183;
// set ignition_mode 0
engineConfiguration->ignitionMode = IM_ONE_COIL;
// set injection_mode
engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->idleMode = IM_MANUAL;
engineConfiguration->HD44780height = 4;
engineConfiguration->specs.cylindersCount = 4;
engineConfiguration->specs.displacement = 2.156;
// Keihin 06164-P0A-A00
engineConfiguration->injector.flow = 248;
setAlgorithm(LM_SPEED_DENSITY);
/**
* 18K Ohm @ -20C
* 2.1K Ohm @ 24C
* 100 Ohm @ 120C
* 1500 = same pullup as OEM ECU
*/
setCommonNTCSensor(&engineConfiguration->clt, 1500);
setCommonNTCSensor(&engineConfiguration->iat, 1500);
// set cranking_timing_angle 0
engineConfiguration->crankingTimingAngle = -45;
// set global_trigger_offset_angle 34
engineConfiguration->globalTriggerAngleOffset = 34;
// set_rpm_hard_limit 4000
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
// set_cranking_rpm 2000
engineConfiguration->cranking.rpm = 500;
/**
* ADC inputs:
*
* Inp1/ADC12 PC2: CLT
* Inp2/ADC11 PC1: AIT/IAT
* Inp3/ADC0 PA0: MAP
* Inp4/ADC13 PC3: AFR green wire
* Inp6/ADC1 PA1: TPS
* Inp12/ADC14 PC4: VBatt
*/
/**
* wideband O2 Sensor
*/
engineConfiguration->afr.hwChannel = EFI_ADC_13;
/**
* VBatt
*/
engineConfiguration->vbattAdcChannel = EFI_ADC_14;
engineConfiguration->vbattDividerCoeff = ((float) (10 + 39)) / 10 * 2;
// todo engineConfiguration->afr.hwChannel = 14;
/**
* MAP D17/W5 blue wire
*/
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
/**
* IAT D15/W7 green wire
*/
engineConfiguration->iat.adcChannel = EFI_ADC_11;
/**
* CLT D13/W9 yellow wire
*/
engineConfiguration->clt.adcChannel = EFI_ADC_12;
/**
* TPS D11/W11 blue wire
*/
engineConfiguration->tps1_1AdcChannel = EFI_ADC_1;
/**
* Outputs
*/
// Frankenso low out #1: PE6
// Frankenso low out #2: PE5
// Frankenso low out #3: PD7
// Frankenso low out #4: PC13
// Frankenso low out #5: PE3 Fuel Relay
// Frankenso low out #6: PE4 radiator fan - blue wire
// Frankenso low out #7: PD3 idle air valve solenoid - green wire
// Frankenso low out #8: PE2 MIL - white wire
// Frankenso low out #9: PB9 Injector #2
// Frankenso low out #10: PD5 Injector #3
// Frankenso low out #11: PB8 injector #1
// Frankenso low out #12: PB7 injector #4
engineConfiguration->fuelPumpPin = Gpio::E3;
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
engineConfiguration->malfunctionIndicatorPin = Gpio::E2;
engineConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
engineConfiguration->fanPin = Gpio::E4; // blue wire
engineConfiguration->idle.solenoidPin = Gpio::D3; // green wire
engineConfiguration->injectionPins[0] = Gpio::B8;
engineConfiguration->injectionPins[1] = Gpio::B9;
engineConfiguration->injectionPins[2] = Gpio::D5;
engineConfiguration->injectionPins[3] = Gpio::B7;
engineConfiguration->ignitionPins[0] = Gpio::E12; // white wire
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
engineConfiguration->ignitionPins[2] = Gpio::Unassigned;
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
setFrankenso_01_LCD(engineConfiguration);
setFrankenso0_1_joystick(engineConfiguration);
engineConfiguration->idle.solenoidFrequency = 500;
}
void setHondaAccordConfiguration1_24() {
engineConfiguration->trigger.type = TT_HONDA_1_24;
setHondaAccordConfigurationCommon();
}

View File

@ -1,21 +0,0 @@
/**
* @file honda_accord.h
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
#include "engine_configuration.h"
void setHondaAccordConfigurationTwoWires();
/**
* https://technet.ff-squad.com/wiring.obd1.htm
*
* as you move inward from the outside of the connector, tooth count decreases
* outermost CKP = 12/24
* middle = 4 total, 1/cyl
* inner CID cylinder ID = 1 total, 1/cam
*/
void setHondaAccordConfiguration1_24();

View File

@ -148,15 +148,6 @@ void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp) {
case SHAFT_SECONDARY_RISING:
currentTrigger2 = true;
break;
// major hack to get most value of limited logic data write
#if EFI_UNIT_TEST
case SHAFT_3RD_FALLING:
currentCoilState = false;
break;
case SHAFT_3RD_RISING:
currentCoilState = true;
break;
#endif
default:
break;
}

View File

@ -857,7 +857,6 @@ void updateTunerStudioState() {
break;
}
case DBG_TRIGGER_COUNTERS:
// no one uses shaft so far tsOutputChannels->debugIntField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_FALLING);
#if EFI_PROD_CODE && HAL_USE_ICU == TRUE
tsOutputChannels->debugFloatField3 = icuRisingCallbackCounter + icuFallingCallbackCounter;
#endif /* EFI_PROD_CODE */
@ -867,8 +866,6 @@ void updateTunerStudioState() {
tsOutputChannels->debugIntField5 = engine->triggerCentral.triggerState.currentCycle.eventCount[1];
#endif // EFI_SHAFT_POSITION_INPUT
// debugFloatField6 used
// no one uses shaft so far tsOutputChannels->debugFloatField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_RISING);
break;
#if EFI_HIP_9011_DEBUG
case DBG_KNOCK:

View File

@ -49,7 +49,6 @@
#include "ford_aspire.h"
#include "ford_1995_inline_6.h"
#include "honda_accord.h"
#include "honda_k_dbc.h"
#include "honda_600.h"
#include "hyundai.h"
@ -1048,9 +1047,6 @@ void resetConfigurationExt(configuration_callback_t boardCallback, engine_type_e
case FRANKENSO_MAZDA_MIATA_NA8:
setMazdaMiataNA8Configuration();
break;
case HONDA_ACCORD_CD_TWO_WIRES:
setHondaAccordConfiguration1_24();
break;
case MITSU_4G93:
setMitsubishiConfiguration();
break;

View File

@ -61,11 +61,6 @@ typedef enum __attribute__ ((__packed__)) {
MITSU_4G93 = 16,
/**
* a version of HONDA_ACCORD_CD which only uses two of three trigger input sensors
*/
HONDA_ACCORD_CD_TWO_WIRES = 17,
TEST_33816 = 18,
@ -221,6 +216,7 @@ typedef enum __attribute__ ((__packed__)) {
ET_UNUSED96 = 96,
ET_UNUSED97 = 97,
ET_UNUSED98 = 98,
ET_UNUSED_17 = 17,
/**
* this configuration has as few pins configured as possible
@ -341,11 +337,6 @@ typedef enum {
// todo: this really looks to be same as Miata_NA shall we remove?
TT_MITSUBISHI = 11,
// this makes sense because mechanical spark distribution does not require synchronization
TT_HONDA_4_24 = 12,
TT_HONDA_1_4_24 = 13,
// cam-based
TT_DODGE_NEON_2003_CAM = 14,
@ -368,8 +359,6 @@ typedef enum {
*/
TT_60_2_VW = 20,
TT_HONDA_1_24 = 21,
TT_DODGE_STRATUS = 22,
/**
@ -407,12 +396,6 @@ typedef enum {
*/
TT_MIATA_VVT = 33,
/**
* This is a different version of TT_HONDA_ACCORD_1_24
* See https://sourceforge.net/p/rusefi/tickets/319/
*/
TT_HONDA_ACCORD_1_24_SHIFTED = 34,
/**
* a version of NB1 with shifted CAM, useful for VVT testing & development
*/
@ -519,6 +502,11 @@ typedef enum {
// GM 24x with 3/12 degree gaps
TT_GM_24x_2 = 74,
UNUSED_12 = 12,
UNUSED_13 = 13,
UNUSED_21 = 21,
UNUSED_34 = 34,
// do not forget to edit "#define trigger_type_e_enum" line in integration/rusefi_config.txt file to propogate new value to rusefi.ini TS project
// do not forget to invoke "gen_config.bat" once you make changes to integration/rusefi_config.txt
// todo: one day a hero would integrate some of these things into Makefile in order to reduce manual magic

View File

@ -53,8 +53,6 @@ typedef enum {
typedef enum {
T_PRIMARY = 0,
T_SECONDARY = 1,
// todo: I really do not want to call this 'tertiary'. maybe we should rename all of these?
T_CHANNEL_3 = 2,
T_NONE = 15
} trigger_wheel_e;
@ -64,8 +62,6 @@ typedef enum {
SHAFT_PRIMARY_RISING = 1,
SHAFT_SECONDARY_FALLING = 2,
SHAFT_SECONDARY_RISING = 3,
SHAFT_3RD_FALLING = 4,
SHAFT_3RD_RISING = 5,
} trigger_event_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -24,7 +24,7 @@
// todo https://github.com/rusefi/rusefi/issues/3003
#define PWM_PHASE_MAX_COUNT 280
#endif /* PWM_PHASE_MAX_COUNT */
#define PWM_PHASE_MAX_WAVE_PER_PWM 3
#define PWM_PHASE_MAX_WAVE_PER_PWM 2
typedef trigger_value_e pin_state_t;

View File

@ -10,163 +10,6 @@
#include "trigger_honda.h"
#include "trigger_universal.h"
#define S24 (720.0f / 24 / 2)
static float addAccordPair(TriggerWaveform *s, float sb, trigger_wheel_e const channelIndex) {
s->addEvent720(sb, channelIndex, TV_RISE);
sb += S24;
s->addEvent720(sb, channelIndex, TV_FALL);
sb += S24;
return sb;
}
#define DIP 7.5f
static float addAccordPair3(TriggerWaveform *s, float sb) {
sb += DIP;
s->addEvent720(sb, T_CHANNEL_3, TV_RISE);
sb += DIP;
s->addEvent720(sb, T_CHANNEL_3, TV_FALL);
sb += 2 * DIP;
return sb;
}
/**
* Thank you Dip!
* http://forum.pgmfi.org/viewtopic.php?f=2&t=15570start=210#p139007
*/
void configureHondaAccordCDDip(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
s->initialState[T_SECONDARY] = TV_RISE;
float sb = 0;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(90, T_SECONDARY, TV_FALL);
sb = 90;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(180, T_SECONDARY, TV_RISE);
sb = 180;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(270, T_SECONDARY, TV_FALL);
sb = 270;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(360.0f - DIP, T_PRIMARY, TV_RISE);
s->addEvent720(360, T_SECONDARY, TV_RISE);
sb = 360;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(450, T_SECONDARY, TV_FALL);
sb = 450;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(540, T_SECONDARY, TV_RISE);
sb = 540;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(630, T_SECONDARY, TV_FALL);
sb = 630;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent720(720.0f - DIP, T_PRIMARY, TV_FALL);
// s->addEvent720(720.0f - 12 * sb, T_SECONDARY, TV_FALL);
// s->addEvent720(720.0f, T_SECONDARY, TV_FALL);
s->addEvent720(720.0f, T_SECONDARY, TV_RISE);
s->isSynchronizationNeeded = false;
}
/**
* '1' is conditional
* '4' is conditional
* '24' is always secondary channel
*/
void configureHonda_1_4_24(TriggerWaveform *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float prefix) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
float sb = 5.0f + prefix;
float tdcWidth = 0.1854 * 720 / 4;
s->isSynchronizationNeeded = false;
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent720(sb - S24 / 2, oneEventWave, TV_RISE);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent720(sb - S24 / 2, oneEventWave, TV_FALL);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(1 * 180.0f + prefix, fourEventWave, TV_FALL);
}
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb,T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(2 * 180.0f + prefix, fourEventWave, TV_FALL);
}
for (int i = 3; i <= 4; i++) {
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent720(i * 180.0f + prefix, fourEventWave, TV_FALL);
}
}
s->useOnlyPrimaryForSync = true;
}
void configureHondaCbr600(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
s->useOnlyPrimaryForSync = true;
@ -208,35 +51,6 @@ void configureHondaCbr600(TriggerWaveform *s) {
s->addEvent720(720.0f, T_PRIMARY, TV_RISE);
}
void configureHondaAccordShifted(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
float sb = S24;
// like this there is no issue
// s->addEvent720(S24 + 0.001, T_PRIMARY, TV_RISE);
// s->addEvent720(S24 + 0.1, T_SECONDARY, TV_RISE);
s->addEvent720(S24 + 0.001, T_SECONDARY, TV_RISE);
s->addEvent720(S24 + 0.1, T_PRIMARY, TV_RISE);
sb += S24;
s->addEvent720(sb, T_SECONDARY, TV_FALL);
sb += S24;
s->addEvent720(S24 + 22, T_PRIMARY, TV_FALL);
for (int i = 0;i<23;i++) {
sb = addAccordPair(s, sb, T_SECONDARY);
}
s->isSynchronizationNeeded = false;
}
void configureOnePlus16(TriggerWaveform *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR);
@ -307,5 +121,4 @@ void configureHondaK_4_1(TriggerWaveform *s) {
s->addEvent360(353, T_PRIMARY, TV_RISE);
s->addEvent360(360, T_PRIMARY, TV_FALL);
}

View File

@ -9,14 +9,6 @@
class TriggerWaveform;
void configureHondaAccordCDDip(TriggerWaveform *s);
void configureHondaAccordShifted(TriggerWaveform *s);
void configureHonda_1_4_24(TriggerWaveform *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float d);
void configureOnePlus16(TriggerWaveform *s);
void configureHondaCbr600(TriggerWaveform *s);

View File

@ -77,7 +77,7 @@ void TriggerWaveform::initialize(operation_mode_e operationMode) {
memset(initialState, 0, sizeof(initialState));
memset(expectedEventCount, 0, sizeof(expectedEventCount));
wave.reset();
wave.waveCount = TRIGGER_CHANNEL_COUNT;
wave.waveCount = TRIGGER_INPUT_PIN_COUNT;
wave.phaseCount = 0;
previousAngle = 0;
memset(isRiseEvent, 0, sizeof(isRiseEvent));
@ -668,23 +668,10 @@ void TriggerWaveform::initializeTriggerWaveform(operation_mode_e triggerOperatio
configureHondaK_12_1(this);
break;
case TT_HONDA_4_24:
configureHonda_1_4_24(this, false, true, T_NONE, T_PRIMARY, 0);
shapeWithoutTdc = true;
break;
case TT_HONDA_1_24:
configureHonda_1_4_24(this, true, false, T_PRIMARY, T_NONE, 10);
break;
case TT_HONDA_ACCORD_1_24_SHIFTED:
configureHondaAccordShifted(this);
break;
case TT_HONDA_1_4_24:
configureHondaAccordCDDip(this);
break;
case UNUSED_12:
case UNUSED_13:
case UNUSED_21:
case UNUSED_34:
case TT_1_16:
configureOnePlus16(this);
break;

View File

@ -58,8 +58,6 @@ public:
void setAngle(angle_t angle);
};
#define TRIGGER_CHANNEL_COUNT 3
class Engine;
class TriggerDecoderBase;
class TriggerFormDetails;

View File

@ -266,13 +266,7 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index) {
#if EFI_TOOTH_LOGGER
// todo: we need to start logging different VVT channels differently!!!
trigger_event_e tooth;
if (index == 0) {
tooth = front == TV_RISE ? SHAFT_SECONDARY_RISING : SHAFT_SECONDARY_FALLING;
} else {
// todo: nicer solution is needed
tooth = front == TV_RISE ? SHAFT_3RD_RISING : SHAFT_3RD_FALLING;
}
trigger_event_e tooth = front == TV_RISE ? SHAFT_SECONDARY_RISING : SHAFT_SECONDARY_FALLING;
LogTriggerTooth(tooth, nowNt);
#endif /* EFI_TOOTH_LOGGER */
@ -544,9 +538,8 @@ bool TriggerNoiseFilter::noiseFilter(efitick_t nowNt,
TriggerDecoderBase * triggerState,
trigger_event_e signal) {
// todo: find a better place for these defs
static const trigger_event_e opposite[6] = { SHAFT_PRIMARY_RISING, SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_RISING, SHAFT_SECONDARY_FALLING,
SHAFT_3RD_RISING, SHAFT_3RD_FALLING };
static const trigger_wheel_e triggerIdx[6] = { T_PRIMARY, T_PRIMARY, T_SECONDARY, T_SECONDARY, T_CHANNEL_3, T_CHANNEL_3 };
static const trigger_event_e opposite[4] = { SHAFT_PRIMARY_RISING, SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_RISING, SHAFT_SECONDARY_FALLING };
static const trigger_wheel_e triggerIdx[4] = { T_PRIMARY, T_PRIMARY, T_SECONDARY, T_SECONDARY };
// we process all trigger channels independently
trigger_wheel_e ti = triggerIdx[signal];
// falling is opposite to rising, and vise versa

View File

@ -334,8 +334,8 @@ bool TriggerDecoderBase::isValidIndex(const TriggerWaveform& triggerShape) const
return currentCycle.current_index < triggerShape.getSize();
}
static trigger_wheel_e eventIndex[6] = { T_PRIMARY, T_PRIMARY, T_SECONDARY, T_SECONDARY, T_CHANNEL_3, T_CHANNEL_3 };
static trigger_value_e eventType[6] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE, TV_FALL, TV_RISE };
static trigger_wheel_e eventIndex[4] = { T_PRIMARY, T_PRIMARY, T_SECONDARY, T_SECONDARY };
static trigger_value_e eventType[4] = { TV_FALL, TV_RISE, TV_FALL, TV_RISE };
#if EFI_UNIT_TEST
#define PRINT_INC_INDEX if (printTriggerTrace) {\
@ -478,7 +478,7 @@ expected<TriggerDecodeResult> TriggerDecoderBase::decodeTriggerEvent(
bool useOnlyRisingEdgeForTrigger = triggerConfiguration.UseOnlyRisingEdgeForTrigger;
efiAssert(CUSTOM_TRIGGER_UNEXPECTED, signal <= SHAFT_3RD_RISING, "unexpected signal", unexpected);
efiAssert(CUSTOM_TRIGGER_UNEXPECTED, signal <= SHAFT_SECONDARY_RISING, "unexpected signal", unexpected);
trigger_wheel_e triggerWheel = eventIndex[signal];
trigger_value_e type = eventType[signal];

View File

@ -70,9 +70,8 @@ void TriggerStimulatorHelper::feedSimulatedEvent(
// todo: code duplication with TriggerEmulatorHelper::handleEmulatorCallback?
constexpr trigger_event_e riseEvents[] = { SHAFT_PRIMARY_RISING, SHAFT_SECONDARY_RISING, SHAFT_3RD_RISING };
constexpr trigger_event_e fallEvents[] = { SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_FALLING, SHAFT_3RD_FALLING };
constexpr trigger_event_e riseEvents[] = { SHAFT_PRIMARY_RISING, SHAFT_SECONDARY_RISING };
constexpr trigger_event_e fallEvents[] = { SHAFT_PRIMARY_FALLING, SHAFT_SECONDARY_FALLING };
for (size_t i = 0; i < PWM_PHASE_MAX_WAVE_PER_PWM; i++) {
if (needEvent(stateIndex, multiChannelStateSequence, i)) {
@ -88,7 +87,6 @@ void TriggerStimulatorHelper::feedSimulatedEvent(
}
}
}
}
void TriggerStimulatorHelper::assertSyncPosition(

View File

@ -71,7 +71,7 @@ enum triggerType {
TRIGGER_ADC,
};
static triggerType shaftTriggerType[TRIGGER_SUPPORTED_CHANNELS];
static triggerType shaftTriggerType[TRIGGER_INPUT_PIN_COUNT];
static triggerType camTriggerType[CAM_INPUTS_COUNT];
static int turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft) {
@ -169,7 +169,7 @@ static void turnOffTriggerInputPin(int index, bool isTriggerShaft) {
/*==========================================================================*/
void stopTriggerInputPins() {
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
if (isConfigurationChanged(triggerInputPins[i])) {
turnOffTriggerInputPin(i, true);
}
@ -184,7 +184,7 @@ void stopTriggerInputPins() {
static const char* const camNames[] = { "cam1", "cam2", "cam3", "cam4"};
void startTriggerInputPins() {
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
if (isConfigurationChanged(triggerInputPins[i])) {
const char * msg = (i == 0 ? "Trigger #1" : (i == 1 ? "Trigger #2" : "Trigger #3"));
turnOnTriggerInputPin(msg, i, true);

View File

@ -11,8 +11,6 @@
#include "trigger_structure.h"
#include "trigger_central.h"
#define TRIGGER_SUPPORTED_CHANNELS 2
void turnOnTriggerInputPins();
void applyNewTriggerInputPins();
void startTriggerInputPins();

View File

@ -151,7 +151,7 @@ void stopTriggerInputPins(void) {
compDisable(EFI_COMP_PRIMARY_DEVICE);
isCompEnabled = false;
#if 0
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
if (isConfigurationChanged(bc.triggerInputPins[i])) {
turnOffTriggerInputPin(activeConfiguration.bc.triggerInputPins[i]);
}

View File

@ -21,7 +21,7 @@
#error "PAL_USE_CALLBACKS should be enabled to use HAL_TRIGGER_USE_PAL"
#endif
static ioline_t shaftLines[TRIGGER_SUPPORTED_CHANNELS];
static ioline_t shaftLines[TRIGGER_INPUT_PIN_COUNT];
static ioline_t camLines[CAM_INPUTS_COUNT];
static void shaft_callback(void *arg, efitick_t stamp) {

View File

@ -191,7 +191,7 @@ struct_no_prefix engine_configuration_s
#define DIGIPOT_COUNT 4
#define HW_MAX_ADC_INDEX 17
#define TRIGGER_SIMULATOR_PIN_COUNT 3
#define TRIGGER_INPUT_PIN_COUNT 3
#define TRIGGER_INPUT_PIN_COUNT 2
#define LOGIC_ANALYZER_CHANNEL_COUNT 4
#define SCRIPT_SETTING_COUNT 8
@ -582,7 +582,7 @@ adc_channel_e fuelLevelSensor;+This is the processor pin that your fuel level se
struct trigger_config_s @brief Trigger wheel(s) configuration
#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "INVALID", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi 4G93", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM 24x 5 degree", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata NB", "INVALID", "INVALID", "Subaru 7+6", "Jeep 18-2-2-2", "12 tooth crank", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "INVALID", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "INVALID", "36/2", "Subaru SVX", "1+16", "Subaru 7 without 6", "INVALID", "TriTach", "GM 60/2/2/2", "Skoda Favorit", "Barra 3+1 Cam", "Kawa KX450F", "Nissan VQ35", "INVALID", "Nissan VQ30", "Nissan QR25", "Mitsubishi 3A92", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "32/2", "36-2-1", "36-2-1-1", "INVALID", "INVALID", "GM 24x 3 degree", "trg75"
#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "INVALID", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Mercedes Two Segment", "Mitsubishi 4G93", "INVALID", "INVALID", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "INVALID", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM 24x 5 degree", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped", "Dodge Neon 2003 crank", "Miata NB", "INVALID", "INVALID", "Subaru 7+6", "Jeep 18-2-2-2", "12 tooth crank", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "INVALID", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "INVALID", "36/2", "Subaru SVX", "1+16", "Subaru 7 without 6", "INVALID", "TriTach", "GM 60/2/2/2", "Skoda Favorit", "Barra 3+1 Cam", "Kawa KX450F", "Nissan VQ35", "INVALID", "Nissan VQ30", "Nissan QR25", "Mitsubishi 3A92", "Subaru SVX Crank 1", "Subaru SVX Cam VVT", "Ford PIP", "Suzuki G13B", "Honda K 4+1", "Nissan MR18 Crank", "32/2", "36-2-1", "36-2-1-1", "INVALID", "INVALID", "GM 24x 3 degree", "trg75"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:6], @@trigger_type_e_enum@@
trigger_type_e type;+https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers\nset trigger_type X
@ -712,6 +712,7 @@ custom adc_channel_mode_e 1 bits, U08, @OFFSET@, [0:1], "Off", "Slow", "Fast"
float idle_antiwindupFreq;+0.1 is a good default value;"x", 1, 0, -1000000, 1000000, 4
brain_input_pin_e[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputPins;
uint16_t unused688
pin_output_mode_e hip9011CsPinMode;
output_pin_e tachOutputPin;
pin_output_mode_e tachOutputPinMode;
@ -1118,6 +1119,7 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@
pid_s alternatorControl;
pid_s etb;
Gpio[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputDebugPins;
uint16_t unused1452
brain_input_pin_e turboSpeedSensorInputPin;
int16_t tps2Min;Closed throttle#2. todo: extract these two fields into a structure\nSee also tps2_1AdcChannel\nset tps2_min X;"ADC", 1, 0, 0, 1023, 0
int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\nSee also tps1_1AdcChannel\nset tps2_max X;"ADC", 1, 0, 0, 1023, 0

View File

@ -17,16 +17,13 @@ import java.util.TreeMap;
public class AverageAngles {
static String PRIMARY = "T_PRIMARY";
static String SECONDARY = "T_SECONDARY";
static String T_CHANNEL_3 = "T_CHANNEL_3";
private int count;
enum trigger_event_e {
SHAFT_PRIMARY_FALLING(PRIMARY),
SHAFT_PRIMARY_RISING(PRIMARY),
SHAFT_SECONDARY_FALLING(SECONDARY),
SHAFT_SECONDARY_RISING(SECONDARY),
SHAFT_3RD_FALLING(T_CHANNEL_3),
SHAFT_3RD_RISING(T_CHANNEL_3);
SHAFT_SECONDARY_RISING(SECONDARY);
private String channel;

View File

@ -57,8 +57,6 @@ public class TriggerImage {
return "Subaru SVX";
case TT_HONDA_K_12_1:
return "Honda K 1/12";
case TT_HONDA_1_24:
return "Honda 1+24";
case TT_SUBARU_7_6:
return "Subaru 7/6";
case TT_GM_24x:

View File

@ -456,7 +456,6 @@ TEST(trigger, testTriggerDecoder) {
testTriggerDecoder2("test1+1", DEFAULT_FRANKENSO, 0, 0.7500, 0.2500);
testTriggerDecoder2("testCitroen", CITROEN_TU3JP, 0, 0.4833, 0);
testTriggerDecoder2("testAccordCd 2w", HONDA_ACCORD_CD_TWO_WIRES, 2, 0.9167, 0.5);
testTriggerDecoder2("testMitsu", MITSU_4G93, 0, 0.3553, 0.3752);
{