Open Access
This article is

- freely available
- re-usable

*Energies*
**2015**,
*8*(8),
8650-8681;
https://doi.org/10.3390/en8088650

Article

A Closed-Loop Control Strategy for Air Conditioning Loads to Participate in Demand Response

^{1}

Department of Electrical Engineering, Southeast University, Nanjing 210096, China

^{2}

China Electric Power Research Institute, Nanjing 210003, China

^{3}

Department of Electrical Engineering and Computer Science, University of Tennessee, Knoxville, TN 37996, USA

^{*}

Author to whom correspondence should be addressed.

^{†}

These authors contributed equally to this work.

Academic Editor:
Thorsten Staake

Received: 15 July 2015 / Accepted: 6 August 2015 / Published: 14 August 2015

## Abstract

**:**

Thermostatically controlled loads (TCLs), such as air conditioners (ACs), are important demand response resources—they have a certain heat storage capacity. A change in the operating status of an air conditioner in a small range will not noticeably affect the users’ comfort level. Load control of TCLs is considered to be equivalent to a power plant of the same capacity in effect, and it can significantly reduce the system pressure to peak load shift. The thermodynamic model of air conditioning can be used to study the aggregate power of a number of ACs that respond to the step signal of a temperature set point. This paper analyzes the influence of the parameters of each AC in the group to the indoor temperature and the total load, and derives a simplified control model based on the two order linear time invariant transfer function. Then, the stability of the model and designs its Proportional-Integral-Differential (PID) controller based on the particle swarm optimization (PSO) algorithm is also studied. The case study presented in this paper simulates both scenarios of constant ambient temperature and changing ambient temperature to verify the proposed transfer function model and control strategy can closely track the reference peak load shifting curves. The study also demonstrates minimal changes in the indoor temperature and the users’ comfort level.

Keywords:

demand response; thermostatically controlled loads; air conditioning; closed-loop control; peak load shifting## 1. Introduction

Demand Response (DR) is defined as the changes in electric usage by customers from their normal usage patterns with changes in the price of electricity over time. It is considered a critical application in smart grids. With the Advanced Metering Infrastructure (AMI), the power usage of different appliances can be adjusted either directly, e.g., through incentive-based programs (IBP), such as operational parameters/states changing requested by grid operators, direct load control, and interruptible loads; or indirectly, e.g., through price-based programs (PBP) [1], such as real-time pricing, time of use pricing, and critical peak pricing [2,3]. By smoothing out the system power demand over time, DR is capable of providing peak shaving, load shifting and ancillary services to achieve system reliability and stability. The performance of DR programs is measured by peak load reduction and demand elasticity.

Traditionally, the power system adopts the strategy of “electricity production determined by loads” to achieve power balance. Loads have been regarded as the passive physics terminal. In recent years, the smart grid concept has become popular in the electric system. The communication capability of the new intelligent service network and the loads’ controllability have been greatly improved. Direct Load Control (DLC), which usually reduces the loads by controlling the thermostatically controlled loads (TCLs) of air conditioners, fridges, water heaters of the residential users or the small-business users, is an important type of incentive-based demand response. These kinds of loads are called flexible loads. They have heat energy storage ability and can switch or change the control parameters in a short time, which will not impact users. Meanwhile, they have the potential to balance system power. Flexible loads can have a real-time response to the grid’s demand, reduce the backup capacity properly, and improve the level of the power system to run safely and economically [4]. They can be incorporated into the normal operation of power system’s dispatch by the demand response [5].

Electricity shortages usually occur during peak hours in the summer or winter, when the percentage of the air-conditioning loads reach 30%~40% of the total capacity—the demand peak rises with the number of air conditioners in use, while during off-peak hours, there is usually a power surplus. The types of the air conditioners include centralized and non-centralized [6,7]. A centralized air conditioner controls the temperature in different rooms by a mainframe connecting to several terminals through the ventilation system, while non-centralized air conditioners (ACs), which account for a large proportion of all ACs, are installed in individual rooms and control the temperature independently. TCL presents a huge opportunity in the power grid. The effect of controlling the loads of TCLs is equivalent to building a power plant with the same capacity. However, the investment of the demand response is much lower compared with the construction of a new power plant, and reasonable load control has minimal impact on users. The cost for building a peaking power plant is 1200 dollars per kilowatt [8], while the compensation for users about load management is much lower and can be put into use in a short time.

There are several ways to model TCLs, including modeling based on the actual physical process, regression modeling based on historical data, and modeling based on the Fokker-Planck diffusion equations. Other authors focus on a probability characteristics model and the use of black-box model identification techniques [9,10,11]. These models are often too complicated for the control system. For example, the physical process model, which needs to be converted to the mathematical model of control, cannot be directly used in numerical simulations. The regression model requires a large amount of historical data. Similarly, the model based on Fokker-Planck equation is very complex and difficult to implement [12]. A state sequence model, proposed by Lu and Chassin, considers the uncertainty modeling of thermostatically controlled loads. The disadvantage of this model is that it can only slowly change the load over time.

In most cases, the control scheme of TCLs is based on the idea of optimization. A scheduling decision model has an objective function to maximize the load aggregate interest and to minimize the actual output deviation of ACs. It includes a constraint condition that the indoor temperature has to be within the range of [${T}_{\mathrm{min}},\text{\hspace{0.05em}\hspace{0.05em}\hspace{0.05em}}{T}_{\mathrm{max}}$] in order to ensure the user’s comfort level [13]. After the air conditioning model is determined, the air conditioning scheduling scheme is calculated using the optimization algorithm. This method belongs to the open-loop control, with intensive calculation, cannot achieve accurate control and real-time control which is based on load output change. The research by Na et al., on the direct load control (DLC) and controlling AC loads by electricity price in order to achieve the purpose of load reduction does not include control strategies. Manichaikul and Schweppe used the predictive method to control centralized TCLs and provide the auxiliary service for the power grid, taking the minimum error as the target [14]. Centralized TCL load management is carried out by using the comfort control method proposed in Malhamé’s and Chong’s paper. The reference signal which is compared with the actual signal, is the desired aggregated air-conditioning load. Then, the temperature set points were calculated using the intima controller [15]. In [16], the electric heat load DLC algorithm is based on the state sequence control algorithm, which aims to stabilize tie-line power fluctuations between distribution network and micro-grid including clean energy.

These methods adopt price signals or power surge signals to control the switch state of the users’ equipment. Although they can take part in the ancillary service of the power system, their time scale is usually counted in hours or days, so they cannot follow the target load curve closely. Currently, most load control strategies destroy the diversity of the load group, resulting in power demand oscillation, and produce negative effects to the power system [17]. Demand side customers’ satisfaction can be taken into consideration using the load management (LM). A fuzzy membership function is established to characterize the users’ satisfaction according to the user’s continuous control time [18], but it is difficult to express the users’ comfort level directly. In this paper, a closed-loop control strategy to solve the above-mentioned problems in existing methods is proposed.

The core contribution and innovation of this paper lies in exploring a simplified two order linear time invariant transfer function model by analyzing the duty cycle of the air conditioning group, proposing a closed-loop control strategy to provide a new way for flexible loads to participate in demand response, and putting forward two suggestions to solve the problem that parameters of the proposed transfer function model vary with the ambient temperature in the case study. Based on the proposed model, accurately load control could be achieved without negatively affecting user experience.

The rest of this paper is organized as follows: Section 2 presents an equivalent thermal parameters model of air conditioning. Section 3 analyzes the influence of AC parameters on its output characteristic and explores a simplified transfer function model for ACs by analyzing the duty cycle of the population. Section 4 presents a design of the model’s PID controller based on the PSO algorithm. Section 5 demonstrates the simulation results of both scenarios of constant and changing ambient temperature to verify the proposed transfer function model and control strategy. Section 6 summarizes the discussions and puts forth our conclusions.

## 2. An Equivalent Thermal Parameters Model of Air Conditioning

In this section, the correlation between power, temperature and time is established, based on the equivalent thermal parameters (ETP) model. The study focuses on fixed-frequency air conditioning, and uses the Monte Carlo method to simulate the aggregated dynamic response of AC groups.

Air conditioning has a periodic working pattern, as shown in Figure 1: When the air conditioning is on, the temperature inside the house keeps dropping until the temperature reaches the boundary
${\theta}_{-}$. Then the air conditioner is off and the temperature inside the house keeps rising until the temperature reaches the boundary
${\theta}_{+}$, after which the air conditioning is switched on again.

**Figure 1.**Periodical properties of the temperature inside the house and the power of air conditioners (ACs).

The AC’s periodical properties can be described by the following equivalent thermal parameters model [19]:
where
${\theta}_{i}(t)$
is the air temperature inside the i-th house at time t,
${\theta}_{a}$
is the outdoor ambient temperature,
${C}_{i}$
(kWh/°C) is the i-th AC’s equivalent thermal capacitance,
${R}_{i}$
is the i-th AC’s equivalent thermal resistance (°C/Kw),
${P}_{i}$
(kW) is the i-th AC’s thermal power, which divided by the coefficient of performance (COP) is the actual load of air conditionings,
${s}_{i}(t)$
is the switch state variable of the i-th AC at time t.
${s}_{i}(t)=1$
means the i-th AC is on at time t, while
${s}_{i}(t)=0$
means the i-th AC is off at time t.

$$\frac{d{\theta}_{i}(t)}{dt}=-\frac{1}{{C}_{i}{R}_{i}}[{\theta}_{i}(t)-{\theta}_{a}+{s}_{i}(t){R}_{i}{P}_{i}],\text{}i=1,2,...\text{N}$$

$${s}_{i}({t}^{+})=\{\begin{array}{l}0\text{if}{\theta}_{i}(t)\le {\theta}_{-}\text{}\hfill \\ 1\text{if}{\theta}_{i}(t)\ge {\theta}_{+}\text{}\hfill \\ {s}_{i}(t)\text{otherwise}\hfill \end{array}$$

The formula for calculating the aggregated demand of n ACs in the group is:

$${D}_{t}^{ac}(t)=\frac{{\displaystyle \sum _{i=1}^{n}{s}_{i}(t)\frac{{P}_{i}}{{\text{COP}}_{i}}}}{{\displaystyle \sum _{i=1}^{n}\frac{{P}_{i}}{{\text{COP}}_{i}}}}$$

${D}_{t}^{ac}(t)$
is a per-unit value, taken as the baseline, whose numerator represents the sum of the running AC loads in the group, and the denominator represents the total power of the group, assuming that all ACs in the group are on.

The traditional thermodynamic model of the air conditioning using Equations (1)–(3) has some limitations. Each air conditioning room is a dynamic system with a nonlinear and independent iteration. When there is a large number of ACs, we have to face the problem of dimension disaster which triggers great difficulties. In addition, the model contains both continuous variable temperature θ, and discrete variable switching state s. In the following section, we present a simplified transfer function model, which can be used to easily solve the aggregated load of the population containing n ACs.

## 3. Transfer Function Model for Aggregated Air Conditioning Group

It is difficult to perform an accurate mathematical analysis of the traditional thermodynamic model, since each air conditioned room is a dynamic system with a nonlinear and independent iteration. This section explores a simplified transfer function model by analyzing the duty cycle of the air conditioning group. The excitation signal is step change of temperature set point.

#### 3.1. The Influence of Air Conditioning Parameters on the Output Characteristic

In order to maintain the diversity of the air conditioning group, we assume that at the initial stage, all air-conditioned room temperatures uniformly distribute between the boundary temperature value [${\theta}_{-},\text{\hspace{0.17em}}{\theta}_{+}$], which determines whether the AC is on or off. In order to explore the equivalent heat capacity’s relationship with ambient temperature and duty cycle of air conditioning group, we assume that all ACs have the same thermal power P and the same equivalent thermal resistance R. This ensures that the decline rate of the room temperature when the air conditioning is on is equal to the rate of the temperature rise when the air conditioner is off. Therefore, the duty cycle is 0.5. We assume that equivalent thermal capacitance C follows lognormal distribution. Then we have:

$${R}_{i}{P}_{i}=2({\theta}_{a}-{\theta}_{ref})$$

As the control signal, the temperature set point of ACs is the same for all the members in the group:
${\theta}_{ref}=\left({\theta}_{+}+{\theta}_{-}\right)/2$. The hysteresis width that consists of the boundary temperature values is the same for all air conditioners. In the simulation of this paper, the hysteresis width is:
$H={\theta}_{+}-{\theta}_{-}=1$
°C.

Then we analyze the air conditioning group based on the assumption of the above conditions. At t = 0, a step change of 0.5 °C of the temperature set point is occurred. Figure 2a,b indicates the temperature distribution before the step response. Figure 2c,d illustrates the temperature change after the step response. Therefore, the temperature boundary
$\left({\theta}_{-},{\theta}_{+}\right)$
will move right into
$({\theta}_{-}^{post},{\theta}_{+}^{post})$, which is:

$${\theta}_{+}^{post}={\theta}_{+}+0.5,{\theta}_{-}^{post}={\theta}_{-}+0.5$$

**Figure 2.**The temperature distribution of ACs before and after a step change of 0.5 °C of the temperature set point.

Figure 2a,c shows that when the air conditioning is off, the room temperature rises, while Figure 2b,d shows that when the air conditioning is on, the room temperature drops. We define the change rate of the temperature of the i-th air conditioning room as follows:

$$\left|\frac{d{\theta}_{i}(t)}{dt}\right|\approx {v}_{i}=\frac{{\theta}_{a}-{\theta}_{ref}}{{C}_{i}R}$$

Besides, we define state variables:
where:

$${x}_{i}(t)={x}_{0}^{i}+{v}_{i}t$$

$${x}_{i}^{0}=\{\begin{array}{l}1+{\theta}_{i}(0)-{\theta}_{-}^{post}\text{\hspace{0.17em}\hspace{0.17em}}if\text{\hspace{0.17em}}\frac{d{\theta}_{i}({0}^{-})}{dt}>0,\\ {\theta}_{+}^{post}-{\theta}_{i}(0)\text{\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}}if\text{\hspace{0.17em}}\frac{d{\theta}_{i}({0}^{-})}{dt}<0\end{array}$$

For an air conditioning group based on the thermodynamic model, at t = 0, a step change of 0.5 °C of the temperature set point is occurred. When
${x}_{i}(t)\in [2k,\text{\hspace{0.17em}}2k+1]$, the air conditioning is on, and when
${x}_{i}(t)\in [2k+1,\text{\hspace{0.17em}}2k+2]$, the air conditioning is off. Each time when
${x}_{i}$
becomes an integer, a on-or-off state transformation occurs. The relationship between
${x}_{i}$
and the state variable
${s}_{i}(t)$
of air conditioning in the thermodynamic model (1)–(3) is:

$${s}_{i}(t)=\{\begin{array}{c}\text{}0\text{\hspace{0.05em}\hspace{0.05em}\hspace{0.05em}if}2k-1\le {x}_{i}(t)2k\text{}\\ 1\text{\hspace{0.05em}\hspace{0.05em}if}2k\le {x}_{i}(t)2k+1\text{}\end{array},\text{}k=1,2,...$$

When
${x}_{i}(t)$
< 1, at time 0+, temperature set point rises. From Figure 3, we can see that only 1/3 of the ACs are on, and by Equation (8), the state of the air conditioning is distributed in the interval of
${x}_{i}(t)$
> 0.5. The probability that an air conditioning in the population switched on is:
where Pr[·] is the probability operator.

$$\mathrm{Pr}[m(t)=1|x(t)<1]=\frac{\mathrm{Pr}[x(t)<1]}{3}$$

For an air conditioning group based on the ETP model, at t = 0, the temperature set point of all air conditioners rises by 0.5 °C. Assuming that all ACs have the same power, if they are switched on at the same time, we take their total power as the baseline. Therefore, the normalized power demand D(t) of the air conditioning group which consists of n ACs is equal to the probability of a random AC turning on [20]:

$$D(t)=\frac{\mathrm{Pr}[x(t)<1]}{3}+{\displaystyle \sum _{k=1}^{\infty}\mathrm{Pr}[x(t)<2k+1]-}\mathrm{Pr}[x(t)<2k]$$

D(t) also gives the proportion of the air conditioning that is on in the group at time t. The first term of Equation (11) is the duty cycle of the air conditioning group at the moment 0+ when the temperature set point rises, while the second term is the duty cycle of the air conditioning group after t > 0. Assuming that all ACs have the same R, P, and the parameter C obeys a lognormal distribution. Consequently, according to Equation (6), the temperature change rate v obeys the lognormal distribution, too. We use
$s.d.$
to represent the standard deviation, as well as E to the mean value:

$$\frac{{\sigma}_{v}}{{\mu}_{v}}=\frac{s.d.\left[\frac{{\theta}_{a}-{\theta}_{ref}}{{C}_{i}R}\right]}{E\left[\frac{{\theta}_{a}-{\theta}_{ref}}{{C}_{i}R}\right]}=\frac{s.d.\left[1/{C}_{i}\right]\frac{{\theta}_{a}-{\theta}_{ref}}{R}}{E\left[1/{C}_{i}\right]\frac{{\theta}_{a}-{\theta}_{ref}}{R}}=\frac{s.d.\left[1/{C}_{i}\right]}{E\left[1/{C}_{i}\right]}\text{\hspace{0.05em}\hspace{0.05em}\hspace{0.05em}}=\frac{s.d.\left[{C}_{i}\right]}{E\left[{C}_{i}\right]}=\frac{{\sigma}_{c}}{{\mu}_{c}}$$

${\sigma}_{rel}$
is defined by:
where
${\mu}_{c}$
is the mean value of the equivalent heat capacity of n ACs, and
${\sigma}_{c}$
is the standard deviation.

$${\sigma}_{rel}=\frac{{\sigma}_{v}}{{\mu}_{v}}=\frac{{\sigma}_{c}}{{\mu}_{c}}$$

Based on Equation (11), when
$\frac{d{\theta}_{i}(t)}{dt}$
obeys the lognormal distribution, it can be considered that
${x}_{i}(t)$
is also subject to the same distribution. According to the nature of the lognormal distribution we obtain:
where:

$$\mathrm{Pr}\left[x(t)\le y\right]=\frac{1}{2}+\frac{1}{2}\text{erf}\left[\frac{\mathrm{log}(y)-\mu (t)}{\sqrt{2{\sigma}^{2}(t)}}\right]$$

$$\mu \left(t\right)=\mathrm{log}({\mu}_{x}(t))-\frac{1}{2}\mathrm{log}\left(1+\frac{{\sigma}_{x}^{2}(t)}{{\mu}_{x}^{2}(t)}\right)$$

$${\sigma}^{2}(t)=\mathrm{log}\left(1+\frac{{\sigma}_{x}^{2}(t)}{{\mu}_{x}^{2}(t)}\right)$$

From Equation (11) we can also derive:
and:

$${\mu}_{x}(t)=E[x(t)]=E[x(0)]+E[v]t={\mu}_{x}(0)+{\mu}_{v}(t)$$

$${\sigma}_{x}^{2}(t)={(s.d.[x(t)])}^{2}={(s.d.[x(0)])}^{2}+{(s.d.[v])}^{2}{t}^{2}\text{\hspace{0.05em}}={\sigma}_{x}^{2}(0)+{\sigma}_{v}^{2}{t}^{2}$$

The value of the first term of the above two formulas is very small and can be ignored. Therefore:

$$\frac{{\sigma}_{x}^{2}(t)}{{\mu}_{x}^{2}(t)}\approx \frac{{\sigma}_{v}^{2}}{{\mu}_{v}^{2}}={\sigma}_{rel}^{2}$$

By plugging Equations (17) and (19) into Equation (14), the following equation is obtained:
where
$\mathrm{erf}$[·] is the Gauss error function.

$$\mathrm{Pr}[x(t)\le y]\approx \frac{1}{2}+\text{\hspace{0.05em}\hspace{0.05em}\hspace{0.05em}}\frac{1}{2}\text{\hspace{0.05em}}erf\left[\frac{\mathrm{log}(y)-\mathrm{log}({\mu}_{x}(0)+{\mu}_{v}t)+\frac{1}{2}\mathrm{log}(1+{\sigma}_{rel}^{2})}{\sqrt{2\mathrm{log}(1+{\sigma}_{rel}^{2})}}\right]$$

Let y = 1 and for 2k and 2k + 1, k = 0, 1, … ,. Then, by plugging Equation (19) into Equation (11), D(t) can be approximated as follows:

$$D(t)\approx \frac{1}{6}+\frac{1}{6}\mathrm{erf}\left[\frac{\mathrm{log}(1)-\mathrm{log}({\mu}_{x}(0)+{\mu}_{v}(t))}{\sqrt{2}{\sigma}_{rel}}\right]\text{\hspace{0.17em}}+\frac{1}{2}{\displaystyle \sum _{k=2}^{\infty}{(-1)}^{k+1}}\mathrm{erf}\left[\frac{\mathrm{log}(k)-\mathrm{log}({\mu}_{x}(0)+{\mu}_{v}(t))}{\sqrt{2}{\sigma}_{rel}}\right]$$

Figure 4 shows the average temperature and power for the population composed of 10,000 air conditioners according to different values of
${\sigma}_{rel}$. At t = 500 min, the temperature set point of all ACs rises 0.5 °C. In Figure 4a–d, for
${\sigma}_{rel}$
= 0.02, 0.05, 0.2 and 0.5 respectively, the top represents the average temperature inside the house before and after the step response, while the bottom represents the total power of all ACs before and after the step response.
${\sigma}_{rel}$
means the standard deviation of log-normal distributions as a fraction of the mean value for R, C and P. According to Equation (3), the normalized power demand D(t) means the proportion of the air conditioning which is on in the group at time t. Assuming that all ACs have the same R, P, while C obeys lognormal distribution. This ensures that, the rate of fall of the room temperature when the air conditioning is on, is equal to the rate of rising of the room temperature when the air conditioner is off. The steady-state value of the duty cycle is 0.5.

As shown in Figure 4, the average temperature of the air conditioning group is in the vicinity of the set point 20 °C before a 0.5 °C step. Then, the room temperature stabilizes at 20.5 °C after a period of oscillation. The temperature and power have the same settling time. More generally, the duty cycle may not always remain at 0.5, as in the hotter days when there are more ACs turning on, the duty cycle is larger than 0.5, but in colder days, the situation is the opposite.

When not all parameters such as R, P are the same, for example, as follows a lognormal distribution, variations of temperature and power of the ACs in the group will be more dramatic. Due to the diversity, the damping will be greater.

The temperature and the power of ACs experienced an underdamped oscillation after the temperature set point had risen 0.5 °C at t = 500 min. Figure 4 shows a decaying oscillation. For
${\sigma}_{rel}={\sigma}_{c}/{\mu}_{c}$, the bigger
${\sigma}_{rel}$
is, the greater the system damping becomes. The average temperature and the power curve have a shorter settling time and a smaller overshoot.

**Figure 4.**The average temperature and power for the population composed of 10,000 ACs before and after the step signal of temperature set point, respectively under conditions of ${\sigma}_{rel}$ = 0.02, 0.05, 0.2 and 0.5. ${\sigma}_{rel}$ is the standard deviation of log-normal distributions as a fraction of the mean value for R, C and P. (

**a**) ${\sigma}_{rel}$ =0.02; (

**b**) ${\sigma}_{rel}$ =0.05; (

**c**) ${\sigma}_{rel}$ =0.2; (

**d**) ${\sigma}_{rel}$ =0.5.

By observing changes in the aggregated load before and after a step change of the temperature set point, we use a second-order dynamic model to approximate the air conditioning group. It will be easy to solve the aggregated load of a population consisting of n ACs. Thus we can design a controller based on the transfer function later. In the following simulation we can see that, when we release some restrictions on the assumptions in more general cases, the transfer function model and control strategy on the ACs will still be quite effective in real situations.

#### 3.2. A Transfer Function Model for the Second Order Linear Time Invariant System

When the temperature set point rises by 0.5 °C, the response of a population consisting of n ACs will be:
where
${D}_{ss}({\theta}_{ref})$
is the aggregated power demand of the AC group given a constant temperature set point. It is also the duty cycle of the steady state. The term including
${G}_{p}(s)$, which belongs to a transient process of change, indicates the aggregated demand response of a 0.5 °C step in the form of a second-order linear model:
where the hysteresis width H is obtained by the upper and lower limit of temperature which determines whether the AC is operating or switched off:

$$D(t)={D}_{ss}({\theta}_{ref})+{L}^{-1}\left({G}_{p}(s)0.5/s\right)$$

$${D}_{ss}(\theta )={\left(1+\frac{\mathrm{log}\left(1+\frac{H}{{\theta}_{a}-\theta -H/2}\right)}{\mathrm{log}\left(1+\frac{H}{PR-{\theta}_{a}+\theta -H/2}\right)}\right)}^{-1}$$

$$H={\theta}_{+}-{\theta}_{-}$$

The second order transfer function model of an AC group is:

$${G}_{p}(s)=\frac{{b}_{2}{s}^{2}+{b}_{1}s+{b}_{0}}{{s}^{2}+2\xi {\omega}_{n}s+{{\omega}_{n}}^{2}}$$

Whose parameters are calculated from the equivalent thermal capacitance, thermal resistance, thermal power, hysteresis width and so on. The damping ratio
$\xi $
and the undamped natural oscillation
${\omega}_{n}$
of the characteristic polynomials in the denominator are:

$$\xi =\frac{\mathrm{log}(r)}{\sqrt{{\pi}^{2}+{\mathrm{log}}^{2}(r)}},\text{\hspace{0.17em}\hspace{0.17em}}{\omega}_{n}=\frac{\pi {\mu}_{v}}{\sqrt{1-{\xi}^{2}}},$$

The coefficients in the numerator are:
where
${\mu}_{v}$
represents the mean values of v defined in Equation (6):
where erf represents the Gaussian error function. The proof of the above equation is given in the Appendix A.

$${b}_{0}=\frac{{\omega}_{n}^{2}\left({D}_{ss}\left({\theta}_{ref}+0.5\right)-{D}_{ss}({\theta}_{ref})\right)}{0.5}$$

$${b}_{1}=0.5{\mu}_{v}+2{b}_{2}\xi {\omega}_{n},\text{\hspace{0.17em}\hspace{0.17em}}{b}_{2}={D}_{ss}({\theta}_{ref})$$

$$r=\frac{\left|\text{erf}\left(\frac{1}{0.9+2\sqrt{2}{\sigma}_{rel}}\right)-0.5\right|}{\left|\text{erf}\left(\frac{1}{0.9}\right)-0.5\right|}$$

#### 3.3. Stability Analysis

The aggregated demand response of a 0.5 °C step based on a second-order linear time invariant (LTI) model is shown in Figure 5, which reveals the process of an underdamped oscillation when the system cross the position of equilibrium.

The simulated parameters are listed in Table 1, whose parameters are subsequently calculated by using Equations (25)–(27), according to the air conditioning parameters given in Table 2.

**Figure 5.**The aggregated demand response of a 0.5 °C step based on the second-order linear time invariant (LTI) model.

Parameters | D_{ss}(θ) | r | ξ | ω_{n} | b_{0} × 10^{−4} | b_{1} | b_{2} |
---|---|---|---|---|---|---|---|

Value | 0.429 | 0.431 | 0.259 | 0.033 | 0.378 | 0.012 | 0.429 |

Parameters | Value | Description |
---|---|---|

R | ${\mu}_{R}$ = 2 °C/kW | Equivalent thermal resistance, log-normally distributed with mean ${\mu}_{R}$ and variance |

C | ${\mu}_{C}$ = 3.6 kWh/°C | Equivalent heat capacity log-normally distributed with mean ${\mu}_{C}$ and variance ${\sigma}_{C}^{2}$ |

P | ${\mu}_{P}$ = 6 kW | Equivalent thermal power, log-normally distributed with mean ${\mu}_{P}$ and variance ${\sigma}_{P}^{2}$ |

θ_{a} | 32 °C | Ambient temperature |

θ_{+} | 20.5 °C | Higher end of hysteresis band |

θ_{−} | 19.5 °C | Lower end of hysteresis band |

θ | 20 °C | Initial temperature set point for n ACs |

${\sigma}_{rel}$ | 0.2 | defined as ${\sigma}_{rel}^{2}={\sigma}_{C}^{2}/{\mu}_{C}^{2}$ |

${\sigma}_{C}^{2}$ | 0.4 | Variance of n ACs’ heat capacity |

${\sigma}_{R}^{2}$ | 0.72 | Variance of n ACs’ thermal resistance |

${\sigma}_{P}^{2}$ | 1.2 | Variance of n ACs’ thermal power |

H | 1 °C | Hysteresis width of indoor temperature |

COP (coefficient of performance) | 2.5 | Load efficiency |

When
${\sigma}_{rel}$
= 0.2, we can calculate that
$\xi =0.259$
and
${\omega}_{n}=0.033$. The decay time of the step response of the control plant to 1% is:
${t}_{s}=4.6/(\xi {\omega}_{n})=520$
min. It can be seen that the settling time calculated from the second order LTI model in Figure 5 is consistent with the thermodynamic model in Figure 4. Figure 6 shows the dynamic performance of the open-loop transfer function of the air conditioning group composed of n ACs. We can see from the graph that without the controller, the peak of the two order system is 0.422, the overshoot is 1180%, the rise time is 47.1 s, the adjustment time is 235 s, the system stability is 0.0329, and there exists a static error of 2% for the normalized power demand D(t). Therefore, it is sensible to design a corresponding controller, considering increasing the open loop amplification, and using a proportional control to reduce the static error.

By analyzing the stability of the transfer function
${G}_{p}$, we get the Bode diagram. As shown in Figure 7, the system amplitude stability margin
${G}_{p}$
and phase angle crossover frequency
${W}_{cg}$
are defaults, and the phase margin angle
${P}_{m}$
= −107.9061, gain crossover frequency
${\omega}_{cp}$
= 0.0227. Therefore, the closed-loop system with stability parameters marked in the figure is stable.

#### 3.4. Simulation Analysis

The initial temperature set point of the air conditioning group is assumed to be 20 °C. At t = 500 min, the temperature set point of all ACs is raised by 0.5 °C. The upper and lower limit of the temperature, which determines the operating state of ACs, rises to 20.5 and 19.5 °C. The temperature hysteresis width is still 1 °C. Figure 8 shows a comparison of the aggregated demand between the transfer function model and the equivalent thermal parameters (ETP) model in response to a 0.5 °C step rise. In the ETP model, the number of ACs in the population is 50, 1000 and 10,000 respectively. Figure 8a shows the variation on the average temperature inside the room of the AC group, and Figure 8b shows the variation on the aggregated demand of the AC group. Parameters of the equivalent thermal parameters model can be found in Table 2.

**Figure 8.**(

**a**) The variation on the average temperature inside the room and (

**b**) the variation on the aggregated demand of the AC group when the ACs’ temperature set point has a step rise of 0.5 °C. The two order linear time invariant transfer function model is compared with the ETP model which contains 50, 1000 and 10,000 ACs.

When there are only 50 air-conditioning units, although the AC parameters C, R and P are still log-normally distributed in the simulation, the diversity of the population cannot be achieved because of the strong randomness. The simulation curve is very volatile and has many glitches. In contrast, when the number of aggregated ACs in the population is 1000 and 10,000, the population has a strong diversity. The ACs are uniformly distributed in all running states, and the step response curve is very smooth.

We can see that with the parameters in Table 1, the two order linear time invariant transfer function model can be used to approximate the aggregate response of the AC group accurately. The load profile simulated by the transfer function model is very close to which simulated by the ETP model that contains 10,000 ACs. The input signal u(t) represents that, at t = 500, all the ACs’ temperature set point has a step rise of 0.5 °C.

The two order LTI model, which has a simple structure, can be used to capture the oscillation characteristics of the aggregate demand response of ACs. This is the key to the design of feedback control strategies for load control. In addition, applicability and complexity can be balanced, which makes the proposed model very practical.

The novelty provided in this section is as follows: the aggregated power of a population of n ACs that respond to the step signal of temperature set point was computed. The dynamics of the response of a numerically simulated population over a realistic range of parameter values were captured. Furthermore, a simplified control model based on the two order linear time invariant transfer function was proposed for the reason that the ETP equations were too complicated to solve. The excitation signal was the step change of temperature set point. The proposed model provided rule-of-thumb about the response with no need for intensive numerical calculations. In addition, it offers facilities for control design.

## 4. Proportional-Integral-Differential (PID) Controller Based on Particle Swarm Optimization (PSO) Algorithm

The performance of the PID controller depends on three parameters: K

_{p}, K_{i}and K_{d}. Therefore, it is important to optimize these parameters. Currently, the PID controller parameters are mainly adjusted manually, which is not only time consuming, but also cannot guarantee the best performance. The PSO algorithm has been widely used in function optimization, neural network training, pattern classification, fuzzy control system, as well as in other fields [21]. This paper will use the PSO algorithm to optimize the parameters of PID controller. Figure 9 shows a load control strategy for the AC group based on the PSO algorithm for PID parameter tuning.**Figure 9.**A load control strategy for the AC group based on the particle swarm optimization (PSO) algorithm for Proportional-Integral-Differential (PID) parameter tuning.

The desired reference demand of the ACs minus the actual output power of them is the load tracking error, when the event of load control occurs. This load tracking error is taken as the input of the PID controller, and then, the PSO algorithm is used to adjust its parameters. The calculated temperature set point u(t) is considered as the control signal of the air conditioning group. The bridge between the PSO algorithm and the Simulink model is the corresponding fitness value of the particles, namely, the parameters of the PID controller and the performance index of the system. The optimization process is as follows: firstly, the particle swarm is generated by the PSO algorithm, and the three-dimensional particles in the particle swarm are sequentially assigned to the PID controller parameters K

_{p}, K_{i}, K_{d}. Then we run the transfer function model for the AC group, and get the corresponding performance index of the specified parameters. Finally, we take the performance index as the fitness value of PSO to determine whether the exit conditions have been met. If so, the calculation process is terminated, otherwise the particle swarm will continue to update.The performance index, which is presented by the integral formula of the deviation between the expected system’s power demand and the actual feedback output, is a measure of the performance of the control system. In this paper, the instantaneous error function e(t) of the control system is evaluated by the integrated time and absolute error (ITAE) index:

$${J}_{\text{ITAE}}={\displaystyle {\int}_{0}^{\infty}t\left|e(t)\right|}dt$$

The transient response oscillation of the control system based on the ITAE performance index is small. Parameters also have good selectivity.

The novelty provided in this section is as follows: after the analysis of the stability of the proposed model, this paper designs its PID controller based on the PSO algorithm. Compared with the general optimization algorithm, the closed-loop control and feedback strategy are applied to provide a new way for flexible loads like air conditioners to be involved in demand response.

However, the PSO algorithm itself is not the present authors’ invention, and it is part of the innovation of this paper. It is applied to tune parameters for the PID controller in order to obtain smaller overshoot, shorter settling time and higher accuracy throughout the control process, and to meet with requires of demand response applications, such as load shifting and peak shaving. The principle and flowchart of PSO algorithm tuning PID controller parameters can be found in Appendix B.

## 5. Case Study: Demand Shaping Performance

#### 5.1. Scenario 1: Simulation under Constant Ambient Temperature Conditions

A population of ACs of similar characteristics can be used as a control group [22,23]. We choose the downtown area of the city of Nanjing, China for this research, where there are 18,000 ACs of 10,000 residents participating in the demand response plan. Parameters of ACs in the group are as follows: thermal resistance
$R~LN(2,\text{\hspace{0.05em}\hspace{0.05em}}{0.4}^{2})$, thermal capacitance
$C~LN(3.6,\text{\hspace{0.05em}\hspace{0.05em}}{0.72}^{2})$, thermal power
$P~LN(6,\text{\hspace{0.05em}\hspace{0.05em}}{1.2}^{2})$. When the ambient temperature is constant (e.g., 32 °C), the parameters of the two order transfer function of the aggregate AC group are shown in Table 2. In this scenario the parameters remain unchanged.

First, we do not have any control over the AC population. Therefore the temperature set point would stay fairly stable, and the total power demand of the whole AC population is shown in Figure 10. The temperature of 30 random air-conditioned rooms among the population is presented in Figure 11, and the mean temperature inside the house of all ACs is presented in Figure 12. The simulations were run in MATLAB (The MathWorks, Inc., Natick, MA, USA.) on a desktop computer equipped with an Intel Corei5-3230M 2.60GHz CPU, 4.00 GB memory, and 64 bit Windows 8 operating system.

Figure 10, Figure 11 and Figure 12 show that, without any control, the AC group will keep running independently. The profile of the aggregated demand of AC group is gentle, the duty cycle in steady state is 0.467. The temperatures of 18,000 air-conditioned rooms are uniformly distributed between 19.5–20.5 °C. The hysteresis width, which determines the upper and lower limits of temperature inside the air-conditioned rooms, is 1 °C. Besides, the mean temperature of all AC rooms is close to the temperature set point 20 °C.

A scenario analysis by varying the temperature set point offset to control the aggregated power demand of air-conditionings is started. Assuming that at the initial stage, 44.6% of the ACs are on, while the rest of them are off, the whole load control scenario is divided into three stages. For the first 100 min, the ACs run independently without any control. The second stage is from 100 to 350 min, during which the grid is in a peak load period. There is a power shortage and therefore needs a 20% reduction of air conditioning load, which is equivalent to 4.3 MW. The load aggregator will raise the temperature set point of the ACs to achieve peak load shifting. The third stage takes place between 350 and 600 min, when the peak load period of the power grid is over, it needs an additional 20% increase of air conditioning load to meet the power consumption of the off-peak period. The load aggregator will drop the temperature set point of the ACs to achieve a satisfactory comfort level. The load management scenario finalizes at t = 600 min. In this scenario, the two order transfer function of the AC group remains unchanged because of the constant ambient temperature, as is shown in Table 2. The particle swarm optimization algorithm is applied to tune parameters for the PID controller. The parameters of the PSO algorithm are set as follows: population size m = 100, dimension D = 3, the 3 parameters K

_{p}, K_{i}and K_{d}, to be optimized are in the range of 0–300, the inertia weight w = 0.6, the maximum number of iterations t = 200, acceleration coefficients ${C}_{1}={C}_{2}=2$.The IEAT index is chosen as the fitness function, with the minimum fitness value being 0.1. The particle velocity is between [−1, 1]. How to select the parameters of the PSO algorithm in detail is explained in [24,25]. Figure 13a,b shows the optimization of PID parameters K

_{p}, K_{i}and K_{d}by using the PSO algorithm, and Figure 14 shows a variation of the ITAE performance index.With the increase of the number of iterations of the particle swarm, the ITAE performance index, which is considered as the fitness function, gradually stabilizes at around 1.06. Therefore, we get the optimal PID parameters and the performance index as shown in Table 3, in which we tune PID parameters by using the particle swarm optimization algorithm and make a comparison of tuning results with the Ziegler-Nichols method. The parameters t

_{s}represents settling time, and t_{p}represents peak time. In order to demonstrate the advantages of the PSO algorithm, we compared it with the classical Ziegler-Nichols method on tuning PID parameters of the two order transfer function model for aggregated ACs [26]. Simulation results indicate that, although the peak time of the tuning process is slightly longer, the optimized controller based on the PSO algorithm outperforms the conventional one greatly in the settling time, overshoot and performance index.Figure 15 shows the comparison between the desired reference value of the aggregated demand of a population of ACs for load shifting, the power output of the population based on conventional PID controller, and the power output of the population based on PSO tuning PID parameters, when the outdoor temperature is a constant 32 °C. In Figure 15, the black curve is the ideal load control reference output, the green curve is the actual power output of the population using the Ziegler-Nichols method to tune PID parameters, and the red curve is the actual power output of the population using the particle swarm optimization algorithm to tune PID parameters. Figure 15b,c is obtained by zooming in on the parts circled by a dotted curve in Figure 15a, and show the effects of reducing the power output in 100–350 min and increasing the power output in 350–600 min, respectively.

**Table 3.**Tuning proportional-integral-differential (PID) parameters using the Ziegler-Nichols method in comparison with the particle swarm optimization algorithm.

Parameters | PID Tuning Methods | |
---|---|---|

Classic Z-N Algorithm | Particle Swarm Optimization (PSO) | |

${K}_{p}$ | 26.521 | 33.647 |

${K}_{i}$ | 0.023 | 0.167 |

${K}_{d}$ | 10.870 | 38.799 |

$\sigma \%$ | 30.596% | 3.115% |

${t}_{s}(\mathrm{min})$ | 26.704 | 18.363 |

${t}_{p}(\mathrm{min})$ | 5.800 | 7.318 |

Integrated Time and Absolute Error (ITAE) | 4.292 | 1.060 |

As can be seen from the figure, using PSO to tune PID parameters is significantly better than using the Z-N algorithm. In response to the step changes of reference values of load control at time 100 and 350 min, the Z-N tuning method has a larger overshoot, a longer settling time, a continuous oscillation throughout the control process and more glitches. In contrast, the control effect on PSO algorithm tuning PID parameters is quite satisfactory, and it meets with requires of rapidity, accuracy and stability of the control system.

We can also achieve a 100% load reduction by adjusting the expected reference value of the air conditioning load to zero. Figure 15d shows the simulation results of the aggregated demand of n ACs in this extreme case. We assume that, there appears a serious power shortage and needs a 100% reduction of air conditioning load. The aggregated power consumption of ACs based on PSO tuning PID parameters drops to zero when the reference signal is applied at time t = 100 min, and the whole stage continues for 30 min.

The cost of doing so is that all of the ACs have been switched off and the air temperature inside the house will gradually rise. From a technological perspective, we can achieve any arbitrary adjustment of ACs by using the proposed model and control strategy, but in a real-world scenario, if the duration of 100% load reduction is longer, it will affect the user’s comfort and lead to their dissatisfaction on a hot day. Thirty min later, the power demand increases to the initial value, and all of ACs return to the steady state without any parasitic oscillation.

Figure 16 shows the variation of the indoor temperature of 30 random ACs. The temperature hysteresis width H = 1 °C. The air temperature inside the house changes in response to the variation of the temperature set point u(t). We also observe that, the ACs’ temperature set point can be controlled by the load aggregator who sets a higher value to reduce the load, as well as setting a lower value to increase the load. After 600 min, the control process is over, but the room temperature does not directly return to the initial value [19.5 °C, 20.5 °C]. Instead, it has undergone a nearly 200 min variable process, and the final stable temperature is slightly lower than the initial value. The reason for this phenomenon is that the characteristics of air conditioning itself make the load rebound before and after the load control event.

**Figure 15.**(

**a**), (

**b**), (

**c**) A comparison between the desired reference value of the aggregated demand of a population of ACs for load shifting, the power output of the population based on conventional PID controller, and the power output of the population based on PSO tuning PID parameters, when the outdoor temperature is constantly 32 °C. (

**d**) The aggregated demand of n ACs in the extreme case of a 100% load reduction for 30 min.

Mehta et al., proposed an advanced open loop method in [27,28,29], which reduced two-way broadcasting to one-way and eliminated the problem of unwanted synchronization of TCLs with high quality control and without requiring a channel for consumer-to-grid communication. To quickly compensate for a mismatch between generation and load, the authors put forward strategies based on the timer-based safe protocols (SPs), including SP-1, SP-2 and SP-3, and focus on developing the algorithms to generate a set of power pulses that are useful in spinning reserve applications.

This paper presents a comparison of power demand response between the above hybrid SP protocol combining SP-1 and SP-2 and the proposed closed loop strategy in Figure 17. The simulation scenario is unchanged, from 100 to 350 min, there needs a 20% reduction of air conditioning load (Figure 17a), and an additional 20% increase of air conditioning load to meet the power consumption of the off-peak period (Figure 17b).

**Figure 17.**A comparison of power demand response between the proposed closed loop strategy and hybrid SP protocol combining SP-1 and SP-2. (

**a**) Negative pulse: p = 0.2, ξ = 0.5 °C; (

**b**) Positive pulse: p = 0.2, ξ = −0.5 °C.

The green line is the power response under hybrid SP protocol which combines SP-1 (yellow) and SP-2 (blue). How these protocols work in detail is explained in [28,29]. The proportion of the ACs undergoing SP-1 is P = 0.2, and the rest of them follows SP-2. By combining two SPs, peak reduction can be achieved. It can be observed that from 100 to 160 min, and from 400 to 600 min, the power demand of ACs based on the hybrid protocol combing two SPs has been tracking the reference output closely. It responded to the signal instantly and maintained the low power at the expected value for an hour (the natural TCL cycle time), but in the remaining time, the green curve gradually deviates from the reference value, and is slowly saturating close to the initial value. In contrast, at all times during the control period (100–350 min and 400–600 min), the power demand curve based on the proposed model and control strategy (red) is tightly maintained.

Although there are many advantages, the SP strategy is an open loop approach, and cannot compensate for the output error. On the contrary, the proposed closed loop control can adjust the control signal according to the results to obtain a higher precision.

#### 5.2. Scenario 2: Simulation under Variable Ambient Temperature Conditions

In this scenario, we consider a more realistic situation, which means an ever-changing ambient temperature. We choose 5 August 2014, which was a hot summer day, and the total load was very high. The temperature sensors of the weather station deployed in the area collect practical ambient temperatures once every 10 min. We draw the ambient temperature profile of 24 h as shown in Figure 18. It is observed that from 12:00 to 15:00, the ambient temperature is high, and the maximum temperature is 36.3 °C.

Figure 19 represents 24 h power load of a downtown area in Nanjing, China, where there are 18,000 ACs of 10,000 residents operating on the hot day 5 August 2014. The real data for the load profile, which was collected every 15 min, was provided by State Grid Nanjing power supply company. The real-time temperature on the same day, which was collected every 10 min, was provided by the Jiangsu Provincial Meteorological Bureau. In Figure 19, the top blue curve is the 96 points load characteristic curve of the customers in the area on the maximum load day. We simulated the load values each second, by using the method of spline interpolation. Peak hours are from 10:30 a.m. to 16:00 p.m. and from 20:00 p.m. to 22:00 p.m. During these periods, the electricity demand outstrips supply, and a power shortfall will appear. As can also be seen, a low load period is from 4:00 a.m. to 8:00 a.m. The maximum load is 5.75 MW and the minimum load is 3.51 MW, and the load peak and off-peak difference is 38.96% of the maximum load. The bottom red curve in Figure 19 is for the baseline load of 18,000 ACs. The curve is obtained by simulating the two order linear time invariant transfer function model, which is based on the parameters in Table 1 and the ambient temperature curve in Figure 19. The total load characteristic curve minus the AC load curve based on the TF model is the green curve of the non-air conditioning load, which is in the middle of the figure.

The population consists of 18,000 ACs. Assuming that at the initial moment, 44.6% of the ACs are on, while the rest of them are off, the whole load control scenario is divided into two stages. The first stage is from 12:00 p.m. to 16:00 p.m., when the grid is in a peak load period. We decide to cut the peak load of ACs to 2 MW. The load aggregator will raise the temperature set point of the ACs to achieve peak load shifting. The second stage takes place between 4:00 a.m. and 8:00 a.m., when the peak load period of the power grid is over, we decide to increase the load of ACs to 1.2 MW to maintain the power consumption of the trough period. The load aggregator will drop the temperature set point of the ACs to realize users’ comfort recovery.

In this scenario, the two order transfer function model of air conditioning is no longer linear time invariant, and instead, it is changing with time. The model parameters vary with the outdoor temperature in the case of equivalent thermal resistance, thermal capacitance and other parameters remaining unchanged.

**Figure 19.**24 h power load of a downtown area of Nanjing, China where there are 18,000 ACs of 10,000 residents operating on the hot day 5 August 2014.

There are two ways to solve this problem. This paper mainly focuses on the load control of ACs to achieve peak load shifting. Since the peak load duration is not long, the first method takes the average of the ambient temperature at intervals of half an hour within the required period of peak load shifting. In less than half an hour, it can be assumed that the ambient temperature is constant. During the period when ACs are participating in demand response, the change of the ambient temperature is not dramatic, especially for the existence of the heat island effect in the city center area. Therefore another method calculates the parameters of the transfer function whenever the outdoor temperature changes 0.5 °C. If the temperature variation is within 0.5 °C, the transfer function of the model is believed to remain unchanged.

In this paper, we adopt the second method. According to the different ambient temperature, the two order transfer function parameters are shown in Table 4. The numbers in Table 4 are subsequently calculated by using Equations (21)–(27). The relevant AC parameters used in the calculation can be found in Table 2. In the process of calculation, the ACs’ other parameters are as follows:
$R~LN(2,\text{\hspace{0.05em}\hspace{0.05em}}{0.4}^{2})$,
$C~LN(3.6,\text{\hspace{0.05em}\hspace{0.05em}}{0.72}^{2})$
and
$P~LN(6,\text{\hspace{0.05em}\hspace{0.05em}}{1.2}^{2})$, all of which remain unchanged.
${\sigma}_{rel}=0.2$. The period when ACs could be controlled by the load aggregator is from 4:00 a.m. to 8:00 a.m. and from 12:00 p.m. to 16:00 p.m. Thus, according to the real-time ambient temperature on the warmest day, 5 August 2014, the research scope is identified as (28 °C, 32 °C) and (34 °C, 36 °C).

Figure 20 illustrates the effect of the AC load control based on the PSO tuning parameters of the PID controller for load shifting on a hot day when the ambient temperature continues to change. In Figure 20a, the upper blue curve represents the aggregated power 18,000 ACs without any control, the middle red dashed curve is the desired AC load reference value for load shifting, and the solid black line at the bottom represents the actual output power of AC load based on PSO tuning parameters of the PID controller. Figure 20b,c is obtained by zooming in on the parts circled by a dotted curve in Figure 20a. They show the effects of increasing the power output from 4:00 a.m. to 8:00 a.m. and reducing the power output from 12:00 p.m. to 16:00 p.m, respectively. Figure 20d shows the probability density distribution of the tracking error between the actual output and the reference value.

Ambient Temperature (°C) | D_{ss}(θ) | r | ξ | ω_{n} | b_{0} | b_{1} | b_{2} |
---|---|---|---|---|---|---|---|

28 | 0.285 | 0.431 | 0.259 | 0.022 | 0.168 | 0.007 | 0.285 |

28.5 | 0.303 | 0.431 | 0.259 | 0.023 | 0.190 | 0.007 | 0.303 |

29 | 0.321 | 0.431 | 0.259 | 0.024 | 0.213 | 0.008 | 0.321 |

29.5 | 0.339 | 0.431 | 0.259 | 0.026 | 0.237 | 0.008 | 0.339 |

30 | 0.357 | 0.431 | 0.259 | 0.027 | 0.263 | 0.009 | 0.357 |

30.5 | 0.375 | 0.431 | 0.259 | 0.028 | 0.290 | 0.010 | 0.375 |

31 | 0.393 | 0.431 | 0.259 | 0.030 | 0.318 | 0.011 | 0.393 |

31.5 | 0.411 | 0.431 | 0.259 | 0.031 | 0.347 | 0.011 | 0.411 |

32 | 0.429 | 0.431 | 0.259 | 0.033 | 0.378 | 0.012 | 0.429 |

34 | 0.500 | 0.431 | 0.259 | 0.038 | 0.515 | 0.016 | 0.500 |

34.5 | 0.518 | 0.431 | 0.259 | 0.039 | 0.552 | 0.017 | 0.518 |

35 | 0.536 | 0.431 | 0.259 | 0.041 | 0.591 | 0.018 | 0.536 |

35.5 | 0.554 | 0.431 | 0.259 | 0.042 | 0.631 | 0.019 | 0.554 |

36 | 0.571 | 0.431 | 0.259 | 0.043 | 0.672 | 0.019 | 0.571 |

Based on the discussions above, one can draw the conclusion that through the PID controller based on the PSO algorithm, the output power of 18,000 ACs can be controlled by adjusting the temperature set point offset. Throughout the control period, the output power of the air conditionings has been following the reference value closely, and the tracking error is small. During peak hours, the load aggregator can reduce the power of ACs by up to 6 MW, and maintain the total load of n ACs at about 20 MW. To some extent, the power shortage has been eased. In peak-off hours, the load aggregator can increase the power of ACs by 4 MW to make the load curve smoother, and maintain the total load of n ACs at about 12 MW.

Figure 21 shows the variation of ACs’ temperature set point offset, which is also the control signal of the two order transfer function model for the air conditioning group. The range of air conditioning set point temperature is [−0.4 °C, 0.95 °C]. Figure 22 shows the variation of the indoor temperature of 30 random ACs. The hysteresis width of the room temperature, which varies with the air conditioning temperature set point u(t), has remained unchanged H = 1 °C. The figure illustrates such a process: the ACs’ temperature set point can be controlled by the load aggregator who sets a higher value to reduce the load as well as setting a lower value to increase the load. The variation range of the indoor temperature is [19.1 °C, 21.4 °C]. Therefore, load control can be achieved without affecting human comfort level.

**Figure 20.**(

**a**), (

**b**), (

**c**) A comparison between the aggregated power of 18,000 ACs without any control, the desired AC load reference value for load shifting, and the actual output power of AC load based on PSO tuning parameters of the PID controller. (

**d**) Probability density distribution of the tracking error between the actual output power and the reference value. The model is simulated for a hot day, and the ambient temperature continues to change.

At 16:00, when the load control period is over, the temperature set point offset does not return to 0. Instead, it continues changing (in Figure 21) and the room temperature does not directly return to the initial value [19.5 °C, 20.5 °C] (in Figure 22). The reason for this phenomenon is that, within the short time for the air-conditioning chillers to restart after shutdown, the power demand is usually significantly higher. This is the pattern of the air conditioning which makes the load rebound before and after the load control event. In order to bring the load curve back to the state before controlling, such as the curve after 16:00 p.m. in Figure 20a, a continuous control is required for some time after the load management.

The novelty provided in this section is as follows: in the variable ambient temperature scenario, the two order transfer function model of air conditioning is no longer linear time invariant, and instead it changes over time. The model parameters vary with the outdoor temperature. This paper puts forward two suggestions to solve this problem, and we adopt the second one.

## 6. Conclusions

This paper presented the design of a closed-loop control strategy for air conditioning loads to participate in load control. A core contribution in this paper is to present the aggregated power demand of the AC population by describing how the proportion of operating ACs varies over time, in response to a step shift in the temperature set point of all ACs. Assuming that the thermal capacitances are distributed log-normally among ACs, a formula for the transient response to a temperature set point offset was derived. The temperature and power of ACs experienced an underdamped oscillation after the temperature set point had risen by 0.5 °C. By observing this phenomenon, we can use a simplified second-order dynamic model to approximate the air conditioning group. As far as we know, this is the first work to characterize a mathematical approximation for the period of such response. Based on the above work, a simplified control model based on the two order linear time invariant transfer function was derived.

Another contribution of this paper was the application of the closed-loop control and feedback strategy to provide a new way for flexible loads like air conditioning to be involved in demand response. In the feedback control strategy, the error between the expected demand reference value and the actual power of the AC group were used as an input variable for the controller. The output of the controller was the offset of the temperature set point, which was also the control signal of the AC group.

A simulation model for controlling the offset of the temperature set point was developed to verify that the proposed transfer function model and control strategy can closely track the reference peak load shifting curves. Two scenarios were selected for the simulation, including the constant ambient temperature and the variable one. The simulation results demonstrated the effectiveness of the controller design. The control model could lower electricity demand during peak hours effectively, fill the gap between peak and off-peak loads, and balance the supply and demand of electricity. The proposed closed-loop control strategy provided a new way for flexible loads to participate in demand response.

## Acknowledgments

This research was supported by the National Natural Science Foundation of China (71471036, 51277028) and the S&T Foundation of State Grid Corporation of China (DZ71-14-042).

## Author Contributions

Xiaoqing Hu designed the model and performed the simulations. Xiaoqing Hu and Beibei Wang analyzed the data. Shengchun Yang, Taylor Short and Lei Zhou have proposed the research topic and provided materials and analysis tools. All authors contributed to the writing of the manuscript, and have read and approved the final manuscript.

## Conflicts of Interest

The authors declare no conflict of interest.

## Appendix A. Proofs and Derivations

The initial transients of the AC’s output in the response to a step change in temperature set point displays an oscillation whose period is:

$$T\approx 2/{\mu}_{v}$$

The amplitudes of the oscillation decay with time, as well as having an envelope bound:
in which:

$$1-\text{erf}(1/z(t))\le A(t)\le \text{erf}(1/z(t))$$

$$z(t)=2\sqrt{2}{\sigma}_{rel}({\mu}_{x}(0)+{\mu}_{v}t-1/2)$$

After a semi-period
$T/2$, we obtain
${z}_{2}={z}_{1}(t+1/{\mu}_{v})$, applying Equation (A3),
${z}_{2}={z}_{1}+2\sqrt{2}{\sigma}_{rel}$. According to Section 3.1, the duty cycle is 0.5, so the ratio between the distance of two successive peaks that we call
${D}_{k+1}$
and
${D}_{k}$
is:

$${D}_{k+1}/{D}_{k}=\frac{\left|\text{erf}\left(\frac{1}{{z}_{1}+2\sqrt{2}{\sigma}_{rel}}\right)-0.5\right|}{\left|\text{erf}\left(\frac{1}{{z}_{1}}\right)-0.5\right|}$$

Proposing z

_{1}= 0.9 and applying Equation (A4), we have:
$${D}_{k+1}/{D}_{k}=\frac{\left|\text{erf}\left(\frac{1}{0.9+2\sqrt{2}{\sigma}_{rel}}\right)-0.5\right|}{\left|\text{erf}\left(\frac{1}{0.9}\right)-0.5\right|}$$

The damping factor:
can be calculated, where:

$$r=\mathrm{exp}\left[\frac{-\pi \xi}{\sqrt{1-{\xi}^{2}}}\right]$$

$${\xi}^{2}=\frac{{\mathrm{log}}^{2}(r)}{{\pi}^{2}+{\mathrm{log}}^{2}(r)}$$

From Equation (A2) we can calculate the undamped natural frequency as:
which yields:

$${\omega}_{n}=\frac{{\omega}_{d}}{\sqrt{1-{\xi}^{2}}}$$

$${\omega}_{d}=\pi {\mu}_{v}$$

The above are parameters of the denominator of the transfer function. Next we calculated parameters of the numerator. D(t) is the expected value of the expression
${T}_{on}/({T}_{on}+{T}_{off})$
when the system is in steady state. In which
${T}_{on}$
and
${T}_{off}$
depend on the reference temperature
${\theta}_{ref}=\left({\theta}_{+}+{\theta}_{-}\right)/2$. Therefore:
and:

$${T}_{on}\left({\theta}_{ref}\right)=CR\mathrm{log}\left(\frac{PR+{\theta}_{ref}+H/2-{\theta}_{a}}{PR+{\theta}_{ref}-H/2-{\theta}_{a}}\right)$$

$${T}_{off}\left({\theta}_{ref}\right)=CR\mathrm{log}\left(\frac{{\theta}_{a}-{\theta}_{ref}+H/2}{{\theta}_{a}-{\theta}_{ref}-H/2}\right)$$

We replace these expressions in:
to obtain Equation (22). We assume
$Y(s)={G}_{p}(s)0.5/s$
and
${L}^{-1}\left\{Y(s)\right\}=y(t)$, Therefore, from the initial value theorem that is mentioned in [30], we get:

$${D}_{ss}\left({\theta}_{ref}\right)={T}_{on}\left({\theta}_{ref}\right)/\left({T}_{on}\left({\theta}_{ref}\right)+{T}_{off}\left({\theta}_{ref}\right)\right)$$

$${D}_{ss}\left({\theta}_{ref}\right)/2=y\left({0}^{+}\right)=\underset{s\to \infty}{\mathrm{lim}}0.5{G}_{p}(s)=0.5{b}_{2}$$

Then we have:

$${D}_{ss}\left({\theta}_{ref}\right)={b}_{2}$$

Besides, from the final value theorem in [30], we obtain:

$${D}_{ss}({\theta}_{ref}+0.5)-{D}_{ss}({\theta}_{ref})={y}_{\infty}=\underset{s\to \infty}{\mathrm{lim}}0.5{G}_{p}(s)\text{=}0.5{b}_{0}/{\omega}_{n}^{2}$$

Then:
$${b}_{0}=\frac{{\omega}_{n}^{2}\left({D}_{ss}\left({\theta}_{ref}+0.5\right)-{D}_{ss}({\theta}_{ref})\right)}{0.5}$$

According to the Laplace transform of a derivative and the initial value theorem, we obtain:

$$\stackrel{\xb7}{y}\left({0}^{+}\right)=\underset{s\to \infty}{\mathrm{lim}}0.5{G}_{p}(s)-0.5{b}_{2}\text{\hspace{0.05em}\hspace{0.05em}}=0.5\left({b}_{1}-2{b}_{2}\xi {\omega}_{n}\right)$$

where:

$${b}_{1}=\stackrel{\xb7}{y}\left({0}^{+}\right)/0.5+2{b}_{2}\xi {\omega}_{n}$$

$$\begin{array}{l}\frac{y({0}^{+}+\text{\Delta}t)-y({0}^{+})}{\text{\Delta}t}=-\frac{(0.25-0.25{\mu}_{v}\text{\Delta}t)-0.25}{\text{\Delta}t}=0.25{\mu}_{v}\end{array}$$

Therefore

$${b}_{1}=0.5{\mu}_{v}+2{b}_{2}\xi {\omega}_{n}$$

## Appendix B. The Principle of the PSO Algorithm

Assuming that the particle swarm contains i particles, the information of the particle i$(i\in \{1,2,\mathrm{...},l\})$
can be represented by the D-dimensional vector which indicates the number of parameters that need to be optimized.
${\text{x}}_{i}=({x}_{i1},{x}_{i2},\mathrm{...},{x}_{iD})$
represents the space position, and
${\text{v}}_{i}=({v}_{i1},{v}_{i2},\mathrm{...},{v}_{iD})$
represents the speed. After the two optimal solutions
${p}_{i,best}$
and
${g}_{i,best}$
are obtained, the particle swarm updates the velocity and position according to Equations (B1) and (B2):

$${v}_{i}(t+1)=\omega {v}_{i}(t)+{c}_{1}{r}_{1}({p}_{i,best}(t)-{x}_{i}(t))+\text{\hspace{0.05em}\hspace{0.05em}\hspace{0.05em}}{c}_{2}{r}_{2}({g}_{i,best}(t)-{x}_{i}(t))$$

$${x}_{i}(t+1)={x}_{i}(t)+{v}_{i}(t+1)$$

In the above formulas,
${v}_{i}(t)$
is the speed of particle i in the D-dimensional space at the time t, and
${x}_{i}(t)$
is the position of the particle i in the D-dimensional space at the time t.
${p}_{i,best}(t)$
represents the optimal solution of a single particle i itself, and
${g}_{i,best}(t)$
represents the optimal solution of the whole group.
${c}_{1}$
and
${c}_{2}$
are the acceleration factors and their general values are between (0, 2).
${r}_{1}$,
${r}_{2}$
are random functions, scaling values range from 0 to 1.
$\omega $
is a non-negative weight, which affects the overall optimization ability. Figure 10 shows the flowchart of the PSO algorithm tuning PID controller parameters. The complete optimization procedure is as follows:

Step 1: Initialize the PSO’s population size, maximum number of iterations, the learning factor, as well as the initial position and velocity of particles.

Step 2: Choose the integrated time and absolute error (ITAE) as the fitness function. Calculate the fitness of each particle, find out the best individual in the initial particle swarm optimization, and initialize it as the best particle
${g}_{i,best}(t)$
in the group. Besides, the fitness of the particles themselves are taken as the initial value of the particle’s individual optimal
${p}_{i,best}(t)$.

Step 3: If the current fitness is better, take the current position of the particle as the best position
${p}_{i,best}(t)$. If the fitness of the particle’s optimal position is higher than that of the swarm’s optimal position, then take the optimal position of the particle as the best position
${g}_{i,best}(t)$
of the population.

Step 4: Adjust the speed and position of each particle according to the Equations (B1) and (B2).

Step 5: The terminating condition is that a predetermined maximum number of iterations or the lower limit of fitness has been reached. Otherwise, go to Step 3.

Step 6: Output the global optimal particles which are best parameters of the PID controller.

## References

- Weckx, S.; D’hulst, R.; Driesen, J. Locational pricing to mitigate voltage problems caused by high PV penetration. Energies
**2015**, 8, 4607–4628. [Google Scholar] [CrossRef] - Faria, P.; Vale, Z.; Baptista, J. Demand response programs design and use considering intensive penetration of distributed generation. Energies
**2015**, 8, 6230–6246. [Google Scholar] [CrossRef] - Moghaddam, M.P.; Abdollahi, A.; Rashidinejad, M. Flexible demand response programs modeling in competitive electricity markets. Applied Energy
**2011**, 9, 3257–3269. [Google Scholar] [CrossRef] - McIntyre, J.M.; Ciecior, L.; Kaspar, A.; Castrop, D. Distributed intelligence in load control, results of an experiment using demand limiting devices for residential load control. IEEE Trans. Power Appar. Syst.
**1985**, 5, 1140–1146. [Google Scholar] [CrossRef] - Palensky, P.; Dietrich, D. Demand side management, demand response, intelligent energy systems, and smart loads. IEEE Trans. Ind. Inform.
**2011**, 7, 381–388. [Google Scholar] [CrossRef] - Yao, L.; Lu, H.R. A two-way direct control of central air-conditioning load via the internet. IEEE Trans. Power Deliv.
**2009**, 24, 240–248. [Google Scholar] [CrossRef] - Zheng, J.H.; Zhu, S.Z.; Wang, G.; Wang, X.Y. Key characteristics and modeling of air conditioner load. Proc. CSEE
**2011**, 10, 67–73. (In Chinese) [Google Scholar] - Middelberg, A.; Zhang, J.; Xia, X. An optimal control model for load shifting-with application in the energy management of a colliery. Appl. Energy
**2009**, 86, 1266–1273. [Google Scholar] [CrossRef] - Manichaikul, Y.; Schweppe, F.C. Physically based industrial electric load. IEEE Trans. Power Appar. Syst.
**1979**, 4, 1439–1445. [Google Scholar] [CrossRef] - Galiana, F.D.; Handschin, E.; Fiechter, A.R. Identification of stochastic electric load models from physical data. IEEE Trans. Autom. Control
**1974**, 19, 887–893. [Google Scholar] [CrossRef] - Yu, N.; He, D.; Li, G. Decision factors and classification model of demand response. J. Northeast Univ.
**2011**, 4, 112–116. [Google Scholar] - Lu, N.; Chassin, D.P.; Widergren, S.E. Modeling uncertainties in aggregated thermostatically controlled loads using a state queueing model. IEEE Trans. Power Syst.
**2005**, 20, 725–733. [Google Scholar] [CrossRef] - Meliopoulos, A.; Polymeneas, E.; Tan, Z. Advanced distribution management system. IEEE Trans. Smart Grid
**2013**, 4, 2109–2117. [Google Scholar] [CrossRef] - Mcdaniel, G.H.; Gabrielle, A.F. Load diversity—its role in power system utilization. IEEE Trans. Power Appar. Syst.
**1965**, 84, 626–635. [Google Scholar] [CrossRef] - Perfumo, C.; Kofman, E.; Braslavsky, J.H.; Ward, J.K. Load management, model-based control of aggregate power for populations of thermostatically controlled loads. Energy Convers. Manag.
**2012**, 55, 36–48. [Google Scholar] [CrossRef] - Malhamé, R.; Chong, C.Y. Electric load model synthesis by diffusion approximation of a high-order hybrid-state stochastic system. IEEE Trans. Autom. Control
**1985**, 30, 854–860. [Google Scholar] [CrossRef] - Callaway, D.S.; Hiskens, I. Achieving controllability of electric loads. Proc. IEEE
**2011**, 99, 184–199. [Google Scholar] [CrossRef] - Zhang, Q.; Wang, X.; Bie, Z.; Wang, J. A decision model of direct load control in electricity markets. Autom. Electr. Power Syst.
**2010**, 34, 23–28. [Google Scholar] - Callaway, D.S. Tapping the energy storage potential in electric loads to deliver load following and regulation with application of wind energy. Energy Convers. Manag.
**2009**, 50, 1389–1400. [Google Scholar] [CrossRef] - Collotta, M.; Messineo, A.; Nicolosi, G.; Pau, G. A dynamic fuzzy controller to meet thermal comfort by using neural network forecasted parameters as the input. Energies
**2014**, 4727, 4727–4756. [Google Scholar] [CrossRef] - Poli, R.; Kennedy, J.; Blackwell, T. Particle Swarm Optimization. Swarm Intell.
**2007**, 1, 33–57. [Google Scholar] [CrossRef] - Newsham, G.R.; Birt, B.J.; Rowlands, I.H. A comparison of four methods to evaluate the effect of a utility residential air-conditioner load control program on peak electricity use. Energy Policy
**2011**, 39, 6376–6389. [Google Scholar] [CrossRef] - Bode, J.; Sullivan, M.J.; Eto, J.H. Measuring Short-Term Air Conditioner Demand Reductions for Operations and Settlement; Lawrence Berkeley National Laboratory: Berkeley, CA, USA, 2012. [Google Scholar]
- Trelea, I.C. The particle swarm optimization algorithm: Convergence analysis and parameter selection. Inform. Proc. Lett.
**2003**, 317, 317–325. [Google Scholar] [CrossRef] - Jiang, M.; Luo, Y.P.; Yang, S.Y. Stochastic convergence analysis and parameter selection of the standard particle swarm optimization algorithm. Inform. Proc. Lett.
**2007**, 102, 8–16. [Google Scholar] [CrossRef] - Xue, D.; Chen, Y.; Atherton, D.P. Linear feedback control: analysis and design with MATLAB. International Journal of Systems Science
**2007**, 6, 979–984. [Google Scholar] - Kundu, S.; Sinitsyn, N.; Backhaus, S.; Hiskens, I. Modeling and Control of Thermostatically Controlled Loads. Available online: http://arxiv.org/abs/1101.2157 (accessed on 10 August 2015).
- Mehta, N.; Sinitsyn, N.A.; Backhaus, S.; Lesieutre, B.C. Safe control of thermostatically controlled loads with installed timers for demand side management. Energy Conver. Manag.
**2014**, 86, 784–791. [Google Scholar] [CrossRef] - Sinitsyn, N.A.; Kundu, S.; Backhaus, S. Safe protocols for generating power pulses with heterogeneous populations of thermostatically controlled loads. Energy Convers. Manag.
**2013**, 67, 297–308. [Google Scholar] [CrossRef] - Goodwin, G.C.; Graebe, S.F.; Salgado, M.E. Control System Design, 1st ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2000. [Google Scholar]

© 2015 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/4.0/).