Closed Loop Idle Working

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

Moderators: jsmcortina, muythaibxr

Post Reply
Maddog6961
Helpful MS/Extra'er
Posts: 134
Joined: Thu Sep 01, 2005 8:33 am

Closed Loop Idle Working

Post by Maddog6961 »

I got my closed loop idle setup tonight. I haven't been through a full warmup with it yet, but its working with the engine warmed up and is able to compensate for turning the A/C on and off. All of my settings are pretty low though which surprises me.

Open Duty : 35
Idle Valve Codes Duty: 80
Idle Activation RPM adder: 500
Idle activation TPS: 0

Min Duty for PID: 45
PID delay: 1
Proportional Gain: 5
Integral Gain : 1
Derivative Gain: 0

Watching the map signal on a datalog shows oscilation, but the idle is stable.

Am I getting this right?
George Carstens
1984 BMW 533i turbo
MS II Extra Beta
http://www.wreckracing.com
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Your open duty is lower than the min duty for PID. I think that'll cause some weird things to happen. Open duty should be the duty that holds your valve all the way open.

Min duty for PID should be the lowest duty you want PID to adjust to.

Ken
Maddog6961
Helpful MS/Extra'er
Posts: 134
Joined: Thu Sep 01, 2005 8:33 am

Post by Maddog6961 »

I had some really strange warmup behavior this morning. The whole system just really wasn't working at all. I'll try changing those settings when I leave work today and see if that fixes things. I'll play with it some more when I leave work today and see what I can come up with.
George Carstens
1984 BMW 533i turbo
MS II Extra Beta
http://www.wreckracing.com
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

You may want to use the latest beta. Its lockout protection works very well on the bench, and I have a feeling it'll work pretty well in the car too.

I'm moving this thread to the ms2 dev section since it's a beta feature that we're discussing.

Ken
Maddog6961
Helpful MS/Extra'er
Posts: 134
Joined: Thu Sep 01, 2005 8:33 am

Post by Maddog6961 »

I upgraded to the new code and screwed around with my settings. I had it setup wrong the first time. Here are my new settings that work much better.

Open Duty: 80
Closed Duty : 20
Idle Activation RPM adder: 500
Idle Activation TPS threshold: 1
Dashpot adder : 1

Min duty for PID 40
PID delay 2
Prop. Gain 9
Integral Gain 1
Derivative Gain 2

PID lockout rpmDOT 50
PID lockout max decel 20

I still with the engine RPMs would fall to idle a little faster. I don't know if this is an issue with my setup or a setting in the code.
George Carstens
1984 BMW 533i turbo
MS II Extra Beta
http://www.wreckracing.com
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

to fall a little faster you might want to reduce the dashpot adder, and/or increase the Proportional gain.

I noticed that your dashpot adder was already pretty low, so you'll probably want to just try slightly increasing proportional gain.

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

Post by mattd860 »

Maddog6961 wrote:Min duty for PID 40
PID delay 2
Prop. Gain 9
Integral Gain 1
Derivative Gain 2

I still with the engine RPMs would fall to idle a little faster. I don't know if this is an issue with my setup or a setting in the code.
Yeah definitely increase the Integral Gain. For me, the “I” term is perfect at 4%. Also, set the “D” term to 0 and see how that works. If I understand PID right, the “D” term just slows down the “P” term as it gets closer to the target which isn't really necessary if the P and I terms are set up correctly. Of course everybody's setup is different but start with what I and Ken suggested and go from there.
Maddog6961
Helpful MS/Extra'er
Posts: 134
Joined: Thu Sep 01, 2005 8:33 am

Post by Maddog6961 »

If I increase the I term at all, I start to oscillate. I have all all terms to their max setting without oscillation.
George Carstens
1984 BMW 533i turbo
MS II Extra Beta
http://www.wreckracing.com
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

Maddog6961 wrote:If I increase the I term at all, I start to oscillate. I have all all terms to their max setting without oscillation.
But what if you increase I and decrease D?

Also, what about if you increase P?

What frequency are you running the valve at?

Ken
Jon k
Super MS/Extra'er
Posts: 1256
Joined: Fri Oct 14, 2005 10:28 am

Post by Jon k »

What idle valve are you using?
1992 BMW 525i M50 Non Vanos 24v Turbocharged
Stock COP Wasted Spark
MS2/E v3
Maddog6961
Helpful MS/Extra'er
Posts: 134
Joined: Thu Sep 01, 2005 8:33 am

Post by Maddog6961 »

I have a 2 wire bosch valve in my BMW 533i. I just ended up turning closed loop off because it was oscillating a lot and causing a lot of other strange behavior. I was running it at 78hz. I tried the 156, but my results did not change and I was not able to increase my P or I values at all. I did zero out my D value and that helped, but again, i just wasn't having much luck.
George Carstens
1984 BMW 533i turbo
MS II Extra Beta
http://www.wreckracing.com
muythaibxr
Site Admin
Posts: 8228
Joined: Thu Oct 14, 2004 12:48 pm

Post by muythaibxr »

The way it's usually recommended to tune is the following:

1) Increase P until it oscillates, then reduce it slightly
2) Increase I until it oscillates, then reduce it slightly
3) Increase D until it oscillates, then reduce it slightly

A lot of people skip #3 as it's not totally necessary. Also, the default settings may cause oscillation, on some engines as well, so if they do, I recommend restarting with values of 5,0,0 and following the steps above for P,I, and D.

Ken
Post Reply