Help! Engine states in 1.5

General support questions and announcements for MS3. See also MS3 manuals.

Moderators: jsmcortina, muythaibxr

Post Reply
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Help! Engine states in 1.5

Post by elaw »

So... a couple of days ago I updated to 1.5 and generally things have been working well. But one aspect of the engine states is killing me and that's the "overrun MAP threshold"... I think!

If I set it to low number like 33 kPa, MS can't seem to decide whether the engine is in the overrun or idle state when coasting at RPMs just above the idle range, like 1500. Raising the overrun MAP threshold fixes that issue, but then it oscillates between overrun and idle when the engine is idling!

I've tried a lot of different values for that setting, as well as changing the slow acceleration & deceleration thresholds with no luck.

.MSQ file and short log snippets showing the two problems attached... I can supply full logs if needed.

Does anyone have any insight on this?
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

Getting the slow accel/decel right will help a lot here. If the engine is accelerating or decelerating, it can't be in idle.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

Ken,

Thanks!

I understand your point but would argue it's not true 100% of the time. When the engine is idling smoothly and stably RPMdot will be very close to zero. But when it's ramping to target or the engine is idling roughly, it won't be.

Looking at a log I took this morning, over a 7-second section where CL idle kicks in and the engine goes to a stable idling state, RPMdot max is 70 and min is -220 (average is -43). Looking at another 3.5-second section where I'm coasting in 5th gear with the throttle closed, RPMdot max is 30, min is -80, and average is -25. Those numbers are closer to zero than when the engine is idling! I've actually seen areas in logs when I'm coasting downhill in 4th or 5th gear where over several seconds, RPMdot won't exceed +/- 10.

Anyhow, can I get your input on another issue related to engine states?

Here's the scenario: I was cruising in 5th gear and was approaching a stop. I pressed in the clutch, engine RPM dropped of course and it entered idle state. Then I shifted to 3rd gear and engaged the clutch to get some engine braking, causing the engine to go into overrun.

The fun part is what happened next. I once again disengaged the clutch, and the RPM dropped to 440 (idle target RPM is about 800) before it switched from overrun to idle state! The engine didn't stall but it came darn close.

One thing that I think may have contributed to the issue was that the dashpot adder didn't seem to kick in... the idle PWM value stayed very low right up until just before it went out of overrun.

But it also seems to me that it might make sense to add some code to cancel the overrun state if RPMdot is very negative and RPM is approaching idle?

Log snippet and .msq attached.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

I'll have to take a look later. Sounds like the idle code didn't go into the right state. The old "reengage the clutch without revmatching" that everyone but me seems to do.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

Do you have something odd going on, like a lumpy cam or something that makes your engine not idle well? RPMdot of -220 on the decelerating side sounds odd. On my own setup, I was able to set it to ~-50.

In any case, because the accel/decel thresholds are so high, when you let out the clutch, in the split second it took for the engine state to go from idle to overrun, idle speed control saw the RPM go up, and dropped the idle valve duty to compensate. It just stayed there at that point, most likely because the throttle was never pressed. I'll have to add something to the code such that if the engine states code bumps you out of idle then goes back into it, it's the same as pressing and releasing the throttle again.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

I have a potential fix. I'll test it on the bench in the next day or two.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

muythaibxr wrote:Do you have something odd going on, like a lumpy cam or something that makes your engine not idle well? RPMdot of -220 on the decelerating side sounds odd. On my own setup, I was able to set it to ~-50.
Um... not that I know of? :?

I bought the engine used so don't know its complete history but as far as I know it's completely stock in most aspects that would affect idle, particularly the cams. From what I understand, these engines just idle a bit on the rough side.

I think the lowest I could set accel/decel and have the "accel" indicators on the engine states screen never light up was +/- 150. So I set the numbers a bit higher to give a "safety margin".
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

muythaibxr wrote:I have a potential fix. I'll test it on the bench in the next day or two.
Great!
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

The fix appears to work. PM me your current email address, I'll send you something to test.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

Hey can I toss out an idea?

