CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How can I determine the Kp, Ki, Kd for digital controlsystem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








How can I determine the Kp, Ki, Kd for digital controlsystem
PostPosted: Fri Jul 10, 2009 12:50 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Fri Jul 10, 2009 10:44 pm     Reply with quote

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

Rohit
Guest








PostPosted: Sat Jul 11, 2009 3:05 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Jul 11, 2009 3:26 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 12, 2009 12:42 am     Reply with quote

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








PostPosted: Sun Jul 12, 2009 7:23 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Mon Jul 13, 2009 8:38 am     Reply with quote

PID without a phd helped me the most.

http://www.embedded.com/2000/0010/0010feat3.htm

see tuning section, other issues, and sampling rate.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group