{'fraction_non_alphanumeric': 0.03420669577874818, 'fraction_numerical': 0.0064809038608165245, 'mean_word_length': 4.718390804597701, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Decentralized Frequency Control using Packet-based Energy Coordination

This paper presents a novel frequency-responsive control scheme for demand-side resources, such as electric water heaters. A frequency-dependent control law is designed to provide damping from distributed energy resources (DERs) in a fully decentralized fashion. This local control policy represents a frequency-dependent threshold for each DER that ensures that the aggregate response provides damping during frequency deviations. The proposed decentralized policy is based on an adaptation of a packet-based DER coordination scheme where each device send requests for energy access (also called an"energy packet") to an aggregator. The number of previously accepted active packets can then be used a-priori to form an online estimate of the aggregate damping capability of the DER fleet in a dynamic power system. A simple two-area power system is used to illustrate and validate performance of the decentralized control policy and the accuracy of the online damping estimating for a fleet of 400,000 DERs.


I. INTRODUCTION
Due to environmental concerns and energy policy, the integration of inverter-based renewable energy sources (RES), such as wind and solar PV in power systems is increasing. However, the intermittent nature of these sources has introduced new challenges. One of these is the decrease in power system inertia, which is defined as the power system's ability to oppose changes in frequency [1]. The kinetic energy stored in rotating machines such as synchronous generators and loads is the main source of inertia in conventional power systems. With decreasing costs of renewable generation, some of the conventional generators will not be competitive and, thus, will go offline, which results in increased renewable generation capacity on the grid and reduction in the system's inertia. This subsequently increases the rate of change of frequency (ROCOF) and makes primary frequency control more challenging. Another factor, affecting frequency response is frequency-dependent loads. This is usually modelled by a damping constant which is defined as the percentage change in total system load in response to frequency change [1]. One way to remedy this is to require alternative sources of damping and inertia.For example, during a sudden loss of generation some of the stored kinetic energy in synchronous machines is used to compensate for frequency deviations.
Using spinning reserves to compensate for variability in renewable generation is an expensive solution for power systems with high penetration of RES [2]. With the development in sensor technologies, sensor cost has been reduced considerably, which has enabled DERs to provide fast ancillary services, such as frequency control. To have effective primary frequency control, DERs should react within 1 to 2 seconds [3]. Much work has been done to find an efficient and fast method to use loads endowed with local control policies to provide frequency regulation ( [2], [4], [5], [6], [7], [8], [9], [10], [11], [9], [12], [13]).
Different structural coordination models are used for DER coordination. In centralized control, all of the measurements are sent to a coordinator and then decisions are broadcast by coordinator to each individual device. Distributed control requires coordination from a centralized agent but includes local sensing, computation, and control. Fully decentralized control has no centralized coordinator and the system response is a function of only local sensing, computation, and actuation.
Fully decentralized frequency control enables devices to make local decisions during frequency disturbances by using a local control law for DERs and generators. A distributed secondary frequency control for multi-area systems is presented in [5] which restores the nominal frequency while minimizing the regulation costs. [6] estimates virtual load demand for controllable generators based on local frequency but the approach does not consider demand side frequency control. [7] uses gather-and-broadcast and generalized continuous-time feedback control version of the dual decomposition method [8] to dispatch DERs during the frequency deviations.
Different methods for prioritization of DERs are presented in the technical literature. In [9], a frequency adaptive power-energy re-scheduler (FAPER) is introduced, which sets frequency-dependent thresholds based on the temperature of temperature-bound appliances such as EWH or air conditioners. In [2], those same frequency thresholds are randomized in order to overcome the problem of synchronization in FAPER. In [11] local measurements are sent to the aggregator within 5 to 15 minutes and a fitness value is calculated for each DER. These fitness values are then used by the aggregator to assign frequency-response thresholds in a prioritized manner. While the method works fine for small aggregation of DERs, sharing local measurements from large-scale fleets of DERs with an aggregator in real-time incurs large communication costs. Another important aspect in the problem of regulation is to guarantee the stability of the system when using DERs for primary frequency control. In [10] a fully decentralized integral control is employed. This approach, yields global asymptotic stability condition but it does not guarantee the results to be optimal or feasible for the economic dispatch problem. This deficiency is addressed by introducing a distributed averaging-based integral (DAI) control, which operates by sensing local frequency and allowing communication between neighboring system busses.
Several packet-based energy management systems have been proposed to coordinate DERs [13], [14], [15]. In packet based systems, loads request for energy packets with given duration and amount. Each device is equipped with a timer which turns the device OFF when the packet length is completed. In this paper, the focus is on packetized energy management (PEM), which is a packet-based approach. Most frequency regulation approaches using DERs rely on communication between DERs and the (centralized) aggregator. However, sending online measurements from large number of appliance to aggregator requires a reliable, low-latency communication network, which can be costs at scale. Therefore, a fully decentralized frequency control scheme that does not require real time communication with aggregator is desired. This requires adapting PEM to the appropriate timescale, which is the main contribution of this paper. Thus, this paper develops a novel, and fully decentralized primary frequency control scheme within the existing PEM literature. Specifically, each controllable load responds to a locally measured frequency deviation based on a pre-determined local control law and timer state which begets fast response and provides damping. The distribution of timers is available to the aggregator since it knows how many devices are accepted during any time period. These data can be used to accurately predict the effect of any frequency deviation on the fleet, thus quantifying the damping available in real-time, which is valuable to grid operators. The proposed scheme can be applied to any packet-based energy management. The main contributions of this paper can be summarized as follows: • A responsive and fully decentralized frequency control policy is designed within a packet-based energy management systems that automatically prioritizes resources based on local dynamic states. • The equivalent damping for a fleet of resources operating with PEM is estimated analytically and enables the aggregator to quantify, in real-time, the effect of packetized DERs on primary frequency control prior to any event. • Simulation-based analysis is used to validate the performance of the proposed local control policy and the online estimate of damping provided by the aggregator on a dynamic, two-area model under various operating conditions. This paper is organized as follows: Section II, provides the network model and PEM preliminaries. The describes the decentralized packet-based frequency control scheme in described in Section III. Section' IV provides the method for quantification of PEM damping by the aggregator. In Section. V, an illustrative simulation for two-area system is shown to verify performance and validity of the methodology. The conclusions are given in Section VI.

II. MODELING PRELIMINARIES
In this section, first the network model is presented. This is followed by a brief summary of the PEM scheme. Specifically, the concepts of packet duration and packet interruption are provided. These are at the core of the proposed decentralized frequency control scheme.

A. Network Model
Let G = (V, E) be a graph representing the topology of a transmission network, where V is the set of N system nodes V = {1, ..., N }, E is the set of edges between nodes (E ⊆ V × V). If a pair of nodes i and j are connected by a tie line, then the tie line (i, j) ∈ E. Each node represents a frequency control area which is modeled with aggregate generation and loads for each area. The load consists of two components: 1) uncontrollable loads and 2) PEM-enabled loads. The dynamics of the angular frequency deviations from nominal, ∆ω(t) := ω(t) − ω 0 , in each area j is determined by the swing equations [16]: where ∆P G j , ∆P PEM j and ∆P L j are the change in generation, PEM controlled loads, and uncontrollable loads at node j after the occurrence of a disturbance, respectively. D j and M j are the damping provided by motor loads and generator rotational losses in [MW/Hz] and the power system inertia in [s]. The last term in (1b) describes the power flow between area i and j. DC power flow is used to calculate the power flow as in [17]. Before the disturbance, the frequency is assumed to be f 0 = 60Hz, which in radians amounts to ω 0 := 2πf 0 . The emphasis of this manuscript is on frequency response and active power changes, therefore it is reasonable to neglect bus voltages and reactive power for the sake of simplicity [18].
To model the generators' primary frequency response, the effect of the generators' turbine is included as follows  (2), model the frequency dynamics related to primary frequency control in a transmission network. This model will be used in Section V to quantify the role of the proposed decentralized DER control policy.

