Custom 4-1 wheel setup

All Megasquirt 1 support questions. See also the Documentation

Moderators: jsmcortina, muythaibxr

Post Reply
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Custom 4-1 wheel setup

Post by Joe Perez »

I've finally grown tired of the very occasional misfire which I am getting, and having thoroughly gone through the ignition system itself, I'm suspecting a trigger problem.

I've been running a 36-1 wheel setup for quite some time, and while I'm in there dicking around, I think it may be wise to simplify things a bit. 36 teeth is more than the MS1 needs, and I'm not using trigger-return cranking anyway. So I'm thinking that, in addition to truing it on the lathe, I may take the opportunity to cut my wheel down to a 4-1 configuration. Fewer teeth = fewer opportunities for a missed tooth, less CPU workload, basically win-win.

The current config has the missing tooth 90° after the sensor with the crank at #1 TDC. I am able to rotate the wheel in multiples of 45° relative to the crank.

My original thought was this, where red dots indicate teeth removed, and green dots indicate teeth remaining. In this picture, the crank is at TDC:

Image

On reflection, however, I'm pretty sure that won't work, as the sensor needs to see an actual tooth some reasonable time prior to #1 TDC.


Not wanting to remove the tooth opposite the current missing tooth (to preserve the balance of the wheel) I then considered rotating the wheel 90° clockwise relative to the crank, which would give me this:

Image

Seems like it'd work, though I'd have to change my trigger position from 60° to 90°, and that would likely throw off my spark advance table.


The only way I can see to keep my trigger position at 60° BTDC is to do this:

Image

