**1. Introduction**

The integration of renewable energy sources into power system has stressed system operation by causing balancing resources to cycle more frequently, and generating ramps of critical steepness or duration. Flexibility requirements increase strongly in power systems with combined wind and PV (photovoltaics) contribution of more than 30% of total energy and a share of PV in the renewables mix above 20–30% [1]. Nowadays, more than 140 countries currently have renewable energy targets in place. For example, the European Union (EU) has set targets to achieve a 37% renewables share in overall energy use, which could lead to renewable power generation shares in the range of 51–68% [2]. Under this scenario, maintaining a close balance between generated and demanded active power becomes crucial to guarantee power system security and stability, keeping grid frequency within certain intervals—less than ±1% of the nominal value for European power systems [3]. Traditionally, conventional supply-side units are equipped with primary and secondary frequency control systems [4], using the demand-side response to restore the balance only under severe instability conditions [5].

The primary frequency control (PFC) operates locally by means of a governor to modify, around a set-point, the mechanical power input of the supply-side units based on the local frequency deviation [6]. This control system, also known as the droop control, is decentralized with a timescale up to low tens of seconds and an initial rate of change determined by the rotating mass inertia of the power system. A new power balance and frequency grid stabilization is usually achieved, but does not in itself restore the nominal frequency. The main purpose of secondary frequency control (SFC), also called Automatic Generation Control (AGC) from the supply-side, is to balance the total system generation by recovering the global grid frequency and power interchanges among neighboring areas to their set-point values [7,8]. These unintended frequency deviations require reliable and fast-acting controllers to recover the grid frequency. However, many Control Areas (CAs) still adopt a simplified approach in the design of AGC, i.e., the conventional controls—Integral (I), Proportional Integral (PI), and Proportional Integral Derivative (PID). Although these gain controllers are simple to implement, their performance is not always satisfactory, being usually slow and presenting a lack of efficiency in handling system nonlinearities [9,10].

Over the years, the demand-side contribution to the power system started gaining considerable attention as a measure to obtain frequency and voltage regulation. Increased attention has been focused on demand response (DR), strongly motivated by the remarkable penetration of renewables into current power systems, particularly at the distribution level [11]. Loads, such as Thermostatically Controlled Residential Loads (TCRLs), can shift their demand over certain time intervals without compromising their performance and services. In fact, some authors considered that over 40% of residential appliances are compatible with load control strategies [12]. For this reason, TCRLs can be considered as ideal to be used in dynamic DR strategies [13,14]. Moreover, taking into account the large number of consumers and hence small loads connected to the grid, these strategies would improve resource utilization and subsequently would reduce supply-side capacity requirements [15]. Advantages and drawbacks of different load control and dynamic demand can be found in [16].

Most contributions in the last decade have proposed switching-off/on actions applied on TCRLs when frequency variations exceed certain limits [17–24]. However, these works have been mainly focused on PFC. In [17], a simple and optimal control strategy is proposed to modulate the customer load as a linear function of the frequency excursions. Short et al. [18] analyzed how a certain degree of frequency stability could be achieved by integrating dynamic demand controllers into fridges/freezers. These devices monitor the grid frequency and switch-off/on appliances accordingly, while achieving a trade-off between appliance requirements and the grid. Scenarios with high penetration of wind energy are also discussed. Samarakoon et al. [19] described a frequency-based load control scheme for primary frequency response purposes by using smart meters. Loads are grouped according to their relevance for the customer. When the grid frequency falls below the nominal value, each load controller is switched-off for a specific time depending on the frequency excursion. In [20], an experimental platform is proposed by using commercially available smart meters. These appliances are remotely controlled through smart sockets to evaluate the load blocking strategies. In [21], a decentralized approach for using TCRLs is proposed. The authors affirmed that a two-way communication between loads and the control center is not essential when the number of individual loads is considerably large. The value of Dynamic Demand (DD) concept is quantified in [22], enabling domestic refrigeration appliances to contribute to primary frequency regulation through an advanced stochastic control algorithm. In [23], a comprehensive central DR algorithm for primary frequency regulation is described in a smart micro-grid. Contributions for transient studies can be found in [24], where a systematic method to re-balance power and resynchronize bus frequencies after a disturbance with significantly improved transient performance is described. Recently, we discussed DR strategies applied to PFC by including auxiliary frequency control carried out by Wind Farms (WFs) [25]. The work focuses on evaluating the two control actions counteracting frequency deviations as well as their compatibility.

During the last years, the high integration of wind resource into the global energy mix has required an important reformulation of wind power plant services, including their contribution to the frequency control [26,27]. These requirements are regularly updated and often include very rigid criteria, particularly in power systems with a relevant presence of wind power plants, where difficulties in maintaining the grid frequency within an acceptable range emerge as an additional concern under large wind power fluctuations [28,29]. In addition, some authors affirmed that the WT inertia contribution to the total kinetic energy stored in the power systems is considerably less significant than traditional power plants [30,31] and, subsequently, larger frequency deviations will be suffered by the systems after sudden generation or demand variations [32]. Moreover, systems with reduced total inertia experience a sharper immediate frequency drop under imbalance and, thus, are more vulnerable and sensitive to involuntary under-frequency load shedding [33]. Due to this scenario, alternative resources connected to the grid, mainly PV solar installations and wind power plants, are required to provide ancillary services [34]. With this aim, a frequency-dependent control loop is proposed in [35] for Variable Speed Wind Turbines (VSWTs) to improve frequency response and provide an active contribution to the frequency control. This additional controller synthesizes virtual inertia for VSWTs —i.e., kinetic energy stored in their rotating masses—that can be provided at the beginning of a frequency deviation event, diminishing its impact [35]. In this way, Spanish wind power plants are able to participate in ancillary services by a regulation framework issued by the Spanish Secretary of State for Energy [36], which made it legally possible since February 2016.

By considering previous works, this paper analyzes the demand-side contribution to SFC as an additional support to the frequency control strategy proposed in [21,25]. In line with these previous works, a decentralized demand-side solution is proposed to avoid the cost and complexity associated with two-way communications between many loads and the control center. The frequency-responsive load controller is thus extended by considering an additional integral-action function. This function adjusts the thermostat temperature of thermostatically controlled loads based on local frequency estimates. As a result, their power demand profiles are restructured, thus achieving a reduction (or increase) of their energy consumed. In this way, the controller is able not only to modify load's instantaneous power consumption, but also their energy demand during a specific time interval. This innovative load controller operates autonomously and provides a decentralized solution where individual loads are randomly distributed and connected to the grid. A two-area interconnected power system is simulated under severe wind power fluctuations to assess the proposed decentralized solution. An auxiliary frequency controller for VSWTs is also included to combine the contribution of VSWT's inertia to maintain the balance in future power systems with high wind power plant integration.

The rest of the paper is structured as follows: the implemented two-area interconnected power system is described in Section 2, including WF and demand-side modeling. The contribution of demand-side to SFC is discussed in Section 3. Extensive results are provided and widely discussed in Section 4. Finally, the conclusion is given in Section 5.

#### **2. Power System Modeling: Wind Power Plant and Demand-Side Contribution to Frequency Control**