B. Packetized energy management
Previously, PEM has been used to provide load balancing and regulation grid services. In this paper, PEM capabilities are extended with a novel decentralized DER control policy that dynamically prioritizes which packets to interrupt to provide damping. This paper proposes a timer-based prioritization, but the underlying ideas also apply to other "fitness"based DER prioritization schemes (e.g., [11]).
For completeness, a brief description of PEM is provided next and illustrated in Fig. 1. Under PEM, DERs request stochastically for energy packets from the grid based on their local dynamic state e.g. temperature for thermostatically controlled loads (TCL) or state of charge (SoC) for batteries The closed-loop feedback system for the packetized energy management with the reference signal P ref provided by the Grid Operator. and electric vehicles (EVs). This randomization limits synchronization between DERs. For example, an electric water heater with lower temperature is more likely to request an energy packet than devices with higher temperatures. The probability of requesting a packet at time-step k is modelled as a discrete-time variable as where T n [k] is the DER's temperature and µ is a design parameter defined as [19]: with m R > 0 is the mean time-to-request (MTTR) and T max n , T min n , T set n are maximum, minimum and setting temperatures, respectively.
The DERs' requests are then sent to the aggregator asynchronously and, based on grid or market reference tracking signal, are either accepted (e.g., DER is allowed to turn ON) or denied (e.g., DER is not allowed to turn ON). When an energy request is accepted, then a local timer is triggered and the DER will turn ON for a pre-defined period of time, called epoch length (δ). When the epoch length is completed, the device will turn OFF automatically and its local timer is reset. The local timer is defined as: where ∆t is the sampling time. The number of bins is n p := δ ∆t . In particular, when the n-th DER has its request accepted at time step k and is consuming its packet, then C n [l] = 1 for all l ∈ [k + 1, k + n p ] and C n [k] = 0, if request is denied. According to (4), when DER is in standby mode, C n and t n are both set to zero. Using the internal timer of each device, a distribution of timer states can be constructed at the aggregator that keeps track of the number of accepted requests at each time during the latest epoch. This is represented in [20] by where x ∈ R np×1 is the vector of number of DERs in each bin, q + ∈ R is the number of accepted requests at the current time, B ∈ R np×1 is responsible for allocating the new accepted requests into the first bin. That is, B is a zero matrix except for its first element whose value is 1. M ∈ R np×np is a zero matrix except for its first lower diagonal whose components are 1. The number of devices completing their packets at time-step k + 1 is equal to the number of devices in the last bin of the timer distribution, . Consider using PEM for tracking a slowly moving reference signal and the frequency is maintained close to the nominal frequency. Fig. 2 shows the distribution of timer states (t n [k]) and temperatures (T n [k]) for devices n that are ON at time-step k for an example system of 400,000 EWHs. The number of bins for temperature and timer status is 30 and 10, respectively and δ=3 minutes. The histogram of timers in Fig. 2 is constructed using (4) and (5) while the histogram of temperatures must be estimated. Note that some of the devices with high t n have low temperatures because of recent high water usage. In addition, some of devices with high temperature have just started their timer. This is caused by the random nature of PEM requests. The clear correlation between temperature and timer occurs because the more energy that a device consumes, the higher the temperature. For simplicity, The DER capacities are assumed homogeneous. The dashed line shows the average number of devices in each bin, which is where 1 np ∈ R np is vector of ones.
To guarantee quality of service (QoS) for the endconsumers, packetized-enabled DERs are endowed with optout logic [21]. This means that if the DER's dynamic state exceeds predefined comfort limits, the device will exit PEM temporarily and return to its default control logic (e.g., TCL) until the dynamic state is returned to within comfort limits. Since the dynamic state evolves much more slowly than the grid frequency and power deviations and the duration of frequency event is shorter than 30 seconds, the opt-out behaviors are negligible. In fact, since the duration of the frequency response is short, it is reasonable to assume that the DERs' energy states are fixed for the duration of the frequency event.
The timer state distribution is clearly a function of past aggregator packet acceptance rates. If the fleet's aggregate power is near the nominal power reference, which is given by nominal QoS (e.g., set-point temperature), then from [22], the rates of requests and accepted requests are uniformly distributed. That is, x[k] ≈x for all bins. These conditions are representative of a packetized DER fleet tracking ISO regulation signals, such as tracking ISO-NE's energy neutral or PJM's Reg-D, and ensure that the net energy exchanges of the fleet are close to zero. To make the scheme more responsive to frequency deviation, packets can be actively interrupted. The packet interruption is defined next.

