Tuning Haltech O2 Control PID Settings?
Can anyone give me advice on how to tune the PID settings for the Haltech O2 control?
Haltech states the following:
1. Set all proportional, integral and derivative to zero
2. Bring up the proportional in increments of 1% until you see a small oscillation in Air Fuel Ratio
Note: The target air fuel ratio will not be met with only the proportional part of the controller being used
3. Bring up the integral in increments of 1% until you cancel out the oscillation in the air fuel ratio. When the integral part is introduced the air fuel ratio will go to the target
The range for proportional is 0 to 200 and the range for integral is 0 to 100. Derivative is normally set to 0. I have an AEM wideband.
• I set everything to zero, and the A/F is already oscillating (like a sine wave) from about 13.5 to 15.5. Should I leave the proportional at 0 and start increasing the integral since it is already oscillating?
• What do they mean increments of 1%? Does that mean 2 points at a time for proportional and 1 point at a time for integral? The base map I got from Hal had proportional set to 80 and integral set to 0.36! How the hell do you end up with numbers like that by following the Haltech procedure? The “default” setting for proportional is 11, and 5 for integral.
• It is required that the ecu be rebooted every time to make changes to these settings take effect. Does this mean I have to sit there and re-start the engine like 50 or more times to get this thing tuned in?
I’m confused.
Haltech states the following:
1. Set all proportional, integral and derivative to zero
2. Bring up the proportional in increments of 1% until you see a small oscillation in Air Fuel Ratio
Note: The target air fuel ratio will not be met with only the proportional part of the controller being used
3. Bring up the integral in increments of 1% until you cancel out the oscillation in the air fuel ratio. When the integral part is introduced the air fuel ratio will go to the target
The range for proportional is 0 to 200 and the range for integral is 0 to 100. Derivative is normally set to 0. I have an AEM wideband.
• I set everything to zero, and the A/F is already oscillating (like a sine wave) from about 13.5 to 15.5. Should I leave the proportional at 0 and start increasing the integral since it is already oscillating?
• What do they mean increments of 1%? Does that mean 2 points at a time for proportional and 1 point at a time for integral? The base map I got from Hal had proportional set to 80 and integral set to 0.36! How the hell do you end up with numbers like that by following the Haltech procedure? The “default” setting for proportional is 11, and 5 for integral.
• It is required that the ecu be rebooted every time to make changes to these settings take effect. Does this mean I have to sit there and re-start the engine like 50 or more times to get this thing tuned in?
I’m confused.
If you have access to simulink, you can get the ideal PID settings for most first or second order control schemes if you have data points. Theres also quite a few ways of estimating PID mathamatically, not qualitatively.
Back to your question. You are oscillating but are not critically dampened. Increase P until you oscillate but still hit set point plus or minus some offset. It should look like a sine wave that converges to the Set point.
Example of a well tuned P loop:
http://parts.mit.edu/igem07/images/t...lala_copia.jpg
The Green line is Setpoint, the blue line is the process variable (lambda?). It overshoots, corrects and then reaches some value that is SP +/- offset. Then you can add I in slowly to remove the offset.
Once the offset is removed with adding I, you can add D to cause the loop to converge quickly without overshoot.
With simulink it'll be 20X faster:
http://www.mathworks.com/matlabcentr...x-optimization
Back to your question. You are oscillating but are not critically dampened. Increase P until you oscillate but still hit set point plus or minus some offset. It should look like a sine wave that converges to the Set point.
Example of a well tuned P loop:
http://parts.mit.edu/igem07/images/t...lala_copia.jpg
The Green line is Setpoint, the blue line is the process variable (lambda?). It overshoots, corrects and then reaches some value that is SP +/- offset. Then you can add I in slowly to remove the offset.
Once the offset is removed with adding I, you can add D to cause the loop to converge quickly without overshoot.
With simulink it'll be 20X faster:
http://www.mathworks.com/matlabcentr...x-optimization
Last edited by plumpzz; May 4, 2010 at 06:40 AM.
I also use the stock PID settings and it seems to work fine. It seems that not all implementations of the PID algorithm are the same, which makes me think that using a simulator would be fruitless? The boost PID settings do not work at all with the same settings used for O2 control, as an example.
Thanks plumpzz, that helps me understand it a lot better.
The settings on the 350z base map from Haltech are:
P=120
I=.4
D=0
and the settings on the map that Hal sent me are:
P=80
I=.36
D=0
It's not that it doesn't work, it's just that I think it could work better. I get quite a bit of oscillation with Hal's settings (from what I recall it swings either way about .5 A/F from the target, and every now and then it sounds like the engine misses), and I was going to try to see if I could tune it out. I just got confused by the Haltech instructions on how to tune the PID settings (the whole 1% at a time thing, and the fact that you can enter any number between 0 and 100 for I, despite the fact that it seems like it is always between 0 and 1). Plus it is very time consuming to make small changes and have to shut down and re-start the engine every time to see how it worked. Why cant this be real-time tunable? Does every change in the settings menu on the Haltech require a reboot of the ecu to take effect?
The settings on the 350z base map from Haltech are:
P=120
I=.4
D=0
and the settings on the map that Hal sent me are:
P=80
I=.36
D=0
It's not that it doesn't work, it's just that I think it could work better. I get quite a bit of oscillation with Hal's settings (from what I recall it swings either way about .5 A/F from the target, and every now and then it sounds like the engine misses), and I was going to try to see if I could tune it out. I just got confused by the Haltech instructions on how to tune the PID settings (the whole 1% at a time thing, and the fact that you can enter any number between 0 and 100 for I, despite the fact that it seems like it is always between 0 and 1). Plus it is very time consuming to make small changes and have to shut down and re-start the engine every time to see how it worked. Why cant this be real-time tunable? Does every change in the settings menu on the Haltech require a reboot of the ecu to take effect?
Last edited by mx594; May 4, 2010 at 08:44 AM.
ya every setting needs a reboot. at least with the UTEC, a 'reboot' would just cause the car to stumble but you could gas your way out so it didnt stall.
Keep us updated, very interesting as I have an AEM as well. Did you ask Hal for those PIDs and wonder how he determined them.
Keep us updated, very interesting as I have an AEM as well. Did you ask Hal for those PIDs and wonder how he determined them.
Last edited by str8dum1; May 4, 2010 at 08:47 AM.
Trending Topics
Thats a bummer. Even on my 12 year old LINK standalone system in my Miata you can change every setting in the whole darn computer and it takes effect immediately with no reboot and no effect on the engine. Hell you can be driving down the street and change the rev limit if you want.
Even if it oscillates a little, adding D will make the oscillation disapear. The example I gave you is perfectly tuned, but notice its slow, undershoots, overshoots and then settles above the SP, all characteristics of a P loop.
So then how come Haltech reccomends using it only as a PI controller and leaving D at 0? D basically slows the reaction rate and prevents overshoot correct? So given a long enough time, a PI controller alone can converge to the set point, and D just helps it do so more quickly correct?
Yesh!
"The derivative term slows the rate of change of the controller output and this effect is most noticeable close to the controller setpoint. Hence, derivative control is used to reduce the magnitude of the overshoot produced by the integral component and improve the combined controller-process stability. "
Less overshoot= faster convergence!
I guess the caveate, and haltechs reasoning is with a derivative term you'll reach SP faster but the response time increases (input to output). O2 sensors have a low characteristic time so they need fast response times over a fast convergence time.
BTW, i read up on haltechs suggestions and they're implementing a very common closed loop tuning method called the ZN method (ziegler-nichols). Look it up. I'm sure theres documents online which explain WHY they ask you to do what they say so you can make your own judgments, and make urself into a better tuner.
"The derivative term slows the rate of change of the controller output and this effect is most noticeable close to the controller setpoint. Hence, derivative control is used to reduce the magnitude of the overshoot produced by the integral component and improve the combined controller-process stability. "
Less overshoot= faster convergence!
I guess the caveate, and haltechs reasoning is with a derivative term you'll reach SP faster but the response time increases (input to output). O2 sensors have a low characteristic time so they need fast response times over a fast convergence time.
BTW, i read up on haltechs suggestions and they're implementing a very common closed loop tuning method called the ZN method (ziegler-nichols). Look it up. I'm sure theres documents online which explain WHY they ask you to do what they say so you can make your own judgments, and make urself into a better tuner.
Last edited by plumpzz; May 4, 2010 at 10:27 AM.
For boost control, the recommended tuning strategy provided is similar, but once you detect oscillation you are supposed to halve the proportional value and then start incrementing the integral. Perhaps a lower setting for P and higher setting for I would help you? Trial and error, and yes unfortunately some changes in the Haltech tables require a reboot...
The calibration I sent over was built using a Haltech wideband controller, which is why you are seeing that difference. You will have to experiment with it a little to dial in the AEM. I have set up o2 feedback on AEM before using 60, .28, 0, but it had large injectors so those values may not be fitting either.
Thanks Hal. I wasn't sure if the settings you put in the base map were AEM specific or not. I see a Haltech dual wideband in my future anyway, so I guess I won't fret over it too much right now. I just like to know how things work!
sorry to bring an old thread but I have.a haltech 350z platinum pro and get crazy oscillations as well. Did the OP ever find a solution optimum setting. The setting I have work but goes from like 13 to 15.5 and car sounds like its about to cut off the correts and goes back to normal.....and does this over and over instead of staying...
So with closed loop off, you dont get the AFR swings? IF you do, then its not your PID settings.
Motec has some great tutorials on setting up PID controllers. http://www.motec.com.au/webinars/webinararchive/
They say you are supposed to setup P, then D, and only use I at the end.
Thats different than the Haltech method, but teh way they describe it, makes complete sense to go P,D, and then I.
Motec has some great tutorials on setting up PID controllers. http://www.motec.com.au/webinars/webinararchive/
They say you are supposed to setup P, then D, and only use I at the end.
Thats different than the Haltech method, but teh way they describe it, makes complete sense to go P,D, and then I.


