Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pid temperature control

Status
Not open for further replies.
Thanks Les, the link I found for microchip was forbidden! Looks like they move stuff around.

Ahmed, can you give details on what your using as a heater? What kind of power is it? PID will be difficult with a underpowered heater, what kind of leeway you got on the set temperature? Most temp sensors have a margin of error, with water being a good heat sink, I dont think PID is a must for this. If you are happy with say 0.1C each way, then maybe PID in full isnt needed.
Anyway hopefully that should get you on your way.
 
Just for grins, you might also consider Fuzzy Logic Control which is designed for digital execution and can readily handle non-linear conditions, whereas PID is an linear analog approach adapted to digital control.
Here's a short thread where a poster found that he had better results using Fuzzy Logic as compared to PID for pressure/flow control in an Espresso Machine.
 
Fuzzy Logic...Is that like women thinking?
 
If you look on the wikipedia page for PID control they even have this nice sudo code, if you aren't sure how to make equations from block diagrams. If you were to translate this to C and put it on a microcontroller it would pretty much do the job as is.

Code:
previous_error = 0
integral = 0
loop:
  error = setpoint - measured_value
  integral = integral + error*dt
  derivative = (error - previous_error)/dt
  output = Kp*error + Ki*integral + Kd*derivative
  previous_error = error
  wait(dt)
  goto loop
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top