Page 1 of 1

Support for Subaru EZ30 trigger

Posted: Fri Jun 17, 2022 4:20 pm
by Dron_Gus
Does this one looks the same as some of 36/x/y triggers that RE already supports?

Re: Support for Subaru EZ30 trigger

Posted: Fri Jun 17, 2022 4:51 pm
by mck1117
Maybe the same as RX8 36/2/2/2?

Re: Support for Subaru EZ30 trigger

Posted: Fri Jun 17, 2022 6:14 pm
by AndreyB
mck1117 wrote:
Fri Jun 17, 2022 4:51 pm
Maybe the same as RX8 36/2/2/2?
As in https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers#36222 ?

Re: Support for Subaru EZ30 trigger

Posted: Fri Jun 17, 2022 6:25 pm
by AndreyB
Oh also https://github.com/rusefi/rusefi/issues/4256 but that's probably not a problem here

Re: Support for Subaru EZ30 trigger

Posted: Sat Jun 18, 2022 7:22 pm
by NormanAlphaspeed
Later Subaru does use the same trigger as RX8, just in care, 36-2-2-2

Re: Support for Subaru EZ30 trigger

Posted: Sun Jun 19, 2022 4:19 pm
by Dron_Gus
Thanks everyone!
Customer is still gathering debug data.
I'll get back with update as soon as receive something. Or visit him.

Re: Support for Subaru EZ30 trigger

Posted: Sun Jun 19, 2022 10:48 pm
by WOOL
Hello everyone, this is my problem Andrey created this topic. So far managed to get data from the RE developer console. There is no synchronization, but I tried to reverse the polarity of the VR crankshaft sensor in software and hardware. In non-reversed polarity,
I counted 18 teeth, then 2 missing teeth, then 9 teeth, then 2 missing teeth, and 2 more missing teeth.
Not Inverted.png
Not Inverted.png (127.36 KiB) Viewed 16161 times
If inverted, I get 19 teeth -2, then 10 -2 -2
Inverted.png
Inverted.png (82.59 KiB) Viewed 16161 times
Right now I don't have the paid version of TS. If this helps a lot in solving the problem, then soon I will buy it.
In the part of the code https://github.com/rusefi/rusefi/blob/master/firmware/controllers/trigger/decoders/trigger_subaru.cpp#L57 of the for loop, the teeth are counted up to 12 and skipped, then 15 teeth and two more skipped sectors 2 teeth. Do I understand correctly that in this case I should look like this

for (int i = 0; i < 18; i++) {
s->addEvent720(base + narrow / 2, T_PRIMARY, TV_FALL);
s->addEvent720(base + narrow, T_PRIMARY, TV_RISE);
base += narrow;
}

s->addEvent720(base + wide / 2, T_PRIMARY, TV_FALL);
s->addEvent720(base + wide, T_PRIMARY, TV_RISE);
base += wide;

for (int i = 0; i < 9; i++) {
s->addEvent720(base + narrow / 2, T_PRIMARY, TV_FALL);
s->addEvent720(base + narrow, T_PRIMARY, TV_RISE);
base += narrow;
}

s->addEvent720(720 - wide - wide / 2, T_PRIMARY, TV_FALL);
s->addEvent720(720 - wide, T_PRIMARY, TV_RISE);

s->addEvent720(720 - wide / 2, T_PRIMARY, TV_FALL);
s->addEvent720(720, T_PRIMARY, TV_RISE);
s->useOnlyPrimaryForSync = true;

After all, if the FOR loop counts up to 12, then the gap between 13 and 14 teeth will be considered as 2 missing teeth.
Sorry for my bad english, I use google translator

Re: Support for Subaru EZ30 trigger

Posted: Mon Jun 20, 2022 12:03 am
by AndreyB
Let's slow down a bit :)

Why are we trying to code anything? Do we believe that your trigger is not 36-2-2-2? Do we have _any_ data about your trigger?

Is it Subaru which has nice workshop manual or is it just Nissan? Any photos from the internet? Etc? Overall, what are we trying to change why based on what data exactly?

Re: Support for Subaru EZ30 trigger

Posted: Mon Jun 20, 2022 8:51 am
by WOOL
AndreyB wrote:
Mon Jun 20, 2022 12:03 am
Let's slow down a bit :)

Why are we trying to code anything? Do we believe that your trigger is not 36-2-2-2? Do we have _any_ data about your trigger?

