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

sd1nl
Master MS/Extra'er
Posts: 470
Joined: Wed Apr 11, 2012 3:21 am
Location: Netherlands

Closed loop idle target bug

Post by sd1nl »

Hi,

I have been watching the closed loop idle target today, and found what looks like buggy behaviour. See the attached log and msq.

Sometimes when driving the idle target is what it is supposed to be at idle (840rpm), but sometimes it is much higher (1050rpm or so). This is not consistent behaviour, and it matters because the initial value calculation is affected by the closed loop idle target. Resulting in an unpredictable drop to idle.

The drop to idle seems to be much nicer by the way when the closed loop idle targed is raised slightly when not being in closed loop. Why not implement this as a feature?

Also it is still not clear to me when the idle valve dashpot adder is applied and when not. When I blip the throttle a littlebit when idling no dashpot adder is applied resulting in near stalls.

Still a frustrating part of Megasquirt, and almost impossible to get it right.

Rene
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: Closed loop idle target bug

Post by jsmcortina »

Please upgrade to the current release code. There was a small change to CLidle target that may be related.

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 »

I think that fix was already implemented in pre3.3.2beta4a. I think that was related with the idle target countdown.

I could do the upgrade nevertheless.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
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 »

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

Solution: the closed loop idle target, when not in closed loop, should be: (idle target taken from idle target graph)+( fixed value). The fixed value should make the target a few hundred rpm's higher than the normal idle rpm for a given temperature.

This will give predictable results.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
slyrye
Experienced MS/Extra'er
Posts: 255
Joined: Sun Aug 12, 2007 2:41 pm
Location: Philippines
Contact:

Re: Closed loop idle target bug

Post by slyrye »

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

Solution: the closed loop idle target, when not in closed loop, should be: (idle target taken from idle target graph)+( fixed value). The fixed value should make the target a few hundred rpm's higher than the normal idle rpm for a given temperature.

This will give predictable results.
I reviewed you msq, there's something strange the way you did your closed-loop initial values, my setup for my lancer is higher steps on cold cells and lower on top yours is inverted, i am mythiculous on my idle setup and found the code sufficiently working brilliant like a stock, my dashpot adder works fine aswell, mind checking your TPS lag , mine is set to about 96% :D
MSnS'n'4G15
slyrye
Experienced MS/Extra'er
Posts: 255
Joined: Sun Aug 12, 2007 2:41 pm
Location: Philippines
Contact:

Re: Closed loop idle target bug

Post by slyrye »

Dashpot decay reduces the duty over time (by an amount based on the factor set and the rpmDOT value
at that time). The algorithm used is decay_factor x 10 / rpmdot and the amount being subtracted is
logged in status4.
:D :D :D
MSnS'n'4G15
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 »

My idle steps are higher also when the clt is colder. The y axis is MAT, en my engine needs more idle steps when the MAT is high.

This bit works fine.

Problem with the current code is that there seems to be a bug in the code that causes the wrong value picked out of the initial values table.

Rene
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Closed loop idle target bug

Post by muythaibxr »

This does not happen in MS3, but it is possible that there is something going on in MS2. I will compare and see if I find anything.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
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 »

Also something I noticed:

When driving around the idle stepper valve Is sometimes in a strange position (probably also the last position it was in when being in PID).

This is not a problem when you normally lift the throttle, because then the dashpot is added. But it can be an issue if you are in overrun, en you suddenly have to press the clutch.

The idle then plummets to zero if you are unlucky.

Rene
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
slyrye
Experienced MS/Extra'er
Posts: 255
Joined: Sun Aug 12, 2007 2:41 pm
Location: Philippines
Contact:

Re: Closed loop idle target bug

Post by slyrye »

sd1nl wrote:Also something I noticed:

When driving around the idle stepper valve Is sometimes in a strange position (probably also the last position it was in when being in PID).

This is not a problem when you normally lift the throttle, because then the dashpot is added. But it can be an issue if you are in overrun, en you suddenly have to press the clutch.

The idle then plummets to zero if you are unlucky.

Rene
I think that's when you need to install a "PID lockout switch", I also suffer from deep rpm stall when releasing clutch during cruising when over-run is engaged, what I did was raised the "total Idle valve close steps" limit sufficiently enough to mitigate this, not too high and not too low, also I tune in carefully my "Max decel load" :D
MSnS'n'4G15
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 »

