**4. Simulation Results**

In the simulations, the HVAC units track the daily automatic generation control (AGC) signal from the PJM (Pennsylvania–New Jersey Maryland Interconnection) electricity markets. Following the parameters of TCLs in the simulation process [7], it is assumed that the average values of *R*, *C*, and *P* in Equation (1) follow a Gaussian distribution with standard deviation 0.1, and the values of *R*, *C*, and *P* are 2 ◦C/kW, 2 kWh/◦C, and 14 kWh, respectively. Assume the loads' initial temperatures are distributed uniformly in the deadband of temperature, *Tse<sup>t</sup>* is 20 ◦C and *Ta* is 32 ◦C. The deadband of temperature is 0.5 ◦C, *η* in Equation (4) is 2.5, and the sampling time interval is 4 s. The tracking errors are used to characterize the performance of the frequency regulation based on the fuzzy neural network control.

Through the iterative solution of the particle swarm optimization algorithm and BP algorithm, the appropriate connection weight coefficient is obtained after the training of 2500 sample dates. The membership functions of error *e* and error variation *de* are shown in Figures 6 and 7, respectively. At the beginning of the simulation, we assume that the membership functions of the fuzzy sets of error *e* and error variation *de* are Gaussian functions, as shown in Figures 6a and 7a—after training, the membership functions of each fuzzy set of the fuzzy neural network are shown in Figures 6b and 7b.

(**a**) The initialized membership function of error *e*.

(**b**) The optimized membership function of error *e*.

**Figure 6.** The membership function of error *e*.

(**a**) The initialized membership function of error variation *de*.

(**b**) The optimized membership function of error variation *de*.

**Figure 7.** The membership function of error variation *de*.

The influence of the PSO algorithm on the performance of the neural fuzzy network is shown in Figure 8. From the results shown in Figure 8, it can be observed that the RMSE with optimized parameter under PSO algorithm is 2.7003, which is obviously smaller than the RMSE with random parameters. Hence, it is necessary to optimize these parameters by the PSO algorithm.

**Figure 8.** Error comparisons with non-optimized and optimized parameters.

The control performance of the fuzzy neural network is shown in Figure 9, and the changes in temperature set-point are shown in Figure 10. We observe that the aggregated TCLs can track the AGC signal in a power system to provide ancillary service, and the maximum change in temperature set-point is 1.18 ◦C, which indicates that the control scheme has a minor impact on the thermal comfort of consumers.

Furthermore, several control strategies are compared for the problems of frequency control. Figure 11 shows the comparison results of tracking errors, it is shown that the fuzzy neural network control strategy can better reduce the tracking errors. Table 1 shows the detailed comparison results, which demonstrate that the fuzzy neural network control strategy can better reduce tracking errors with acceptable temperature set-point change. In addition, it can be observed from Table 1 that there are a small number of switching on/off times using the fuzzy neural network control strategy, which indicates that its regulation has a smaller impact on the life of TCLs compared with other control strategies.

**Figure 9.** Automatic generation control (AGC) signal tracking.

**Figure 10.** The temperature set-point change.

**Figure 11.** Error comparisons under five control strategies.