Is it Subaru which has nice workshop manual or is it just Nissan? Any photos from the internet? Etc? Overall, what are we trying to change why based on what data exactly?
Excuse me for my rush, the upcoming business trip will slow me down by a week. That's right, my trigger is 36-2-2-2 and so far I don't have the logs from TunerStudio Tooth Logger.
My logic proceeds from the fact that in the code there is a calculation of the sequence of 12 consecutive teeth and two missing ones, then there is a count of 15 teeth and 2 more sectors of -2 teeth.
Whereas I have 10 teeth -2 and another 19 -2 -2.
EZ30 10-219-2-2.png
EZ30 10-219-2-2.png (363.03 KiB) Viewed 16136 times
Here is an image of the RX8 13b engine trigger, here 16 |-2| 13| -2 |-2.
13b trigger.png
13b trigger.png (182.74 KiB) Viewed 16136 times
Let me know where I'm wrong, I don't understand at all how the 13th tooth between the -2 and -2 sectors is considered. I have a very poor understanding of the logic of the code since I am very weak in programming

Re: Support for Subaru EZ30 trigger

Posted: Mon Jun 20, 2022 3:52 pm
by AndreyB

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 12:23 pm
by Dron_Gus
Console sniffer

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 12:24 pm
by Dron_Gus
And fast logger from TS.

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 2:37 pm
by AndreyB
Happy or unhappy?

verbose trigger loggier text output?

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 3:07 pm
by WOOL
AndreyB wrote:
Sun Jul 10, 2022 2:37 pm
Happy or unhappy?

verbose trigger loggier text output?
unhappy =( No sync. in the beginning there is 200 RPM and the failure of the synronization. Trigger err. What do you mean by trigger loggier text output?

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 3:14 pm
by WOOL
Dron_Gus wrote:
Sun Jul 10, 2022 12:23 pm
Console sniffer
Maybe still 19-2-2 then 10-2 and 1 tooth remains between sectors -2-2 after 19 tooth???

Re: Support for Subaru EZ30 trigger

Posted: Sun Jul 10, 2022 3:33 pm
by AndreyB
sync has nothing to do with overall shape

if it sync it would kind of work with very wrong shape

enable "log trigger details" in TS

switch to console, crank

copy-paste text from messages which would looks somewhat like

Code: Select all

2021-11-06_16_49_03_605: EngineState: TRG rpm=268 time=822 eventIndex=114 gapIndex=0: gap=2.517 expected from 2.250 to 3.750 error=No
2021-11-06_16_49_03_605: EngineState: TRG rpm=268 time=822 eventIndex=114 gapIndex=1: gap=1.000 expected from 0.750 to 1.250 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=0 gapIndex=0: gap=0.587 expected from 2.250 to 3.750 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=0 gapIndex=1: gap=2.517 expected from 0.750 to 1.250 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=2 gapIndex=0: gap=0.674 expected from 2.250 to 3.750 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=2 gapIndex=1: gap=0.587 expected from 0.750 to 1.250 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=4 gapIndex=0: gap=0.995 expected from 2.250 to 3.750 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=4 gapIndex=1: gap=0.674 expected from 0.750 to 1.250 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=6 gapIndex=0: gap=1.007 expected from 2.250 to 3.750 error=No
2021-11-06_16_49_03_620: EngineState: TRG rpm=268 time=822 eventIndex=6 gapIndex=1: gap=0.995 expected from 0.750 to 1.250 error=No

well, actually "normal" TS logs also have some useful info. Please ensure your logging data rate is high and upload normal log (not tooth log) to rusefi online

I shall document more of that at https://github.com/rusefi/rusefi/wiki/Trigger-Configuration-Guide

Re: Support for Subaru EZ30 trigger

Posted: Mon Jul 11, 2022 7:15 am
by mck1117
swap your VR sensor wires edit: nope, it looks fine

Try setting your trigger gap overrides like this:
image.png
image.png (20.67 KiB) Viewed 15817 times

Re: Support for Subaru EZ30 trigger

Posted: Thu Jul 14, 2022 8:36 pm
by WOOL
mck1117 wrote:
Mon Jul 11, 2022 7:15 am
swap your VR sensor wires edit: nope, it looks fine

Try setting your trigger gap overrides like this:

image.png
Thank you very much, the redistribution of intervals helped me !!! Synchronization is now clear and without disruptions.
2022-07-12_00_55_46_925rpm_0_maf_0.0.png
2022-07-12_00_55_46_925rpm_0_maf_0.0.png (30.04 KiB) Viewed 15690 times
Today even almost started the engine, greatly frightened the entire covered parking lot with a strong explosion =)) Now I need to adjust the cam sensor and pull #1 TDC. Hopefully there won't be a problem with that. Many thanks to Andrew and all those who responded!! I am very happy

Re: Support for Subaru EZ30 trigger

Posted: Thu Jul 14, 2022 8:54 pm
by AndreyB
@mck1117 how did you come up with the numbers you've suggested for gaps?

@WOOL your tune and log on http://rusefi.online would be the nice next step :)

Re: Support for Subaru EZ30 trigger

Posted: Thu Jul 14, 2022 10:46 pm
by WOOL
AndreyB wrote:
Thu Jul 14, 2022 8:54 pm
@mck1117 how did you come up with the numbers you've suggested for gaps?

