Closed loop idle target bug

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

DocWalt
Helpful MS/Extra'er
Posts: 35
Joined: Sun Dec 15, 2013 5:43 pm
Location: Royersford, PA

Re: Closed loop idle target bug

Post by DocWalt »

Agreed, the adaptive timing itself seems to work fine and I'd much prefer using that. The inconsistent idle target is the issue, which also prevents me from using the adaptive timing.
'92 GTI 16V running MS2 v3.57 & MS2/Extra v3.4.0
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

Bump.

I've been having the same issue. I'm running the 3.3.2.

I cannot use the Adaptive Idle Advance feature because of the incorrect CL Target RPM. My CL target is 850rpm for all conditions, but datalogs show random targets from 1100-1500rpm.

I have several datalogs that I can attach if needed. Looks to be the same problem at the previous posters.
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

I'm wondering if this issue has been acknowledged and is in the process of being sorted out. I know Ken mentioned being busy and will take a look, but that was Aug. 20th and I haven't heard or seen anything about this in any of the alpha or beta codes.

The problem is getting very annoying. It was not until I updated from 3.3.1 to 3.3.2 that this problem started. I tried going back to 3.3.1 and the problem followed. Not sure if the 3.3.1 on the downloads page is different from the 3.3.1 that I installed back in February.

Attached msq and catalog. Shows the incorrect CL target at startup. RPM based idle advance allows the car to operate once the CL idle has engaged for the first time, but Adaptive idle advance will leave the car stumbling and never enter CL idle.
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

PDX5 wrote:Attached msq and catalog. Shows the incorrect CL target at startup. RPM based idle advance allows the car to operate once the CL idle has engaged for the first time, but Adaptive idle advance will leave the car stumbling and never enter CL idle.
Where in the log are you seeing a problem? The code looks to be working as expected to me.

However, does your idle valve actually work correctly? In the log at 2242.259 the code picks your initial value and RPMs start to fall. Then after the delay, the duties start to rise but RPMs fall further.

When idle duty increases, the RPMs must go up - otherwise your valve has a problem or the "invert" setting is backwards. Unless this works, closed-loop will never work.

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".
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

sd1nl wrote:Upgraded to pre3.3.3beta1, but the behaviour is the same.

The closed loop idle target seems to stay at the last known value, which can be anything. This in turn influences the idle valve position that is taken from the initial values lookup table.

Result: unpredictable rpm return to idle.
Where in your posted logs are you seeing this?
The log I just looked at seems to be behaving as expected.

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".
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

jsmcortina wrote:Where in the log are you seeing a problem? The code looks to be working as expected to me.

