# Fuzzy Logic Controller

Fuzzy Logic Controller, as the name implies, is a fuzzy logic controller written in C# as part of my CSA3200 – Machine Learning, Expert Systems and Fuzzy Logic course.

The fuzzy logic controller is intended to control a plant, represented by the given equation:

$DP(t) = sign(DH(t)) K |DH(t)| ^ {0.75}$

where DH(t) is the input delta pressure into the plant, and DH(t) is the output delta heat of the plant. This is an oversimplification of the steam engine boiler, but a precise model is not needed.

The controller’s input is defined in terms of the pressure error at time t (PE(t)) and the change in pressure error at time t (CPE(t))and its output is defined in terms of delta heat (t+1).

PE(t) is defined as being the pressure at time t (P(t)) minus the set point pressure (an initial reference value). CPE(t) is defined as being the pressure error at time (PE(t)) minus the the pressure error at time t – 1 (PE(t-1)).

P(t) is defined as being the pressure at time t – 1 (P(t-1)) plus the delta pressure at time t (DP(t))

The following parameter values were used to simulate the plant and the controller, but these may be changed when running the program:

• set point = 500
• range of Pressure Error = [-5,5]
• range of Change in Pressure Error = [-5,5]
• range of Delta Heat = [-5,5]
• number of sampling points = 41
• maximum number of iterations = 40

The fuzzy production rules and parametric definitions of the values used in the fuzzy logic controller may be built from editors in the program. The files used for the assignment may be downloaded below.