View previous topic :: View next topic |
Author |
Message |
Guest
|
How can I determine the Kp, Ki, Kd for digital controlsystem |
Posted: Fri Jul 10, 2009 12:50 pm |
|
|
I just want to design a PID controller for controlling temperature. But I have a problem to determine these coefficient Kp Ki Kd. I have searched a lot of documents for this topic and I have learned the algorithm and Ziegler-Nicholas method for these operations. But still I couldn't do this operation. If you have any sample code please post it here. |
|
|
Rohit de Sa
Joined: 09 Nov 2007 Posts: 282 Location: India
|
|
Posted: Fri Jul 10, 2009 10:44 pm |
|
|
There is no 'code' as such which you can use to tune you PID system. Without additional information about your system I won't be able to help much.
A PID control loop would obey and equation which looks something like:
output = Kp*error + Ki*integral + Kd*differential
where, integral = integral + error*(sample_time)
and, differential = (error - error_previous)/(sample_time)
Every time this loop is run, the error, integral, and differential will vary. The constants, Kp, Ki, Kd make sure the output stays as close to the set point as possible.
The Ziegler-Nichols is a very common *method* of tuning, where you set all gain constants to 0, and then slowly increase Kp till the system starts to oscillate. Once this is done, the other constants are calculated by simple arithmetic. Though the Ziegler-Nichols algorithm is widely used, it may not always give 'correct' results, since it involves some degree of trial-and-error. Also, this method gives very aggressive constants, and so you may want to change your tuning method so as to adopt a more 'docile' approach .
Rohit |
|
|
Guest
|
|
Posted: Sat Jul 11, 2009 3:05 am |
|
|
Is there any alternative method to Ziegler-Nicholas?
How can I determine these parametres(Kp,Ki,Kd) in software? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Jul 11, 2009 3:26 am |
|
|
Basically you have to identify the control process (or "plant") parameters or a meaningful deviation of it somehow. Ziegler-Nichols is a possible method, measuring step-response or gain/phase characteristic are others. Controller parameter optimization methods based on process models are discussed in control theory text books.
Regarding Ziegler-Nichols, please consider that the adjustment rules are based on a different controller structure than parallel kp/ki/kd, so kp(respectively xp)/Ti/Td have to be transformed. |
|
|
MikeW
Joined: 15 Sep 2003 Posts: 184 Location: Warrington UK
|
|
Posted: Sun Jul 12, 2009 12:42 am |
|
|
Just a thought, but maybe fuzzy logic is the way to go.
Google on bytecraft fuzzy logic.
Their preprocessor produces c code, and specifically pic code I think.
I haven't done either pid or fuzzy, but checked into it a while ago, since setting up the pid constants seems a black art.
Mike |
|
|
Guest
|
|
Posted: Sun Jul 12, 2009 7:23 pm |
|
|
There are many fine tutorials on how to select and test the PID parameters. As I recall Analog Devices had one.
Search Google - the information you want: i.e. How do I go about picking proper PID constants is out there.
HTH - Steve H |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
|
|