MAP Sync and how it works

It's all about the code!
Post Reply
User avatar
NormanAlphaspeed
Posts: 63
Joined: Fri Jan 13, 2017 7:15 am
Location: Puerto Rico
Contact:

MAP Sync and how it works

Post by NormanAlphaspeed »

An FSAE team that have an AlphaECU 2chan are trying to get MAP sync working on their Kawasaki EX300 engine with an intake manifold (since it's turbocharged) working, but they have not been succesful.

Here is a log of the engine not turning on with MAP sync:
https://rusefi.com/online/view.php?log=1223

And here is a log of MAP sync working on a Yamaha FZ09 engine:
https://github.com/rusefi/rusefi/files/11312116/2022-06-14_20.46.00.mlg.zip

I'm still trying to wrap my head around how it works??
Thread created for permanent reference
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: MAP Sync and how it works

Post by AndreyB »

Code: Select all

	if (engineConfiguration->vvtMode[0] == VVT_MAP_V_TWIN &&
			Sensor::getOrZero(SensorType::Rpm) < engineConfiguration->cranking.rpm) {
		// we are trying to figure out which 360 half of the total 720 degree cycle is which, so we compare those in 360 degree sense.
		auto toothAngle360 = currentPhase;
		while (toothAngle360 >= 360) {
			toothAngle360 -= 360;
		}

		if (mapCamPrevToothAngle < engineConfiguration->mapCamDetectionAnglePosition && toothAngle360 > engineConfiguration->mapCamDetectionAnglePosition) {
			// we are somewhere close to 'mapCamDetectionAnglePosition'

			// warning: hack hack hack
			float map = engine->outputChannels.instantMAPValue;

			// Compute diff against the last time we were here
			float diff = map - mapCamPrevCycleValue;
			mapCamPrevCycleValue = map;

			if (diff > 0) {
				mapVvt_map_peak++;
				int revolutionCounter = getTriggerCentral()->triggerState.getCrankSynchronizationCounter();
				mapVvt_MAP_AT_CYCLE_COUNT = revolutionCounter - prevChangeAtCycle;
				prevChangeAtCycle = revolutionCounter;

				hwHandleVvtCamSignal(TriggerValue::RISE, timestamp, /*index*/0);
				hwHandleVvtCamSignal(TriggerValue::FALL, timestamp, /*index*/0);
#if EFI_UNIT_TEST
				// hack? feature? existing unit test relies on VVT phase available right away
				// but current implementation which is based on periodicFastCallback would only make result available on NEXT tooth
				getLimpManager()->onFastCallback();
#endif // EFI_UNIT_TEST
			}

			mapVvt_MAP_AT_SPECIAL_POINT = map;
			mapVvt_MAP_AT_DIFF = diff;
		}

		mapCamPrevToothAngle = toothAngle360;
	}
}
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: MAP Sync and how it works

Post by AndreyB »

So we see that only syncs at RPM below cranking and that it's looking at instant MAP not just MAP

We see that it's about "diff" being positive or negative, and diff is difference of instant MAP at the "mapCamDetectionAnglePosition" engine position.

So depending on where is your sync point on your trigger mapCamDetectionAnglePosition "MAP readout angle" setting would have to be different.

Do you have a link to Yamaha FZ09 tune?

https://rusefi.com/online/?vehicleName=FXLRS&user_id=1662 or https://rusefi.com/online/?vehicleName=RoadKing+TEST&user_id=1662 could be helpful

In canned tune I see engineConfiguration->mapCamDetectionAnglePosition = 50;
image.png
image.png (62.82 KiB) Viewed 4631 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
User avatar
NormanAlphaspeed
Posts: 63
Joined: Fri Jan 13, 2017 7:15 am
Location: Puerto Rico
Contact:

Re: MAP Sync and how it works

Post by NormanAlphaspeed »

https://rusefi.com/online/view.php?msq=1093

Link to FZ09 tune


-_________________
I think there is a problem at setting the detection angle at 50, because for some reason with VTwin by MAP active, the count starts at 360 and goes up to 720, so 50 degrees never happens
Post Reply