MEGAsquirt A place to collectively sort out this megasquirt gizmo

Abe & JasonC's NB Cam & Crank input circuits

Thread Tools
 
Search this Thread
 
Old 05-12-2010, 10:00 PM
  #81  
Elite Member
iTrader: (2)
 
240_to_miata's Avatar
 
Join Date: May 2007
Location: Cromwell, Connecticut
Posts: 2,604
Total Cats: 16
Default

Thank you. This will be next weeks mission. Id do it this week, but I want my car running for autox

So should I bother disconnecting the TSEL to OPTOUT or just leave it ?
240_to_miata is offline  
Old 05-13-2010, 01:23 AM
  #82  
Senior Member
iTrader: (7)
 
Marc D's Avatar
 
Join Date: Jul 2007
Location: Milpitas, CA
Posts: 1,047
Total Cats: 1
Default

Originally Posted by 240_to_miata
Thank you. This will be next weeks mission. Id do it this week, but I want my car running for autox

So should I bother disconnecting the TSEL to OPTOUT or just leave it ?
As far as circuits are concerned, you would probably need to cut the connection. Just use a wire/plier cutter, and it should be easy to desolder.
Marc D is offline  
Old 05-14-2010, 09:35 PM
  #83  
Elite Member
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

Yeah - you don't need to take out the entire circuits (though it wouldn't hurt) at least break each end of it - i.e. where it goes to the CPU, and where it goes to the DB37.
AbeFM is offline  
Old 01-13-2012, 04:05 PM
  #84  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Joe Perez
Jason, regarding the circuit in post 14- I see no pullup on the input side of the gate. Seems to me we need one to the left of R1.

Also, we need the control pin to be tied high. That pin isn't illustrated on your symbol. but the CD4016 has one control per gate.
To update this thread...
The 74C14 (same functionality) appears to have better hysteresis specs for our purposes.
JasonC SBB is offline  
Old 01-13-2012, 04:26 PM
  #85  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

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.
Attached Thumbnails Abe & JasonC's NB Cam & Crank input circuits-o8c2h.gif   Abe & JasonC's NB Cam & Crank input circuits-xuem0.gif  
Joe Perez is offline  
Old 01-13-2012, 04:32 PM
  #86  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

youknow whats easier?


using the VR input circuit...
Braineack is offline  
Old 01-15-2012, 04:12 PM
  #87  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

Originally Posted by Braineack
youknow whats easier?
using the VR input circuit...
You know what's even easier than that?

Your mom.

(Bazinga.)


Originally Posted by JasonC SBB
To update this thread...
The 74C14 (same functionality) appears to have better hysteresis specs for our purposes.
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.
Joe Perez is offline  
Old 05-02-2012, 11:45 AM
  #88  
Junior Member
 
FatKao's Avatar
 
Join Date: Mar 2010
Posts: 491
Total Cats: 32
Default

For those like me who barely understand what's going on. Make sure you bring Vdd to +5v and Vss to ground when the CD40106 circuit. Otherwise ---- gets weird.
FatKao is offline  
Old 05-02-2012, 11:49 AM
  #89  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

I dont really see any point to this circuit anymore, at least when using MS2/3
Braineack is offline  
Old 06-16-2012, 05:40 PM
  #90  
Junior Member
 
MD323's Avatar
 
Join Date: Sep 2010
Location: SFL
Posts: 369
Total Cats: 3
Default

would a LM324 work in the application also? 0ne channel to the TSEL and the cam to the 3x or this.


I also want to bring 2 separate vehicle speed sensors in on the remain 2 channels later on.
MD323 is offline  
Old 06-21-2012, 02:52 PM
  #91  
Elite Member
iTrader: (3)
 
AbeFM's Avatar
 
Join Date: Aug 2006
Location: San Diego, CA
Posts: 3,047
Total Cats: 12
Default

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.

Originally Posted by Braineack
I dont really see any point to this circuit anymore, at least when using MS2/3
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. :-)
AbeFM is offline  
Old 06-21-2012, 02:56 PM
  #92  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

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.
Braineack is offline  
Old 06-21-2012, 05:01 PM
  #93  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

Abe! I thought you were dead! Haven't seen you around these parts in forever.
Joe Perez is offline  
Old 06-21-2012, 05:11 PM
  #94  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

dont you live together?
Braineack is offline  
Old 06-21-2012, 05:16 PM
  #95  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,022
Total Cats: 6,590
Default

Originally Posted by Braineack
dont you live together?
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.)
Joe Perez is offline  
Old 01-03-2013, 07:42 PM
  #96  
Junior Member
iTrader: (2)
 
tottestad's Avatar
 
Join Date: Sep 2011
Posts: 318
Total Cats: -1
Default

if I build this circuit in the vr area of the board, what are the settings in tunerstudio, under spark settings and wheel decoder settings, if run with a CAS?
tottestad is offline  
Old 01-03-2013, 08:59 PM
  #97  
Boost Czar
iTrader: (62)
 
Braineack's Avatar
 
Join Date: May 2005
Location: Chantilly, VA
Posts: 79,493
Total Cats: 4,080
Default

are you building a ms2?
Braineack is offline  
Old 01-03-2013, 09:58 PM
  #98  
Junior Member
iTrader: (2)
 
tottestad's Avatar
 
Join Date: Sep 2011
Posts: 318
Total Cats: -1
Default

No, its an ms1. The car has the cruising stumble. By the log its setting off the rev limiter. Spiking rpm to around 9000 rpm in the logs.
tottestad is offline  
Old 01-04-2013, 11:25 AM
  #99  
Junior Member
iTrader: (2)
 
tottestad's Avatar
 
Join Date: Sep 2011
Posts: 318
Total Cats: -1
Default

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)
Attached Thumbnails Abe &amp; JasonC's NB Cam &amp; Crank input circuits-2ndopto.jpg  
tottestad is offline  
Old 03-29-2013, 04:33 PM
  #100  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Originally Posted by Joe Perez
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.
Hmm, I missed this post when it came out.

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.
What you have to look at, to judge between long RC constant with small hysteresis, vs. vice versa, is, for a given latency, how good the noise rejection is. The big difference between large hysteresis and small hysteresis is that, once the state of the output toggles, large hysteresis makes it more resistant to noise that tries to toggle the output back. Which is the whole point of hysteresis to begin with.
JasonC SBB is offline  


Quick Reply: Abe & JasonC's NB Cam & Crank input circuits



All times are GMT -4. The time now is 07:24 AM.