# Equivalence between Fuzzy PID Controllers and Conventional PID Controllers
## 3 Simulation Results  
In this section, the proposed equivalence relationship is verified by use of Matlab/Simulink. A three-order controlled plant is employed with transfer function [17], which is shown below  
\[P(s)=\frac{1.2}{0.36\text{s}^{3}+1.86\text{s}^{2}+2.5s+1}. \tag{17}\]  
A conventional PID controller design for \(P(s)\) with \(K_{P}=1.2\), \(K_{I}=0.36\), and \(K_{D}=1\), which was simulated by Simulink is shown in Figure 4, and the PID controller can simultaneously improve system responses in rise time, settling time, steady-state error, and overshoot. The magnitude of the input step signal is set as 5, and the resulting error signal, error integral, error derivative, control signal, and system output are shown in Figure 5 (red line). Figure 4: The Proportional-Integral-Derivative (PID)-controlled system in Simulink. Figure 5: The (**a**) step input; (**b**) error signal; (**c**) error integral; (**d**) error derivative; (**e**) control signal and (**f**) system output with PID controller, the equivalent fuzzy logic controller (FLC), and the equivalent FLC in discrete form. Subsequently, we built the equivalent FLC based on the above conventional PID controller design according to the derived equivalence equation. By observing the system responses \(e(t)\), \(\int e(t)\), \(\dot{e}(t)\), and \(u(t)\) with the above conventional PID controller in Figure 5 (red line), the operating ranges \(OR_{e}\), \(OR_{i}\), \(OR_{d}\), and \(OR_{u}\) can be defined in accordance with Equation (15), as the procedure below shows. 1. \(OR_{e}\) is set as \([-a_{e},\,a_{e}]=[-5,\,5]\), which is the range for \(e(t)\). 2. \(OR_{u}\) is set as \([-a_{u},\,a_{u}]=[-18,\,18]\) to satisfy \(K_{P}=1.2\). 3. \(OR_{i}\) is set as \([-a_{i},\,a_{i}]=[-16.67,\,16.67]\) to satisfy \(K_{I}=0.36\). 4. \(OR_{d}\) is set as \([-a_{d},\,a_{d}]=[-6,\,6]\) to satisfy \(K_{D}=1\). For this case, it shows good results in defining the operating ranges. Furthermore, this is not a limitation as there are four parameters \(a_{e}\), \(a_{u}\), \(a_{i}\) and \(a_{d}\) for adjustment to satisfy the three control parameters \(K_{P}\), \(K_{I}\), and \(K_{D}\) in Equation (15). The Fuzzy Logic Designer in Matlab/Simulink was applied for the equivalent FLC design and simulation. Figure 6 shows the feedback control structure. The \"FIS Type\" of the FLC design in Figure 6 should be set as \"Sugeno\". Based on the above operating ranges of four fuzzy variables, the corresponding membership functions can be defined by Figure 1. The parameter \(m\) was set as 5, resulting in 5 fuzzy sets, which are equally-spaced and triangular-shaped, for each input fuzzy variable \(e(t)\), \(\int e(t)\), or \(\dot{e}(t)\). On the other hand, the output fuzzy variable \(u(t)\) is fuzzified by 13 singleton membership functions with singleton values \(-18\), \(-15\), \(-12\), \(\ldots\), \(-3\), \(0\), \(3\), \(\ldots\), \(12\), \(15\), and \(18\). Figure 7 shows the settings of all the membership functions in the Matlab environment. The 125 fuzzy rules are defined according to the knowledge base in Figure 2, and the resulting system input and responses are shown in Figure 5 (green line). However, it is found that the system responses with a green line cannot be examined, which is due to the overlap of system responses in the red line. In Figure 5, the green lines (responses by the equivalent FLC) were plotted prior to the red lines (responses by the PID controller). On the contrary, if we plot system responses by the PID controller (red line) first, it will turn out that all the red responses are covered by the latter green responses in the equivalent FLC. This verifies the proposed equivalence relationship between the PID controller and the equivalent FLC. Figure 8 further shows the linearity of the equivalent fuzzy PID controller with the control surface view under \(\int e(t)=0.36\). For the equivalent FLC-controlled system in Figure 6, the Matlab/Simulink finishes the simulation in a manner of a continuous-time system.