Any general discussion around the firmware, what is does, how it does it etc.
#66494
so simple maths says,

Normal tooth 12.7ms
Small tooth 8.5ms
difference is 4.2ms
if we take half the difference (2.1ms) and convert all of the above into percentages we get,

Normal tooth 100%
Small tooth 67% of the duration of a normal tooth
Difference between the two is 33%
Half way between the two is 84%

So if we find a tooth that who's duration is 84% or less of a full sized tooth we've got a small tooth. With teeth occurring every 90 degrees this doesn't sound like a robust tooth 1 detection strategy to me. Could potentially measure the gap between teeth so the gap has to over 116% and then the tooth less than 84% which complicates the code as we'd have to then decide what do we do if the gap is below and the tooth above the threshold or vis-versa.

If you think 84% works, let me know and i'll knock up some sample code based on missing tooth decoder to test.

Also, i'm picturing this as being very similar to a dual wheel setup conceptually. The trigger is the rising edge and all 8 teeth are spaced identically - this is like dual wheel. The difference is the 'secondary' isn't actually a separate wheel but a routine within dual wheel to reset the tooth counter.
#66500
I imagine 84% and 116% are the issue, especially at cranking speeds with compression lope. This may be why Ford used self-triggering with the TFI module on leading edge (similar to GM HEI event triggering), as it allowed cranking and starting at fixed-angle timing, with controlled timing only occurring at higher (more predictable?) speeds, advancing ahead of the base timing.

Perhaps that could be first-step testing POC, avoiding the limited signature difference in the worst conditions. Conversely, the ECM could function similar to the module, transitioning from signal-return firing at low speeds (on leading edge), to controlled timing when it can read reliably to advance the timing. I'm guessing this is how other systems handle it, but not sure.

Corny idea, but what about identifying only the tooth and gap pair, and checking (no matter the rpm) for relative size of the pair simply against each other? So (easy numbers), it reads a tooth at 8.4ms and a gap at 11.6ms, therefore relative ratio = signature. If tooth and gap are near equal or not signature ratio = not signature. Perhaps this would take the rpm (and some of the accel's including compression lope) out of the mix. I'm thinking the gap is just as useful and important as the tooth.
#66510
Wish i'd read your reply earlier..... got carried away and wrote some code, then threw that away as i learned some more, wrote some more which almost worked but inspired me to try a third time ...... which is working in my test environment

(if i could paste from the clipboard you'd have an image from my logic monitor of full sequential on 4 cylinder engine using an 8 tooth wheel which has 1 smaller tooth)

I didn't think the compression issue would be an issue - its 8 teeth, one per cylinder, each leading edge is identical and physically (via the cam) linked to the crank so they'll always have compression at the same point for every cylinder, so the measurement will be the same for every cylinder. The concern as I think about it would be initial ignition which could see a large decrease in time between trigger events.

Not sure how I can do self triggering as I'd need to know what is the small tooth to know which ignition event and injector to trigger - unless you're suggesting this keeps the distributor and its single channel ignition?

If you want to try the current version its here -> https://github.com/mike501/speeduino/tr ... othTrigger
If you need a guide to compiling code onto an arduino let me know.

I'll think about your logic suggestion.
#66511
10 minutes thinking - I'm not sure gap+tooth will work any better. Please correct the logic i'm using below.

Assumptions
- every 90 degrees we get a gap and tooth pair for a normal tooth
- every 90 degrees we get compression event at the same relative point on the cycle
- compression slows down the cycle

The figures we're working from say for a normal tooth is (near enough) 50% gap and 50% tooth. We can't work with this as we don't know how much the gap/tooth duration will be affected by compression or ignition - unless you've got data that says the 50/50 split we're working with includes compression slow down - then we're into situations that old engines or wild cams will affect the figures.

Alternatively we compare the ratio between previous teeth & gap and the current tooth & gap, if it shifts then it must be small tooth. The difference is 33% and we're back to my original post as all i'm doing is measuring the difference in tooth size as opposed to tooth+gap size.
#66521
miker wrote: Sun Dec 31, 2023 12:47 pmAssumptions
- every 90 degrees we get a gap and tooth pair for a normal tooth
- every 90 degrees we get compression event at the same relative point on the cycle
- compression slows down the cycle
Ah, and as it is every cylinder, then every signal is affected the same. IOW, every signal has compression and acceleration involved, just as the last (assuming #T = #cyl, e.g., TFI/Holley).

What I hope this allows is a verification that the narrow tooth read is validated by a wide gap read. This then would remove any RPM implications, and helpful to "hot cam" errors. You're not relying on just one read, and with only one more edge, verifying with two as a ratio. If I'm thinking right, this would then make a signature tooth & gap the equivalent of a missing tooth for settings, allowing selection of Signature instead of Missing tooth in setup, with all the same available parameters.
miker wrote: Sun Dec 31, 2023 12:47 pm…or wild cams will affect the figures.
This appears to be an issue with any decoder? Are there any that are not affected by lope?
#66531
Whilst I'd written my assumptions I realise I wasn't clear, the code i've written doesn't have a hard coded link between teeth and cylinders. You could use an 8 tooth decoder on a 4 cylinder engine. The assumptions written were based on our conversation of an 8 cylinder engine. Anyway..... sticking with 8 cylinder / 8 tooth....

I don't think the narrow tooth / wide gap really helps us unless i'm missing something in the logic. I see the options as follows,

1) read previous tooth, compare to current tooth. If the difference is less than 84% then its a small tooth - we've found our sync point (the way the code is currently setup)
2) read previous gap, compare to current gap, if the difference is greater than116% then its a large gap - we've found our sync point (alternative to current approach by measuring the gap instead of the tooth - no real difference in logic or performance)
3) read the previous gap and tooth, compare to the current gap and tooth, if the difference is 84% & 116% - we've found our sync. Although this adds the complication of what if its 83% tooth and 115% gap (one indicates small tooth and one indicates its a normal tooth). Do we claim small tooth as both didn't come back positive?, or do we now say we've not lost sync completely? The only advantage is we're doing both tests listed above in a 90 degree window. Does this really help?

