Abe & JasonC's NB Cam & Crank input circuits
#85
Boost Pope
Thread Starter
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
I see I have sparked some renewed interest here.
Being home with a cold, I decided to prototype Jason's circuit this morning (largely out of boredom) and saw that the effective hysteresis spread with the CD40106 was only about 0.6v, although the thresholds were pretty ideal, 2.6v high-going, 2.0v low-going.
The scope traces which revealed this, where CKP into 40106 after the filter is is upper trace, output of IC is lower trace. We're at 40us/div horizontal, and 1v/div vertical on the upper trace:
Not horrible, really. Those traces were taken with a .1uf cap in position C1 and 1k in position R1, with a 1k pullup. Increasing the value of C1 to 0.2uf increased latency to about 300us on the high-going transition, which is just outside the MS's "hardware latency" compensation range (max value is 255us). So I'd wager than 0.15uf is probably the ideal value here.
Sadly, Digikey is without stock on the 74C14, so I'll probably just proceed with this circuit.
Being home with a cold, I decided to prototype Jason's circuit this morning (largely out of boredom) and saw that the effective hysteresis spread with the CD40106 was only about 0.6v, although the thresholds were pretty ideal, 2.6v high-going, 2.0v low-going.
The scope traces which revealed this, where CKP into 40106 after the filter is is upper trace, output of IC is lower trace. We're at 40us/div horizontal, and 1v/div vertical on the upper trace:
Not horrible, really. Those traces were taken with a .1uf cap in position C1 and 1k in position R1, with a 1k pullup. Increasing the value of C1 to 0.2uf increased latency to about 300us on the high-going transition, which is just outside the MS's "hardware latency" compensation range (max value is 255us). So I'd wager than 0.15uf is probably the ideal value here.
Sadly, Digikey is without stock on the 74C14, so I'll probably just proceed with this circuit.
#87
Boost Pope
Thread Starter
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
You know what's even easier than that?
Your mom.
(Bazinga.)
I was thinking about this last night.
While the 74C14 does have a guaranteed minimum 1v HT, it also has specified VT+ of minimum 3v, typical 3.6v. As such, using a 74C14 instead of a CD40106 would dramatically increase the effective time-constant of the RC filter, pushing it well outside of the maximum compensation which can be applied within the MS (255us), and thus forcing me to reduce the actual time-constant of the filter.
Such a tradeoff requires an analysis of the probable interference modes within the system in order to make an informed choice. I do not, unfortunately, have a scope capture available of a typical "noisy" system, however I can foresee two possible situations:
1: There is induced noise present on the line, causing ripple in the signal, and
2: The sensor exhibits a behavior analogous to switch bounce, possibly due to mechanical factors (vibration, timing belt stretch, lash in the interface between the cam and the CAS, etc.)
Now, a part with a larger hysteresis would be effective in combating scenario #1, although it seems quite a stretch to me to envision there being 600mv or more worth of noise in the line. It would not, however, be effective against a signal which exhibits ringing across the full rail-to-rail range.
Sacrificing on-chip hysteresis in favor of a longer actual RC time constant, however, provides protection against both scenarios. Noise will inherently be absorbed by the filter, as will ringing events provided that they occur within a sufficiently brief time window.
In other words, I'm starting to change my opinion here, looking at a large RC time constant as being of greater significance than a large hysteresis voltage, given the constraint of a hard limit on total trigger latency.
Your mom.
(Bazinga.)
While the 74C14 does have a guaranteed minimum 1v HT, it also has specified VT+ of minimum 3v, typical 3.6v. As such, using a 74C14 instead of a CD40106 would dramatically increase the effective time-constant of the RC filter, pushing it well outside of the maximum compensation which can be applied within the MS (255us), and thus forcing me to reduce the actual time-constant of the filter.
Such a tradeoff requires an analysis of the probable interference modes within the system in order to make an informed choice. I do not, unfortunately, have a scope capture available of a typical "noisy" system, however I can foresee two possible situations:
1: There is induced noise present on the line, causing ripple in the signal, and
2: The sensor exhibits a behavior analogous to switch bounce, possibly due to mechanical factors (vibration, timing belt stretch, lash in the interface between the cam and the CAS, etc.)
Now, a part with a larger hysteresis would be effective in combating scenario #1, although it seems quite a stretch to me to envision there being 600mv or more worth of noise in the line. It would not, however, be effective against a signal which exhibits ringing across the full rail-to-rail range.
Sacrificing on-chip hysteresis in favor of a longer actual RC time constant, however, provides protection against both scenarios. Noise will inherently be absorbed by the filter, as will ringing events provided that they occur within a sufficiently brief time window.
In other words, I'm starting to change my opinion here, looking at a large RC time constant as being of greater significance than a large hysteresis voltage, given the constraint of a hard limit on total trigger latency.
#91
Jason/Joe,
There are some new chips which I've been wanting to try - and I agree that a little bit of predictable delay isn't a bad thing (what's a few degrees between friends)... But as I recall with my circuit, I'd slightly bumped the values of the resistors (more for what was commonly available than to re-engineer anything) nonetheless I bumped them so the hysteresis was greater.
Off the top of my head, I don't know what that number was, but I recall it was pretty substantial... That I tried smaller numbers like a 1 volt window and got nothing. I believe on the car you need to have at least a 3 volt, I would do a 3.5 volt, to be sure you're getting rid of the ungodly amounts of noise present (i.e. switching at >4.25 and <0.75). I remember in testing being shocked how big it had to be.
Is MS2/3 code for the new hybrids? I thought you had to. I mean, I thought their inputs were still shady. Fred over at FreeEMS has some little super cheap dual input board which actually looks ok - I was very tempted to try it on a friend/customer's car only his real issue was grounding and once he fixed it everything was better. :-)
There are some new chips which I've been wanting to try - and I agree that a little bit of predictable delay isn't a bad thing (what's a few degrees between friends)... But as I recall with my circuit, I'd slightly bumped the values of the resistors (more for what was commonly available than to re-engineer anything) nonetheless I bumped them so the hysteresis was greater.
Off the top of my head, I don't know what that number was, but I recall it was pretty substantial... That I tried smaller numbers like a 1 volt window and got nothing. I believe on the car you need to have at least a 3 volt, I would do a 3.5 volt, to be sure you're getting rid of the ungodly amounts of noise present (i.e. switching at >4.25 and <0.75). I remember in testing being shocked how big it had to be.
Is MS2/3 code for the new hybrids? I thought you had to. I mean, I thought their inputs were still shady. Fred over at FreeEMS has some little super cheap dual input board which actually looks ok - I was very tempted to try it on a friend/customer's car only his real issue was grounding and once he fixed it everything was better. :-)
#92
Boost Czar
iTrader: (62)
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
the VR input on the MS can sync reliably well over 20K RPMs or something (forgot what diyautotune.com tested). There's no issue with it and it's already built into the mainboard and expander board.
I sure Fred will say bad things about it, that's what he does, but there's also thousands of cars running it vs his what? handful?
so long as you're running MS i see no point in reinventing the wheel trigger... because it's as simple as inserting two jumpers and adding 1 pullup.
I sure Fred will say bad things about it, that's what he does, but there's also thousands of cars running it vs his what? handful?
so long as you're running MS i see no point in reinventing the wheel trigger... because it's as simple as inserting two jumpers and adding 1 pullup.
#95
Boost Pope
Thread Starter
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
No, I got tired of driving in bullshit traffic for an hour and a half every day to get from his place up to Carlsbad about two years ago. And I'm pretty sure that with the two of us in the same place, we had to have been violating some city ordinance for "maximum number of non-functional engines stored in a residential dwelling."
edit: given that this is a Miata form, I suppose that this particular line of conversation could be interpreted in a couple of different ways. (And yes, the neighbors had taken note of two Miata-owning men sharing a residence. Abe's pink motorcycle didn't help matters.)
edit: given that this is a Miata form, I suppose that this particular line of conversation could be interpreted in a couple of different ways. (And yes, the neighbors had taken note of two Miata-owning men sharing a residence. Abe's pink motorcycle didn't help matters.)
#99
so, I have the car running, but the trigger angle is set to 4+0. the problem im having is its hard to start. is sounds like its out of time and backfiring until it fires up, then all is fine. From what ive read, the settings I have put the ms in next cylinder mode, I suspect that has something to do with it. attatched is the circuit I built for the 2nd input. I have is going to pin 11 on the processor. (not js10)
#100
Not horrible, really. Those traces were taken with a .1uf cap in position C1 and 1k in position R1, with a 1k pullup. Increasing the value of C1 to 0.2uf increased latency to about 300us on the high-going transition, which is just outside the MS's "hardware latency" compensation range (max value is 255us). So I'd wager than 0.15uf is probably the ideal value here.
I wouldn't set the delay to be more than about 75 us. At 7000 RPM, one degree of crank rotation takes 24 us. So 75 us is about 3*.
The problem is not being unable to correct for the latency in software. Rather, the problem is the *variance* in latency over temperature and time. The capacitor tolerance, and the Schmitt thresholds, can change with temperature. Therefore the latency will change. If your 75 us latency varies by 30%, that's a 1* change in latency. If your latency is 250 us, that'll be a 3* change. Your software can't know that it changed.
Sacrificing on-chip hysteresis in favor of a longer actual RC time constant, however, provides protection against both scenarios. Noise will inherently be absorbed by the filter, as will ringing events provided that they occur within a sufficiently brief time window.
In other words, I'm starting to change my opinion here, looking at a large RC time constant as being of greater significance than a large hysteresis voltage, given the constraint of a hard limit on total trigger latency.
In other words, I'm starting to change my opinion here, looking at a large RC time constant as being of greater significance than a large hysteresis voltage, given the constraint of a hard limit on total trigger latency.