I think one thing that complicates detecting when the engine is in overrun with my setup is that I've got the idle valve set not to close. So in overrun, the idle valve position is whatever it last was when the engine was idling, which is kind of random. And the idle valve position affects the MAP during deceleration.

What about adding an option so that when the engine enters the overrun state (or maybe when it exits idle?), the valve can go to a fixed position other than fully closed? I'm thinking in my situation, the position would be the initial value from the "CL idle initial values" table, based on the current CL idle target, plus the dashpot adder.

I know one obvious answer is to let the valve close, but my car seems to drive better if the valve is allowed to stay open. I think some OEMs actually have functionality to partially open the valve when coasting, to keep MAP from getting really low. I'm not sure what the motivation is for that... maybe to improve combustion when coasting but not in fuel cut?
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

Just to add a little more fuel to the fire...

Here's a good example of when it can't seem to decide whether to be in overrun or idle:
graph.png
I know this sounds crazy but I swear when overrun fuel cut kicks in, MAP increases a little*. I've got overrun MAP threshold in engine states set to 32.5 kPa and what happens here is the the throttle closes, MAP drops to below 32.5 kPa, and the Megasquirt enters overrun state. Then when ORFC kicks in MAP goes above 32.5 and the state changes from overrun to idle. That turns off ORFC and the cycle begins again. The TPS threshold is set at 0.5 and the TPS reading is 0.2-0.3 so that doesn't appear to be the cause of this. Edit: although it's not shown in the image above, PWM idle duty also remains constant throughout the event.

I know one obvious answer is to change the MAP threshold, but that's just going to move the problem to a different point in the engine's operating curve.

I also understand that at least part of the problem is I'm trying to cut things very close. I could probably set it up so overrun would only register above 2500 RPM (= lower MAP) and fix all these issues. The problem is most of my driving is in town at low speeds so 90% of the time the engine is at low RPM, even when cruising. So I'd really like the overrun/ORFC functions to be effective down to a few hundred RPM above idle.

I'm thinking in my case the best answer would be a little hysteresis on that threshold... what do you guys think?

* Edit: I just thought of something that might explain this although it's a little far-fetched. The injectors and idle valve are all fed from the same main feed and relay, although they're separately fused. Maybe when fuel is cut and the injectors aren't drawing any power, the voltage increases a tiny bit, making the idle valve open farther and thus increasing MAP?
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

remind me what your lags are set to.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

As shown below except... when I first started using 1.5, RPM lag was set to 45. Then tried 60 as shown below, and yesterday I set it to 100 and took the car for a drive. The change didn't seem to make much of a difference.
Capture.PNG
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

OK. I will have to give your problem some thought.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

Thanks... I appreciate it!
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

I've been doing some thinking about using MAP to distinguish when the engine is in the overrun state.

I can't really think of a better way to do it, but using a fixed MAP threshold has a flaw in that the threshold between overrun and non-overrun MAP varies by RPM and idle valve position, especially at low engine speeds. Here's a scatter chart of my engine at closed throttle, from a couple of recent logs:
graph.png
I don't know how you could account for variation due to idle valve position, but for RPM maybe a small table would be helpful, instead of just a single value?
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

The goal was to make it a simple as possible to set up. I am not ready to complicate it that way yet. I think I might be able to make the state machine logic a little more robust around those states.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
elaw
Super MS/Extra'er
Posts: 2926
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: Help! Engine states in 1.5

Post by elaw »

Hey for what it's worth, I've gotten it running pretty well on the regular 1.5.0 code. Not perfectly, but I'd say 8/10.

Msq is attached, you can download a complete log here: http://www.thelawsplace.com/2017-02-21_06.14.12.msl.zip

There's one pretty clear spot where it has trouble deciding whether to be in overrun or idle, it's when the throttle closes at t=335.363 seconds, and things get weird starting at 349 seconds.
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Help! Engine states in 1.5

Post by muythaibxr »

James and I have discussed a potential solution. I may have some time to code it up tomorrow.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
Post Reply