PID idle changes / development

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

Moderators: jsmcortina, muythaibxr

pigga
Master MS/Extra'er
Posts: 618
Joined: Sat Feb 09, 2008 12:44 pm

Re: PID idle changes / development

Post by pigga »

Hi.
Just take the update_ms2_whatever.bat file and the CHOICE.COM from any other MSextra software package (such as 3.1.1 release) and copy it into the unzipped V10/V11 folder. Then run the Batchfile.
And please give update if v11 works in your case. I had no luck for what reason ever...
Thomas
juansh2385
Master MS/Extra'er
Posts: 612
Joined: Fri Feb 25, 2011 4:28 pm

Re: PID idle changes / development

Post by juansh2385 »

got it. but no luck with v11 (for some reason the pw values are to hi and the car does not start) and I think v10 have bugs for some reason the clt idle does not go to target never it stays in the idle step table values... My setting was working ok with version 4 or 5 dont know wich one so i know is not the setting I try alredy to disable the rpm hysteresis and and the step tolerance and no change what so ever cld idle is on Tunerstudio say so but it does not try to adjust to the idle curve.
92notch
Experienced MS/Extra'er
Posts: 163
Joined: Thu Mar 30, 2006 7:13 am
Location: Staten Island, Ny

Re: PID idle changes / development

Post by 92notch »

do you mean the Cranking PW's? if so can we just set them lower and the car should start?
MS2 V3 W/Extra Code 3.1.1
92 Mustang Notchback
306
TFS Heads intake and stage one cam
42lb injectors
255 pump
B and G Single turbo kit with T-67 garrett 7PSI
pigga
Master MS/Extra'er
Posts: 618
Joined: Sat Feb 09, 2008 12:44 pm

Re: PID idle changes / development

Post by pigga »

Yeah, my car got stuck in "locked out" condition as well occasionally, but I cannot tell if it was related to my lockout settings or if the code got sth wrong.
Only thing I noticed that sometimes my TPS gets negative value such as "-1" because the resistance of tps seems to drift a bit. May this be a Problem?
Thomas
juansh2385
Master MS/Extra'er
Posts: 612
Joined: Fri Feb 25, 2011 4:28 pm

Re: PID idle changes / development

Post by juansh2385 »

ok thats not the point the car is starting normally with the same setting in V10 version I think that in V11 there are problems with pw values in general I have not keep trying abut I imagine that even if I lower the cranking PW it will cause problem with the rest of the settings
juansh2385
Master MS/Extra'er
Posts: 612
Joined: Fri Feb 25, 2011 4:28 pm

Re: PID idle changes / development

Post by juansh2385 »

well in my case I notice that V10 code like a bug if you enter to the curve idle setting you see that it reads as if it where spot on the curve even though the rpm are not in target
tjts1
Helpful MS/Extra'er
Posts: 49
Joined: Thu Dec 24, 2009 12:26 am

Re: PID idle changes / development

Post by tjts1 »

I've been fighting to get a stable idle that doesn't hang on at random high RPMs ever since I started working with MS2. The standard response on the forum was always, well your settings are all wrong. I tried all sorts of settings, finally got a sort of stable idle with 2.1 when 3.1 came out. It was back to the same old same old so I re installed 2.1. Then I came across this thread, first tried the mariob posted on page 1 which worked amazingly well. Then read through the rest of the thread and skipped to the S19 file on page 9. At first I though it was working, then it wasn't. Not sure why but after a few minutes of driving it kept getting hung up somewhere between 1300 and 1800rpm. Pretty much the same behavior as the standard 3.1. The only way I could unstick it (bring the idle back to the normal 800) was to keep it in gear all the way below 1000rpm for a few seconds then sometimes it would wake up again. I tried changing my settings maybe 10 different ways, I couldn't get this issue to go away. I re read this thread and installed the S19 from page 4. It works! I put a good 20 miles of city driving on it today and it didn't hang up once. The idle settings are exactly the same as what didn't work with the 3.1, 3.1.1 and page 9 S19 file. The 0.1% increments in simple EGO control is brilliant (PID ego is still beyond me) and it idles the way it always should have. Thank you mariob for your work.
pigga
Master MS/Extra'er
Posts: 618
Joined: Sat Feb 09, 2008 12:44 pm

Re: PID idle changes / development