Not a bad thought, the lockout switch on the clutch.

But I still think it would help a lot if I the idle valve would already be in the proper position when I step on the clutch pedal.

It is unclear to me why the proper stepper idle valve position+dashpotadder is commanded when the system is engaging pid, and not when leaving pid. I assume this is because the code was developed with PWM valves in mind. They are quicker, and then this is less of a problem.

Hope this can be fixed.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
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 »

:msq:

Oh, and the msq and log were already attached in the first post. If any other info is needed I can make some extra logs.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
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 »

Figured I'd bump this as I see the exact same behavior on 3.3.2. Quite hard to predict what's going to happen when I return to idle since sometimes it's into closed loop well before it even bumps the target RPM up to start the ramp down. I also see the inconsistent dashpot behavior (which could be removed in my case if the idle target worked as I believe it should)

I'll attach an example as well.
'92 GTI 16V running MS2 v3.57 & MS2/Extra v3.4.0
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 »

Any news on this issue? Would be great to have it solved
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
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 »

Dear developers:

There is very little feedback on this unfortunately.

I will be brutally honest here:

I like Megasquirt very much, and I like playing with tunes and trying out new beta and alpha versions. When I find a bug I report it, send logs, try to explain it. This all in the hope future versions will be better (and they could be a lot better) and everybody will profit.

It just seems to be a little one way traffic lately. if you guys are just not interested, just say so: then I won't be bothered anymore to give anymore input.

Disappointed Megasquirt user.
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Closed loop idle target bug

Post by muythaibxr »

I have been extremely busy with work lately. I have seen your report, and have not had time to do anything with it.

I'll get to it as soon as I can get a chance.
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
wes kiser
Super MS/Extra'er
Posts: 1402
Joined: Tue Jan 03, 2006 2:49 pm
Location: Charlotte, NC

Re: Closed loop idle target bug

Post by wes kiser »

Do any of you guys use the adaptive idle timing feature? Every one wants to rely on airflow, but as a general rule it is the least responsive "button" you have to push. A properly setup adaptive idle table can mask HUGE errors in intial airflow.

I would also temper your dissappointment. Bugs exist in many commercial ecu's as well, and these guys do at least as good of a job responding to them.
86 Rx-7, swapped to 2.3 ford turbo (BW EFR 6758), ms3/ms3x sequential fuel /waste spark, ls2 coils
88 Tbird 2.3t, Microsquirt Module (PIMP), TFI ignition
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 »

Due to this bug I can't use the adaptive idle timing feature because when the closed loop idle target spikes up like it does suddenly the idle bounces all over the place because of the timing change. I have to use RPM based idle timing, which isn't what I want to do, obviously.
'92 GTI 16V running MS2 v3.57 & MS2/Extra v3.4.0
pigga
Master MS/Extra'er
Posts: 618
Joined: Sat Feb 09, 2008 12:44 pm

Re: Closed loop idle target bug

Post by pigga »

Hi.
I compared the latest Alpha to the GSlender-Modded Firmware I used before. As far as I can see, the adaptive idle correction was implemented in a similar way?
In the beginning (when dialing in the values at GSlender 2.8) I had similar problems to get adaptive Idle running.
Reason: Initially you have to set up a "flat" adaptive Idle Advance curve.
So you insert RPM-Delta Values let's say -500RPM, -250RPM, 0RPM, 250RPM and 500RPM for example. Then you set the Ignition advance accordingly (i.e. the lower RPM from target is, the more advance and the opposite for positive RPM-Delta values). I noticed (accidently) that it is important which way you enter the values of the X-Axis.
The negative RPM Values at the top, ascending to the positive values at the bottom of the table works correctly (*). It did not work the other way round, although TS always makes the graph appear in a way that it seems to be correct? Maybe this information is of any help. If not, no offence.
Screenshot 2014-08-31 13.00.14.png
* at least it works in my case. But I must say that I am not using the latest Alpha, so there might be some bug anyway
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 »

The bug is in the inconsistent way the stepper motor behaves when letting go off the throttle or when returning to idle.

It is not related to idle advance timing (that works fine).

Rene
Rover Vitesse 3.5
MS3 full-sequential
36-1 triggerwheel
Direct coil control
Innovate LC1 wideband lambda sensor
Post Reply