Continue to Site

# heater control thru pic16f876

Status
Not open for further replies.

#### lats

##### Full Member level 4
Dear friends

i am designing a PID temperature controller using lm35 .in which i m controling the heater thru pid.

now my question is that,since m new to pid i dont know how to proceed.i know the basic fundamentals of pid ,like why is it used ,but the doubt in my mind is abt
i have to display "p" ," i", and "d" values all three seperaltely on the lcd screen .m using pic16f876 seperately .

can anybody please give me the circuit daigram for this pid.
ALSO
wht is the use of proprotional in controlling heater and how it is done
wht is the use of integral in controlling heater and how it is done
wht is the use of derevative in controlling heater and how it is done

i have read previous all posts on pid on this forum but could not get much help in case of ciruit daigram.

any kind help is appreciated.

thnkx

Hi
I think that the difficulty is on digital PID, how to make digital PID equation.

For programing with PIC, you can find some articles on the site:

Best regards
Muoinho

shailukelkar

### shailukelkar

Points: 2
please send the link again. it has some symbol so giving error

shailukelkar

### shailukelkar

Points: 2
Hi

DIGITAL PI is

pid_output = rtc/2*tn( current sample + previous sample ) + kp( current sample - previous sample )

where tn = Time Constant.
Kp = Propotional Constant.

Thx+

thnks for help but how to calculate kp and tn .wht circuit to add to the system for pid control. i now the equation as:

v= kp x Verror + Ki x integral Verror dt + Kd x derevative Verror dt

now how to find wht is kp ki kd
wht circuit to make?

Hi
Like my suggest. For calculating the coefficients Ki, Kp, Kd, you must known your control object and methods for digital PID. My background in control theory is not good. So that I only give you the reference:
Digital Control of Dynamic Systems - Gene Franklin
It is a excellent book about digital control theory.

Regards

wht daigram u refering

shailukelkar

### shailukelkar

Points: 2
thnks for replying .the control object is a heater. i know the formula for calculating pid

v= kp x Verror + Ki x integral Verror dt + Kd x derevative Verror dt

but wht will the circuit be to make this pid.

and also wht is this digital pid

Hi

Before replying to this I would like to know little bit more about...

1. Verror
2. Integral Verror
3. Derivative error

The above formula is for Digital PID comprising of uP/uC ADC DAC etc. Analog PID is comprising of OPAMPs, Resitor Capacitor Diodes etc...

Thx+

shailukelkar

### shailukelkar

Points: 2
wht does the ckt follow up for both types pid?

thnx for help
verror is difference between set temp and actual temp.

others are differential and intergral of it.

ok so i can control pid thru two method that is either digitally or thru analog part

which one is simpler and how to do it?
please explain me the ciruitryor concept for both.

m in really goin nuts behind this pid

Hi

Analog will be simpler to realise. Digital you require smapling of signals thru ADCs and o/p THRU Dacs.

Thx+

thnx unix for help .

wht should be the circuit daigram for analog part?

using the pid to increasing the responce of the system and deacreasing the overshot and rise time to stay the system in and you can use pi or pd or pid

Kp = Proportional gain

using the pid to increasing the responce of the system and deacreasing the overshot and rise time to stay the system in and you can use pi or pd or pid

Kp = Proportional gain

muoinhohn said:
Hi
Like my suggest. For calculating the coefficients Ki, Kp, Kd, you must known your control object and methods for digital PID. My background in control theory is not good. So that I only give you the reference:
Digital Control of Dynamic Systems - Gene Franklin
It is a excellent book about digital control theory.

Regards

out= Kp*(old_val-act_val)+Ki*(Σ(old_val)+Kd*(old_val1 - 2(old_val2-old_val3))

step 1.
old_val1 >old_val2
act_val > old_val1

step2
calculate PID

step 3
goto step 1

Only private.

My project heater control by PID realy PI.

unsigned char Intergral;
unsigned char I_Counter;
unsigned char ErrorCounter;
unsigned char LastTemperature;

//****************************************************************
// Calculate
//****************************************************************
unsigned char PID(unsigned char TARGET,unsigned char CURRENT)
{
unsigned int POWER;

if(TARGET >= CURRENT)
{
if(CURRENT < (TARGET-CONTROLED_BAND))
{
POWER=250;
Intergral=0;
}
else
{
if(CURRENT != TARGET)
{
if(I_Counter++ > I_COUNT_MAX)
{
if (licznik++ > TIC)
{
I_Counter=0; //-- Counter slows the response of I
Intergral++; //-- Only Increase Integral if less than target
licznik=0;
if(Intergral > I_VALUE_MAX) Intergral=I_VALUE_MAX;
}

}
}
// test=(TARGET*100);
if (TARGET>CURRENT){
// POWER=((test-CURRENT) * P_GAIN)/10000;
// test1=(((test-CURRENT)*P_GAIN)/10000);
}
// POWER=(((TARGET*100)-CURRENT) * P_GAIN)/10000;
else
POWER=0;

//-- P.I.D Proportional Integral Derivative
// POWER=(((TARGET / CURRENT) * P_GAIN) + (Intergral * I_GAIN) + ((TARGET - CURRENT) * D_GAIN)/10) ;
}
}
else
{
POWER=0;
if(I_Counter++ > (I_COUNT_MAX*I_COUNT_DEC)) //-- Slower decrease of value
{
I_Counter=0; //-- Counter slows the response of I
if(Intergral !=0)Intergral--;
}
}

if(POWER > 250) POWER =250;

if(CURRENT > MAX_TEMP) POWER=0;

return(POWER);
}

GPQL

Status
Not open for further replies.