auto-sync

This commit is contained in:
rusEfi 2016-05-27 22:02:56 -04:00
parent eaf28ac977
commit be1e36b223
14 changed files with 214 additions and 167 deletions

View File

@ -18,6 +18,11 @@ void setCamaro4(DECLARE_ENGINE_PARAMETER_F) {
engineConfiguration->specs.displacement = 5.7;
engineConfiguration->specs.cylindersCount = 8;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0; // PA0
engineConfiguration->mafAdcChannel = EFI_ADC_NONE;
engineConfiguration->hasMafSensor = false;
}

View File

@ -119,6 +119,8 @@ const char *getTrigger_type_e(trigger_type_e value){
switch(value) {
case Force_4b_trigger_type:
return "Force_4b_trigger_type";
case TT_HONDA_CBR_600:
return "TT_HONDA_CBR_600";
case TT_DODGE_NEON_1995:
return "TT_DODGE_NEON_1995";
case TT_GM_LS_24:

View File

@ -1,4 +1,4 @@
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon May 23 14:53:43 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri May 27 20:30:17 EDT 2016
// begin
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
#define ENGINE_CONFIGURATION_GENERATED_H_
@ -1712,4 +1712,4 @@ typedef struct {
#endif
// end
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon May 23 14:53:43 EDT 2016
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri May 27 20:30:17 EDT 2016

View File

@ -179,7 +179,9 @@ typedef enum {
TT_GM_LS_24 = 27,
TT_UNUSED = 28, // this is used if we want to iterate over all trigger types
TT_HONDA_CBR_600 = 28,
TT_UNUSED = 29, // this is used if we want to iterate over all trigger types
Force_4b_trigger_type = ENUM_32_BITS,
} trigger_type_e;

View File

@ -66,6 +66,5 @@ public:
};
void checkSwitchTimes2(int size, float *switchTimes);
void configureHondaAccordCDDip(TriggerShape *s);
#endif /* EFI_WAVE_H_ */

View File

@ -13,6 +13,7 @@ TRIGGER_DECODERS_SRC_CPP = \
$(PROJECT_DIR)/controllers/trigger/trigger_subaru.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_toyota.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_gm.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_honda.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_rover.cpp
TRIGGER_SRC_CPP = \

View File

@ -34,6 +34,7 @@
#include "trigger_nissan.h"
#include "trigger_toyota.h"
#include "trigger_rover.h"
#include "trigger_honda.h"
#include "trigger_structure.h"
#include "efiGpio.h"
#include "engine.h"
@ -504,6 +505,10 @@ void TriggerShape::initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMET
configureHondaAccordCDDip(triggerShape);
break;
case TT_HONDA_CBR_600:
configureHondaCbr600(triggerShape PASS_ENGINE_PARAMETER);
break;
case TT_MITSU:
initializeMitsubishi4g18(triggerShape);
break;

View File

@ -0,0 +1,170 @@
/*
* @file trigger_honda.cpp
*
* @date May 27, 2016
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#include "trigger_honda.h"
#define S24 (720.0f / 24 / 2)
static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const waveIndex) {
s->addEvent(sb, waveIndex, TV_RISE);
sb += S24;
s->addEvent(sb, waveIndex, TV_FALL);
sb += S24;
return sb;
}
#define DIP 7.5f
static float addAccordPair3(TriggerShape *s, float sb) {
sb += DIP;
s->addEvent(sb, T_CHANNEL_3, TV_RISE);
sb += DIP;
s->addEvent(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(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->initialState[T_SECONDARY] = TV_RISE;
float sb = 0;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(90, T_SECONDARY, TV_FALL);
sb = 90;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(180, T_SECONDARY, TV_RISE);
sb = 180;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(270, T_SECONDARY, TV_FALL);
sb = 270;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(360.0f - DIP, T_PRIMARY, TV_RISE);
s->addEvent(360, T_SECONDARY, TV_RISE);
sb = 360;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(450, T_SECONDARY, TV_FALL);
sb = 450;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(540, T_SECONDARY, TV_RISE);
sb = 540;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(630, T_SECONDARY, TV_FALL);
sb = 630;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(720.0f - DIP, T_PRIMARY, TV_FALL);
// s->addEvent(720.0f - 12 * sb, T_SECONDARY, TV_FALL);
// s->addEvent(720.0f, T_SECONDARY, TV_FALL);
s->addEvent(720.0f, T_SECONDARY, TV_RISE);
s->isSynchronizationNeeded = false;
}
void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float prefix) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
// trigger_wheel_e const oneEventWave = T_CHANNEL_3;
// bool withFourEventSignal = true;
// trigger_wheel_e const fourEventWave = T_PRIMARY;
float sb = 5.0f + prefix;
float tdcWidth = 0.1854 * 720 / 4;
s->isSynchronizationNeeded = false;
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent(sb - S24 / 2, oneEventWave, TV_RISE);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent(sb - S24 / 2, oneEventWave, TV_FALL);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(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->addEvent(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(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->addEvent(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(i * 180.0f + prefix, fourEventWave, TV_FALL);
}
}
}
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) {
// todo: finish this
setToothedWheelConfiguration(s, 24, 0, FOUR_STROKE_CRANK_SENSOR);
}

View File

@ -0,0 +1,21 @@
/*
* @file trigger_honda.h
*
* @date May 27, 2016
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#ifndef CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_
#define CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_
#include "trigger_structure.h"
void configureHondaAccordCDDip(TriggerShape *s);
void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float d);
void configureHondaCbr600(TriggerShape *s DECLARE_ENGINE_PARAMETER_S);
#endif /* CONTROLLERS_TRIGGER_TRIGGER_HONDA_H_ */

View File

@ -434,157 +434,3 @@ void TriggerShape::setThirdTriggerSynchronizationGap2(float syncRatioFrom, float
void TriggerShape::setSecondTriggerSynchronizationGap(float syncRatio) {
setSecondTriggerSynchronizationGap2(syncRatio * 0.75f, syncRatio * 1.25f);
}
#define S24 (720.0f / 24 / 2)
static float addAccordPair(TriggerShape *s, float sb, trigger_wheel_e const waveIndex) {
s->addEvent(sb, waveIndex, TV_RISE);
sb += S24;
s->addEvent(sb, waveIndex, TV_FALL);
sb += S24;
return sb;
}
#define DIP 7.5f
static float addAccordPair3(TriggerShape *s, float sb) {
sb += DIP;
s->addEvent(sb, T_CHANNEL_3, TV_RISE);
sb += DIP;
s->addEvent(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(TriggerShape *s) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
s->initialState[T_SECONDARY] = TV_RISE;
float sb = 0;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(90, T_SECONDARY, TV_FALL);
sb = 90;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(180, T_SECONDARY, TV_RISE);
sb = 180;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(270, T_SECONDARY, TV_FALL);
sb = 270;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(360.0f - DIP, T_PRIMARY, TV_RISE);
s->addEvent(360, T_SECONDARY, TV_RISE);
sb = 360;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(450, T_SECONDARY, TV_FALL);
sb = 450;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(540, T_SECONDARY, TV_RISE);
sb = 540;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(630, T_SECONDARY, TV_FALL);
sb = 630;
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
sb = addAccordPair3(s, sb);
s->addEvent(720.0f - DIP, T_PRIMARY, TV_FALL);
// s->addEvent(720.0f - 12 * sb, T_SECONDARY, TV_FALL);
// s->addEvent(720.0f, T_SECONDARY, TV_FALL);
s->addEvent(720.0f, T_SECONDARY, TV_RISE);
s->isSynchronizationNeeded = false;
}
void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float prefix) {
s->initialize(FOUR_STROKE_CAM_SENSOR, true);
// trigger_wheel_e const oneEventWave = T_CHANNEL_3;
// bool withFourEventSignal = true;
// trigger_wheel_e const fourEventWave = T_PRIMARY;
float sb = 5.0f + prefix;
float tdcWidth = 0.1854 * 720 / 4;
s->isSynchronizationNeeded = false;
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent(sb - S24 / 2, oneEventWave, TV_RISE);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withOneEventSignal)
s->addEvent(sb - S24 / 2, oneEventWave, TV_FALL);
sb = addAccordPair(s, sb, T_SECONDARY);
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(1 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(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->addEvent(2 * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(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->addEvent(i * 180.0f + prefix - tdcWidth, fourEventWave, TV_RISE);
}
sb = addAccordPair(s, sb, T_SECONDARY);
if (withFourEventSignal) {
s->addEvent(i * 180.0f + prefix, fourEventWave, TV_FALL);
}
}
}

View File

@ -192,9 +192,5 @@ private:
void setVwConfiguration(TriggerShape *s);
void setToothedWheelConfiguration(TriggerShape *s, int total, int skipped, operation_mode_e operationMode);
void configureHondaAccordCD(TriggerShape *s, bool withOneEventSignal, bool withFourEventSignal,
trigger_wheel_e const oneEventWave,
trigger_wheel_e const fourEventWave,
float d);
#endif /* TRIGGER_STRUCTURE_H_ */

View File

@ -275,7 +275,7 @@ struct trigger_config_s @brief Trigger wheel(s) configuration
custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true"
#define trigger_type_e_enum "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 23", "trg28", "trg29", "trg30", "INVALID"
#define trigger_type_e_enum "custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "trg29", "trg30", "INVALID"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:4], @@trigger_type_e_enum@@
trigger_type_e type;

View File

@ -1,5 +1,5 @@
// This file was generated by Version2Header
// Mon May 23 08:56:04 EDT 2016
// Fri May 27 21:52:26 EDT 2016
#ifndef VCS_VERSION
#define VCS_VERSION "9928"
#define VCS_VERSION "9945"
#endif

View File

@ -1,6 +1,6 @@
package com.rusefi.config;
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon May 23 14:53:43 EDT 2016
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri May 27 20:30:17 EDT 2016
public class Fields {
public static final int LE_COMMAND_LENGTH = 200;
public static final int FSIO_ADC_COUNT = 4;
@ -921,7 +921,7 @@ public class Fields {
public static final Field TPSADCCHANNEL = Field.create("TPSADCCHANNEL", 524, FieldType.INT, adc_channel_e);
public static final Field OVERRIDECRANKINGIGNITION = Field.create("OVERRIDECRANKINGIGNITION", 528, FieldType.INT);
public static final Field SENSORCHARTFREQUENCY = Field.create("SENSORCHARTFREQUENCY", 532, FieldType.INT);
public static final String[] trigger_type_e = {"custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 23", "trg28", "trg29", "trg30", "INVALID"};
public static final String[] trigger_type_e = {"custom toothed wheel", "ford aspire", "dodge neon", "Miata NA", "Miata NB", "GM_7X", "Cooper", "Mazda SOHC 4", "60/2", "36/1", "Accord CD", "MITSU", "ACCORD 2", "ACCORD DIP", "Neon 2003", "MAZDA D 1+4", "1+1", "1+60/2", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Accord 1+24", "DODGE STRATUS", "36_2_2_2", "Nissan", "2JZ", "Rover K", "GM LS 24", "Honda CBR 600", "trg29", "trg30", "INVALID"};
public static final Field TRIGGER_TYPE = Field.create("TRIGGER_TYPE", 536, FieldType.INT, trigger_type_e);
public static final Field TRIGGER_CUSTOMISSYNCHRONIZATIONNEEDED = Field.create("TRIGGER_CUSTOMISSYNCHRONIZATIONNEEDED", 540, FieldType.BIT, 0);
public static final Field TRIGGER_CUSTOMNEEDSECONDTRIGGERINPUT = Field.create("TRIGGER_CUSTOMNEEDSECONDTRIGGERINPUT", 540, FieldType.BIT, 1);