Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

question about pid control

Status
Not open for further replies.

mana111

Member level 1
Member level 1
Joined
Nov 22, 2005
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,569
Hi
I'm developing a thermistor pic16f876 based temperature controller and it worked successfully and now i want to make it work with PID, And i learned that the P,I,D constant are gained expermently So i have question here
many companies provide PID temperature controller wothout adapting it on the clients systems so how can they make it?

another one
which is better fuzzy or the PID control??

Thanks In Advance
 

I suspect that they set the values based on the worst case load thermal mass.

The PID method was invented for foolproof experimental optimization of the system. It is not as good as the Nyquist method or the optimal control method but requires less system information to adjust.

It is better than the on-off limit method though. Many heating systems like room temperature control work well with the on-off method because the temperature variation is not noticed much by people. In chemical reaction situations, like colour photography processing, the temperature has to be held within 1 C or less variation.
 

hi m also working on the same project i have designed the p and i part. but notgeting wht to do with d ,how to make it control?
can u please help flatulent
 

The general adjustment procedure is to set I and D to zero effect and increase P until the transient response starts to ring. Then increase D to bring the ringing down and this allows you to increase P again. (Remember that higher gain {P} in a control system reduces the error of output verses what you wanted.)

Once these two are adjusted to your liking, I is adjusted to reduce steady state error.
 

hi
thanx all
i heard about what called self tuning
could this be a routine in the software which adapt the controller by it self?
 

It is possible that the tuning procedure I described could be done by the software.
 

    mana111

    Points: 2
    Helpful Answer Positive Rating
=====================================================================================================*/
#include <string.h>
#include <stdio.h>
/*====================================================================================================
PID Function

The PID function is used in mainly
control applications. PIDCalc performs one iteration of the PID
algorithm.

While the PID function works, main is just a dummy program showing
a typical usage.
=====================================================================================================*/

typedef struct PID {

double SetPoint; // Desired Value

double Proportion; // Proportional Const
double Integral; // Integral Const
double Derivative; // Derivative Const

double LastError; // Error[-1]
double PrevError; // Error[-2]
double SumError; // Sums of Errors

} PID;

/*====================================================================================================
PID
=====================================================================================================*/

double PIDCalc( PID *pp, double NextPoint )
{
double dError,
Error;

Error = pp->SetPoint - NextPoint;
pp->SumError += Error;
dError = pp->LastError - pp->PrevError;
pp->PrevError = pp->LastError;
pp->LastError = Error;
return (pp->Proportion * Error
+ pp->Integral * pp->SumError
+ pp->Derivative * dError
);
}

/*====================================================================================================
Initialize PID Structure
=====================================================================================================*/

void PIDInit (PID *pp)
{
memset ( pp,0,sizeof(PID));
}

/*====================================================================================================
Main Program
=====================================================================================================*/

double sensor (void) // Dummy Sensor Function
{
return 100.0;
}

void actuator(double rDelta) // Dummy Actuator Function
{}

void main(void)
{
PID sPID; // PID Control Structure
double rOut; // PID Response (Output)
double rIn; // PID Feedback (Input)

PIDInit ( &sPID ); // Initialize Structure
sPID.Proportion = 0.5; // Set PID Coefficients
sPID.Integral = 0.5;
sPID.Derivative = 0.0;
sPID.SetPoint = 100.0; // Set PID Setpoint

for (;;) { // Mock Up of PID Processing

rIn = sensor (); // Read Input
rOut = PIDCalc ( &sPID,rIn ); // Perform PID Interation
actuator ( rOut ); // Effect Needed Changes
}
}
 

    mana111

    Points: 2
    Helpful Answer Positive Rating
flatulent ,Do you have any examples?

xiaoqun, Thanx but soory i don't use C . Is this a normal PID or auto tuning ?
 

Code:
PIDInit ( &sPID ); // Initialize Structure
sPID.Proportion = 0.5; // Set PID Coefficients
sPID.Integral = 0.5;
sPID.Derivative = 0.0;
sPID.SetPoint = 100.0; // Set PID Setpoint

As you see ,these are initialization code.So this is not a auto tuning PID.
Which language do you use? In assembly,it's very hard to deal with 16 bit and floating point arithmetic.
 

No, I'm using basic
and i have a code for pid but the my problem is in the constants
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top