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.

single water tank using Fuzzy PID

Status
Not open for further replies.

wongchoy

New Member
i'm electronic student. my lecturer give me a project using fuzzy pid to control water tank. i wanna ask u guys got any idea to do the prototype? it make me headache T.T
 
1. This should be posted in the "Homework" forum here.

2. More details, please. "Control water tank"? how? control a valve? going into or out of the tank? what conditions are you sensing? what's the point of the whole exercise?
 
i wanna make a prototype of water tank which follow the statement below.
1.water level low then high speed water flow to tank.
2.water level medium then normal speed water flow to tank.
3.water level high then low speed water flow to tank.
but then i have no idea how to make a prototype and use what component... please give me a hand.thx.
 
thx carbonzit. this is my first time use this forum. i have post to "homework" forum there about the statement.
 
You need three water sensors to detect the three water levels.

Feed the output of the three sensors to an appropriate microprocessor (any number of PIC types should work).

Write the Fuzzy Logic program for the microprocessor, which is just a series of If-Then-Else type statements, to implement the three control conditions you listed in post #3 and drive the valves/pumps that control the water flow.
 
This is a link to an example PID Loop controller that happens to use a water tank and simulation. The program was actually written by a fellow named Max Seim of the 3M corporation and written in VB 6.0. If you would like the source code I will make it available or you can Google VB6 PID Loop Control and find the source code. Be aware that without a version of VB it will be useless. However, the program runs fine and provides a great example of PID control. Download the zip file and extract and double click the executable setup icon to install it. This is just an example of computer based software to run PID control.

You can also as was mentioned use a PIC or uController based approach. There are many ways to go about using a uC but I don't know if by definition they would be a PID control. Given a choice I would likely use a single pressure sensor and measure the pressure at the bottom of the tank. Then convert the pressure to an analog voltage where the voltage is proportional to pressure which is proportional to tank water level. This is based on the weight of the water. You also have a choice as to slow, medium, and fast. You could for example use 3 solenoid valves where slow = valve 1, medium = valves 1&2 and fast = valves 1,2 and 3 ON. That or a single valve that can be throttled.

How you choose to go about it is entirely up to you and what you feel the lecturer/teacher/professor expects.

I suggest you start reading about PID Control Loops and move along from there.

Ron
 
Fuzzy PID is sort of an oxymoron.

A Fuzzy Logic control loop does not use PID to control a system. Instead it consists of Fuzzy logic statements for control, which are basically a series of If-Then-else loops.

PID uses analog Proportional, Integral, and Differential terms to control the loop. These were originally generated by analog function modules (op amps) to form the control loop, but these analog functions can be simulated with a digital computer (although it is rather inefficient and can require a lot of processing power, depending upon the required speed of the loop).

My preference for a digital control loop is to use Fuzzy logic since it is designed for a digital processor, unlike PID which is designed for an analog processor. Fuzzy logic is generally easier to understand, easier to determine how to tweak the loop to improve the performance, and is much easier and faster for a digital processor to execute.
 
Hi Carl

My understanding (likely incorrect) was that PID in itself was just a form of fuzzy logic. I never gave it much thought but found this link which lends strong support to exactly what you covered, especially the use of if statements. I can also see where Fuzzy PID is an oxymoron as you stated. I can also see where it makes more sense for a digital processor.

Thanks
Ron
 
Last edited:
i wanna know is there any component can control the water flow to the valve?(switch or bump or something else)
 
Last edited:
i wanna know is there any component can control the water flow to the valve?(switch or bump or something else)
You could use three solenoid valves, one each for the high, normal, and low water flow.
 
Funny enough, I was about to comment last night on the fact that I’ve been in Process Control and Instrumentation for nearly 20 years, and in all that time I’ve never once came across a Fuzzy logic control block, unlike a PID control function block, or a DOL (Direct On Line) etc.

I thought perhaps that here in South Africa, even though we have access and do use the latest and greatest releases of all the major PLC manufacturers, we’ve been left out of the loop regarding Fuzzy Logic.
 
Hi Carl

My understanding (likely incorrect) was that PID in itself was just a form of fuzzy logic. I never gave it much thought but found this link which lends strong support to exactly what you covered, especially the use of if statements. I can also see where Fuzzy PID is an oxymoron as you stated. I can also see where it makes more sense for a digital processor.
Interestingly, that reference does refer to PID as a special case of a Fuzzy Logic controller, so perhaps the phrase Fuzzy PID does make sense. But I don't see where the code for the referenced PID controller loop performs classic integrator and differentiator functions, even though they are mentioned (probably I just don't understand the code), so I'm somewhat confused as to the use of the PID terminology here.:confused:

Here's an interesting simulation using a Fuzzy Logic controller (requires Java plug-in).
 
The simulation was pretty cool. Nice break from regular work. :)

Thanks
Ron
 
i wanna know is there any component can control the water flow to the valve?(switch or bump or something else)

Attached are two images of different types of valves. The first is a basic on or off solenoid valve. This is the type both Carl and I mentioned using 3 of for slow, medium and fast. The second is a valve body that can be controlled for example from 0 to 100% open.

You have not mentioned yet how you plan to do the actual control? Do you plan to write some software for a micro controller PIC Chip or use a computer? Until anyone knows your plan it is difficult to answer questions or go much farther. I suggested a single sensor for level and Carl also made a suggestion and you never commented?

Ron
 

Attachments

  • Solenoid Valve.png
    Solenoid Valve.png
    14.2 KB · Views: 321
  • Pneumatic Valve.png
    Pneumatic Valve.png
    22 KB · Views: 289
Ron
i planning to write some program for a microcontroller chip and use ur suggestion which a single pressure sensor and the valve body that can be controlled for example from 0 to 100% open in my project. is there any schematic and source code as reference?
 
carl
u had mention VB6.0 at post#6. is it same with PIC Visual basic pro?

:)

Yeah, post #6 was me. No, Visual Basic Professional is not the same as PIC Basic, they are two different languages. The example demo program I linked to was written in Visual Basic Professional Version 6.0. Matters not.

In an effort to keep this simple here is what I would suggest. I would use a pressure sensor to measure the tank level. I mentioned that several post ago. Using a controlled valve though a nice way to go gets complex so to keep it simple I would do as has been suggested. I would use three simple On/Off solenoids and drive them from a PIC. This way you only need one ADC Input and three DO (Digital Out).

You need to determine the height of the tank in mm (for me inches). Then determine a suitable pressure gauge. The pressure is converted to a voltage proportional to the column of water.

Once the hardware is worked out and decided on then we can go from there. I am not a PIC guru, far from it but we have plenty of people here who are very good with programming a PIC. I have only worked a little with PICAXE.

Ron
 
Ron or carl
Is the VB6 can direct burn the coding inside the PIC(i have no experience for VB6)?can u guy give some example coding about fuzzy PID? cause i had no idea how to write a program which contain fuzzy PID characteristics.
 
Last edited:
i wanna make a prototype of water tank which follow the statement below.
1.water level low then high speed water flow to tank.
2.water level medium then normal speed water flow to tank.3.water level high then low speed water flow to tank.
but then i have no idea how to make a prototype and use what component... please give me a hand.thx.

The way you word this makes me think that this tanks is some sort of buffer tank. water always exiting, and water always coming in.

If I were given this task (as a real world task), I would install an ultrasonic sensor in the top of the tank to detect the water lavel. The analog output of the sensor would go to a variable frequency drive that has a PID function. This VFD would control a pump into the tank.

I am neglecting to mention the "fuzzy" part. Reason being, last time I read about "fuzzy logic control" it seemed that it was as simple as 1 or 0 (digital) or "somewhere in between" (which makes it analog, not digital) - I interpreted it as being just someone's excuse for claim to fame and pretty useless. A PID loop, when it is in a steady state is "somewhere in between" so IMO you could call good 'ol tried and true PID "fuzzy logic" and not be incorrect.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top