MEGAsquirt A place to collectively sort out this megasquirt gizmo

Abe & JasonC's NB Cam & Crank input circuits

Thread Tools
 
Search this Thread
 
Old 09-10-2008, 12:41 AM
  #21  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

If the capacitors used are Z5U or Y5V, and not temperature stable types such as NPO or X7R, the capacitance can very 2 to 1 over temperature. This means the delay can change by 2° at 7200 RPM. For a high boost, finely tuned engine, that is a bad thing.

Reduce the filter delay and use shielded cable directly from the CAS to the MS.

Frank, the lowpass filter will delay the edges a certain amount of time, not produce a fixed phase shift.

Last edited by JasonC SBB; 09-10-2008 at 12:51 AM.
JasonC SBB is offline  
Old 09-10-2008, 12:46 PM
  #22  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,026
Total Cats: 6,592
Default

Did nobody read the caption that says C1 and C2 can be omitted if not required? We're not espousing intentionally high-latency circuits here, merely duplicating what the factory did.
Joe Perez is online now  
Old 09-10-2008, 02:03 PM
  #23  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

It would be a BAD IDEA to have no noise filtering at all by removing C1 and C2.

Joe, no need to be defensive. I'm trying to help.

The factory probably uses NPO caps. Besides, 2° error on the factory map, without FI, wouldn't hurt the engine.

I repeat - anyone who builds that factory circuit is better off reducing those caps by a factor of 4, *and* using NPO or X7R type capacitors.

It would also be prudent to use shielded cable for CKP and CMP. The shield should be connected to the chassis at one end, and one of the inner conductors used for the sensor ground ... connecting from the sensor to the ECU sensor ground.

Anyone who wants a lower parts count circuit, can use the one I posted.
JasonC SBB is offline  
Old 09-23-2008, 08:34 PM
  #24  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,026
Total Cats: 6,592
Default

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.
Joe Perez is online now  
Old 09-24-2008, 01:44 AM
  #25  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Ah yes, that circuit was designed for my setup which is a parallel install - the factory ECU is installed. I don't know if the NB sensors by themselves have pulldown outputs if the factory ECU is not there.

You can add a pullup to the left of R1 and then just get rid of R2.
JasonC SBB is offline  
Old 10-14-2008, 11:44 AM
  #26  
Junior Member
 
323driver's Avatar
 
Join Date: Jul 2007
Posts: 57
Total Cats: 0
Default

Is the output of the CAS from 99-2005 and 90-93 the same?

Did anyone try Abe's circuit with the 90-93 CAS?

I have built the CMP input using the optoisolator circuit but everytime the RPM reach a certain value (~1750 rpm), they drop to 0 and then recover, the MS2 staying fully powered.
My next try is to connect the CAS CMP input directly to the MS port without the optoisolator and if that doesn't work, try Abe's circuit.

Thanks
323driver is offline  
Old 10-14-2008, 01:09 PM
  #27  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,026
Total Cats: 6,592
Default

Originally Posted by 323driver
Is the output of the CAS from 99-2005 and 90-93 the same?
They're similar. And frankly, this is a better circuit than the opto-based one for pretty much any Miata.
Joe Perez is online now  
Old 10-14-2008, 01:52 PM
  #28  
Junior Member
 
323driver's Avatar
 
Join Date: Jul 2007
Posts: 57
Total Cats: 0
Default

So it should work if I use this circuit with the 90-93 CAS, right?

Do you know what is the difference between the 2 CAS inputs? Maybe there is a way to account for the difference electronically?
323driver is offline  
Old 10-30-2008, 07:16 PM
  #29  
Newb
 
drytoast's Avatar
 
Join Date: Apr 2007
Posts: 3
Total Cats: 0
Default

Originally Posted by JasonC SBB
Or a CD40106 (which is very similar to a 74C14)

Like so.

You can increase the 470Ω resistor to ~1kΩ and the delay will be <0.5° at 7200 RPM.
Originally Posted by JasonC SBB
Ah yes, that circuit was designed for my setup which is a parallel install - the factory ECU is installed. I don't know if the NB sensors by themselves have pulldown outputs if the factory ECU is not there.

You can add a pullup to the left of R1 and then just get rid of R2.