Definition 1. (Packet Interruption)
The interruption of a packet is the instantaneous termination of a packet before the end of its epoch length (t n < δ) due to local conditions.
With packet interruptions, PEM-related demand can be actively modified by appropriately interrupting packets. For example, for an under-frequency event, packet interruptions enable DERs to turn OFF devices based on their local timer and/or temperature state, which offer a simple scheduling mechanism for dynamically prioritizing which devices turn OFF at what frequency as a contingency unfolds. This approach also limits potentially harmful synchronization effects.
The proposed decentralized frequency control scheme is provided in the next Section, where PEM-enabled DERs leverage information about their local packet duration and timer state.

III. DECENTRALIZED FREQUENCY CONTROL FOR PEM
To design a decentralized control policy for PEM, one needs to consider the local data/measurements available to each DER n at node i: 1) frequency, f i [k], 2) temperature, T n [k], and 3) timer state, t n [k]. These enable each DER to make local ON/OFF decisions. In that context, each DER decides whether or not requests should be sent to the aggregator. In other words, when a PEM-enabled DER senses that the frequency deviation exceeds a predefined dead-band, the DER blocks requests locally and switches to a decentralized control policy. This is detailed next.
A dead-band around f 0 is set in order to define the transmission reliability criteria. Within this dead-band, ∆f db , conventional PEM is used to provide ancillary and wholesale energy market services. However, deviating beyond the dead-band represents reliability concerns, so PEM-enabled DERs switch to decentralized control policy to actively support primary frequency response.
For the sake of simplicity, this paper focuses on EWHs. As mentioned earlier, the dynamic state of devices evolves slowly and does not change during the frequency event. In addition, the aggregator knows the timer state distribution. Therefore, one can estimate how the number of packet interruptions affect the damping provided by PEM devices (D PEM ). The analysis performed herein assumes a fleet whose aggregate energy dynamics (e.g., distribution of device temperatures) are not changing much with time. Under this assumption, the timer states distribution follows a uniform distribution, which simplifies analysis as explained next. Extending the analysis of decentralized PEM to arbitrary distribution of timer states is straightforward since the aggregator have the distribution of timer states at each time.
A naive initial approach to reduce demand implies to automatically accept or reject all packet requests during frequency disturbances. However, this does not offer a sufficient change in demand to affect the frequency response since such approach relies on slow packet completion rates. Another overly simplistic approach consists of interrupting all of the timers simultaneously when any frequency deviation occurs. This triggers a step change in demand that ignores the frequency's evolution and can cause system instabilities [23] if the share of DERs in the power system is significant. Therefore, it is necessary to prioritize devices so that the ones with higher timer or temperature turn OFF first in underfrequency events. In fact, one needs to dynamically interrupt the packets to reduce demand and have a meaningful effect on the frequency. In the proposed method, a packet interruption threshold is assigned to the local timer based on the local frequency measurement as shown in Fig. 3. That is, when the magnitude of frequency deviation is smaller than ∆f db , no control action is needed. The design of this deadzone depends on power system reliability requirements defined by transmission operators. For frequency deviations between ∆f db and ∆f max , η ∈ [0, 1]. If the frequency deviation is larger than ∆f max , the value of η will remain constant at η max ∈ [0, 1]. Therefore, the only local design parameters are η max , ∆f db , and ∆f max . For η max ≈ 1, the aggregate decentralized PEM response is more aggressive due to more interruptions for a given frequency deviation. A linear function is used for η(∆f ) which will result in an aggregate response that adds equivalent, constant damping to the system. The proposed local control law is given by: The aggregate effect of the control law (7) in a simple two-area system is shown in fig. 4 for different values of η max . It can be seen that larger η max results in more damping. When η max is zero, none of the ON devices are interrupted. In this case, all of the requests are rejected locally and no new energy packet request is sent to the aggregator. Thus, consumption decreases with a constant rate equal to packet completion rate which is P ratex /∆t. Observe in Fig. 4 that the packet completion rate is relatively slow and have small impact on ROCOF (blue curve). Increasing packet interruption leads to a more sudden and larger drop in PEM demand for under-frequency events, which improves the ROCOF, maximum frequency deviation (also called the nadir point), and final frequency deviation. The demand starts to decrease, ∆t seconds after the occurrence of disturbance. Table I shows ROCOF, ∆f nadir and final frequency deviation for different values of η max , which illustrates the effectiveness of the proposed prioritization scheme. As seen in Table I, interrupting more energy packets (larger η max ) improves the frequency response of the system. In a conventional power system, after a loss of generation, the frequency decreases rapidly until it achieves a minimum value and then it partially recovers due to the remaining generators' primary droop controllers and system damping. In this paper, ∆f nadir is defined as the frequency deviation at nadir point. According to (7), when the frequency achieves its nadir point, η achieves its maximum value, which means that the largest proportion of devices are interrupted at this time. After the frequency recovers away from the nadir point, η decreases, but this does not change the number of interrupted devices since no new devices are turned ON after the nadir point 1 . In other words, the frequency deviation at the nadir point, provides the largest η, which determines the damping provided by the PEM fleet.
Clearly, the decentralized PEM scheme can provide damping as seen in Fig. 4. This damping is achieved with no coordination between DERs and aggregator. Being able to estimate the damping available from a fleet of DERs would be valuable for grid operators and market participants interested in fast frequency response (FFR) markets [24]. The next section provides an accurate online estimate of the equivalent damping provided by a fleet of DERs operating under (7).

IV. PREDICTING THE AGGREGATE RESPONSE
In this section, the equivalent damping provided by a fleet of DERs operating under the decentralized control law in (7) is estimated analytically. In addition, (7) is augmented to combine both local timer and temperature information in the fully decentralized packet interruption scheme and estimate the resulting equivalent damping. While the PEM aggregator has direct access to the distribution of timer states, the temperature distribution required for the online estimate must be obtained indirectly with a state estimator [25], [21].
Next, an analytical estimate of the equivalent damping for just the aggregator's timer state distribution is provided.

A. Timer-based prioritization
In order to predict the equivalent PEM damping, the aggregator leverages available real-time information about the distribution of timer states. The aggregator makes use of the following simplifying assumptions that are reasonable in a practical setting, to estimate the damping. Assumption 3. The frequency response event duration is less than 30 seconds. That is, it is assumed that the nadir point is such that η(∆f nadir ) > 30 δ . This implies that one can neglect the effect of packet completions rate.
For example, consider a PEM system with δ = 180s and frequency event with a nadir such that η(∆f nadir ) = 0.9. Then, all devices with timer states t n > 18 are interrupted and natural packet completions will not occur for 162 seconds and can, therefore, be neglected. The analytical estimate is embodied by the following theorem. Theorem 1. Let δ, ∆f and P rate , and n p be fixed for a DER fleet with decentralized control policy (7) and chosen η max , ∆f max and ∆f db . Under assumptions 1, 2 and 3, the PEM fleet responds to frequency deviations with an equivalent damping of Proof. The proof is by construction. A PEM-enabled DER can either naturally complete or interrupt its packet. From (7), if ∆f nadir > ∆f db , then no device is interrupted and the PEM fleet is not responsive to the frequency, so the equivalent damping is zero. For larger frequency deviations, assumption 3 ensures that one only has to consider packet interruptions. Thus, the total change in PEM load for system area j is described as: where x i [k] is the i th entry of an arbitrary timer states distribution x[k]. From Assumption 1, the total number of interruptions can be approximated by multiplying total number of ON devices and η(∆f nadir ). Therefore, (9) can be rewritten as follows: In addition, from Assumption 2, 1 np x[k] ≈ N bxnom . For ∆f nadir ∈ [∆f max , ∆f db ], (7) gives η(∆f nadir ) = (∆fnadir−∆fdb)ηmax ∆fmax−fdb and substituting this into (10) yields Since this change in power occurs over frequency deviation ∆f nadir − ∆f db , the equivalent damping in (8) is obtained. Finally, for ∆f nadir < ∆f max , (7) saturates and η(∆f nadir ) = η max . Then, ∆P PEM j (∆f nadir ) ≈ P rate η max N bxnom . The equivalent damping is then ∆P PEM j (∆fnadir) ∆fnadir−∆fdb , which results in (8). This concludes the proof.
Remark. Theorem 1 allows the PEM fleet to be modeled as a proportional controller with gain D PEM . Note also, from (9), that Theorem 1 can be extended to estimate D PEM in real-time for an arbitrary distribution of timer states. Nevertheless, D PEM will no longer be constant for all ∆f nadir ∈ [∆f max , ∆f db ]. This represents ongoing work.
Next, the proposed scheme is implemented on a two-area system to verify its performance.

