The Mamdani fuzzy controller depicted in your image poses a challenging design task, as it relies heavily on the choices made by the expert or the arbitrary selections of an untrained designer. This usually results in a time-consuming design process. For instance, the decision to employ 7 membership functions (MFs) prompts questions such as: Could 5 MFs or 9 MFs be viable alternatives, or is an even number of MFs acceptable? Similarly, the rationale behind setting the Input Range as [-0.1, 1] remains unclear. Would the fuzzy controller still function if the output of the Step block were -1?
Consequently, I would like to introduce the fundamentals of implementing a fuzzy controller, specifically of the Sugeno type, in Simulink. The concept is relatively straightforward: design a state-feedback controller to achieve satisfactory performance and employ the tuned gains in the fuzzy controller design. While it is possible to further refine the fuzzy controller for enhanced performance, the extensive technical design process will not be covered in this forum.
Fig.1: The Block diagram of the Simulink model, with Kp = 2000, and Kd = 3795.77.
Fig.2: Step responses (Top: PD controller, Bottom: Fuzzy PD controller).
Fig.3: The Sugeno FIS created in the Fuzzy Logic Designer App (before R2022b).
Fig.4: The membership functions for both inputs x1 and x2 using trimf. If R2022a and newer, you can use the more appropriate linzmf and linsmf. The input range is selected to be [-1, 1] because the difference between the Unit Step input (based on your image) and the output of a system falls inside this range.
Fig.5: The singleton membership functions for output U. Set mf1 = -2, mf2 = 0, and mf3 = 2. The Output Range should be [-2, 2].
Fig.6: The fuzzy rules consist of only 4 rules.
Fig.7: The control surface should look like this if you design the FIS correctly.