Go Down

### Topic: PID temperature control (Read 1 time)previous topic - next topic

#### harindesilva

##### Dec 14, 2011, 08:08 pm
Has anyone out there implemented the PID algorythem for temperature control ? with PWM?
Any advice/help would be appreciated.

Thanks

#### AWOL

#1
##### Dec 14, 2011, 08:18 pm
What are you trying to control the temperature of?
For most common applications, PWM (except the very long period stuff controlled by a simple thermostat) is overkill.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#### harindesilva

#2
##### Dec 14, 2011, 08:33 pm
I am trying to control the temperature of a glass which has an ITO coating applied to it (conductive) and 6 terminals connected to the ITO coating. The aim is to maintain the glass at 37.00 deg C. The sensor i am using is a TSic506F. the aim is to achive an even temp accross the glass (round) so i apply current to each set of terminals in forward and reverse direction and swap from terminal sets in a clockwise direction to achive the even temperature. My problem is with the control algorithim to sense the temperature and change the PWM signal. Also the temp sensor is on the edge of the glass and there is a difference in temperature (lag) between center of glass which i need to compensate for.

#### PeterH

#3
##### Dec 14, 2011, 11:52 pm
I don't quite get how your heaters and temperature sensors are arranged, but from your description I can imagine a solution using a PID algorithm to decide how much heating is required, and a PWM output to control each heater with the duty cycle being proportional to the required amount of heat as specified by the PID. Is that what you're aiming for? What's the problem?

#### harindesilva

#4
##### Dec 15, 2011, 01:38 am
my problem is implementing the PID i am a bit lost here???

#### PeterH

#5
##### Dec 15, 2011, 02:36 am
The algorithm itself is pretty simple. But you probably don't need to write it yourself, I'm sure you'll find a standard library implementing a PID controller. I expect you'll need to configure the P, I & D components and connect up the inputs and outputs, but you don't need to be bothering about how to code the algorithm yourself. Unless you want to; it's not complex and there's no reason you couldn't write your own if you want.

#### johnmchilton

#6
##### Dec 15, 2011, 05:34 am
I'm using Brett Beauregard's PID library with great success. It's on the Arduino Playground. It comes highly recommended.

Note that I had to make a minor change to it to filter the input for taking derivatives because I need to take samples every 1ms (the minimum time step).

If you do use it for a heating system, I would recommend setting the time step at which it computes new a new adjustment to something on the order of minutes so that it can actually detect change for the derivative reaction.

#### harindesilva

#7
##### Dec 16, 2011, 02:48 pm
hey thanks guys.
Will have to make some small mods to adapt to my application.

Go Up