Any general discussion around the firmware, what is does, how it does it etc.
#66609
Sorry I have been absent from this forum for a while, but here is how I made my TFI decoder. I set the trigger to change, so you detect on rising and falling edge. To first detect you are at the signature tooth for sync you look at the falling edge. So if the current tooth is smaller than than the last gap and the falling edge time is less than the rising edge time, then you are at the signature tooth. This way you double confirm the signature tooth and you compare 31.5 to 45 degrees (142% larger) and 76.5 to 90 degrees (118 %). Then on the next trigger, if the current tooth is 1 (signature) I also measure from the rising edge of the 2nd tooth, so that way you have a 58.5 degree gap compared to the 31.5 degree tooth and I also compare 58.5 degree gap to the 45degree gap before. You only check for sync while cranking (not in sync) and if the current tooth is the signature tooth, not every trigger event. So you are generally looking at 4 events in 135 degrees, and the large gap is 58.5 degrees compared to 31.5 degree tooth which is 185.7% larger but I set a target of being at least 150% larger while running so it can accommodate for acceleration/deceleration in that 90 degree window. I have never used Github to share code but that would be easier than trying to copy and paste the code here, so I may have to look into setting that up so you can try it out.

Chris
#66621
It worked but I created it on an older version of Speeduino, and so I had to recode it for the current version. I was using the old functions and Boolean variables instead of the BIT_SET and BIT_CLEAR, but it compiles now without errors. The old set end teeth function is no longer there, and it looks like it will default to the missing tooth if you leave that function call void. So, I need to load this version in to make sure it will run. I also need to clean up the code, and clear out the commented out code before getting it submitted. I wanted to put it out there so others could test as well if they were so inclined. I do have it coded so it should work with the 2.3 Lima 4 cylinder and the 300 6 cylinder that use TFI as well but never tested those. On my car, I am still using the TFI module and a single coil since I never got around to building the drivers to run the EDIS modules. With the weather in the 30s, it is going to take some real motivation to get it loaded but will try.

Chris
#66645
had a quick look at the code - looks good. Couple of thoughts from a very quick scan,

Why do you need to set the tooth angles? They're all exactly the same amount apart & this is normally for oddly spaced teeth. If you set the number of teeth to match a the number on the rotor you could use the missing tooth set end teeth.

