thoughts about 34-2 3 cam Toyota wheel

It's all about the code!
Post Reply
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

I was taking a look at was already written for the trigger_toyota and trying to understand the logic behind.

Code: Select all

void initialize2jzGE3_34(TriggerWaveform *s) {
	setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR);

	s->initialize(FOUR_STROKE_CAM_SENSOR);

	float camD = 720 / 6; // 120

	float crankAngle = 20; // skipping two teeth

	for (int i = 0; i < 10; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 10

	float camAngle = 0;
	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 120

	for (int i = 0; i < 12; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 22


	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 240

	for (int i = 0; i < 12; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 34

	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 360

	crankAngle += 20; // skipping two teeth one more time
	for (int i = 0; i < 10; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 10

	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 480

	for (int i = 0; i < 12; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 22

	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_RISE, -1, 721); // 600


	for (int i = 0; i < 12; i++) {
		s->addEvent2(crankAngle + 5, T_SECONDARY, TV_RISE, -1, 721);
		s->addEvent2(crankAngle + 9.9, T_SECONDARY, TV_FALL, -1, 721); // 120
		crankAngle += 10;
	} // 2 + 32
	camAngle += camD;
	s->addEvent2(camAngle, T_PRIMARY, TV_FALL, -1, 721); // 720

	s->isSynchronizationNeeded = false;
The problem that i see is that the "float camD = 720 / 6; // 120" where dosnt make seance, I dont know if its just for capturing the 1st or 3rd cycle no matter which come first. The crank just go twice the speed of the cam so it should see events every 240 degrees not 120.
engineidle-camcrank-signals.png
engineidle-camcrank-signals.png (17.26 KiB) Viewed 20134 times
My idea to make this decoded (dont laugh i'm not a programer):

if ((crankAngle == 0) II (crankAngle == 12) II (crankAngle == 24)) {
eventcount = 0;}
else if ((crankAngle == 10) && eventcount) { goto startsync }
else if ((crankAngle == 22) && eventcount) { goto startsync }
else if ((crankAngle == 34) && eventcount) { goto startsync }

// Sync process

if ((crankAngle == 0) || (crankAngle == 46) || (crankAngle == 24)) {
eventcount = 0;
} else if (((crankAngle == 56) && (!eventcount))
|| ((crankAngle == 34) && (!eventcount)))

_______________________________________________________

I think that the key here will be that 34 tooth if you can reset and star count after see 34, next cycle will be my TDC 1st.
First TDC cycle have a tooth on 22 and second TDC have a tooth on 10 and 34, you almost no need to use the second tdc.
Can be sync on cranking and after start you can switch to your crank wheel completely and if you loose sync you can switch to waste spark and start
the cycle again. will be nice to have a indicator in tuner studio for half sync and full sync. The vvti will relays only on the 22 tooth for cam facing.

Please Comment, I appreciate you support.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Current initialize2jzGE3_34 looks to be FUBAR.
Please remind us if we have VVT here or not really?

Within rusEFI current trigger implementation this would be normal 36/2 or 34-2 skipped tooth crank + custom 2jz VVT logic of locating one of the three cam tooth closest to crankshaft skipped tooth.

At the moment this new custom 2jz cam mode exists only in my head, looks like about 2 hours of coding. Please post a video of this engine running rusEFI in wasted mode on 34-2 and I will get you the new custom cam mode :)
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

At the moment this new custom 2jz cam mode exists only in my head, looks like about 2 hours of coding. Please post a video of this engine running rusEFI in wasted mode on 34-2 and I will get you the new custom cam mode
I will send you the video this week. happy to know that is doable.
Thank you
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

porelmundo wrote:
Tue May 05, 2020 2:38 am
I will send you the video this week.
https://w2.countingdownto.com/2979133
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Ok it's running, although need some work, provably have to change all VR crank sensor wiring, but its start and idle good.
Please remind us if we have VVT here or not really?
Yes the engine is VVTI. 2JZ-GTTE VVTI

And this is the video:
IMG_6727_HEVC.MOV
(7.48 MiB) Downloaded 416 times
Thank you.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Sweet! Now I need to make progress on my side of the deal :)
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: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: thoughts about 34-2 3 cam Toyota wheel

Post by mck1117 »

porelmundo wrote:
Fri May 08, 2020 11:57 pm
Ok it's running, although need some work, provably have to change all VR crank sensor wiring, but its start and idle good.
Please remind us if we have VVT here or not really?
Yes the engine is VVTI. 2JZ-GTTE VVTI

And this is the video:
IMG_6727_HEVC.MOV

Thank you.
Is that a Proteus v0.3 I spy?
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Is that a Proteus v0.3 I spy?
Yes it is, i was expecting to comment on your post once it was running and do my test but under the circumstances the video spoil my built.
if is anything i can help you just let me know (hardware side or testing)
mck1117
running engine in first post
running engine in first post
Posts: 1494
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: thoughts about 34-2 3 cam Toyota wheel

Post by mck1117 »

porelmundo wrote:
Sat May 09, 2020 3:10 am
Is that a Proteus v0.3 I spy?
Yes it is, i was expecting to comment on your post once it was running and do my test but under the circumstances the video spoil my built.
if is anything i can help you just let me know (hardware side or testing)
That means our first starts on 0.3 were within hours of each other - awesome!
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Made some progress today, I have a working prototype. I will wrap up my testing hopefully tomorrow and we will need to try on real vehicle.

Do we know range of VVT motion on this vehicle?
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Do we know range of VVT motion on this vehicle?
Range is 60 degrees. and if i dont forgot and if is apply here (i dont know) the minimum sensor angle is 70 and the maximum is 130
those are good news, ready for testing here.

Thank you
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

2JZ is maybe ready.

Toyota 2JZ has three cam tooth. We pick one of these three tooth to synchronize based on the expected angle position of the event.

Please run latest build in 36/2 crank wheel mode with VVT, while using VVT debug_mode. Please record a log at the highest possible frequency.

We would be looking at Debug->Event Position gauge to see what values of position we have for three tooth (I expect three different values)

Once we have the value picked we need to give it a range for tests you can configure detection window using FSIO settings #15 and #16. VVT has nothing to do with FSIO it was just easiest for me to use those temporary. Once we decide on good values I will probably hard-code them.

Actual VVT pid is in "Advanced->Aux Pid #1"
FSIO settings is in Advanced->FSIO Outputs

A very rough tune example https://rusefi.com/online/view.php?msq=7 at least all the settings are set there.
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Working on that, Thanks
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

just realized it would be in sync and out of sync angle for each tooth depending on cranking luck.

please save composite log to file as well
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Hi, yesterday I replace the trigger shielded cables that was glitching now i have solid signals.
try the test firmware with multiple combinations with no luck but i'm not 100% sure that i'm making this right.
im testing on what it say dev 2jz/ 3/34 simulator and activate my cam on sync/vvti input.
my advance trigger is in 2GZ?
What i have is a bunch of events but no start, almost but no start.

Also i have some issues with some warnings like boost duty that i dont exactly know what it means but the big problem that i have with 36-2 start is that it dosnt pass 3400 rpm, as soon as it hits some boost it just start to miss something, i though that was related to dwell but is not. I will change spark plugs and see if that cure the condition, i didnt want to bother with this at this time but is having me thinking. here is the tune anyway.

Thank you for your support

[The extension msq has been deactivated and can no longer be displayed.]

User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Step 1: get car running on wasted spark, completely ignore VVT sensor and actuator.

We need to gather data at this point. In order to gather data we need a running engine. A way to start your engine is wasted mode maybe with two wire mode.

I am interested in the normal logs and composite logs when you have latest firmware running with wasted. Maybe a phone call or Slack chat would help. Today is a busy day so probably not today :( Poke me on Slack and we will start coordinating good time.
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Poke me on Slack and we will start coordinating good time.
I will do that
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

36/2 it start nice and idle perfect, with vvti, event position trow high numbers and stay there
Here a data log of the trigger:
2020-05-12_11.37.03.csv
(1.42 MiB) Downloaded 394 times
i think is doing something :P
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Thank you for composite logs!
I am interested in the normal logs and composite logs when you have latest firmware running with wasted.
Please provide normal logs as well.
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: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

No SecLevel in that composite log, i.e. no cam signals? Could be HW issue could be FW issue could be anything :)
Attachments
no_sec_level.png
no_sec_level.png (145.71 KiB) Viewed 19585 times
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

After struggling the other day trying to make my engine rev all the way and dealing with a bunch of stuff (New spark plugs, igniter, some wiring, coils)
I find out that my timing belt jump two tooth and yesterday morning i pull out the engine and do a mayor rebuild cos is been abused on my last drag event. I start it yesterday night and is revving all the way up, actually very impressive with the rusefi than my previous ECU on that engine, it is scares me how better and fast rev up.
No SecLevel in that composite log, i.e. no cam signals? Could be HW issue could be FW issue could be anything
Well, I take another fresh one and is the same result. but i test the HW and is working properly, wiring is new cos i rewire it this week and test it, dont know if can be bad sensor, maybe do some more test.
Im including what i have until now,

trigger event video
SIMG_6798_HEVC.MOV
(1.98 MiB) Downloaded 296 times


Trigger Logger, again, dont know where goes the cam
trg2020-05-15_15.09.51.csv
(1.71 MiB) Downloaded 232 times
Data log
2020-05-15_15.11.14.csv
(95.64 KiB) Downloaded 244 times
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

porelmundo wrote:
Fri May 15, 2020 7:49 pm
I start it yesterday night and is revving all the way up, actually very impressive with the rusefi than my previous ECU on that engine, it is scares me how better and fast rev up.
I know I am going off on a tangent but that's just too interesting. What previous ECU? Are you sure it's not the engine rebuild or tune difference? Can you grab more data? that would be a cool comparison data point probably worth a separate thread.


Looking into your data, there is definitely some useful info there.
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Change VR1 for VR2 and change it to single tooth and i have revs.
this how it looks on MS
MStrigger2020-05-15_16.19.58.csv
(747.97 KiB) Downloaded 342 times
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Shoot cus im down for anything at this point, it start and run good after rebuild and on MS3 its working :lol:
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

The binary log file has amazing data: it shows that your three tooth are happening at 175 degree, 415 degree and 655 degree.

Based on that, please open FSIO Outputs and set Set#15 and Set#16 to magic values 130 and 220 (that's your 175 degrees minus and plus 45 range) - with these settings your current firmware as is should start synchronizing VVT position statistically at half of your cranking attempts (i.e. try to start six times - I would hope that three times your VVT Position gauge would show 175).

This "half of your cranking attempts" is fixed now in firmware 20200515.
Composite logger is not showing cam sensor, that's a defect in the code - also fixed now.

Please wait 2 hours from now and new version 20200515 would be build. Update to latest and firmware in two hours and at that point once you set settings expected behavior would be for your VVT position gauge to start showing value around 175.
Attachments
set_15_set_16_values.png
set_15_set_16_values.png (124.95 KiB) Viewed 19431 times
debug_f1_is_your_vvt_event_log.png
debug_f1_is_your_vvt_event_log.png (169.28 KiB) Viewed 19431 times
composite_logger_not_showing_vvt.png
composite_logger_not_showing_vvt.png (166.38 KiB) Viewed 19431 times
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

Ok this is what i got now, on the data log seams that is working.
2020-05-15_18.56.21.csv
(3.45 MiB) Downloaded 354 times
trigger log
2020-05-15_18.57.28.mlg.csv
(79.51 KiB) Downloaded 369 times
data log

i thin we are close, vvt event position max out , what i can see is just the timing number perhaps
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

Your log now shows constant 1138 degree VVT position. I've just made a code change to make sure that VVT position is displayed in the 0 to 720 range.

I think it works. You have VVT position gauge working now, you just need to tune VVT actuator and set target table - see sample VVT tune for details.
Also you can play with VVT offset to get VVT gauge where you want it to be.

Let me know if you have open questions?
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: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

AndreyB wrote:
Sat May 16, 2020 1:14 am
I've just made a code change to make sure that VVT position is displayed in the 0 to 720 range.
I am taking this back. Actually please use vvtOffset to get this VVT position where you want it to be.
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
porelmundo
contributor
contributor
Posts: 87
Joined: Tue Apr 26, 2016 1:15 am

Re: thoughts about 34-2 3 cam Toyota wheel

Post by porelmundo »

I'm happy to report, that it's working. and is working good. i still playing with the best parameters for stability and collecting data for future development. Numbers are completely far from the miata example, further test need to be done before report.
Thank you for the support.
User avatar
AndreyB
Site Admin
Posts: 14332
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: thoughts about 34-2 3 cam Toyota wheel

Post by AndreyB »

:ugeek: glad to her! please provide logs and share tune once it looks good
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
Post Reply