Support for Subaru EZ30 trigger

It's all about the code!
Post Reply
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Support for Subaru EZ30 trigger

Post by Dron_Gus »

Does this one looks the same as some of 36/x/y triggers that RE already supports?
Attachments
IMG-20220616-WA0031.jpg
IMG-20220616-WA0031.jpg (70.14 KiB) Viewed 14973 times
20220617_191946.jpg
20220617_191946.jpg (63.39 KiB) Viewed 14973 times
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Support for Subaru EZ30 trigger

Post by mck1117 »

Maybe the same as RX8 36/2/2/2?
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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 ?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post by AndreyB »

Oh also https://github.com/rusefi/rusefi/issues/4256 but that's probably not a problem here
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
NormanAlphaspeed
Posts: 63
Joined: Fri Jan 13, 2017 7:15 am
Location: Puerto Rico
Contact:

Re: Support for Subaru EZ30 trigger

Post by NormanAlphaspeed »

Later Subaru does use the same trigger as RX8, just in care, 36-2-2-2
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: Support for Subaru EZ30 trigger

Post 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.
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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 14866 times
If inverted, I get 19 teeth -2, then 10 -2 -2
Inverted.png
Inverted.png (82.59 KiB) Viewed 14866 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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 14841 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 14841 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: Support for Subaru EZ30 trigger

Post by Dron_Gus »

Console sniffer
Attachments
2022-07-10_15_19_15_204rpm_0_maf_0.0.png
2022-07-10_15_19_15_204rpm_0_maf_0.0.png (32.91 KiB) Viewed 14561 times
User avatar
Dron_Gus
contributor
contributor
Posts: 450
Joined: Wed Nov 13, 2013 1:11 pm
Location: S-Pb
Github Username: dron0gus

Re: Support for Subaru EZ30 trigger

Post by Dron_Gus »

And fast logger from TS.
Attachments
2022-07-10_15.20.10.csv
(19.48 KiB) Downloaded 192 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post by AndreyB »

Happy or unhappy?

verbose trigger loggier text output?
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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?
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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???
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Support for Subaru EZ30 trigger

Post 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 14522 times
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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 14395 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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 :)
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Support for Subaru EZ30 trigger

Post 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 13878 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 13878 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.
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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 13224 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 13224 times
Attachments
2022-09-06_17.55.31.msl
(6.03 MiB) Downloaded 170 times
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post 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
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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 11242 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
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Support for Subaru EZ30 trigger

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
WOOL
Posts: 45
Joined: Mon Apr 25, 2022 1:10 pm

Re: Support for Subaru EZ30 trigger

Post 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
Post Reply