Audi OEM 5-cyl trigger pattern aka "Tri-Tach" https://rusefi.com/forum/viewtopic.php?f=5&t=1912

This commit is contained in:
rusefillc 2021-01-03 13:52:53 -05:00
parent 43586d5348
commit 6eb11dc60a
4 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "rusefi_enums.h"
#include "rusefi_hw_enums.h"
// 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 Fri Jan 01 06:11:31 UTC 2021
// 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 Sun Jan 03 13:42:19 EST 2021
// see also gen_config_and_enums.bat
@ -1379,6 +1379,8 @@ case TT_TOOTHED_WHEEL_36_2:
return "TT_TOOTHED_WHEEL_36_2";
case TT_TOOTHED_WHEEL_60_2:
return "TT_TOOTHED_WHEEL_60_2";
case TT_TRI_TACH:
return "TT_TRI_TACH";
case TT_UNUSED:
return "TT_UNUSED";
case TT_VVT_BOSCH_QUICK_START:

View File

@ -362,13 +362,16 @@ typedef enum {
TT_52 = TT_TT_52,
// https://rusefi.com/forum/viewtopic.php?f=5&t=1912
TT_TRI_TACH = TT_TT_TRI_TACH,
// 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 = 53, // this is used if we want to iterate over all trigger types
TT_UNUSED = 54, // this is used if we want to iterate over all trigger types
Force_4_bytes_size_trigger_type = ENUM_32_BITS,
} trigger_type_e;

View File

@ -243,7 +243,9 @@ void TriggerWaveform::addEvent(angle_t angle, trigger_wheel_e const channelIndex
efiAssertVoid(CUSTOM_ERR_6599, angle > 0 && angle <= 1, "angle should be positive not above 1");
if (privateTriggerDefinitionSize > 0) {
if (angle <= previousAngle) {
warning(CUSTOM_ERR_TRG_ANGLE_ORDER, "invalid angle order: new=%.2f/%f and prev=%.2f/%f, size=%d",
warning(CUSTOM_ERR_TRG_ANGLE_ORDER, "invalid angle order %s %s: new=%.2f/%f and prev=%.2f/%f, size=%d",
getTrigger_wheel_e(channelIndex),
getTrigger_value_e(state),
angle, angle * getCycleDuration(),
previousAngle, previousAngle * getCycleDuration(),
privateTriggerDefinitionSize);
@ -660,6 +662,7 @@ void TriggerWaveform::initializeTriggerWaveform(Logging *logger, operation_mode_
configureFiatIAQ_P8(this);
break;
case TT_TRI_TACH:
case TT_GM_LS_24:
initGmLS24(this);
break;

View File

@ -143,6 +143,7 @@ void calculateTriggerSynchPoint(
efiAssertVoid(CUSTOM_SHAPE_LEN_ZERO, length > 0, "shapeLength=0");
if (length >= PWM_PHASE_MAX_COUNT) {
// todo: by the time we are here we had already modified a lot of RAM out of bounds!
firmwareError(CUSTOM_ERR_TRIGGER_WAVEFORM_TOO_LONG, "Trigger length above maximum: %d", length);
shape.setShapeDefinitionError(true);
return;