Post by pigga »

Hi.
The key point ist, that even at the standard CL Idle of MS 3.1.0 and 3.1.1 there are several conditions that need to be met.
And even worse: If you loosen the lockout conditions to say "CL Idle is always on hah!" you’ll have to notice that this doesn't work well at all.
cl_idle3.jpg
If you fire up the engine code will start with cranking value and (hopefully) ramp down to target.
If you get down to idle next time it is important that PID will not be activated too early (by lockout conditions). Because in this case the code will "see" a dramatically dropping idle and do weird things to compensate.
The strategy of the code is to wait a moment and THEN activate CL Idle.
Mario has added further features. You should tweak them once the basic settings work...
@Developers: If sth in my diagram is wrong let me know!
Thomas
[EDIT]Ok guys, of course you're right. Modified it a bit. Not that beautiful I know, but probably helpful to explain what CL Idle does or even more to visualize possible reasons if CL idle doest NOT what it is supposed to do [/EDIT]
Last edited by pigga on Tue Jun 21, 2011 11:28 am, edited 2 times in total.
Vicoor
Experienced MS/Extra'er
Posts: 305
Joined: Thu Feb 12, 2009 6:58 pm
Location: Manassas, Virginia

Re: PID idle changes / development

Post by Vicoor »

I'm betting that if the TPS is not below threshold the code will not enter PID no matter what the lockout conditions are.

I'm sure there will be some refinement but it's a great idea pigga to do a flow chart so everyone can better understand how it works.

Victor
Don't Talk About it,,,Just Do It!
1993 Toyota P/U 22RE V3.0 MS2/Extra 3.4.2 Full sequential Injection & Spark
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Re: PID idle changes / development

Post by muythaibxr »

Yeah, If TPS isn't below the threshold, the anti-lockout code doesn't even run.

A flow chart like that is a pretty good idea though, I may use that idea and create one for the official docs.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
mariob
Experienced MS/Extra'er
Posts: 193
Joined: Wed Nov 11, 2009 11:35 am
Location: Berlin, Germany

Re: PID idle changes / development

Post by mariob »

The graph is a really brilliant idea.

