×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PID algorithm - determining coefficients

PID algorithm - determining coefficients

PID algorithm - determining coefficients

(OP)
Hi.

Please help me with the pid algorithm.
In order to regulate the temperature to follow a diagram ( to increase from 20 celsius degrees to 250 for 2 hours, then stay at 250 for 1 hour, then increase from 250 - 350 for 1 hour, etc.) I need to give some power to a device.

I inspired from:
http://bestune.50megs.com/typeABC.htm

CO(k) = CO(K-1) - KP * (PV(K) - PV(K-1)) + KI * TS * E(K) + KD / TS * (PV(K) - 2 * PV(K-1) + PV(K-2))

where
CO = controller output between 0 and 100. (the power to be given in order to grow the temperature)
PV = process variable (measured temperature)
SP = set point (the temperature that should be)
E = SP - PV = error
KP = proportional coefficient
KI = integral coefficient
KD = derivative coefficient                
TS= time sample = the time interval at which the regulation of the temperature is made

Questions:
1. Does this alg. apply also when the temperature to be set is not constant (e. g. is growing?)
2. How do i get the p, i, d coefficients? i run the program succesively how many times?
- p,i,d between what ranges?
- At consequent runs, i modify the coefficients with what increment?
- I select the p,i,d which makes the minimum error? how is measured the error? the sum of consequent errors?

Thank you for your help.
Gaby.

RE: PID algorithm - determining coefficients

Why did you select that PID formula in particular?

RE: PID algorithm - determining coefficients

(OP)
The formula was inspired from
http://bestune.50megs.com/typeABC.htm

I don't have a better source of information.
Do you have a better ideea?

Gaby.

RE: PID algorithm - determining coefficients

Gaby, to write one algorithm to adequately perform your control task is quite a mission!
The best approach is to separate the control tasks - one to perform the PID control at the given setpoint and one to provide the setpoint to the PID control (eg. to ramp the setpoint from 20deg to 250 deg over 2 hours, maintain 250deg for 1 hours etc.)
The tuning of the PID loop is a matter of experience and in fact the coefficients will not necessarily be the same across such a wide temperature range to achieve acceptable control across that range.
It is impossible to advise what coefficients to use as these are totally dependent on the system being controlled and the inherent lags of that system.
If the system can be 'played with' safely without causing undue damage or danger in the event of poor control, the best approach is a trial and error one. Set no integral or derivative terms, and then 'play' with the proportional setting until the system oscillates at fixed frequency. The final settings for all 3 terms can then be calculated from the proportional setting at the point of oscillation. (I've forgotten the actual ratios at the moment!) From there, fine tuning can be done by altering the coefficients by small amounts until satisfactory control occurs.
If poor performance of the control loop would introduce an unacceptable hazard, then it's best to leave it to someone who knows what they're doing!

RE: PID algorithm - determining coefficients

Several things, 1st your temp profile is a seperate issue from the PID control loop and is, in fact, a profile of the setpoint as suggested above. It is an easy matter to control that. 2nd, before you aquire optimum parameters for PID, you need to determine TC of process because it is probably very slow. If this was a fast loop it would be fairly easy to aquire these. As a rule, you would set I and D parameters to 0 and increase P until the Pband tightness just to oscillation, then divide p/1.85 and increase integral until it comes in. D probably won't be required. This is only rough; but, will get you close.

RE: PID algorithm - determining coefficients

skills is correct: the problem has two parts. Profiling the setpoint and tuning the loop. The other option instead of the Ziegler-Nichols (Z-N) closed loop method that skills mentioned above is to use the Z-N open loop method. Put the controller in manual mode (i.e., feedback loop is open and controller output can be manually entered) and implement a step change of about 5-15% in the controller output. Log resulting plant transient and use the curve you get and Z-N open loop formulas to calculate your tuning parameters. I, too, think a PI controller should do the trick.

By the way, do a search on PID tuning on the Internet. You'll find a ton of information. There are other methods of tuning, and since you're doing setpoint changes your controller needs to be very responsive to them. Some tuning models work better for setpoint changes; some for disturbance rejection. Z-N handles both pretty well from what I understand.

xnuke

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: PID algorithm - determining coefficients

(OP)
Thanks for the useful hints. I'll try to apply them.

Gaby.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources