Fuzzy Logic using Matlab

P

Thread Starter

Puneet

Need to build a Fuzzy logic control using Matlab Toolbox for controlling the pH of a liquid. There are 2 valves to be controlled. One contains base and the other acid.

Need to build a simulation toolkit using MATLAB and simulink. Want to build a control diagram to reflect the changes. The set point is x. If i pass x1 value, the fuzzy logic should open the valve accordingly and try to bring the pH of the liquid to the set point x by varying the 2 valves.

Help required.
 
W

Will Dwinnell

You are measuring the current pH (1 input, unless we lag values or calculate a rate of change), which is to remain at or near some level or within some range, and have control over 2 valves (2 output variables)?

You need to:

1. Establish fuzzy membership functions for pH, such as "Very Low", "Low", "Correct", "High" and "Very High". This will need to be done for pH rate of change or any other derivatives of pH, as well.

2. Establish fuzzy membership functions for the two outputs (I am assuming that they can be opened variably), like "Closed", "Low", "Medium" and "High".

3. Write rules linking the desired outputs to the given inputs, for example:

IF pH is "Low" THEN Valve1 = "Medium"

Be sure to cover the entire effective input space with rules.

4. Test the whole thing, and adjust as needed.

Fortunately, the Fuzzy Logic Toolbox makes this fairly easy.

good luck,
Will Dwinnell
http://will.dwinnell.com
 
Top