If you use the entered number of teeth from tuner studio instead of forcing it to match the number of cylinders it would allow people to pick a higher tooth count trigger for a four cylinder engine and get better resolution. (not sure how useful this is practically but PSIG mentioned it and i'd instinctively done this anyway).
#66646
Just noticed, very top of decoders.cpp,

#define MJR 1

That is a debug line from my code at some point in the past. It shouldn't be there.

And whilst looking to see if you'd added code to look to see if the edge was high or low as you're using 'change' trigger, you've not followed the coding standard. We do the curly braces on the following line, eg

if (something
{
do this;
do the other;
}

Not,
if (something) {
do this;
do the other;
}

The only time you'd not follow this is if all the instructions were on one line which should be a single command, like this,

if (something)
{ do something; }
#66665
Miker, the #define MJR 1 is in the Speeduino Master, so I did not put that in there. Thanks, I fixed the brackets in the if/else statements to follow the standards, which I honestly did not look at and just started coding to see if I could even make this work. As far as the tooth angles, that is used for the crank angle calculations so I just put in the 3 different TFI spacings in there for the 4, 6, and 8 cylinder variants of this distributor and thought that was needed for sequential as well as per tooth ignition. If the code is to be changed to a generic signature tooth detector, then I guess variable tooth count would make sense. However, if that could be any number then all of the angles would have to be calculated, and it could break something if it doesn't divide evenly into 360 or 720 right? I think there is a decoder that only looks at every 3rd tooth because of that. I mean if you have a 4 cylinder TFI and are going to change out the trigger wheel in the distributor, you could just go to a missing tooth and not mess around with a signature tooth is my thoughts on that. Also, I was able to test this code(before bracket changes) on the bench with my distributor that I have connected, and it works. I did not get to try it in my vehicle yet due to cold and snow and being dark by the time I am home from work, and we are supposed to get another 10 inches this weekend, so, it may be a bit.
#66674
Cgutierrez22 wrote: Thu Jan 11, 2024 6:38 pmI mean if you have a 4 cylinder TFI and are going to change out the trigger wheel in the distributor, you could just go to a missing tooth and not mess around with a signature tooth is my thoughts on that.
True, and is what we do now for most any as the easy option. I only mentioned it as if the code somehow allowed the option, TFI 8-tooth wheels would be dirt cheap and common, to throw-into a 4 or 6-cyl, or easily cut on a divider head for 18T or whatever.

Just something in the back of the brain while looking for options and applications. I think some of the GM and more likely the Bosch signature tooth wheels are higher tooth count. I'll have to look into that for application expansion or future-proofing. BTW, any option to modify +tooth code to read leading and trailing of wider/narrower teeth, or is that a per-wheel thing with +tooth decoders?
#66677
PSIG, we could basically duplicate this code to create another decoder to look for other signature tooth patterns. Then you could put the number of teeth to anything because we could disable the "new ignition" mode and get rid of the per tooth timing. With the TFI, if you are still using the TFI module and distributor, I am not sure what would happen if you loose spout and have extra teeth firing the coil between cylinders, or have an 8 cylinder wheel on a 6 cylinder engine. If you are using a smart coil, COP, or coil packs there would be no spark, but TFI fires on the PIP rising edge if it has no spout input. As far as the +tooth count, are you asking if you can count both the rising and falling edges? I originally had it do that and had the leading and falling angles in the tooth angle array, but I found that was not necessary to find the signature tooth. As Miker pointed out, I probably no longer even need the tooth angle array since they are equally spaced, and I even have it calculate the trigger angle with 720/cylinders. I also left the trigger high or low option in there because I was using a MOSFET instead of a diode on the PIP so I would get a true 0v ground instead of the 0.6V, but that inverted the trigger. Anyway, I now have it keep track of the last 2 falling edges(actually non-trigger edges for inverted signals) so you can calculate the current gap on a rising trigger, and the previous falling tooth gap time. When it is at tooth 1(signature) and a falling trigger you can compare the current falling gap time to the previous falling gap time which should be shorter for the signature tooth versus about the same for all other teeth. So the combination of checks should work for other signature tooth patterns as long as the differences are big enough between the signature and standard pattern. I currently have the threshold at 1.5 times, but could work on more patterns if I knew what were were targeting. If you have any other patterns that you could share, that would be great, and I could check the math to see if they would work if I created a generic signature decoder from this one.

Chris
#66685
IMO regarding TFI specifically, this decoder is a decoder only, for use with narrow-tooth signature systems (such as TFI). The decoder interprets the sensor signal only, or (optionally) the TFI module PIP signal. The TFI module is not required for this portion, nor consideration of it or its function. Like any other decoder, the use of other components in the system are optional, and use of the TFI module is also. Assuming inclusion of the TFI module in the decoder planning would completely change the scope from potential signature decoder to TFI Distributor Module decoder.

In other words and IMO, using another decoder such as missing-tooth or dual-wheel does not assume a specific set of hardware, and neither should this. I have always assumed the TFI module would not be a mandatory part of signature setups or TFI decoder, if for no other reasons than it would limit use to #cyl and distributor-fire, eliminating all other common options such as sequential coil packs, CNP, COP, etc, that sequential triggering would otherwise enable for other decoders.

If possible, my first application of this decoder would be an 8-tooth TFI distributor, no TFI module, 3-pin TFI Hall sensor signal direct to Speeduino, and output to LS coil packs. The conversion to CNP or COP would be very simple. This is why I suggested a perspective and scope for the project early on, in order to capture as many options into the decoder as possible. That said, I'm not writing it, and am happy to take whatever any of you produce that moves us forward in this direction. 8-)
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[…]

Niiiice... 8-) Looking forward to your updates![…]

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