7085CEM-Advanced Machine Learning
Assignment
Case Study
Fuzzy Logic Optimized Controller for a Commercial Greenhouse
Design and Implement a Fuzzy Logic Controller (FLC) to be used to the control climate and/or irrigation for a commercial greenhouse. The environmental parameters to be controlled could be ambient temperature humidity, lighting, soil moisture content and PH. These could be controlled through the use of actuators such as cooling fans, heaters, sprinklers water pumps and lamps.
FLC Design
The FLC should be based on determining the input and output parameters of the system, depending on what control behaviour(s) the FLC will implement. Note that depending on the control behaviours you wish to implement, you can select to use a subset of the input sensors so think about the behaviour(s) the FLC should control.
Design choices should be made to consider the type and number of fuzzy sets for input parameters and or output parameters.
A set of suitable control rules should be defined which can be experimented with to achieve a good control performance of the chosen behaviour(s)
The FLC should therefore implement the following elements:
1.Consideration of which Fuzzy Inference model to use: Mamdani or Sugeno (TSK) fuzzy models
2.Mapping the crisp data input and output parameters into designed fuzzy sets.
3.Map input fuzzy sets into output fuzzy sets (for Mamdani model) based on a set of designed rules that capture the desired control behaviour of the system.
4.Employ appropriate inference operation (rule implication) that handles the way in which rules are activated and combined together (composition and aggregated).
5.The outputs of the fuzzy inference engine will define a modified output fuzzy set (for Mamdani model) that specifies a possibility distribution of the control actions in relation to activated rules.
6.Use an appropriate defuzzifier to convert the modified fuzzy outputs into nonfuzzy (crisp) control values that can then be used to set the output actuation parameters.
Task 1 – Design and Implementation of the FLC
Design and implement a demonstrable FLC, which can be a simulated system programmed in Matlab, FuzzyLite or Juzzy, see links below:
Provide suitable evidence of your implementation in the form of diagrams and screenshots of the different components.
Task 2 – Design Justification and Analysis of Controller Performance
Discuss and justify your design decisions for the choice fuzzy sets: membership functions, fuzzy rules, FLC inference mechanism selected and defuzzification method that was chosen. Back up your explanations with evidence in the form of appropriate diagrams and screenshots
Perform analysis of the output behaviour of the controller showing the rules activation, controller output and control surface plots demonstrating how the controller achieves the specified behaviours in relation to an operational scenario.
Task 3 – Optimize the FLC developed for Task 1
Consider the Fuzzy Logic Controller (FLC) for Controlling the smart home you have designed for the above tasks. The purpose of this task is to optimize the fuzzy controller you have previously developed. A data set of n examples, (xi,yi), i = 1,2 …, n, is available to evaluate the performance of your controller. You are asked to design several versions of genetic algorithms to optimize the performance of your FLC. For each of the steps below, give details of the genetic algorithms you have used, i.e., problem encoding, genetic operators, fitness function.
1. Keeping the same structure of the FLC as you have used in Tasks 1 and 2, design a genetic algorithm to adjust the membership functions of the input and output variables of the FLC. Some of you may have designed the FLC as a Mamdani model, while others may have used Sugeno models. Clarify what is the length of the chromosomes used in your solution.
2. In case you have used a Mamdani model to implement your FLC, describe how the genetic algorithm solution would change if you were to use a Sugeno model for your FLC. Conversely, if you have used a Sugeno model in Tasks 1 and 2, describe how the genetic algorithm solution would change if you were to use a Mamdani model for your FLC. (5 marks)
3. Design a genetic algorithm to find the best fuzzy rule base for your controller. For each combination of antecedent terms (input membership functions), you will have to find out what is the best consequent (e.g., output membership function for Mamdani models or singleton for Sugeno models of order zero) for the fuzzy rule represented by that combination of antecedent terms.
4. What would be a good fitness function to be used if you want to simultaneously minimize the number of fuzzy rules and maximize the performance of your FLC on the given data set at the same time? Explain how you can do this for your FLC.
Task 4 – Compare different optimization techniques on CEC’2005 functions
Choose two functions from the CEC’2005 suite of benchmark functions available
Some of the links in these pages are broken, but you will be able to download the Matlab code for the functions if you click “Resources Database (Different Formats) [Download]” on the last web page indicated above
The task is to compare the performance of at least 2 different optimization techniques on the two functions you have chosen, for both D=2 and D=10, where D is the number of dimensions. If you want to challenge yourself, you may try higher dimensional spaces, for example D=100, but this is optional. As optimization techniques to compare in this task, you may choose Genetic Algorithms, Particle Swarm Optimization, Simulated Annealing or other optimization methods available in the Global Optimization Toolbox or the Optimization Toolboox in Matlab, or developed as standalone programs by yourself.
To make the comparison meaningful you would have to run each optimization algorithm 15 times and report the average performance (including the standard deviation of the obtained results), as well as the best and the worst performance among the 15 runs. You may try to compare your results with results reported in the literature on the same functions.
In your report, you should include the description of the functions you have selected, the Matlab code for those functions, the results obtained and the parameters of the optimization algorithms used to obtain the reported results, any other Matlab scripts or code used in your simulations, convergence graphs, etc.