Should I use PID for this?

Hello,

I have a stove with conducts and I want to control a fan speed. I can't control the stove power so I should control the fan speed instead. I want to start the fan when the temperature sensor reach 40ºC and increase the fan speed if the temperature increases and reduce the speed if the sensor temperature decrease.

I'm trying with PID but I'm not sure that my problem should be resolved with a PID controller system, I only need to increase the fan speed if the temperature is over the setpoint, if the temperature is below my setpoint value, the fan always be running at minimum speed.

Should I use a PID for this? Which is the right way?

Thanks!

I want to start the fan when the temperature sensor reach 40ºC and increase the fan speed if the temperature increases and reduce the speed if the sensor temperature decrease.

You have described a problem that is usually solved by PID, except there is a bias, with the fan always running above a certain temperature. Google "PID with output bias" for starters.

jremington:
You have described a problem that is usually solved by PID, except there is a bias, with the fan always running above a certain temperature. Google "PID with output bias" for starters.

Thanks!

I'm trying with PID with the following setup:

setPoint: 30
input: variable between 20-40
KP: 2
KI: 1 (I've tried with 0)
KD: 1 (I've tried with 0)

Seem's to work "well" but... inverted!! I need that the output increases when the input is greater than 30 (because my fan should reduce the temperature), instead the output increases if the temperature is lower than 30. The problem is that when the input temperature is greater than 30 the output is 0. If the temperature is lower than my setpoint progressively increases to 255.

What I'm doing wrong? I think that the approach is correct, but my implementation fails in some point.

Thanks!

For informed help, please read and follow the directions in the "How to use this forum" post.

The problem of output inversion is an extremely common one that is addressed in all PID libraries I am aware of, so if you are using a library, consult the documentation. If you wrote the code, you got one or more signs wrong.

jremington:
For informed help, please read and follow the directions in the "How to use this forum" post.

The problem of output inversion is an extremely common one that is addressed in all PID libraries I am aware of, so if you are using a library, consult the documentation. If you wrote the code, you got one or more signs wrong.

First of all, sorry if I did something wrong, I've tried to search a lot but I was confused with the results, because I'm totally newbie with the PID term and get a lot of results for "inverted pendulum" and is not my case.

Anyway, I'm very grateful. I had the problem in front of me (exactly what you said), I'm using the PID_v1.h library, the problem was that I was using the controller direction in DIRECT mode but for my situation the ideal is the REVERSE mode. Arduino Playground - HomePage

Thanks jremington.

sorry if I did something wrong

By now you have read and absorbed the "how to use this forum" material, and have realized the error of your ways.