Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added poll level cam trigger type for missing tooth decoder. #450

Merged
merged 15 commits into from Feb 22, 2021

Conversation

pazi88
Copy link
Contributor

@pazi88 pazi88 commented Aug 25, 2020

This poll level cam decoder is mainly meant to be used with the "half moon" cam trigger wheels have one big tooth that is half cam rotation wide. This is used with hall sensor in many BMW engines at least (m50tu, m52, m52tu, m54 etc.) plus in engines from other manufacturers too and effectively the cam input is high for one engine rotation and low for second engine rotation. So ecu can just poll the cam input at tooth#1 and know the engine phase immediately from the fact that is the cam input high or low. No need to wait for edge trigger and this allows very fast sequential sync.
Example cam trigger wheel:
image

As for example in this the yellow is the injector pulses and blue 60-2 cam signal. This is with regular one tooth at cam decoder:
image

This is how much faster sync the poll level decoder gets:
image

The decoder can be used with other type of cam trigger wheels if those use hall sensor and the section for low and high are wide enough around #1tooth. Adding adjustable tooth for checking the phase would make this more versatile, but I couldn't get that working without too much of a performance hit. But #1tooth to check should work for majority of the cases.

There is pattern for ardustim to test this here: speeduino/Ardu-Stim#3
This also works with closed loop VVT.

@VitorBoss
Copy link
Contributor

VitorBoss commented Aug 25, 2020

If instead of comparing it in every tooth you compare it in (toothCurrentCount > (configPage4.triggerTeeth/4)) should improve the code a lot

Edit: If you use the macro READ_SEC_TRIGGER() instead of digitalRead should improve even further

@pazi88
Copy link
Contributor Author

pazi88 commented Aug 25, 2020

It should compare only at toot#1. Not every tooth.

@noisymime noisymime merged commit 7d3df68 into noisymime:master Feb 22, 2021
@pazi88 pazi88 deleted the poll_level branch February 22, 2021 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants