fix gm 24x decoder (#963)

* fix gm

* fix

* fix default config, tests
This commit is contained in:
Matthew Kennedy 2019-10-05 05:27:30 -07:00 committed by rusefi
parent 8467adb13f
commit 40853e1a3f
3 changed files with 11 additions and 10 deletions

View File

@ -43,8 +43,8 @@ void setCamaro4(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->tps1_1AdcChannel = EFI_ADC_2;
// todo: move this into trigger definition
// set global_trigger_offset_angle 230
engineConfiguration->globalTriggerAngleOffset = 230;
// set global_trigger_offset_angle 50
engineConfiguration->globalTriggerAngleOffset = 50;
engineConfiguration->iat.adcChannel = EFI_ADC_11;

View File

@ -39,9 +39,9 @@ void configureGmTriggerShape(TriggerShape *s) {
s->setTriggerSynchronizationGap(6);
}
static int gm_tooth_pair(float startAngle, bool isLongShort, TriggerShape* s, int mult)
static int gm_tooth_pair(float startAngle, bool isShortLong, TriggerShape* s, int mult)
{
int window = (isLongShort ? 12 : 3) * mult;
int window = (isShortLong ? 5 : 10) * mult;
int end = startAngle + mult * 15;
s->addEvent720(startAngle + window, T_PRIMARY, TV_RISE);
@ -67,7 +67,7 @@ void initGmLS24(TriggerShape *s) {
* The GM 24x crank wheel has 48 edges. There is
* a falling edge every 15 degrees (1/24 revolution).
* After every falling edge, a rising edge occurs either
* 3 or 12 (= 15 - 3) degrees later. The code 0x0A33BE
* 5 or 10 (= 15 - 5) degrees later. The code 0x0A33BE
* encodes the pattern of which type of gap occurs in the
* pattern. Starting from the LSB, each bit left is the
* next gap in sequence as the crank turns. A 0 indicates
@ -80,7 +80,7 @@ void initGmLS24(TriggerShape *s) {
*
* | 0 | 1 | 1 | 1 |
*
* ___ = 12 degrees, _ = 3 deg
* ___ = 10 degrees, _ = 5 deg
*
* There is a falling edge at angle=0=720, and this is position
* is #1 (and #6) TDC. If there's a falling edge on the cam
@ -103,8 +103,9 @@ void initGmLS24(TriggerShape *s) {
s->useOnlyPrimaryForSync = true;
s->setTriggerSynchronizationGap(1.6);
s->setSecondTriggerSynchronizationGap(1);
s->setThirdTriggerSynchronizationGap(2.5);
// This is tooth #20, at 310 degrees ATDC #1
s->setTriggerSynchronizationGap(2.0f);
s->setSecondTriggerSynchronizationGap(0.5f);
s->setThirdTriggerSynchronizationGap(2.0f);
}

View File

@ -528,7 +528,7 @@ TEST(misc, testTriggerDecoder) {
testTriggerDecoder3("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0, 2.9994);
testTriggerDecoder2("MAZDA_323", MAZDA_323, 0, 0.4833, 0);
testTriggerDecoder2("CAMARO_4", CAMARO_4, 34, 0.5, 0);
testTriggerDecoder2("CAMARO_4", CAMARO_4, 40, 0.5, 0);
testTriggerDecoder3("neon NGC4", DODGE_NEON_2003_CAM, 6, 0.5000, 0.0, CHRYSLER_NGC4_GAP);