I corrected the signedness of the D-Term in EGO- and IDLE-PID and it really works better. At the moment i am fighting with the compiler and the way it handles casts from 16 to 32 bits in the EAE-code. The problems with v11 seem to be related to this :(

Here is a snippet of what i am aiming at with the improved internal resolution:
Image
(have a look at the scale for pw!!!)

Mario
Peugeot 106 Sergio_Tacchini, 1124cm³, MS2/Extra pre3.3alpah15, E85
Citroen AX, 954cm³, MS2/Extra pre3.3alpha15, E85
Peugeot 106 Rallye, 1298cm³ ... waiting for ITBs and full sequential injection
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: PID idle changes / development

Post by jsmcortina »

mariob wrote: At the moment i am fighting with the compiler and the way it handles casts from 16 to 32 bits in the EAE-code.
What in particular ?

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".
mariob
Experienced MS/Extra'er
Posts: 193
Joined: Wed Nov 11, 2009 11:35 am
Location: Berlin, Germany

Re: PID idle changes / development

Post by mariob »

jsmcortina wrote:
mariob wrote: At the moment i am fighting with the compiler and the way it handles casts from 16 to 32 bits in the EAE-code.
What in particular ?

James
this here was in v10 and worked quite well:
tmp_pw1 = tmp_pw1*(ASE_AWC-asecount_save)/ASE_AWC + SQF * asecount_save / ASE_AWC;

later on i wanted to make things clearer and avoid overruns (asecount can get 2500, tmp_pw is max. 3.200.000, so it will fit if we shift one position) and it seems as if the upper 16 bits are getting lost:
tmp_pw1 = ((unsigned long)
(unsigned long)(tmp_pw1>>1 * (ASE_AWC-asecount_save) / ASE_AWC) //fade out original PW
+ (unsigned long)(SQF>>1 * asecount_save / ASE_AWC) //fade in EAE
)<<1;*

I have reanimated my testbench and will try to catch it with the help of the gpioadc-fields.

Mario
Peugeot 106 Sergio_Tacchini, 1124cm³, MS2/Extra pre3.3alpah15, E85
Citroen AX, 954cm³, MS2/Extra pre3.3alpha15, E85
Peugeot 106 Rallye, 1298cm³ ... waiting for ITBs and full sequential injection
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: PID idle changes / development

Post by jsmcortina »

Why are you "fading in" EAE? That makes a nonsense of the algorithm - surely.

However, have you examined the generated ASM ? We do that to confirm these issues.

For casting to work correctly, you must cast-extend the INPUT variables not the result.
Take:
int a, b;
long c;
c = (long) (a * b); /* DOESN'T WORK */
c = (long)a * b; /* WORKS */

I'd also suggest using more brackets to be sure you know what is being done and/or using temporary variables for intermediate calculations to force the result you want.

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: PID idle changes / development

Post by muythaibxr »

I agree with James, the EAE fade in is unnecessary and against actual physics.

Ken
Megasquirt is not for use on pollution controlled vehicles. Any advice I give is for off road use only.
mariob
Experienced MS/Extra'er
Posts: 193
Joined: Wed Nov 11, 2009 11:35 am
Location: Berlin, Germany

Re: PID idle changes / development

Post by mariob »

Hi,

that is totally true from the physics point of view and may be ok for a lot of engines with separate injectors for each cyclinder.

But if i try to start my 1-litre-engine with 35mm-ports and a 45mm-throttle running on E85, which is injected through one injector above the throttle-body, i have to pull in a lot of fuel to get it doing anything. After the engine has started, EAE will instantly cut my fuel and begin to oscillate badly. (roughly 30ms priming pulse, 10...15ms while cranking, ~1.5ms in idle and ~4ms under load - EAE is working pretty well as soon as the engine runs)

The idea was to fade in EAE slowly during the ASE-phase. Otherwise the result will be very different depending on the time needed for cranking.

Mario
Peugeot 106 Sergio_Tacchini, 1124cm³, MS2/Extra pre3.3alpah15, E85
Citroen AX, 954cm³, MS2/Extra pre3.3alpha15, E85
Peugeot 106 Rallye, 1298cm³ ... waiting for ITBs and full sequential injection
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: PID idle changes / development

Post by jsmcortina »

Have you tried tuning the EAE for that low rpm region?

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".
mariob
Experienced MS/Extra'er
Posts: 193
Joined: Wed Nov 11, 2009 11:35 am
Location: Berlin, Germany

Re: PID idle changes / development

Post by mariob »

Yes, some weeks ago i had an EAE-tuning-trip of several hundred kilometers with a friend and we were able to achieve real good throttle response on the car of my girl-friend. But it was impossible to start the car with these settings. Since then i have done a lot of datalogs on three similar cars and am quite sure we can help a lot of people with imperfect EAE-settings or difficult cars by fading in the values slowly. The calculations are only done during ASE, so the impact on the looptime should be neglible.

download v14.zip

Mario
Peugeot 106 Sergio_Tacchini, 1124cm³, MS2/Extra pre3.3alpah15, E85
Citroen AX, 954cm³, MS2/Extra pre3.3alpha15, E85
Peugeot 106 Rallye, 1298cm³ ... waiting for ITBs and full sequential injection
tjts1
Helpful MS/Extra'er
Posts: 49
Joined: Thu Dec 24, 2009 12:26 am

Re: PID idle changes / development

Post by tjts1 »

I set the EAE RPM cooections to zero % below 1000 rpm to get around the cranking and ASE problem.
juansh2385
Master MS/Extra'er
Posts: 612
Joined: Fri Feb 25, 2011 4:28 pm

Re: PID idle changes / development

Post by juansh2385 »

Mario, I think there is a serious problem with V14. It's your car running this version right now? As you know I am not able to turn my car with V11 last that work with me was V10. But with V14 I had some serious problems. Are you cars running waste spark? I am running 420 in waste spark with semi sequential setting and apart from the fact that the car did not start, the code Mixed the outputs of spark. My current configuration with V10 is waste spark from D14 and D16 and running tach output from D15 but with V14 D16 stopped working and while cranking the car instead of D14 and D16 flashing like it always have. the led that flashed during cranking were D14 D15 the ms got a little hot and of course the car did not start I double check the setting nothing was wrong the problem was with the code so I am back to V10 Can you look into this.

Thanks for your time (BTW I finally manage to tune With v10 the idle and is working great)

Juan
Post Reply