Closed loop PWM problem (for me)...

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

Moderators: jsmcortina, muythaibxr

mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Closed loop PWM problem (for me)...

Post by mattd860 »

Ken, The closed loop program has been running really well for a while now. However, with temps now in the low 40's in the morning, I am experiencing something that hopefully can be easily tweaked out.

When the engine is warm, the idle valve DC is about 33 to maintain 900rpms according to the rpm vs coolant table. However, after starting in the cold temps, the DC is about 41-45 in order to maintain 900rpms + 100-200 according to the table. Based on these parameters, I've set the closed DC to 30. So, my problem is that when I press the accelerator and the TPS crosses the threshold, the ICV shoots from 41-45 down to 30. So while the car is slowly accelerating and I cross the threshold, then engine kind of slams or stops due to the quick lack of air and increase in manifold vacuum. It also effectively makes EAE trim tons of fuel. If I make the TPS threshold really close to the TPS closed DC, then this just happens right away. If I move the TPS threshold farther away so the car is already moving and rpms are say 1300-1400, then I get the same effect but toned down a little.

To me, a fix would be another table or algorithm that slowly scales the last known DC down to the closed DC once the TPS threshold is crossed. To make it even easier, maybe you can have this feature only active below a user defined coolant temperature.

Let me know what you think of this. Is anybody else having this problem?



Also – have you given further thought to forcing EAE correction to zero during idle? In some situations of mine, with no correction at idle, this will really smooth out minor oscillating that happens at totally random times like after starting the car and immediately turning on the lights, fan, etc.

Thanks Ken.
Last edited by mattd860 on Wed Oct 17, 2007 7:21 pm, edited 1 time in total.
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Post by hassmaschine »

this is a problem for a lot of us. it closes too fast on throttle application. I just stalled my car today because of it as a matter of fact.. pisses me off too :p

I think they were going to add something to fix that, but he hasn't gotten to that yet. probably in 2.1? beta 14 if we're really lucky. :)

for correcting EAE to zero for idle, I'd been thinking of something.. it probably doesn't work and that's why nobody does it, but how about setting the RPM corrections for the idle speed to zero?
natesully
Experienced MS/Extra'er
Posts: 226
Joined: Mon Jul 25, 2005 9:13 pm

Post by natesully »

I've never had this problem, for whatever reason. However, my idle oscillates in the new, colder weather. The PID just tries too hard to maintain idle speed, even at 3% P and 2% I, IIRC. What are you all using for PID settings?

Of course, I think I need to update firmware anyhow.
95 Miata M-Edition, GT28 Turbo
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Post by hassmaschine »

you probably have your minimum DC set higher. mine is set to the lowest required to get the idle to be in my desired range. I could raise it to eliminate that problem but then I have a 1200rpm idle..

curretntly my PID is 11, 3, and 4

with your P at only 3% it probably can't respond fast enough. also, I notice everyone leaves out D entirely, but it's important to the equation. Part of it's purpose is to dampen oscillations.

95% of the time my RPMs drop right to idle and stay there, the rest of the time I think could be corrected when .1% changes in the PID equation are allowed.

but mostly I'd like to be able to slow the closing time when going on throttle...
pettaw
Helpful MS/Extra'er
Posts: 93
Joined: Fri Apr 29, 2005 6:56 am
Location: London, UK

Post by pettaw »

Yeah, I have the same problem. My idle also oscillates, but I'm running my PID settings higher, around 20/2/0. I reckon its because the loop time is too slow, although I believe that Ken has got the loop time thing on his list to do.

EAE I can't comment on because I haven't been able to get the tuning right, although AFAIK, if EAE is set 100% correct, it shouldn't be trimming loads of fuel and making the mixture lean because it should only trim the correct amount of fuel to maintain an AFR.
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Post by hassmaschine »

again, you're not using the D portion of the equation. also, with your P set so high, it's going to overshoot a lot. try lowering the P to about 15% and put 3-4% for D.

the problem with EAE at idle is fluctiations in MAP cause it to change the correction a little bit - 1-2%. my map at idle fluctuates between 48-55 (big cam) so this can cause idle oscillation.
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Post by mattd860 »

The problem is only going to occur if you have your target table setup to have a higher rpm when clt temps are low. When the engine is warm, if the closed DC is set to a value very close to normal idle DC, then you will never have this problem.

This is why I gave hard values in my original post. You can clearly see that normal idle DC is 33 but to keep up with the target table during cold temps, the idle DC is +40. So once you open the throttle past the threshold, the idle DC is going to drop from +40 to the closed DC value (30 for me). So this means a +10% drop in the DC. This is a substantial decrease in valve opening that can really be felt in the engine especially when EAE subtracts fuel when it sees the vacuum rise in addition to the lower VE percentage if the VE table is speed density. Sometimes this lean condition even stalls the car if I don’t let it warm up for more than 5 minutes but most of the time its just a lean buck.

Again, if you live in moderate climates or don't have your target table set to anything other than the same rpms across the board then you probably have never experienced this.

This is why it would be better to scale down the DC slowly from the last known DC to the valve closed DC because it would prevent a significant MAP drop which makes EAE pull fuel from the total PW.

