5.2. Reproducible Design of the Fuzzy–PID Controller
To improve robustness under nonlinear temperature–humidity coupling, a fuzzy-supervised incremental PID structure is adopted. For consistency, both the baseline PID controller and the fuzzy-PID controller are implemented in incremental form, thereby ensuring a fair comparison under identical sampling intervals, actuator constraints, and disturbance conditions.
- (1)
Controller structure
For each control loop, the tracking error and its first-order difference are defined as
where r(k) is the reference value, y(k) is the measured output, e(k) is the tracking error, and Δe(k) is the change in the tracking error at sampling instant k.
The fuzzy inference system generates a normalized incremental output Δu
n(k). The actual actuator command is updated according to
where K
u is the output scaling factor and sat(⋅) is the saturation function defined as
In this study, the actuator command is normalized and constrained by
Thus, u(k) is a dimensionless normalized actuator command. For the temperature loop, uT = 0 indicates that the heater is switched off, whereas uT = 1 corresponds to operation at the rated heating power. For the humidity loop, uRH = 0 indicates that the humidifier is switched off, whereas uRH = 1 corresponds to the maximum humidification rate.
- (2)
Input/output scaling factors
The fuzzy inputs are normalized to ([−1, 1]):
where
and
are the input scaling factors for the tracking error and error variation, respectively. Values outside the normalized input range are limited to [−1, 1] before fuzzy inference. The adopted input scaling factors are
The fuzzy output is also defined over the normalized universe of discourse
where Δu
n(k) is dimensionless. It is converted into the actual normalized control increment using
Because the heater and humidifier have different physical capacities and dynamic characteristics, separate output scaling factors are adopted:
Therefore, the two actuator commands are updated as
and
The selected values imply that the normalized heater command can change by at most 0.02 during one sampling interval, whereas the normalized humidifier command can change by at most 0.03 during one sampling interval.
The normalized commands are subsequently mapped to physical actuator outputs as
and
where
is the rated heater power and
is the maximum humidification mass-flow rate.
The scaling and actuator parameters used in the simulation are summarized in
Table 1.
- (3)
Membership functions
Five linguistic variables are used:
Triangular membership functions are uniformly distributed over ([−1, 1]):
NB: (−1, −1, −0.5)
NS: (−1, −0.5, 0)
ZO: (−0.5, 0, 0.5)
PS: (0, 0.5, 1)
PB: (0.5, 1, 1)
Each triplet denotes (left, center, right) points of the triangle.
Design rationale: The membership functions are defined as uniformly distributed triangular functions, with center and boundary points set based on empirical rules to cover the input range [−1, 1]. The parameters were adjusted through simulation experiments to ensure system stability and desired response performance. In future work, data-driven methods could be used to optimize the shape and parameters of the membership functions.
- (4)
Rule-based
A 5 × 5 Mamdani-type fuzzy rule table is constructed to map the input linguistic variables en(k) (tracking error) and Δen(k) to the output control increment Δun(k).
In
Table 2, rows represent the linguistic values of the error e
n(k), columns represent the linguistic values of Δe
n(k), and each table entry denotes the linguistic output of Δu
n(k).
The rule base is designed according to the following control principles:
- ①
When the magnitude of the tracking error is large, a relatively strong corrective increment is required.
- ②
When the error and its variation indicate that the system is rapidly moving away from the reference value, the controller applies an appropriate corrective action while limiting excessive increments that may cause overshoot.
- ③
When the tracking error approaches zero, the output increment approaches ZO to reduce steady-state oscillations and unnecessary actuator activity.
The inference mechanism adopts the Mamdani structure. The logical AND operation is implemented using the minimum operator, and the outputs of the activated rules are aggregated using the maximum operator. The final crisp normalized output is obtained through centroid defuzzification:
where z is the normalized output variable and μ
agg(z) is the aggregated output membership function.
The resulting Δun(k) remains within [−1, 1]. It is not applied directly to the actuator. Instead, it is multiplied by the corresponding output scaling factor Ku,T or Ku,RH, added to the previous actuator command, and then limited to the interval [0, 1], as defined in Equations (24) and (25). Saturation is applied after every incremental update to prevent physically infeasible heater or humidifier commands.
- (5)
Sampling interval and discrete implementation
The fuzzy-PID controller is implemented with a fixed sampling interval of
At each sampling instant, the measured temperature and RH are used to calculate e(k) and Δe(k). These quantities are normalized, processed by the fuzzy inference system, converted into actual control increments through the output scaling factors, and then applied to update the actuator commands.
The sampling interval is incorporated into the calibration of Ku,T and Ku,RH. Therefore, the update equation does not contain an additional explicit Ts multiplier. The reported output scaling factors are valid for the 1 s sampling interval used in the present MATLAB/Simulink simulations. If the sampling interval is changed, the output scaling factors should be retuned to preserve comparable rates of actuator-command variation and closed-loop response characteristics.
- (6)
Baseline PID implementation
The classical incremental PID is expressed as
The tuned parameters are:
The PID parameters were initially estimated using the Ziegler–Nichols step-response method and subsequently refined through simulation-based tuning to minimize the integral absolute error while limiting overshoot to less than 5%. The same actuator saturation limits, physical actuator mappings, and 1 s sampling interval are applied to both the conventional PID and fuzzy-PID controllers to ensure a consistent comparison. The corresponding MATLAB/Simulink implementation of the temperature–humidity fuzzy-PID control system is shown in
Figure 3.