unless the engine is very steady state then the previous tooth + gap and current tooth + gap won't be identical. How much of our 16% do we attribute to a margin of error for engine speed change? If we're adding engine speed change to tooth + gap does it really add any extra value than just checking the tooth size?

Everything we do is still working to the 84% or 116%. If we're on a 8 cylinder engine on an 8 tooth trigger, then we'll be measuring at broadly the same point in the cycle. So either it works as approach 1 or it doesn't. I don't think doing approach 2 or 3 gains us anything apart from more of the same checks and with point 3 more complication if one check works and one doesn't.

The simple answer may be to use the speeduino trigger set up option to ensure 2 complete revolutions before firing the engine. This will hopefully give constant speed on the starter, which means you've got the chance of finding sync. Once done the speeduino can in theory run without a cam / home tooth signal on dual wheel.

Simple maths (never my strong point) says, 400rpm, gaining 16% would mean going from 400 to 464 rpm, within 90 degrees. If this increase per 90 degrees continued over 360 degrees it would go from 400 to 656 rpm. 360 degrees takes 150us and 90 degrees 37.5us. I'm not an engine expert but that rate of increase / decrease doesn't sound feasible.

Guess we need a willing tester to give it a go.
#66535
miker wrote: Mon Jan 01, 2024 5:15 pmunless the engine is very steady state then the previous tooth + gap and current tooth + gap won't be identical. How much of our 16% do we attribute to a margin of error for engine speed change? If we're adding engine speed change to tooth + gap does it really add any extra value than just checking the tooth size?
Perhaps it is not of value, but it seemed so to me, if nothing else as a verification that the narrow tooth wasn't from acceleration, or the previous tooth compare from deceleration.

With Missing Tooth, we have a 200% window to the next tooth signal, so the code uses 150% (1.5x) in order to account for reads, vibration, acceleration, etc. Our window is much smaller at +/-16%, and therefore more prone to error. Perhaps a window of -8% to -24% (16% median) of last tooth would get it, assuming accel is not larger than that. Is the system, in a typical installation, capable of reliably detecting -8 to -24% differential from last tooth relaibly?

In order to verify the narrow tooth read was actual, and not a product of an external influence like accel, the gap should also be >±8% of last gap. In my mind, if decel shows this tooth not as 'small' and near equal to the last tooth, it's missed. But if the next gap is huge... that was it! That's my verification vision, adding to your approach.

• NEW APPROACH - start over
Of course, my bigger point was using them as an isolated pair, so time of last tooth or gap is irrelevant. We don't care what that was, as the pair has both times, x% shorter and x% longer (now a 32% spread! :mrgreen:) = signature. Any pair like that is signature, and of course there is only one. Completely different approach. Not an add-on to your approach.

I hope your response is that you understand the different concept, and it can or can't work for some specific reason. If not, I don't know what's missing in my explanation, how to word the concept differently, or if I'm off the deep end. :lol:
#66540
Unfortunately I'm out of time to do any more coding on this.

One concern with the new approach - where is the compression and ignition events. Comparing previous tooth to current tooth you take out most / almost all effects of the previous event vs this event. With this new approach you have nothing to act as a baseline to compare against. Missing tooth uses the previous tooth (frequently from 10 degrees prior to act as that baseline).

This could mean in our case the tooth benefits from an ignition event and the gap contains compression skewing the results.

Reality - we need someone to run tooth logger and share the data so we're not guessing.
#66560
That's cool, I completely understand ;), and thanks for your time and insight. Agreed, some basic data is needed to guide direction. Do you have some preliminary narrow-tooth code to test on the bench or otherwise, you could share?
Injected 2 stroke Bultaco

Alternator testing. Its a 3 phase circa 200w alter[…]

BMW E23 M30B28

Okay, I managed to start the engine. The &quot[…]

NO2C crank signal issues

Once again PSIG, thank you. Note this is set up fo[…]

I've managed to dig up a few obscure wiring diag[…]

Still can't find what you're looking for?