Excuse my ignorance, but what is the purpose of the pulldown in the original circuit. Is that for use in a parallel install with the stock ECU? Just curious as to what the interaction is between two ECU's sharing the signal.
drytoast is offline  
Old 10-31-2008, 10:49 AM
  #30  
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,026
Total Cats: 6,592
Default

I'm not sure where you see a pulldown in the original circuit. Can you provide me with a reference designator?


Let me clarify a bit how the circuits in question work, and what Jason and I were talking about.

First, understand how the crank and cam sensors operate. They do not output a voltage, instead, they provide what in the EE industry is called an "open collector" output, which Jason is referring to as a pulldown output. The origin of the term "open collector" stems from the fact that historically, this type of configuration was achieved by attaching the output pin of the circuit to the collector terminal of an NPN transistor, with the emitter terminal connected to ground internally.

I know that not everyone is familiar with transistor theory, but in an NPN transistor, voltage is allowed to flow from the collector to the emitter whenever the base terminal is energized. The emitter terminal is the one with the triangle on it, the collector is the one opposite, and the base is the terminal on the left, which acts as a gate between the collector and the emitter. You can think of it as a relay, where the emitter and collector are the contacts, and the base is the coil. PNP transistors are similar, but voltage flows in the opposite direction and the base is active when grounded rather than when powered.

Sidebar: here's a quick and simple tutorial on how transistors work: Transistor Tutorial


Now, to get back on topic. I've drawn a massively simplified version of how Abe's circuit works, in which I have included the sensor itself:

As you can see, there is a pullup resistor inside the MS which causes the CPU to see +5v on its input whenever the sensor is "off". When the sensor turns "on", the transistor conducts all the voltage which is passing through the resistor to ground, causing the CPU to see 0v on its input. This is how the processor knows that something is going on.

Now, here's what it would look like if this were a parallel install with the stock ECU in place:

As you can see, there is already a pullup resistor inside the stock ECU. This is how it works from the factory. Since we can't easily eliminate this resistor, we eliminate the one inside the MS instead. The voltage provided by the pullup inside the ECU backflows into the MS, and provides the same functionality as the one we'd have put there originally.

Note that this is the same reason we must remove R7 from the MS with doing a parallel install with the CLT sensor shared between the two. Again, the ECU already has a pullup on the CLT line, and we don't want to do it twice.


Ok, now here's Jason's originall circuit again:

As you can see, there is no pullup resistor on the line to the sensor. This assumes that the stock ECU is there providing the pullup voltage.

If we wanted to use Jason's circuit in a standalone application, we'd need to install a pullup, or there would be no voltage on that line, ever. I've modified his drawing to show this:



One of these eons I'm going to get off my butt and draw a version of Jason's circuit that is complete and ready to use...
Joe Perez is online now  
Old 10-31-2008, 12:21 PM
  #31  
Newb
 
drytoast's Avatar
 
Join Date: Apr 2007
Posts: 3
Total Cats: 0
Default

Sorry, I should have been more clear. I understand the open collector concept. I was referring to R2 in his original diagram. That appears like a pull down except for the fact that its on the other side of the R1 (filter). Perhaps a better worded question is:

What is the purpose of R2?
drytoast is offline  
Old 10-31-2008, 04:27 PM
  #32  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Joe I commend your little writeup above.

drytoast, (typing your handle makes me chuckle, was that what your were eating when you were registering?), the purpose of R2 is to have a slight pull down offset effect on the signal, in case there are ground shifts (slight differences in ground between where the above circuit is, and the ground of the sensor). The reason this offset may be needed, is that the Schmitt trigger (CD40106) threshold centerpoint is not 2.5V, but a bit lower. Therefore it is more sensitive to a slightly positive "low" signal from the sensor, than it is to a slighlty negative "high" signal from the sensor. IIRC the minimum votlage for a definite "low" signal on the Schmitt's input is 0.8V, whereas for "high" it's ~3V. Exact values are in the datasheet.

Did that make sense?

The original reason I put R2 in is that with the factory ECU / parallel setup, I observed that the "low" signal was at ~0.4V, a bit too l close to 0.8V for comfort. If you have a standalone setup and the voltage is much closer to 0V, then R2 is not needed.

Last edited by JasonC SBB; 10-31-2008 at 05:12 PM.
JasonC SBB is offline  
Old 10-31-2008, 11:13 PM
  #33  