However, does your idle valve actually work correctly? In the log at 2242.259 the code picks your initial value and RPMs start to fall. Then after the delay, the duties start to rise but RPMs fall further.
At 2242.295 is where I see the problem in that log. It occurs right after the initial overshoot at startup. The engine revs to life, then bogs, then revs again because the idle valve works itself open (I'm assuming because of the incorrect CL target), and then the idle valve snaps closed and holds the idle speed correctly. This happens at every startup and only at startup, that I've noticed. Trying to used Adaptive Idle Advance does not work at all because the delta valve will be incorrect and the engine bogs and will never enter CL idle (see datalog).
jsmcortina wrote:When idle duty increases, the RPMs must go up - otherwise your valve has a problem or the "invert" setting is backwards. Unless this works, closed-loop will never work.
I rechecked by idle valve and it works as you mentioned in the "inverted valve mode". Besides the startup behavior, the RPM does increase as the idle duty increases. I've checked this with the test mode as well. In the "normal valve mode" the RPM increases as the idle duty decreases.

James: I think that what you're seeing as perhaps a faulty idle valve issue is what I'm seeing as the idle bug. The idle valve and CL idle work well after the initial glitch at startup. I've attach 3 more datalogs of the issue (see file comments).

I appreciate you taking a look James.
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

PDX5 wrote:
jsmcortina wrote:Where in the log are you seeing a problem? The code looks to be working as expected to me.

However, does your idle valve actually work correctly? In the log at 2242.259 the code picks your initial value and RPMs start to fall. Then after the delay, the duties start to rise but RPMs fall further.
At 2242.295 is where I see the problem in that log. It occurs right after the initial overshoot at startup. The engine revs to life, then bogs, then revs again because the idle valve works itself open (I'm assuming because of the incorrect CL target), and then the idle valve snaps closed and holds the idle speed correctly. This happens at every startup and only at startup, that I've noticed. Trying to used Adaptive Idle Advance does not work at all because the delta valve will be incorrect and the engine bogs and will never enter CL idle (see datalog).
That's not an "incorrect CL target" the code is doing what it is designed to do. When it engages closed-loop it grabs the current RPM as the target and then tapers down to the target from the curve. The value in your initial values table can't be correct as the engine doesn't idle at the target right speed.

The fact that the revs INCREASE when the valve "snaps shut" says that there is a settings or valve problem.

The first new log isn't showing me a lot. How does it behave in open-loop mode ? Getting open-loop to work correctly is essential before attempting closed-loop.

For the other logs at what timestamp are you seeing a problem? I'm not seeing one (not a code problem that is.)
I still think that your initial values table is wrong and the valve is perhaps operating backwards.

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".
arran
Master MS/Extra'er
Posts: 617
Joined: Mon Oct 29, 2012 2:34 am
Location: Brisbane Australia
Contact:

Re: Closed loop idle target bug

Post by arran »

My thoughts on a long term problem I have been looing at that has persisted across a number of firmwares is an occasional stall. I have had a thread running on this for a while:
http://www.msextra.com/forums/viewtopic ... 31&t=52949

As things stand at present I believe that it is "idle rpm timing correction" that in my case causes an occasional stall. I disabled this feature and after a number of drives over a couple of weeks the stall has not re-occurred. The stall was intermittently associated with activation of closed loop idle (which was also when the "rpm timing correction" was activating
RX7 Series 2 13B Turbo. Megasquirt 3 with 3X Expander and V3 CPU. Firmware 1.4.1
Knock module, twin EGT, real time clock, WBO2, full sequential fuel and spark
http://web.aanet.com.au/arran
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

jsmcortina wrote: That's not an "incorrect CL target" the code is doing what it is designed to do. When it engages closed-loop it grabs the current RPM as the target and then tapers down to the target from the curve.
Okay, that clarifies what I'm seeing in the datalogs. Thanks.
jsmcortina wrote:How does it behave in open-loop mode ? Getting open-loop to work correctly is essential before attempting closed-loop.
I set up open-loop before moving to closed-loop idle. EDIT: Open-loop idle mode works correctly.
jsmcortina wrote:...The value in your initial values table can't be correct as the engine doesn't idle at the target right speed. The fact that the revs INCREASE when the valve "snaps shut" says that there is a settings or valve problem.
DISCOVERY: While the datalog shows the idle valve duty increase as the rpm falls, the idle valve is not physically moving from the cranking duty. When the idle valve duty "snaps shut" on the datalog is when the idle valve physically starts to work again. So during the startup period the idle valve is stuck at cranking duty (even though the datalog shows otherwise).

-I tested a total of three Bosch idle valves. All three showed the same behavior.
-Closed-loop idle works perfectly with the initial values table and inverted valve mode after the initial startup glitch.
-This problem started immediately after I upgraded to 3.3.2.
-I put over 6k miles on the 3.3.1 firmware and did not have this problem. Same settings as now.
--Switching back to 3.3.1 did not fix the issue.

What can cause Megasquirt to lose control/communication with the idle valve during startup? Obviously the datalog shows the code working correctly but increasing PWM duty has no physical affect on the idle valve.

Idle valve is a Bosch 3-wire: 0 280 140 509
Megasquirt is a MSPNP2-B8793 from diyautotune

EDIT: Open-loop idle mode works correctly.
Last edited by PDX5 on Wed Dec 03, 2014 2:30 pm, edited 1 time in total.
sd1nl
Master MS/Extra'er
Posts: 470
Joined: Wed Apr 11, 2012 3:21 am
Location: Netherlands

Re: Closed loop idle target bug

Post by sd1nl »

jsmcortina wrote:
sd1nl wrote:Upgraded to pre3.3.3beta1, but the behaviour is the same.

The closed loop idle target seems to stay at the last known value, which can be anything. This in turn influences the idle valve position that is taken from the initial values lookup table.

Result: unpredictable rpm return to idle.
Where in your posted logs are you seeing this?
The log I just looked at seems to be behaving as expected.

James

From 6420,737s I seem to be driving around with an idle target of 1001rpm. Don't know why, because idle target when warm is 840rpm. Idle valve position when I push the clutch and the engine returns to idle is the stepper value calculated from int. val. table + dashpot adder. But because the init. val. table now calculates with 1001rpm instead of the correct 840rpm the stepper value is wrong. This causes inconsistent behavior.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

sd1nl wrote:From 6420,737s I seem to be driving around with an idle target of 1001rpm. Don't know why
As stated above, it picks the current RPM and then tapers to the target. At the point in the datalog you were only in closed-loop for half a second.

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".
sd1nl
Master MS/Extra'er
Posts: 470
Joined: Wed Apr 11, 2012 3:21 am
Location: Netherlands

Re: Closed loop idle target bug

Post by sd1nl »

jsmcortina wrote:
sd1nl wrote:From 6420,737s I seem to be driving around with an idle target of 1001rpm. Don't know why
As stated above, it picks the current RPM and then tapers to the target. At the point in the datalog you were only in closed-loop for half a second.

James

I call that buggy behaviour. Just because I was only in closed loop for half a second doesn't mean the system has to calculate with a wrong target rpm from then on.

Maybe It is as you call it "excpected behaviour" , but certainly not "desirable behaviour" .
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

sd1nl wrote:
jsmcortina wrote:
sd1nl wrote:From 6420,737s I seem to be driving around with an idle target of 1001rpm. Don't know why
As stated above, it picks the current RPM and then tapers to the target. At the point in the datalog you were only in closed-loop for half a second.

James
I call that buggy behaviour. Just because I was only in closed loop for half a second doesn't mean the system has to calculate with a wrong target rpm from then on.
During the time that you call "from then on" the code isn't even in closed-loop idle mode, so it isn't TRYING to do anything.

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".
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Re: Closed loop idle target bug

Post by muythaibxr »

jsmcortina wrote:
During the time that you call "from then on" the code isn't even in closed-loop idle mode, so it isn't TRYING to do anything.

James
Correct, the next time it enters PID, it'll redo the initial value lookup based on a new target (whatever RPM you're at when PID engages). It will then taper the target down to the final target for the current CLT.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

Are you still seeing this with the current code? The datalog was from "pre-3.3.2 beta 4"
There was a code change later that ended up in the 3.3.2 release.

Code: Select all

2014-05-09 JSM
Apply same CLidle target change from MS3 to fix "stuck" problem after start.
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".
sd1nl
Master MS/Extra'er
Posts: 470
Joined: Wed Apr 11, 2012 3:21 am
Location: Netherlands

Re: Closed loop idle target bug

Post by sd1nl »

muythaibxr wrote:
jsmcortina wrote:
During the time that you call "from then on" the code isn't even in closed-loop idle mode, so it isn't TRYING to do anything.

James
Correct, the next time it enters PID, it'll redo the initial value lookup based on a new target (whatever RPM you're at when PID engages). It will then taper the target down to the final target for the current CLT.

Ken

Maybe so, but It is still a strange thing to have the idle valve in the wrong position. This can have all kind of unwanted effects. Why would you program the code like this?

Btw: this behaviour is still there in the current firmware.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

We aren't "programming the valve in the wrong position." As I said above, in the part of the log you are complaining about, closed-loop idle isn't actually active. At that point the target could be 7500 for all the code cares, because it won't be using it.

The purpose of grabbing the current RPM when entering closed-loop idle is to give a smooth steady return to idle RPMs (the taper.) I've used it on MS2 and MS3 on a number of vehicles and was able to make it work nicely.

I think you perhaps have problems with engaging closed-loop idle and/or your initial valves table needs work to achieve the target RPM. i.e. if closed-loop target RPM is 1000RPM, the table MUST give a duty cycle that gives 1000RPM. Otherwise the code will still try to get to 1000RPM and you'll end up with overshoot or other weird behaviour. If you are intentionally putting lower duties in the table (perhaps?) then that will certainly break things.

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".
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

I've been working on my initial values table without much success.

Here's an example of grabbing the current rpm as the CL Idle Target messing up the Adaptive Idle Advance feature. Even though you say the CL Idle Target value is irrelevant when out of closed-loop idle... that value is still used by the Adaptive Idle Advance feature. In the attached datalog at 153803.25 you can see 14* ignition advance and idle valve duty at 35.7% supports my desired 850rpm idle. However, the CL Idle Target shows 1192rpm and therefore the Adaptive Idle Advance wants to bump the ignition advance to 22* ignition advance. This leaves the idle oscillating endlessly. If the CL Idle Target was my desired 850rpm, then the feature would work well (I believe this is how it was in 3.3.1 and the car worked very well).

The 2 subsequent starts at 153900.95 and 153949.05 are my "band-aid" which uses RPM based Idle Advance. This at least allows me to drive the car.

Also, why is closed-loop idle (status 2) activating even though the PID activation settings is not met? See 153803.39 and 153903.22 and 153950.98. Load should be above 44kPa, but it's activating below that value.

See attached MSQ and datalog. I set my base timing to 14* around idle to take that variable out.

2014-12-05_12.25.29.msl
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

PDX5 wrote:However, the CL Idle Target shows 1192rpm and therefore the Adaptive Idle Advance wants to bump the ignition advance to 22* ignition advance.
The CL Idle Target has nothing to do with it, the curve uses the actual engine RPM. The oscillation problem is made worse because you keep going above and below your 41kPa threshold and the advance is stepping up and down.

Why did you opt for manual settings instead of linking the idle-advance to closed-loop idle?

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".
PDX5
Helpful MS/Extra'er
Posts: 44
Joined: Mon Nov 03, 2014 11:08 pm
Location: Portland, Oregon / Washington, DC

Re: Closed loop idle target bug

Post by PDX5 »

jsmcortina wrote:
PDX5 wrote:However, the CL Idle Target shows 1192rpm and therefore the Adaptive Idle Advance wants to bump the ignition advance to 22* ignition advance.
The CL Idle Target has nothing to do with it, the curve uses the actual engine RPM. The oscillation problem is made worse because you keep going above and below your 41kPa threshold and the advance is stepping up and down.
*That startup at 153803.25 was using the adaptive advance (not rpm based). The two starts after that were rpm based advance. I did switch the idle advance mode from rpm to adaptive during this period in the msq attached. The timing graph was translated accordingly: (850rpm = 0 delta, 750rpm= -100 delta, 1000rpm= 150delta).

When I'm going in and out of the 41kPa threshold it is not working correctly from my understanding. When in idle advance mode it's commanding 22*. For example at 153810.92: Should be fairly close to 850rpm & 14*. When it drops out of idle advance it goes to 14* from Ignition Table 1. And repeat.

Will a fresh MSQ and datalog of my adaptive idle advance settings help?
jsmcortina wrote:Why did you opt for manual settings instead of linking the idle-advance to closed-loop idle?
I tried this a while back using 3.3.0 and it didn't work well. I use manual so that I can stabilize idle first with timing. Then idle PID settings engage. This also allowed me to raise my idle decel activation kPa... idle advance first at 41kPa, then idle PID at 44kPa
Post Reply