I do not understand the CKP/CMP relationship apparently
#21
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
Yes, but not on my car. There was no reason to scope it, as it worked correctly the first time. This was, admittedly, a low-compression engine with a good battery. I have no idea what Hustler is running.
Huh?
I'd encourage hustler to try it as-is. If it doesn't work, he can remove tooth #11 as well, and set the "missing teeth" to -2.
An MS1 on a 4 cyl engine only times off of two teeth (the "Trigger A and B" teeth) so the error will be worse, however this is functionally identical to what you'd get off of both the NA CAS and the NB crankwheel. Actually, it'll be considerably better than the NA CAS, actually, as there's no timing belt slop.
I understand what you're saying, and I don't in any way disagree. All I'm saying is that what has been described here seems to be "good enough" for a real-world application.
Is that cranking plot, zero of the vertical axis, at the bottom? If so the peaks are double the troughs.
With a 12-1 the missing tooth gap is 2x normal, and it may just be close to the double length gap due to compression.
However when blipping in neutral there was a bit of timing error (like 1.5* IIRC) at low RPM, which wasn't there with the 12+1. This is because the AEM only times off of 6 teeth when you have a 12-1.
I understand what you're saying, and I don't in any way disagree. All I'm saying is that what has been described here seems to be "good enough" for a real-world application.
#22
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
With a 12T wheel aligned as shown, you'll have a potential "trigger return" at exactly TDC and BDC, which the more I think about it is probably ideal for cranking. What I posted above (time-based) will definitely work, however you might get slightly better starting out of the trigger-return scenario which I originally posted and then removed.
#24
Elite Member
iTrader: (1)
Join Date: Jun 2006
Location: Warrington/Birmingham
Posts: 2,642
Total Cats: 42
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
For those having trouble understanding the concept, imagine a game in which you have to toss a hamster into a small hole in the ground. Specifically, there are ten holes, in a straight line, spaced 10 feet apart each. With the MS1, you always have to stand at the very first hole to make your throw, regardless of which hole you are aiming for. So hitting the first hole is easy. For the second hole, you have to throw 10 feet. For the third hole, you have to throw 20 feet. by the time you're aiming for the last hole, you have to throw the hamster 90 feet.
With the MS2/3, you're allowed to walk down the field and stand somewhere between the hole you are aiming for and the hole closest to it (the exact distance is pseudo-random, determined by computing the number of seconds elapsed since the last time the word "Obamacare" was uttered on Fox News.) In this scenario, you never have to throw the hamster further than 10 feet, and thus, we would expect your accuracy to improve.
With the MS2/3, you're allowed to walk down the field and stand somewhere between the hole you are aiming for and the hole closest to it (the exact distance is pseudo-random, determined by computing the number of seconds elapsed since the last time the word "Obamacare" was uttered on Fox News.) In this scenario, you never have to throw the hamster further than 10 feet, and thus, we would expect your accuracy to improve.
..oh wait
![Giggle](https://www.miataturbo.net/images/smilies/gay.gif)
#25
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
I don't have the underlying data behind the graph in question, and I can't tell you exactly which engine it was taken from or what the sensor arrangement was, however I am familiar with the software used, so I can tell you that the graph is linear and the bottom of the Y axis is zero.
Also, bear in mind that this graph was deliberately selected by the author of a FAQ to represent a worst-case-scenario for the purposes of visually illustrating the phenomenon in question. It is not meant to be representative of a street engine with "reasonable" compression cranking on a healthy battery.
So again, I completely understand what you are saying, and I don't disagree on paper. Now, if you would, please humor me for a moment.
Here, again, is the example wheel layout I posted for Hustler. Take careful note of the orientation of the components, specifically the position of the sensor and the missing tooth relative to TDC:
![](https://www.miataturbo.net/attachments/megasquirt-18/31471-i-do-not-understand-ckp-cmp-relationship-apparently-74j5s.gif?dateline=1326252278)
In this arrangement, the missing tooth will cross over the sensor at 90° BTDC (1/4) and 90° ATDC (2/3). As such, the gap will always occur directly in a trough as viewed from the standpoint of the aforementioned graph.
#26
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
I took a bit of time to review the source code and build notes for the MS1 (gotta love open-source ECUs) and realized that I mis-spoke earlier in post # 17. I believe that that slip of the fingers is probably what has prompted this whole debate.
In the original design of the missing-tooth routine for the MS, each gap was indeed compared only to the gap which preceded it. At build # 024s12, however, a change was made such that a rolling average of all tooth gaps is kept, and it is this value is used to detect the missing tooth, rather than just the most recent value.
This change, which occurred many years ago, was originally implemented during some improvements of the false-trigger detection routine (did we receive an IRQ outside of the time-window when we were expecting one? If so, ignore it as noise) however it also had the effect of vastly decreasing the criticality of sensor / gap placement on engines with large numbers of cylinders and small numbers of crank teeth.
As such, this particular line of discussion is pretty much moot.
In the original design of the missing-tooth routine for the MS, each gap was indeed compared only to the gap which preceded it. At build # 024s12, however, a change was made such that a rolling average of all tooth gaps is kept, and it is this value is used to detect the missing tooth, rather than just the most recent value.
This change, which occurred many years ago, was originally implemented during some improvements of the false-trigger detection routine (did we receive an IRQ outside of the time-window when we were expecting one? If so, ignore it as noise) however it also had the effect of vastly decreasing the criticality of sensor / gap placement on engines with large numbers of cylinders and small numbers of crank teeth.
As such, this particular line of discussion is pretty much moot.
#27
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
This can be interpreted in two ways, depending on how I shift the punctuation around.
One suggests that Joe doesn't love tossing hamsters. It implies that my formal title would be "Joe, who doesn't love tossing hamsters," in much the same way as "Now I am become Death, the destroyer of worlds" from the Hindu text, the Bhagavad Gita.
The other interpretation implies that a question is being asked, to wit "Who doesn't love tossing hamsters?"
The degree to which I am simultaneously amused and disturbed by each possible interpretation is difficult to quantify.
One suggests that Joe doesn't love tossing hamsters. It implies that my formal title would be "Joe, who doesn't love tossing hamsters," in much the same way as "Now I am become Death, the destroyer of worlds" from the Hindu text, the Bhagavad Gita.
The other interpretation implies that a question is being asked, to wit "Who doesn't love tossing hamsters?"
The degree to which I am simultaneously amused and disturbed by each possible interpretation is difficult to quantify.
#28
Tour de Franzia
![](/mt2011/images_td/ranks/supporter1.gif)
Thread Starter
iTrader: (6)
Join Date: Jun 2006
Location: Republic of Dallas
Posts: 29,085
Total Cats: 375
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
I think I've spent about an hour reading this repeatedly, lol.
I'm going to put the crank wheel on this weekend and see what happens. I suppose I will pull 3* of spark out of my current spark tables which used the CAS. I don't think I can get this car on a dyno prior to my first race, which makes me nervous.
I'm going to put the crank wheel on this weekend and see what happens. I suppose I will pull 3* of spark out of my current spark tables which used the CAS. I don't think I can get this car on a dyno prior to my first race, which makes me nervous.
#29
Tour de Franzia
![](/mt2011/images_td/ranks/supporter1.gif)
Thread Starter
iTrader: (6)
Join Date: Jun 2006
Location: Republic of Dallas
Posts: 29,085
Total Cats: 375
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
95 CAS sensor Plug Colors
Yellow/Blue - Cam Signal
White - Crank Signal
White/Red - Power
Black/Light Green - Ground
99 Cam Sensor Wires
White/Red - Power
Grey/Blue - Cam Signal
Black/Blue - Ground
99 Crank Sensor Wires
White/Red - Power
Grey/Red - Crank Signal
Black/Blue - Ground
So to hook the NB Sensors up to the NA wires you need to do the following.
Black/Blue from both Cam/Crank plugs goes to Black/Light Green
White/Red from both Cam/Crank plugs goes to White/Red
Grey/Blue from Cam goes to Yellow/Blue
Grey/Red from Crank goes to White
![](https://www.miataturbo.net/attachments/megasquirt-18/25622-im-thinking-about-vvt-swap-my-daily-2hpmyk7.jpg?dateline=1317303831)
For VVT you run one of the wires to the White/Red wire on the CAS.
The other wire gets ran back to your MS connector. I am not sure how Reverent will have you hook it up, but he should be able to give you more details.
Yellow/Blue - Cam Signal
White - Crank Signal
White/Red - Power
Black/Light Green - Ground
99 Cam Sensor Wires
White/Red - Power
Grey/Blue - Cam Signal
Black/Blue - Ground
99 Crank Sensor Wires
White/Red - Power
Grey/Red - Crank Signal
Black/Blue - Ground
So to hook the NB Sensors up to the NA wires you need to do the following.
Black/Blue from both Cam/Crank plugs goes to Black/Light Green
White/Red from both Cam/Crank plugs goes to White/Red
Grey/Blue from Cam goes to Yellow/Blue
Grey/Red from Crank goes to White
![](https://www.miataturbo.net/attachments/megasquirt-18/25622-im-thinking-about-vvt-swap-my-daily-2hpmyk7.jpg?dateline=1317303831)
For VVT you run one of the wires to the White/Red wire on the CAS.
The other wire gets ran back to your MS connector. I am not sure how Reverent will have you hook it up, but he should be able to give you more details.
DIY doesn't think so, but it's pretty close:
Getting the Tach Input Signal:
Run MSnS-E and the "2nd Trigger" Wheel Decoder option (where the missing tooth on the wheel decoder comes from a second sensor, usually cam position). The CAS has a CMP and CKP signal, so you take the outputs of each and run them into the MegaSquirt. Take the CKP signal (4 holes in the Optical sensor wheel, the "outer" ring of the CAS), and run it to the primary tach input on the MS with a 12v pullup resistor - then you take the inner ring of the CAS (1 hole in the sensor wheel) and run it to the secondary tach input on MS (it's pin 11 on the MS-I cpu) with a 5v pullup resistor.
If you follow my documentation for the mods below you'll externally wire the tach inputs like this:
The Primary tach input (CKP) (Reported to be White on Miatas) is connected to pin 24 on the MegaSquirt's DB37
The Secondary tach input (CMP) (Reported to be Yellow on Miatas) is connected to pin 25 on the MegaSquirt's DB37
If you're using a relay board: Pin 24 goes through to position 15, Tach/Ignition for the CKP/Primary Tach Input. Pin 25 goes through to position 7, S1 for the CMP/Secondary Tach Input. You'll need to make sure your relay cable has this wire in place, if so then this will work fine. All of my MS-II ready relay cables have this wire in place. (black loom covered cables are MS-II ready, old MS-I grey cables do not have this wire)
Run MSnS-E and the "2nd Trigger" Wheel Decoder option (where the missing tooth on the wheel decoder comes from a second sensor, usually cam position). The CAS has a CMP and CKP signal, so you take the outputs of each and run them into the MegaSquirt. Take the CKP signal (4 holes in the Optical sensor wheel, the "outer" ring of the CAS), and run it to the primary tach input on the MS with a 12v pullup resistor - then you take the inner ring of the CAS (1 hole in the sensor wheel) and run it to the secondary tach input on MS (it's pin 11 on the MS-I cpu) with a 5v pullup resistor.
If you follow my documentation for the mods below you'll externally wire the tach inputs like this:
The Primary tach input (CKP) (Reported to be White on Miatas) is connected to pin 24 on the MegaSquirt's DB37
The Secondary tach input (CMP) (Reported to be Yellow on Miatas) is connected to pin 25 on the MegaSquirt's DB37
If you're using a relay board: Pin 24 goes through to position 15, Tach/Ignition for the CKP/Primary Tach Input. Pin 25 goes through to position 7, S1 for the CMP/Secondary Tach Input. You'll need to make sure your relay cable has this wire in place, if so then this will work fine. All of my MS-II ready relay cables have this wire in place. (black loom covered cables are MS-II ready, old MS-I grey cables do not have this wire)
#33
mkturbo.com
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/admin.png)
iTrader: (24)
Join Date: May 2006
Location: Charleston SC
Posts: 15,189
Total Cats: 1,685
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
I honestly do not know off the top of my head and I actually have to do work today at work, so I can't actually look it up. I will check this afternoon and get back to you with the wire colors. I will go home and physically look at my CAS on my dd and see.
#35
Tour de Franzia
![](/mt2011/images_td/ranks/supporter1.gif)
Thread Starter
iTrader: (6)
Join Date: Jun 2006
Location: Republic of Dallas
Posts: 29,085
Total Cats: 375
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
Depending on how everything is physically mounted, it might look something like this:
![](https://www.miataturbo.net/attachments/megasquirt-18/31471-i-do-not-understand-ckp-cmp-relationship-apparently-74j5s.gif?dateline=1326252278)
![](https://i.imgur.com/2mIpP.gif)
(Note that it's been a while since I've had to configure one of these, and I've had a few drinks at this point in the evening.)
Note that if you built and configured your MS according to DIY's instruction for an NA using the CAS, they have everything completely backwards in their documentation with regard to the CAS configuration as well as the fuel and spark wiring. If you configure your system as per the above, it will be "correct", and the engine will not run until you un-reverse the fuel and spark wires.
With an MS1, it doesn't really matter. You're running batch fuel anyway, so you might as well save the trouble and remove the tooth. That's how I did my '92.
With an MS2/3, I'd leave the tooth in place and run a cam signal so that I could run sequential.
![](https://www.miataturbo.net/attachments/megasquirt-18/31471-i-do-not-understand-ckp-cmp-relationship-apparently-74j5s.gif?dateline=1326252278)
![](https://i.imgur.com/2mIpP.gif)
(Note that it's been a while since I've had to configure one of these, and I've had a few drinks at this point in the evening.)
Note that if you built and configured your MS according to DIY's instruction for an NA using the CAS, they have everything completely backwards in their documentation with regard to the CAS configuration as well as the fuel and spark wiring. If you configure your system as per the above, it will be "correct", and the engine will not run until you un-reverse the fuel and spark wires.
With an MS1, it doesn't really matter. You're running batch fuel anyway, so you might as well save the trouble and remove the tooth. That's how I did my '92.
With an MS2/3, I'd leave the tooth in place and run a cam signal so that I could run sequential.
#36
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
It's no big deal. Just flip the relative positions of the spark plug wires, such that the wires for the 1/4 cylinders go to the 2/3 coil and vice-versa.
#37
Supporting Vendor
![](/mt2011/images_td/ranks/vendor.png)
![](/mt2011/images_td/ranks/supporter1.gif)
iTrader: (33)
Join Date: Jul 2006
Location: atlanta-ish
Posts: 12,659
Total Cats: 134
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
"Backwards" spark outputs only occurs with MS1, due to how the MS1 wheel decoder is normally set up for Miata (4G63 CAS). MS2 and beyond have dedicated Miata wheel decoders with "correct" spark outputs.
#38
Boost Pope
![](/mt2011/images_td/ranks/supporter1.gif)
![](/mt2011/images_td/ranks/smod.png)
iTrader: (8)
Join Date: Sep 2005
Location: Chicago. (The less-murder part.)
Posts: 33,340
Total Cats: 6,793
![Default](https://www.miataturbo.net/images/icons/icon1.gif)
For what it's worth, the MS1 can easily be made to output spark pulses in the "correct" sequence on an NA CAS by configuring the wheel decoder as follows:
![](https://www.miataturbo.net/attachments/megasquirt-18/53778d1346632943-i-do-not-understand-ckp-cmp-relationship-apparently-wheel.gif)
Note that the "2nd trigger active edge" is set to "falling" in my config because I am using a non-standard input circuit based on an comparator. If you've built the CMP circuit as described in DIY's instructions, that field should still be set to "rising."
This will be of no interest to MSPnP owners, as your ECU is already wired in the reversed configuration. For anyone still building an MS1 from scratch, however, this will allow you to wire the unit such that SparkA correlates to the 1/4 coil, and SparkB to the 2/3 coil, as is the nominal configuration for the Miata in general.
Owners of an original MSPnP who wish to convert to a 36-1 wheel (or any crankwheel, for that matter) must flip the ignition system by reversing the spark plug wires at the coils.