Hi, i want to control the humidity and temperature of the greenhouse and aviculture,so i need a good and simple algorithm,I use SHT75 (a digital temperature and humidity sensor for measuring temperature and humidity) and PIC16F877A. I don't have any problem to work with this sensor and microcontroller,i just want a good idea for controlling algorithm.Imagine we have 4 variables: 1)real_temp 2)real_humid 3)temp_value 4)humid_value
variables 1 and 2 are real temperature and real RH that measured by sensor and variables 3 and 4 are favorite values for temperature and humidity that inserted by operator with keyboard.I want to measure temperature and humidity every 10 minutes and execute the controlling program in a subroutine so i want an algorithm that control the temperature and humidity and adjust them in favorite values.
i just want a simple and utility algorithm,for example with conditional causes:
IF (real_temp)<((temp_value)-1) then
turn on heaters
............
............
ENDIF
i should have a margin for temperature and humidity to avoid frequently turning on and off ,fans and heaters.for example if the favorite value is 29C', i should use (29-1) and (29+1) in my algorithm,are agree with me?
for controlling, i have 8 fans,2 heaters and there is a pad on one side of the aviculture and greenhouse that i can control the water with valve that pour on the pad and big fans (2.5Kwatt) on the other side of the saloon pull the air and adjust temperature and humidity of the saloon.the saloon approximately has 20 meter width and 75 meter length.
you are right but i should work on that really hard and it takes some time,i should do it as soon as possible.I have read somethings about PID controllers and other controller in university 4 years ago but it's hard for me to implement those mathematical formulas in real environment ,could you help me more?
Sounds like a Fuzzy Logic controller would be appropriate for your needs. It basically uses a series of If-Then statements to control a system. It tends to be less complicated and more intuitive then a PID system. See Fuzzy logic tutorial. or fuzzyTECH or **broken link removed** or **broken link removed** for more info. See **broken link removed** for a Fuzzy Logic example.i just want a simple and utility algorithm,for example with conditional causes:
IF (real_temp)<((temp_value)-1) then
turn on heaters
............
............
ENDIF
Sounds like a Fuzzy Logic controller would be appropriate for your needs. It basically uses a series of If-Then statements to control a system. It tends to be less complicated and more intuitive then a PID system. See Fuzzy logic tutorial. or fuzzyTECH or **broken link removed** or **broken link removed** for more info. See **broken link removed** for a Fuzzy Logic example.
Fuzzy Logic is not well know but the Japanese have used it in a number of products. I believe it's even been used to smoothly control the movements of a Japanese subway train.
PID control was originally designed for analog control loops since it meshed well with the analog functions easily performed by op amps (integration, differentiation, summing). It's not generally such a good fit for microprocessors since you are basically having the processor perform a series of complicated functions to simulate the analog integration and differentiation required in a PID loop. This is complicated to write and difficult for a µP to do. Fuzzy Logic uses a series of If-Then statements which are easily performed by a µP and does not usually require solving any mathemetical functions.
Well, I understand your disagreement. PID certainly is the common way to do control loops. But I believe that's more from legacy issues than it being the best way. I'm aware that actual analog control circuitry is now seldom used, but the processors are still simulating the functions. That requires a significant amount of complex software and processing power. If you buy a control processor from a commercial vendor, the software's already done for you. But if you are doing the loop with your own PIC then you need to write that software or download it from someone who's already written it. And that can require significant program memory space.I agree that fuzzy logic could be a solution for the OP, however I feel it would no more or less difficult to implement into a real process then the standard PID methods.
However I do not nessessarly agree with your other statement:
"PID control was originally designed for analog control loops since it meshed well with the analog functions easily performed by op amps (integration, differentiation, summing). It's not generally such a good fit for microprocessors since you are basically having the processor perform a series of complicated functions to simulate the analog integration and differentiation required in a PID loop. This is complicated to write and difficult for a µP to do. Fuzzy Logic uses a series of If-Then statements which are easily performed by a µP and does not usually require solving any mathematical functions."
Your correct that PID were implemented with older techknowleges (analog electronics, pnumatic, etc) however all the major process control manufactures (DECS and PLC vendors) have long converted to controllers using embedded digital components and methods, typically using uP(s). One would be hard pressed to find a current commercial PID controller made today that uses analog op amps to perform the basic PID algorithm.
Lefty
Well, I understand your disagreement. PID certainly is the common way to do control loops. But I believe that's more from legacy issues than it being the best way. I'm aware that actual analog control circuitry is now seldom used, but the processors are still simulating the functions. That requires a significant amount of complex software and processing power. If you buy a control processor from a commercial vendor, the software's already done for you. But if you are doing the loop with your own PIC then you need to write that software or download it from someone who's already written it. And that can require significant program memory space.
PID requires a certain mathematical model of the system to design a stable loop. That's how the various PID values are determined for stable loop control. And if the model mathematical constants deviates significantly from the actual system, then instability can result. Fuzzy Logic generally does not require such a mathematical model to write the control functions and achieve a stable loop, although a general model of the system is needed, of course.
I thus believe it's easier for a beginner to understand, design, and implement a stable control loop in a small µC with Fuzzy Logic then with a PID loop. It certainly seems that Fuzzy Logic would be a good fit to amindzo's control needs and his knowledge. He can start out with a simple loop with a few statements and easily add to it to improve it's performance, if necessary. And if it's not performing correctly, it's usually apparent where the problem is in the code. That's generally not so with a PID loop.
But you can certainly disagree. A free exchange of ideas always involves some disagreement.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?