V. NUMERICAL VALIDATION WITH TWO-AREA SYSTEM
Consider the so-called two-area model [26]. When a fleet of DERs under PEM interact with this system as in Fig. 5, the steady state frequency deviation and damping are given, respectively, by where D j and R j are the damping in MW/Hz and droop constant in Hz/MW in each area j. Here, it has been assumed that both areas have equal damping and inertia. PEM loads and generation drop are in area 2. The two-area system parameters and simulation setup with respect to PEM are presented in table II. Fig. 5 depicts the two area system interacting with PEM loads. Equation (11) is used to compute the actual damping of the system in simulations. In what follows, D actual PEM will be compared against (8) in Theorem 1.

A. Equivalent damping of PEM loads
As seen in the previous subsection, when energy packets are interrupted (η max = 0), the number of natural completions during the disturbance is negligible. Therefore, (8) can be used to calculate the estimated damping of the population of PEM loads. Then, the PEM fleet operating under decentralized control policy from (7) can be modeled as a simple, lumped proportional frequency-responsive demand D PEM . Fig. 6, compares simulation results using PEM loads against equivalent proportional controller. It can be seen that for η max = 0, the error is higher compared to other cases since packet completion rates are not negligible. The Root Mean Square Error (RMSE) for different values of η max and relative error in damping estimation is presented in table III. The estimation error is calculated as 100×  results show that the relative accuracy of the damping estimate improves as the frequency deviation increases, however, for all estimates, the resulting frequency response in Fig. 6 matches closely with RMSE< 1.2mHz. The estimate is made solely based on distribution of timers, which is available to the aggregator. No online measurements or communication are required for DERs to respond to frequency.

VI. CONCLUSION
A packet-based model for primary frequency control was designed. It was shown through simulations that proposed method was able to provide fast frequency response and improved ROCOF and maximum frequency deviation in a fully decentralized manner. In addition, an equivalent damping for the fleet of DERs was calculated based on online measurements available to aggregator. Future work includes studying the combined temperature and timer prioritization and generalizing this work for over-frequency events by modifying the local control law together with using batteries.