@WOOL your tune and log on http://rusefi.online would be the nice next step :)
Exactly! Already done

Re: Support for Subaru EZ30 trigger

Posted: Fri Jul 15, 2022 8:17 am
by AndreyB
WOOL wrote:
Thu Jul 14, 2022 10:46 pm
Exactly! Already done
In the future please explicitily link relevant tunes and logs. Time will pass and it would be unclear what tunes and logs are relevant for this specific forum thread.

I see https://rusefi.com/online/view.php?msq=1118 but I see no logs of vehicle running please add a log of vehicle running that's the more important part to see actual trigger gap behaviour.

Re: Support for Subaru EZ30 trigger

Posted: Fri Jul 15, 2022 8:19 am
by AndreyB

Re: Support for Subaru EZ30 trigger

Posted: Sat Jul 30, 2022 8:45 pm
by mck1117
AndreyB wrote:
Thu Jul 14, 2022 8:54 pm
@mck1117 how did you come up with the numbers you've suggested for gaps?
The "perfect" gaps are only any good when the engine is spinning smoothly - basically once it's running. On engines that have the gap in a "bad" spot, plus have lots of cranking speed variation (high compression, few cylinders, weak starter, weak battery, etc), the gaps end up pretty messy during cranking.

With this wheel, the "ideal" pattern is gap ratios of 3, 1, 0.33: first the short-long, long-long, then long-short.

But in reality, from the TS log, we see:
image.png
image.png (11.36 KiB) Viewed 15173 times
Ideally those 4 gaps have width of x, 3x, 3x, x, but you can see that's just not the case.
image.png
image.png (7.22 KiB) Viewed 15173 times
Checking against the default +-25% ranges for the 3, 1, 0.33 gaps, the middle one is out: 1.31 is too high.

The numbers I suggested cover both the ratios we see during cranking, and the expected ratios during running, plus some margin.

First gap: expected 0.33 cranking 0.35, range given 0.25-0.5
Second gap: expected 1 cranking 1.31, range given 0.7-1.5
Third gap: expected 3 cranking 3.26, range given 2-4

It's fine to make the gaps wider, so long as it doesn't introduce any ambiguity in the trigger. Whatever the gaps are, there must be exactly one spot in the trigger pattern that yields a sync, regardless of engine acceleration.
AndreyB wrote:
Fri Jul 15, 2022 8:17 am
log of vehicle running that's the more important part to see actual trigger gap behaviour.
This is actually the less interesting part, as it's easy to predict. The gaps we see during cranking are much harder to predict.

Re: Support for Subaru EZ30 trigger

Posted: Wed Sep 07, 2022 11:10 am
by WOOL
So, I started the engine. TDC #1 Angles are correct, Trigger is defined correctly. But with the CAM sensor is not yet clear. The cam trigger seems to be visible in the console, but sometimes shifts. I suspect that there are some noises from which there are false positives, Attach Logs and tune

The first screenshot shows that the CAM is positioned correctly.
2022-09-06_17_03_37_409rpm_1047_maf_0.0.png
2022-09-06_17_03_37_409rpm_1047_maf_0.0.png (32.08 KiB) Viewed 14519 times
And at this point, the third pattern is shifted forward.
2022-09-06_17_18_20_212rpm_1178_maf_0.0.png
2022-09-06_17_18_20_212rpm_1178_maf_0.0.png (29.31 KiB) Viewed 14519 times

Re: Support for Subaru EZ30 trigger

Posted: Wed Sep 07, 2022 2:12 pm
by AndreyB
2022-09-06_17.55.31.msl looks like a corrupted text log file, what software have you used how to get it?

The most reliable logs are the ones created by TunerStudio and uploaded to rusefi.online

Re: Support for Subaru EZ30 trigger

Posted: Sat Mar 11, 2023 11:55 am
by WOOL
I think you need to override the TDC #1 position for the EZ30 triggerer. I now have a 240 degree offset for the TDC to match Cylinder #1. Also I use Trigger gap override What advised me mck1117. At home on the stand with an even rotation, the determination of the trigger will occur without trigger gap override, but on the engine only with these intervals.
javaw_U4GUTNl2of.png
javaw_U4GUTNl2of.png (58.1 KiB) Viewed 12537 times
I also attach a tune and a log

Tune https://rusefi.com/online/view.php?msq=1418
Log https://rusefi.com/online/view.php?log=1194

Re: Support for Subaru EZ30 trigger

Posted: Sat Mar 11, 2023 3:18 pm
by AndreyB

Re: Support for Subaru EZ30 trigger

Posted: Sat Sep 09, 2023 9:58 pm
by WOOL
I just found a description of the simulation of the first and second generation EZ30 sensors from the well-known github page of the Crank\Cam signal simulator. But unfortunately, I don't understand much about this.? =)

https://github.com/speeduino/Ardu-Stim/pull/60