It'll take some careful eyeballing and guesstimation to get the wheel back into balance, since I'll be taking off the tooth opposite the current missing tooth (where there's currently a balancing hole drilled) and as there's a slot 180° opposite the new missing tooth location, I'll have to spread the re-balancing across two holes located either side of that slot. Not real sure how to do the math on that one.


I'd like to hear everyone's thoughts on the matter, apart from "Why not just stay 36-1 and fix the real problem?" I've been down that road...
dontz125
Super MS/Extra'er
Posts: 4221
Joined: Mon May 11, 2009 7:14 pm
Location: York, ON
Contact:

Re: Custom 4-1 wheel setup

Post by dontz125 »

Two comments, both subject to correction by wiser heads - first, there are apparently accuracy issues with 4-1, especially when cranking. You mentioned that 36-1 is more info that the ECU needs, but I gather that 4-1 isn't always enough. You might find a 12-1 less work with more options, while still giving a good level of precision.

Second, you mentioned having to redo your spark table, having moved your pick-up from 60 to 90deg. I believe the spark table is relative to TDC, not the pick-up. The wheel decoder figures out where the crank is relative to TDC, and sparks appropriately. The table itself shouldn't change.
Temporarily shut down - back soon!
QuadraMAP Sensor Module -- PWM-to-Stepper Controller -- Dual Coil Driver
Coming soon: OctoMAP Sensor Module
TTR Ignition Systems
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Re: Custom 4-1 wheel setup

Post by Joe Perez »

dontz125 wrote:Two comments, both subject to correction by wiser heads - first, there are apparently accuracy issues with 4-1, especially when cranking.
Understood, however my assumption is that this argument presupposes that the solution is to use trigger return cranking.

A stock Miata has a 4/2 cam sensor, which gives two pulses per crankshaft revolution, and this is functionally equivalent to my proposed setup in the third image. Stock Miatas seem to start just fine, so I'm assuming that this isn't going to be a problem.


Second, you mentioned having to redo your spark table, having moved your pick-up from 60 to 90deg. I believe the spark table is relative to TDC, not the pick-up. The wheel decoder figures out where the crank is relative to TDC, and sparks appropriately. The table itself shouldn't change.
Yes, the spark table is relative to TDC. From am implementation standpoint, however, the spark table is relative to the CPUs prediction of where TDC will be, and that prediction is done by starting a countdown timer when the trigger position is passed. If the crankshaft's angular velocity were a constant, then this method would work for any trigger angle. Since the crankshaft does not turn at a constant velocity (owing to the effects of compression and expansion cycles), there is some variance to be expected in the commanded spark angle vs. the actual spark angle.

So, a spark table which is configured to give, say, 30° advance in a certain cell might actually give you 28° if based on one trigger position, and 32° based on a different trigger position. Since my spark table is currently tuned for my 60° trigger angle, I worry that changing the trigger angle will cause my actual timing to shift slightly in real-world operation.
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Custom 4-1 wheel setup

Post by jsmcortina »

Joe Perez wrote:A stock Miata has a 4/2 cam sensor, which gives two pulses per crankshaft revolution, and this is functionally equivalent to my proposed setup in the third image. Stock Miatas seem to start just fine, so I'm assuming that this isn't going to be a problem.
Stock Miatas use a hall sensor though and so most likely use the rising and falling edges of the vane giving them double the number of "teeth".
So, a spark table which is configured to give, say, 30° advance in a certain cell might actually give you 28° if based on one trigger position, and 32° based on a different trigger position. Since my spark table is currently tuned for my 60° trigger angle, I worry that changing the trigger angle will cause my actual timing to shift slightly in real-world operation.
I guess that is possible, but if you cut off the right teeth the trigger angle can stay at 60 degrees.

With MS1 there really is no actual timing benefit to more teeth. With MS2+ there most certainly is.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Re: Custom 4-1 wheel setup

Post by Joe Perez »

jsmcortina wrote:Stock Miatas use a hall sensor though and so most likely use the rising and falling edges of the vane giving them double the number of "teeth".
?!

I'm intimately familiar with the internals of the 4G63 electronics. Some of the CASs were opto, some were hall (actually VR, but with an onboard conditioner) but from '90-'97, they all produce the same output waveform. Here's a scope capture I took of the output of a JimStim in 4G63 mode, the real signal is almost identical, though I can't seem to find any of the captures I took of it back when I had one:

Image

Trace 1 (green) is the CKP (Ne) signal, which is four evenly spaced pulses per cam revolution, or two per crank revolution. Trace 2 (yellow) is the CMP (G) signal, which is the phase reference, two uneven pulses per cam revolution.

The CKP signal is what the MS uses as the primary trigger. On the MS1, this is pin 14 of the CPU, which is _IRQ1. If you look at the manual for the 68HC908 processor, you see that the hardware IRQ pin is falling-edge sensitive. Regardless of whether you have TachIn configured to be inverting or non-inverting, you are only going to get two falling edges on this line per crankshaft revolution. Thus, the MS1 CPU is only going to "see" two teeth for every crank revolution on any car using this system, which I understand to be just not MX-5s, but quite a lot of Mitsubishi-branded vehicles (and probably other DSMs) as well.

Or am I missing some subtle nuance?
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Custom 4-1 wheel setup

Post by jsmcortina »

You said that the stock setup runs well with that wheel - that's why I pointed out that the wheel can be used for both edges - with the stock system.

MS1 is indeed only triggering on one edge.
MS2 uses both.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Re: Custom 4-1 wheel setup

Post by Joe Perez »

jsmcortina wrote:You said that the stock setup runs well with that wheel - that's why I pointed out that the wheel can be used for both edges - with the stock system.
Ok, I see what you're saying. My intent was to point out that an MS1 runs very happily on the stock Miata CAS (well, in most Miatas it does) and therefore we can infer that the MS1 is fully capable of operating in an environment with 2 crank teeth, which a 4-1 wheel is equivalent to.

However, I think I can de-bunk the mystery surrounding what the stock ECU in the car is doing as well. I finally found the scope traces which I took of my engine when the car was fully stock. They're hand-written on graph paper, since I was using the 4 channel Tek scope to take those measurements, and its floppy drive was broken at the time. Here's a stock 1992 Miata idling at 750 RPM, with the spark at 15° BTDC:

Image

Trace #1 is CMP (G), the uneven two pulse per cam rev signal. Trace #2 is CKP (Ne) which is two pulses per crank rev. Trace #3 is ignition channel 1, trace #4 is ignition channel 2. (The drawing, particularly the dwell times, are not perfectly to scale, but the measurements I've written next to the traces are accurate.)

As I said, we're at 750 RPM here, so that 4.5° of crank movement per millisecond, or 0.22ms per degree.

So, looking at the first ignition event on channel 1. Spark occurred 13ms after the rising edge of CKP, which is 58.5° at the crank. Spark was 15°BTDC, so the CKP rising edge occurred at 73.5° BTDC. The CKP falling edge occurred 2ms after the spark event, during which time the crank traveled 9 degrees. So CKP falling edge was at 6° BTDC.

The second ignition event on channel 1 (you'll probably have to open the image in a new window to see it) is about the same. CKP rose at 75° BTDC, and fell at 5° BTDC. Given the relative inaccuracy of my measurements (the scope's on-screen cursor, and a pencil) I'd call these observations consistent.

So I guess it's theoretically possible that the stock ECU might be using the falling edge to trigger while cranking (I doubt it, but I'd have to scope a stock engine during cranking to know for sure) I think it's pretty certain that they're only looking at the rising edge during normal operation.
jsmcortina
Site Admin
Posts: 39615
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Custom 4-1 wheel setup