Newb
 
drytoast's Avatar
 
Join Date: Apr 2007
Posts: 3
Total Cats: 0
Default

Ahhh, makes sense.

As for the handle, that is a long story from University.

Too bad, I didn't see this thread earlier as I probably would have started with a schmitt trigger. Didn't even consider an IC that already does the same thing as this circuit. Oh well. I copied the idea from Abe's handiwork and just used the leftover VR opamp circuit on the MS board like in the attached picture.

The shaded area is what's in the proto area. The dashed lines are connections made with wire. The solid lines are traces already on the board. I tried to copy the same layout as the MS V3 schematics so you can see what components I left out, shorted or replaced with different values. You can ignore the opto circuit at the top. Another unused section I commandeered for clutch signal protection. I just wanted to document it so when something breaks later, I can figure out what I was doing.

Note: I used slightly different values in the feedback portion as that was what I had at home. Its about same ratios though. My input filter is also based on components left over from the MS kit. The caps are X7R.
Attached Thumbnails Abe &amp; JasonC's NB Cam &amp; Crank input circuits-input.png  

Last edited by drytoast; 11-01-2008 at 12:47 AM.
drytoast is offline  
Old 11-11-2008, 02:52 AM
  #34  
Junior Member
 
arga's Avatar
 
Join Date: Aug 2006
Location: Ridgecrest, Ca
Posts: 306
Total Cats: 0
Default

I built Jason's Schmitt trigger circuit. Should I add a resistor between the CD40106 output and the MS processor?

Please correct me if I'm wrong, but if there is no current draw by the processor then a 10k resistor wouldn't change the reading. On the other hand, if there is no current draw then I really don't need the resistor.
arga is offline  
Old 11-16-2008, 06:41 PM
  #35  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

Jason, do you see any problems using Drytoast's circuit (timingwise or so)? If not, it it would be very easy to use the entire VR area for his circuit, without having to use the proto area even.
WestfieldMX5 is offline  
Old 11-16-2008, 10:03 PM
  #36  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

frank, I don't see aproblem with the circuit.

arga, you don't need a resistor between the CD40106 and the MS processor unless they're 3 feet apart. I don't understand your 2nd Q - what 10k resistor?
JasonC SBB is offline  
Old 11-17-2008, 12:54 AM
  #37  
Junior Member
 
arga's Avatar
 
Join Date: Aug 2006
Location: Ridgecrest, Ca
Posts: 306
Total Cats: 0
Default

Thanks Jason. I asked one of the EEs I work with about this and he said if the Schmitt trigger wasn't TTL I would need a pull up but I had no idea what the CD40106 was.

No real second question, just trying to understand some things and it came out as rambling. I guess my real question is; does the MSII processor (MC9S12) draw current when it reads a voltage?
arga is offline  
Old 11-17-2008, 03:05 AM
  #38  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

thx Jason

Drytoast, I used your design (hope you don't mind) and put Abe's components in it's place. I also reordered the components so they actually fit in the VR area. No need to use the proto area.
Although it looks difficult and there seem to be a lot of wires, it's really not that bad.
Attached Thumbnails Abe &amp; JasonC's NB Cam &amp; Crank input circuits-cmp_and_ckp_input_circuits1.png  

Last edited by WestfieldMX5; 11-28-2008 at 05:13 PM.
WestfieldMX5 is offline  
Old 11-19-2008, 05:09 AM
  #39  
Senior Member
 
WestfieldMX5's Avatar
 
Join Date: Nov 2007
Location: Belgium
Posts: 999
Total Cats: 73
Default

Can't find a LM358N locally, would it be ok to use a TL082 instead? Or do I need to change the values of the resistors?
WestfieldMX5 is offline  
Old 11-19-2008, 06:35 PM
  #40  
Elite Member
 
JasonC SBB's Avatar
 
Join Date: Jul 2005
Posts: 6,420
Total Cats: 84
Default

Oh they're using LM358's as comparators? Those buggers are slow. Hmmm... I wonder if they'll insert a significant delay...

You could maybe use LM393 comparators if they have the same pinout, but they'll need 1k pullups on their outputs.
JasonC SBB is offline  


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



All times are GMT -4. The time now is 04:40 PM.