[EDIT] I just wanted to note that my idle is actually really nice. However at random times, like after starting the engine, MAP has a tough time settling which obviously makes EAE add and pull fuel. Also, after I turn the lights on or cause load to the alternator, the quick pull from alternator load causes MAP to drop for a second but as MAP begins to return to normal, the rise in MAP causes EAE to add fuel, then as MAP falls back EAE again pulls fuel. This will cycle back and forth for a few seconds before finally settling back to normal. This problem has nothing to do with pwn closed loop for me. My PID settings (9,5,0) work flawlessly. I merely brought his up so I didn't make two different posts. I really just wanted a yes or no answer from ken about EAE at idle and not go into great length of detail or discussion.
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Post by hassmaschine »

that is true. it gets colder here so I have mine raise the idle when the coolant temp is low. it behaves almost exactly like the stock idle valve actually.. except the part about almost stalling when I first take off :p

It does still do this when it's warmed up though, it's just not as noticeable. even a simple timed delay for when the valve closes after throttle input would probably work just fine.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Re: Closed loop PWM problem (for me)...

Post by muythaibxr »

mattd860 wrote: Let me know what you think of this. Is anybody else having this problem?
I'm planning to put this in for 2.1.
Also – have you given further thought to forcing EAE correction to zero during idle? In some situations of mine, with no correction at idle, this will really smooth out minor oscillating that happens at totally random times like after starting the car and immediately turning on the lights, fan, etc.

Thanks Ken.
Yes, I've thought about it, and no I'm not going to do it. If you've got some oscillations at idle, most likely they can be tuned out using the RPM table.

I can't turn it off at idle since the algorithm can't track how much fuel is on the walls properly if it's turned off... Turning it off will make off-idle response go to crap, as well as making the variables tracking the amount of fuel on the walls inaccurate.

Ken
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

hassmaschine wrote: It does still do this when it's warmed up though, it's just not as noticeable. even a simple timed delay for when the valve closes after throttle input would probably work just fine.
The workaround is to make it so it doesn't close until a higher rpm. This has worked fine for me on every engine I've tuned using this algorithm.

Ken
mattd860
Experienced MS/Extra'er
Posts: 226
Joined: Mon Nov 13, 2006 10:59 am

Re: Closed loop PWM problem (for me)...

Post by mattd860 »

Thanks Ken. Will look forward to the fix in 2.1.

The EAE fix is really insignificant for me, that's why I tried to keep it a small paragraph below the PWM problem description and not go into it. I'm not even going to mess with it or talk about it any more as idle always does eventually settle back to normal.
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Well, like I said, you may want to tweak your RPM based settings slightly at idle to help get rid of that bad behavior.

I've always been able to get rid of any problems that occur from things like turning on the headlights.
hassmaschine
Super MS/Extra'er
Posts: 1331
Joined: Mon May 21, 2007 8:36 am

Post by hassmaschine »

muythaibxr wrote:
hassmaschine wrote: It does still do this when it's warmed up though, it's just not as noticeable. even a simple timed delay for when the valve closes after throttle input would probably work just fine.
The workaround is to make it so it doesn't close until a higher rpm. This has worked fine for me on every engine I've tuned using this algorithm.

Ken
do you mean increase the idle activation RPM adder?
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Yeah, then the RPM when it closes will be higher, and you won't really feel it. That's how I was running the 20v 4age before we pulled it back out of the car (taking the car to the body shop to have it fixed up, and have a rollcage installed).

Ken
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Post by UnaClocker »

Will the PWM routines work alright if the standard warm PW is 0%? Just a question I've always wondered, because I pretty much have a perfect idle speed when the car is warmed up. I just want to get more air in during warmup. :)
Brian
'84 Dodge Rampage
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

UnaClocker wrote:. I just want to get more air in during warmup. :)
Why not use open-loop.

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".
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Post by UnaClocker »

heh, oh yeah.. :)
Brian
'84 Dodge Rampage
pettaw
Helpful MS/Extra'er
Posts: 93
Joined: Fri Apr 29, 2005 6:56 am
Location: London, UK

Post by pettaw »

muythaibxr wrote:Yeah, then the RPM when it closes will be higher, and you won't really feel it. That's how I was running the 20v 4age before we pulled it back out of the car (taking the car to the body shop to have it fixed up, and have a rollcage installed).

Ken
That doesn't work for me. My engine has an engine driven fan, coupled to a hot cam, which means that it needs more idleDC as it sits in traffic and gets hot. You can really tell as the valve shuts because the engine lurches a lot, oarticularly as that fan kicks in and the valve has to open more to keep the idle revs constant.
UnaClocker
Super MS/Extra'er
Posts: 1933
Joined: Fri May 07, 2004 12:59 pm
Location: Tacoma, WA
Contact:

Post by UnaClocker »

pettaw wrote:
muythaibxr wrote:Yeah, then the RPM when it closes will be higher, and you won't really feel it. That's how I was running the 20v 4age before we pulled it back out of the car (taking the car to the body shop to have it fixed up, and have a rollcage installed).

Ken
That doesn't work for me. My engine has an engine driven fan, coupled to a hot cam, which means that it needs more idleDC as it sits in traffic and gets hot. You can really tell as the valve shuts because the engine lurches a lot, oarticularly as that fan kicks in and the valve has to open more to keep the idle revs constant.
Set the RPM to 7,000 or something crazy like that. Then it won't close, and you won't have a problem.
Brian
'84 Dodge Rampage
muythaibxr
Site Admin
Posts: 8230
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

no, don't do that, then PID will always be running and you'll have other undesirable behavior.

Ken
Post Reply