Post by jsmcortina »

Joe Perez wrote:So I guess it's theoretically possible that the stock ECU might be using the falling edge to trigger while cranking (I doubt it, but I'd have to scope a stock engine during cranking to know for sure) I think it's pretty certain that they're only looking at the rising edge during normal operation.
Seems highly likely that they are doing that. It is like "trigger return" for a wasted spark setup.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
lnbn
MS/Extra Newbie
Posts: 3
Joined: Wed Jul 28, 2010 10:08 pm

Re: Custom 4-1 wheel setup

Post by lnbn »

i got this waveform from the service manual of a mitsubishi 4g18 engine (cedia lancer). the engine uses wasted spark. sensors are crank and cam with the following wave pattern
Image
- The CKP sensor simply indicates that a pair of cylinders ar about to reach TDC (1/4 or 2/3). The CMP signal then signifies which injector to open and which coil pack to energize.
- The CMP leading edge is always 131 degrees BTDC - this indicates that one coil pack needs to be energized to fire up 1/4 - no doubt about it. These leading edge are 180-180 degrees apart.
- The CMP trailing edge signals what? - I don't get the logic behind having one vane at 90 degrees, and the other one at 45 degrees. These trailing edge are 135-225 degrees apart. Ideas why they are unequal?

If the function of the CMP signal is to merely indicate that coil packs for 1/4 needs to be energized, then what's the reason behind having one of the vanes half the size of the other? Is there something here that I am missing?

:?:
marconi118
Helpful MS/Extra'er
Posts: 52
Joined: Thu Dec 20, 2007 4:23 am

Re: Custom 4-1 wheel setup

Post by marconi118 »

do a 6-1 setup:

trigger return on 10°
trigger on 70° (10+60)

60 is the angle of a 6 teeth wheel
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Re: Custom 4-1 wheel setup

Post by Joe Perez »

Hey all. A bit late on the followup, I know...

