Page 1 of 1
Dwell/spark strangeness?
Posted: Mon Apr 04, 2011 5:26 pm
by msiddalingaiah
I'm running v2.891 on a wasted spark single (virtual two cylinder).
I've been testing spark on the bench and it mostly works, but I see some unexplained behavior.
Here are my settings:
Trigger offset: 5 degrees
Ignition input capture: falling edge
Cranking trigger: trigger rise
Coil charging scheme: standard coil
Spark output: going low (normal)
Maximum dwell duration: 4ms
Maximum spark duration: 1ms
I'm measuring everything on a 'scope and the advance is exactly what it should be almost everywhere.
There is strange behavior below approximately 1000 RPM. Above that point, the I see a normal, positive 4ms spark pulse.
Below that point, the spark signal flips polarity and it looks to be about a 50% duty cycle (inverse of the tach signal).
What's odd is that this critical RPM seems to be dependent on dwell. The smaller the dwell, the higher the "flip" RPM.
In theory, this is not a significant issue as the engine idles around 1500 RPM.
The bigger issue is that spark pulses are sometimes missing. It seems random, so I must have something improperly configured or there's a bad/missing signal somewhere.
I plan to use the spark output to fire a CDI of my own design, so dwell and spark duration aren't critical at all.
I just need values that work reliably.
What am I doing wrong?
Re: Dwell/spark strangeness?
Posted: Sat Apr 09, 2011 7:10 am
by msiddalingaiah
Based on the lack of response, one or more possibilities might exist:
1. No one knows why there is a problem
2. There should be no problem based on the known settings
3. No one cares
Possibilities 1 and 3 are not helpful, so I'll disregard those.
That leaves possibility 2, which might might be caused by anomalous behavior on my particular setup. I used MegaTune to configure this setup due to some laptop issues at the time. I'll switch to TunerStudio, reload everything and see if that solves the problem.
Re: Dwell/spark strangeness?
Posted: Sat Apr 09, 2011 7:19 am
by trakkies
I'd log things and look for any other funnies at the point the problem happens. But only a guess.
Re: Dwell/spark strangeness?
Posted: Sat Apr 09, 2011 7:44 am
by Bernard Fife
or:
4. You did not post a MSQ or datalog. It says above each posting page, "For tuning/troubleshooting questions, please attached a datalog and your MSQ file to your post."
Lance.
Re: Dwell/spark strangeness?
Posted: Sat Apr 09, 2011 9:52 am
by msiddalingaiah
Wow! I'm finally getting some love. For a while there, I thought you guys just didn't like me
The latest MSQ and datalog are attached. The "flip" occurs around 1770 RPM for this configuration. It's missing spark pulses above that RPM.
My feeling is that something is not set right and I'm missing it.
Thanks!
Re: Dwell/spark strangeness?
Posted: Mon Apr 11, 2011 7:25 am
by Bernard Fife
Madhu,
As far as I can tell, the dwell is always 2.10 in your log. You max_coil_dur and max_spk_dur look appropriate at 3.0 and 2.0, respectively. But these aren't the 4.0 and 1.0 you note in your earlier post. If this was mine, I would go to either 3.0 and 2.0, or 4.0 and 2.0 if you really want 4.0 msec of dwell.
Note also that you have 16.80 Volts on the vBatt, and this is very high. Certainly too high in the car (you'd need to replace your regulator) but probably too high on the bench too.
I try to keep the supply voltage below 16 at all times. The reported voltage has gone through a few components, and is typically about 0.8 Volts lower than the supply voltage. That puts the supply at about 17.6V, and this can play havoc with some of the circuits if certain components are at the edge of the tolerance band, and leads to some weird result (or worse!).
Lance.
Re: Dwell/spark strangeness?
Posted: Mon Apr 11, 2011 10:05 am
by msiddalingaiah
Lance wrote:Madhu,
As far as I can tell, the dwell is always 2.10 in your log. You max_coil_dur and max_spk_dur look appropriate at 3.0 and 2.0, respectively. But these aren't the 4.0 and 1.0 you note in your earlier post. If this was mine, I would go to either 3.0 and 2.0, or 4.0 and 2.0 if you really want 4.0 msec of dwell.
I tried a few different values, but I seem to get the same dwell in any case. If you don't see anything blatantly wrong in the MSQ, then it's something else.
Lance wrote:
Note also that you have 16.80 Volts on the vBatt, and this is very high. Certainly too high in the car (you'd need to replace your regulator) but probably too high on the bench too.
I'm testing on a hacked up board and it's very possible that ADC input has the the wrong voltage on it. There's no concern of damage, but now I'm wondering if that's the problem with spark/dwell timing. The battery compensation might be throwing it off. I'll correct that and see if it helps.
Thanks!
Re: Dwell/spark strangeness?
Posted: Mon Apr 11, 2011 4:30 pm
by grippo
I was able to reproduce your problem. It is what I thought it was, but haven't seen in a very long time. In order to solve some problem which I can't recall there was a deliberate extension (approx doubling) of the input dwell at low rpms. For2- 4 cyl and above this stops very close to cranking rpm and is not noticeable except on a scope. For lower count cylinders I believe this rpm is somewhat higher. It doesn't affect or hurt anything for three reasons: as you noted spark timing is unaffected - this jumping is in the duration of the dwell; it is always so as to make dwell longer, and so it won't decrease spark quality; it only occurs at low rpm, meaning that even though the dwell is doubled, its duty cycle is still very low, so it won't damage the coil.
As you say the random spark missing is the more serious problem and is related to the conditions which forced the above above dwell doubling. I have only seen it once before be a big problem, and that was long ago and also with a 1 cylinder. But I also know some people have gotten 1 cylinders to run ok, but of course the total data base is small. You can try changing dwell and spark some more, reducing spark to 1 ms seemed to help me. The only other thing I know to try is to convert the MS2 to a microsquirt by making the mods indicated in the microsquirt.info documentation and use dual spark mode - this should work and give more accurate timing, but also requires a toothed wheel.
Re: Dwell/spark strangeness?
Posted: Tue Apr 12, 2011 5:41 am
by msiddalingaiah
grippo wrote:
As you say the random spark missing is the more serious problem and is related to the conditions which forced the above above dwell doubling. I have only seen it once before be a big problem, and that was long ago and also with a 1 cylinder. But I also know some people have gotten 1 cylinders to run ok, but of course the total data base is small. You can try changing dwell and spark some more, reducing spark to 1 ms seemed to help me. The only other thing I know to try is to convert the MS2 to a microsquirt by making the mods indicated in the microsquirt.info documentation and use dual spark mode - this should work and give more accurate timing, but also requires a toothed wheel.
Can you explain a little more of why spark pulses are missing? You can point me to a section of code if that's easier. I'll try a 1 ms spark duration and see if that helps. A toothed wheel is not an option for me, so I would like to get it working with one crank pulse per rev. It's a single cylinder wasted spark (virtual 2 cylinder) setup if that helps.
One more thing: the tach signal is exactly 5 deg BTDC, which is exactly where the spark should be up to 2300 RPM. I measured it using the stock CDI and it is consistent with specs in the shop manual. One possibility is to just turn off spark advance until 2000 RPM or so. I'm not sure how practical that is. From what I read, this how a lot of bikes are setup. The stock pickup has a positive pulse at idle/low RPM advance angle and a negative pulse something like 60 degrees BTDC. Here's a scope picture at idle:
The falling edge of the upper trace is when the spark plug fires. The lower trace is the raw signal from the pickup. I think the positive pulse is used for idle/low RPM and the negative pulse is used for advance.
Thanks Al!
Re: Dwell/spark strangeness?
Posted: Tue Apr 12, 2011 8:29 pm
by grippo
All I can tell you about the missing outputs is that it looks like it is due to some sort of timer overflow at low rpm or some sort of interrupt race condition. The most likely place is in the TimerIn interrupt, but I spent quite a while looking for about 4 or 5 years ago. I didn't want to spend any more time on it because I consider that a 1 cylinder engine should really have a trigger wheel to get good spark accuracy. The 360 degrees without any update is too long to predict, especially on a light engine which can rev up really fast.
As far as the VR pulse shape - there is a trigger return mode which triggers on one edge until it reaches crank speed, then triggers off the other edge from then on, if that is of any help.
Re: Dwell/spark strangeness?
Posted: Wed Apr 13, 2011 8:20 am
by msiddalingaiah
I can understand problems associated with interrupt timing/race conditions. Those can be a challenge to track down. I was skeptical that a spark 360 degrees out could be achieved reliably at low RPM.
I could generate a square wave from the VR with a positive edge 5 degrees BTDC and a negative edge 60 degrees BTDC and then use trigger return mode. I'll test that and see if it works better. My gut feeling is that it would be easier to compute shorter time delays reliably.
Re: Dwell/spark strangeness?
Posted: Sat Apr 16, 2011 3:27 pm
by msiddalingaiah
OK, I made some progress.
I set trigger capture to falling edge and cranking to trigger return as Al suggested.
Using a signal generator with perfect 50% duty cycle, I set the base advance to 185 degree (180 for 50% duty cycle + 5 for cranking/idle).
It works exactly as it should everywhere. There is no strange behavior.
Now MS only has to calculate something less than 180 degrees out rather than a full 360, which was causing it to act up.
It should be even better on the bike, since the falling edge is about 60 degrees BTDC, so MS only has to delay for even a shorter time.
This is probably how the stock CDI works, using the positive edge for cranking/low RPM and the negative edge for spark advance.
I must be dense or something, I can't seem to find where the cranking RPM is set. Can someone point me in the right direction for MT and TS?
Thanks!
Re: Dwell/spark strangeness?
Posted: Sun Apr 17, 2011 1:13 pm
by grippo
Its under the 'Other Fuel Settings' menu and labeled Max. Cranking Speed.