triggers: add Subaru SVX trigger (3 sensors) (#1433)
This commit is contained in:
parent
be8fee161c
commit
a2565b7849
|
@ -4,7 +4,7 @@
|
|||
// was generated automatically by rusEfi tool from rusefi_hw_enums.h
|
||||
// was generated automatically by rusEfi tool from rusefi_enums.h
|
||||
// by enum2string.jar tool
|
||||
// on Mon Jun 17 19:49:25 EDT 2019
|
||||
// on Fri May 15 03:26:02 MSK 2020
|
||||
// see also gen_config_and_enums.bat
|
||||
|
||||
|
||||
|
@ -1189,6 +1189,8 @@ case TT_ROVER_K:
|
|||
return "TT_ROVER_K";
|
||||
case TT_SUBARU_7_6:
|
||||
return "TT_SUBARU_7_6";
|
||||
case TT_SUBARU_SVX:
|
||||
return "TT_SUBARU_SVX";
|
||||
case TT_TOOTHED_WHEEL:
|
||||
return "TT_TOOTHED_WHEEL";
|
||||
case TT_TOOTHED_WHEEL_36_1:
|
||||
|
|
|
@ -343,13 +343,15 @@ typedef enum {
|
|||
|
||||
TT_TOOTHED_WHEEL_36_2 = 48,
|
||||
|
||||
TT_SUBARU_SVX = 49,
|
||||
|
||||
// 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
|
||||
//
|
||||
// Another point: once you add a new trigger, run get_trigger_images.bat which would run rusefi_test.exe from unit_tests
|
||||
//
|
||||
TT_UNUSED = 49, // this is used if we want to iterate over all trigger types
|
||||
TT_UNUSED = 50, // this is used if we want to iterate over all trigger types
|
||||
|
||||
Force_4_bytes_size_trigger_type = ENUM_32_BITS,
|
||||
} trigger_type_e;
|
||||
|
|
|
@ -648,6 +648,10 @@ void TriggerWaveform::initializeTriggerWaveform(Logging *logger, operation_mode_
|
|||
initGmLS24(this);
|
||||
break;
|
||||
|
||||
case TT_SUBARU_SVX:
|
||||
initializeSubaru_SVX(this);
|
||||
break;
|
||||
|
||||
default:
|
||||
setShapeDefinitionError(true);
|
||||
warning(CUSTOM_ERR_NO_SHAPE, "initializeTriggerWaveform() not implemented: %d", triggerConfig->type);
|
||||
|
|
|
@ -115,3 +115,155 @@ void initializeSubaru7_6(TriggerWaveform *s) {
|
|||
s->useOnlyPrimaryForSync = true;
|
||||
|
||||
}
|
||||
|
||||
void initializeSubaru_SVX(TriggerWaveform *s) {
|
||||
int n;
|
||||
/* crank 2 falling happens between crank #1 fallings */
|
||||
float crank_2_offset = 15.0;
|
||||
float cam_offset = 15.0;
|
||||
/* we should use only falling edges */
|
||||
float width = 5.0;
|
||||
|
||||
/* additional 10 degrees should be removed!!! */
|
||||
#define CRANK_1_FALL(n) (20.0 + 10.0 + 30.0 * (n))
|
||||
#define CRANK_1_RISE(n) (CRANK_1_FALL(n) - width)
|
||||
|
||||
/* T_CHANNEL_3 currently not supported, to keep trigger decode happy
|
||||
* set cam second as secondary, so logic will be able to sync
|
||||
* Crank angle sensor #1 = T_SECONDARY
|
||||
* Crank andle sensor #2 = T_CHANNEL_3 - not supported yet
|
||||
* Cam angle sensor = T_PRIMARY */
|
||||
#define SVX_CRANK_1 T_SECONDARY
|
||||
#define SVX_CRANK_2 T_CHANNEL_3
|
||||
#define SVX_CAM T_PRIMARY
|
||||
|
||||
s->initialize(FOUR_STROKE_CAM_SENSOR);
|
||||
|
||||
/****** 0 *****/
|
||||
n = 0;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 1;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - one 1/1 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 2;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 3;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #1 */
|
||||
n = 4;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* cam - one */
|
||||
s->addEvent720(CRANK_1_RISE(n) + cam_offset, SVX_CAM, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + cam_offset, SVX_CAM, TV_FALL);
|
||||
n = 5;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - three - 1/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 6;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - three - 2/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 7;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #6 */
|
||||
/* crank #2 - three - 3/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 8;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 9;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - two - 1/2 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 10;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - two - 2/2 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 11;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #3 */
|
||||
|
||||
/****** 360 *****/
|
||||
n = 12;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 13;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - one - 1/1 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 14;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 15;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #2 */
|
||||
n = 16;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 17;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - three - 1/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 18;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - three - 2/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 19;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #5 */
|
||||
/* crank #2 - three - 3/3 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 20;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
n = 21;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - two - 1/2 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 22;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* crank #2 - two - 2/2 */
|
||||
s->addEvent720(CRANK_1_RISE(n) + crank_2_offset, SVX_CRANK_2, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n) + crank_2_offset, SVX_CRANK_2, TV_FALL);
|
||||
n = 23;
|
||||
s->addEvent720(CRANK_1_RISE(n), SVX_CRANK_1, TV_RISE);
|
||||
s->addEvent720(CRANK_1_FALL(n), SVX_CRANK_1, TV_FALL);
|
||||
/* +10 - TDC #4 */
|
||||
/****** 720 *****/
|
||||
|
||||
s->setTriggerSynchronizationGap2(4.9, 9);
|
||||
s->setTriggerSynchronizationGap3(1, 0.6, 1.25);
|
||||
|
||||
s->isSynchronizationNeeded = false;
|
||||
s->useOnlyPrimaryForSync = true;
|
||||
}
|
||||
|
|
|
@ -11,4 +11,5 @@
|
|||
|
||||
void initialize36_2_2_2(TriggerWaveform *s);
|
||||
void initializeSubaru7_6(TriggerWaveform *s);
|
||||
void initializeSubaru_SVX(TriggerWaveform *s);
|
||||
|
||||
|
|
|
@ -524,7 +524,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 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "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 LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "trg47", "36/2", "trg49", "trg50", "INVALID"
|
||||
#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "1+60/2", "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 LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "trg47", "36/2", "Subaru SVX", "trg50", "INVALID"
|
||||
|
||||
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:7], @@trigger_type_e_enum@@
|
||||
trigger_type_e type;set trigger_type X
|
||||
|
|
Loading…
Reference in New Issue