I wound up keeping the 36-1 pattern, primarily because once I got the wheel chucked up into the lathe and built a tool to cut individual teeth, it turned out to be astoundingly difficult to do accurately. :mrgreen: So, I simply turned it for a while to true all the teeth (it did turn out that the laser-cut teeth weren't all precisely the same height) and knocked them down to put a bit of a plateau on the end of each one rather than a sharp point. Combined with a MAX9924 in place of the B&G-style MC34072AP design, it's now 100% stable.

Other matters:

lnbn wrote: - The CMP trailing edge signals what? - I don't get the logic behind having one vane at 90 degrees, and the other one at 45 degrees. These trailing edge are 135-225 degrees apart. Ideas why they are unequal?
It's so the ECU can determine the absolute phase of the engine in order to do fully sequential injection. 3 of the 4 falling edges on CKP occur while CMP is low, however the CKP falling edge that occurs at 5° before #1 TDC takes place while CMP is high. That specific event (CKP falling while CMP = high) uniquely identifies #1 TDC.

This scheme gives you the benefit of a 4/1 wheel (full sequential injection) while reducing the amount of time it takes to sync up and start firing the plugs when cranking. (It only has to wait a maximum of 1/2 cam rev before it sees a CMP rising edge, rather than having to wait up to a full cam rev in a 4/1 system.)
lnbn
MS/Extra Newbie
Posts: 3
Joined: Wed Jul 28, 2010 10:08 pm

Re: Custom 4-1 wheel setup

Post by lnbn »

After some thinking and imagination, I got how the sequential spark and sequential injection will work. The falling edge of the CMP signal is only used during startups to determine the stroke of all other cylinders with respect to cylinder 1.

Based on the image I posted, the 4 pulses of the CKP signal above correspond to cylinders 1, 3, 4, and 2 on their compression stroke.

Having the CMP signal below (rotating half crank speed) and in direct relationship to cylinder 1, at initial startup:
- If the CKP signal is LOW, and the falling edge of the CMP signal appears, it means that the the next rising edge of the CKP signal should spark@3 and inject@2 (cylinder 3 at 75° BTDC compression, while cylinder 2 at 75° BTDC exhaust). Succeeding occurences of the CKP signal would follow the sequence: spark@4 and inject@1, spark@2 and inject@3, spark@1 and inject@4.
- If the CKP signal is HIGH, and a falling edge of the CMP signal appears, it means that the next rising edge of the CKP signal should spark@2, and inject@3 (cylinder 3 at 75° BTDC exhaust, while cylinder 2 2 at 75° BTDC compression). Succeeding occurences of the CKP signal would follow the sequence: spark@1 and inject@4, spark@3 and inject@2, spark@4 and inject@1.
- Any CKP signal without any falling CMP signal is ignored

After the initial startup and identification of the cylinder strokes, "the falling edge of CMP signal can be ignored entirely during the entire life of the engine running" (i might be wrong in this statement??? - verification???). On the other hand, the rising edge of the CMP signal can be used to identify engine RPM, since they are separated at exactly 180°.
Joe Perez
Experienced MS/Extra'er
Posts: 181
Joined: Mon Dec 03, 2007 2:19 pm
Location: San Diego, CA
Contact:

Re: Custom 4-1 wheel setup

Post by Joe Perez »

lnbn wrote:After some thinking and imagination, I got how the sequential spark and sequential injection will work. The falling edge of the CMP signal is only used during startups to determine the stroke of all other cylinders with respect to cylinder 1.
"Sokath, his eyes opened!"

That's the basic idea. On the face of it, it seems like an odd way of doing things. But as I said, it does have some advantages over the more obvious 4/1 pattern.


After the initial startup and identification of the cylinder strokes, "the falling edge of CMP signal can be ignored entirely during the entire life of the engine running" (i might be wrong in this statement??? - verification???).
In theory, yes, you could do it this way. In practice, it would make sense to continue validating it in order to accommodate for the possibility of a missed CKP pulse due to noise on the line, flakey wiring, etc. If you only ever read CMP once, and then started ignoring it, it would be entirely possible for the ECU to get out of sync with the engine.


On the other hand, the rising edge of the CMP signal can be used to identify engine RPM, since they are separated at exactly 180°.
There's no need for this added complexity. RPM is easily computed from CKP.
Post Reply