Notices
Tuning Reflashes, Piggybacks, Standalone ECUs

Tuning Haltech O2 Control PID Settings?

Thread Tools
 
Search this Thread
 
Old May 4, 2010 | 05:15 AM
  #1  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default 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.
Reply
Old May 4, 2010 | 05:45 AM
  #2  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

This was helpful but most of my above questions remain:

http://en.wikipedia.org/wiki/PID_controller
Reply
Old May 4, 2010 | 06:18 AM
  #3  
Chris@FsP's Avatar
Chris@FsP
Vendor - Former Vendor
iTrader: (4)
 
Joined: Aug 2009
Posts: 1,601
Likes: 0
From: Tulsa
Default

So it doesn't work on the stock settings? That's what I use.
Reply
Old May 4, 2010 | 06:30 AM
  #4  
plumpzz's Avatar
plumpzz
New Member
iTrader: (10)
 
Joined: May 2005
Posts: 7,146
Likes: 0
From: Jersey, New
Default

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

Last edited by plumpzz; May 4, 2010 at 06:40 AM.
Reply
Old May 4, 2010 | 07:36 AM
  #5  
rcdash's Avatar
rcdash
New Member
iTrader: (18)
 
Joined: Jul 2005
Posts: 6,474
Likes: 65
From: Chapel Hill, NC
Default

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.
Reply
Old May 4, 2010 | 08:40 AM
  #6  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

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?

Last edited by mx594; May 4, 2010 at 08:44 AM.
Reply
Old May 4, 2010 | 08:46 AM
  #7  
str8dum1's Avatar
str8dum1
New Member
iTrader: (11)
 
Joined: Oct 2007
Posts: 8,807
Likes: 7
From: raleigh-wood NC
Default

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.

Last edited by str8dum1; May 4, 2010 at 08:47 AM.
Reply
Old May 4, 2010 | 08:50 AM
  #8  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

Originally Posted by str8dum1
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.
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.
Reply
Old May 4, 2010 | 08:52 AM
  #9  
plumpzz's Avatar
plumpzz
New Member
iTrader: (10)
 
Joined: May 2005
Posts: 7,146
Likes: 0
From: Jersey, New
Default

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.
Reply
Old May 4, 2010 | 09:17 AM
  #10  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

Originally Posted by plumpzz
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?
Reply
Old May 4, 2010 | 10:24 AM
  #11  
plumpzz's Avatar
plumpzz
New Member
iTrader: (10)
 
Joined: May 2005
Posts: 7,146
Likes: 0
From: Jersey, New
Default

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.

Last edited by plumpzz; May 4, 2010 at 10:27 AM.
Reply
Old May 4, 2010 | 06:56 PM
  #12  
rcdash's Avatar
rcdash
New Member
iTrader: (18)
 
Joined: Jul 2005
Posts: 6,474
Likes: 65
From: Chapel Hill, NC
Default

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...
Reply
Old May 5, 2010 | 04:52 AM
  #13  
Dynosty's Avatar
Dynosty
Vendor - Former Vendor
iTrader: (27)
 
Joined: Jan 2007
Posts: 2,137
Likes: 11
From: Louisville, KY
Default

What wideband are you using, and where is it located?
Reply
Old May 5, 2010 | 07:51 AM
  #14  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

AEM Wideband, located on drivers side right at the "elbow" of the test pipe.
Reply
Old May 5, 2010 | 07:56 AM
  #15  
Dynosty's Avatar
Dynosty
Vendor - Former Vendor
iTrader: (27)
 
Joined: Jan 2007
Posts: 2,137
Likes: 11
From: Louisville, KY
Default

Originally Posted by mx594
AEM Wideband, located on drivers side right at the "elbow" of the test pipe.
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.
Reply
Old May 5, 2010 | 09:01 AM
  #16  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

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!
Reply
Old May 5, 2010 | 09:04 AM
  #17  
plumpzz's Avatar
plumpzz
New Member
iTrader: (10)
 
Joined: May 2005
Posts: 7,146
Likes: 0
From: Jersey, New
Default

Did you try teh ZN method to find the ideal P, I, and D?
Reply
Old May 5, 2010 | 07:18 PM
  #18  
mx594's Avatar
mx594
Thread Starter
New Member
iTrader: (4)
 
Joined: Dec 2005
Posts: 608
Likes: 1
From: Grand Rapids, MI
Default

Originally Posted by plumpzz
Did you try teh ZN method to find the ideal P, I, and D?
No, not yet.
Reply
Old Apr 8, 2012 | 02:55 AM
  #19  
ranmas2004's Avatar
ranmas2004
Registered User
 
Joined: Sep 2011
Posts: 69
Likes: 0
From: Allentown, PA
Default

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...
Reply
Old Apr 8, 2012 | 04:30 AM
  #20  
str8dum1's Avatar
str8dum1
New Member
iTrader: (11)
 
Joined: Oct 2007
Posts: 8,807
Likes: 7
From: raleigh-wood NC
Default

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.
Reply



All times are GMT -8. The time now is 12:31 PM.