Program PID algorithm into microcontroller 16f877

Thread Starter

jeremy1409

Joined May 19, 2010
1
Hi everyone;

My project title is "temperature control telemetry", and the temperature sensor that i'm using now is SHT75 and i already program the sensor and it is working fine. But now i need to write the PID algorithm into the microcontroller to control my temperature on the set point and i don't know how to program this PID control into it. So i need help here :(. thx~~
 

mik3

Joined Feb 4, 2008
4,843
The following equations will perform the PID if they are executed in an interrupt function with fixed timing. Also, the sampling of the temperature sensor has to happen in the interrupt.

P=Kp*error
I=I+Ki*error
D=Kd(error-error1)

output=P+I+D

error is the current difference between the desired temperature and actual temperature

error1 is the previous value of error
 
Top