New code version v2.890
Posted: Sun Mar 08, 2009 6:15 am
In testing his Honda 4 cylinder CBR dyno engine with a microsquirt Bruce found 2 things that I was able to improve upon in the code. The first was that at rpms above 6000 the flat line in the VR sensor curve for the missing tooth gap would go slightly above 0 and cause an extra tooth leading to loss of synch. He fixed it by a resistor tweak to the bias, but asked why the tooth wasn't thrown out by the extra tooth rejection logic. I checked the code and found that there was a subtle problem with the code. It only affected the missing tooth section - it worked fine for spikes between all the regular teeth, but these teeth typically don't have a long flat section. I fixed this, Bruce went back to the old resistor, and he was able to run up and down to 13000 rpm over and over with no resynchs, using the stock microsquirt VR circuit. So this might help a lot of problems that people have been having. There is one caveat though. The rejection logic is not applied during a tach pulse for which there is already enough calculation time required (for rpm, spark and fuel timing). So if a tach pulse occurs on the first tooth after missing gap (DelayTooth = 0), the rejection logic will not be applied. This didn't affect Bruce because he had a DelayTooth > 0. If people do have the problem, they can set DelayTooth to 1 and adjust trigger offset accordingly.
The second problem was that whenever the engine stalled in the process of tuning (it was especially cold at the time) he had to power cycle the microsquirt or else he had to crank and crank and the engine never started - it never got synch or it took a long time. After checking the code I found that when you lose synch the PulseTol was left at the last setting, and this made sense for a resynch which happens while you are driving and it immediately resynchs with only a small glitch. But for a stall, it uses the running PulseTol and it can be hard to start with that small a tolerance. So I put a check there so if rpm was cranking it would reset PulseTol to cranking. This fixed that problem.
Both of these fixes are in the attached code version v2.890. This code can be used with the latest ini file, but just ignore the mismatched version number message. Lance will put out an ini with correct version number when he gets a chance.
The second problem was that whenever the engine stalled in the process of tuning (it was especially cold at the time) he had to power cycle the microsquirt or else he had to crank and crank and the engine never started - it never got synch or it took a long time. After checking the code I found that when you lose synch the PulseTol was left at the last setting, and this made sense for a resynch which happens while you are driving and it immediately resynchs with only a small glitch. But for a stall, it uses the running PulseTol and it can be hard to start with that small a tolerance. So I put a check there so if rpm was cranking it would reset PulseTol to cranking. This fixed that problem.
Both of these fixes are in the attached code version v2.890. This code can be used with the latest ini file, but just ignore the mismatched version number message. Lance will put out an ini with correct version number when he gets a chance.