A transmission optimization algorithm for smart load controllers

: This paper introduces a transmission optimization algorithm for wireless transmissions between smart load controllers and a corresponding gateway in wireless personal area networks, where smart load controllers connect several electrical appliances through their corresponding load interfaces, measure the power consumption from each electrical appliance connected to the load controller, and control on/off switching through its load interface. The aim of this paper is to reduce the traffic load of power consumption data in electrical appliances used in the building area network and the smart grid network. The proposed algorithm allows the smart load controller to efficiently reduce traffic load even if watt-hours calculated in the smart load controllers are the same as the watt-hours in the gateway and the errors of the present values of power consumption interpreted in the gateway fall under the typical tolerance allowed in the specifications of manufacturers of watt-hour meters used in the electrical power industry.


Introduction
The emergence of electric vehicles and increased use and popularity in smart electrical appliances has brought forward the importance of appropriate energy management methods as well. Meeting electricity demands has its share of problems and difficulties because infrastructural development and overhaul for electricity generation, transmission, and distribution are so costly. Carbon emission and its effects on the environment have become an important international issue. Active research and development is underway to provide effective and efficient energy consumption and management methods. The smart grid emerges as the next-generation electrical power grid, with its capability to adapt and optimize power generation, distribution, and consumption [1]. In a smart grid, there is an intelligent electricity network that integrates the actions of all users connected to it and makes use of advanced information, control, and communications technologies to save energy and reduce cost [2]. It can control intelligent appliances in consumers' buildings to save energy and consumers can be informed of how much power they are using so that they can control their power consumption [3]. The data on power consumption will be utilized to optimize both power supply and distribution.
Advanced metering infrastructure (AMI) and the Internet are very important factors in smart grids [1]. As a part of a smart grid, the building energy management system (BEMS) gathers energy usage and power demand from the building's energy-consuming equipment using smart meters, allowing users to monitor pertinent values such as electrical energy consumption that affect the amount and rate of energy savings. In an energy management system, a load controller measures power consumption from each electrical appliance connected to it through a load interface. A wireless mesh network can be established among load controllers of electrical appliances and a gateway (e.g., ZigBee). A smart meter gathers the data on power demand in electrical appliances through the gateway. The AMI is responsible for gathering and transmitting consumption data delivered from distributed smart meters to the utility control center as well as for relaying a demand response (DR) signal for pricing information from the utility control center back to the smart meters in almost real time [4,5]. The load controller can switch power on or off to electrical appliances, subject to the DR signal transmitted by the gateway.
The quality of service (QoS) of BEMS traffic is an important issue because the historical data of power demand can be incomplete and outdated due to the loss and delay of data transmitted from electrical appliances [6]. When more appliances are added to the network or the smart meters gather the power consumption data more often, more BEMS traffic is generated. When packets generate increasingly, packet delay and loss grow considerably and degrade the QoS of the network, which incurs additional costs for the overall system of the smart grid [4].
The aim of the algorithm proposed here is to reduce traffic load and increase QoS in the wireless network by optimizing network traffic. This paper, in order to further improve the QoS for BEMS traffic, introduces a new architecture for smart load controllers that are used for the experimental testbed of the algorithm, though the performance improvement of the architecture is not fully analyzed. The results show that the proposed algorithm decreases data transmissions efficiently. It should be noted that the errors of the present values of power consumption fall under the typical tolerance and comply with the specifications of manufacturers of watt-hour meters used in the electrical power industry, and watt-hours calculated in the smart load controllers are the same as the watt-hours in the gateway.

Related works
As conservation emerges as a global issue, various technical studies have been conducted to monitor and manage the power consumption of electrical appliances using power outlets via a ZigBee network. A power metering system was designed to provide intelligent energy monitoring and control services for users [7]. A new home energy control system was presented for sensing and control purposes [8]. A wireless power-controlled outlet module for domestic demand response and energy management was developed [9]. An intelligent device-level residential energy monitoring and controlling platform was presented based on interactive outlets, and it can immediately switch off the power or notify a user to manually switch it off remotely [10]. These studies present and implement various power outlets with a single socket, which monitors the power consumption of an electrical appliance.
DR is a component of the smart grid and manages to balance the load between production and consumption. The demonstration of a home energy management system (HEMS) was presented for residential DR applications [11]. A wireless smart grid testbed was designed to analyze and evaluate research issues such as real-time DR [12]. An advanced HEMS with a nonintrusive load monitoring technique was proposed for effectively scheduling major electrical appliances in response to DR [13]. These studies present and implement various load controllers such as ZigBee-based smart plugs and load control relay with a single socket, which are configured to smartly control loads based on utility DR signals. Outlets have multiple sockets to measure and control the power consumption of each socket, so that an outlet can monitor and manage the power consumption of several appliances in response to DR programs [14].
However, data that suffer from long latency from processing or communication risk going obsolete, and wrong decisions can be made in energy monitoring and DR applications. Satisfying QoS requirements (e.g., bandwidth and delay constraints) for smart grid applications based on M2M communications raises significant challenges. As the network design approach, the optimal HEMS traffic concentration was proposed for minimizing QoS degradation [3]. In wireless relay and base station levels, a cooperative transmission scheme for meter data collection in a smart grid was proposed so that transmission delay and loss could be minimized [4]. Data fusion and localized processing can be used to satisfy the QoS requirements in energy monitoring and DR. This allows the sensor node to filter the raw sensed data instead of sending them to the sink node directly. However, there is little research on data fusion and localized processing pertaining to the subject of energy monitoring and DR.

Overview
A BEMS shares information signals from electrical appliances including the demand state of the electrical appliances and power consumption with smart meters. The demand status and power consumption data are sent from the smart meters of each building to a concentrator for measurement data, which relays them to a wide area network (WAN) base station. The WAN base station provides coverage over a service area with multiple buildings. The base station then transmits BEMS traffic to a utility control center, where it is processed and stored. As wireless communications for the smart grid will connect a number of electrical appliances and systems together, the optimal network design is an important issue [6]. The network architecture and design, while minimizing packet loss and delay of smart grid communications, has to meet QoS requirements for smart grid application and traffic.
As the smart meter directs information such as power consumption data and demand status towards the utility control center, a contract is established between the utility control center and generators over periodic intervals (e.g., hourly) to purchase power supply. Through this, a power generator can determine the power price for the customer, given the predicted total power demand from all electrical appliances within the coverage area. It must be noted that the loss and delay of packets sent by electrical appliances can cause the historical energy usage data to be incomplete and out of date. Therefore, the collected energy usage data can differ from predicted values. Supplied power is wasted if the estimated values exceed actual demand. However, if actual demand exceeds the estimated values, then additional power will be necessary. Packet delays and losses can adversely affect demand estimation and incur additional costs for consumers. To avoid this, BEMS traffic should adhere to QoS requirements as it is foundational to the optimal network design with localized processing for data fusion. Outlined below are two solutions to improve the QoS for BEMS traffic.

Reduce the number of transmission nodes in BAN
By reducing the communication nodes that form the mesh network, the probability of data collision and routing overhead are greatly lowered. To achieve this, smart load controllers should be built with communication nodes that control and measure electrical power in each load interface. In a wireless mesh network of the BAN, a network node sends electric consumption data from the electrical appliance to the gateway. As the number of network nodes increases in the wireless mesh network, routing overheads such as packet delay, packet loss rate, route discovery delay, memory use, and broadcast cost proportionally grow. The increase in communication nodes affects the topology; instead of forming in chains, the nodes form in rectangles. This form increases data collision probability, thus increasing link failure probability as well [9]. A link failure can cause an increase in routing overhead. In the case of ad hoc on-demand distance vector (AODV) routing protocols (commonly used in wireless mesh networks), route request (RREQ) messages are broadcast, but such broadcasts can use a large amount of bandwidth and could potentially cause a broadcast storm problem [15]. Memory for the routing tables is also a burden for low-cost ZigBee devices. An increase in communication nodes means an increase in route discovery. This depletes the routing table's memory and leads to rapid deterioration of routing performance [16].
The proposed smart load controller includes multiple load interfaces and only one network node as a load controller in the wireless network. The load controller measures the electrical power consumption for each electrical appliance plugged into the load interface and conducts its on/off control individually. It also transmits the measured data and status information to the gateway and receives commands from it. Compared to single load interface architecture, the smart load controller architecture reduces the number of nodes as additionally many load interfaces as employed, compared to single load interface architecture.

Reduce the amount of transmitted metered data from home appliances
The data transmission between electrical appliances and a smart meter in a BEMS is reduced so that degradation of QoS from a packet delay and loss can be minimized. The proposed algorithm aims to minimize the number of packets and the packet size of the metering data of electrical appliances. The electrical energy consumption values stored in the smart meter can be updated with readings from electrical appliances, but only as needed. This way, barring acceptable margins of error for the present value of electrical power consumption of the electrical appliance, the smart meter retains its correct values for electrical energy consumed in electrical appliances.

Smart load controller architecture
A new architecture for smart load controllers is proposed, as shown in Figure 1. For the reasons mentioned in the above section, the smart load controller can measure the power consumption of each electrical appliance connected to it through the load interface and control its on/off switching to satisfy the requirements of the metering and DR on the smart grid. A legacy load controller allows multiple electrical appliances to be powered from its load interfaces and is often used when many electrical appliances such as refrigerators, fans, hair dryers, desktop computers, or TVs are in close proximity. To measure the power consumption of the load interface individually, every load interface needs to have its own electrical power measurement module. However, the individual use of the electrical power measurement module for each load interface creates a more complex circuit structure and higher device costs. Therefore, this paper introduces a new smart load controller architecture, which has only one electrical power measurement module for multiple load interfaces. The architecture allows power consumption measurements in every load interface by multiplexing the measured current data among all load interfaces.
Current transformer (CT) sensors are used for measuring the alternating current of each load interface.
The voltage sensor measures the voltage at all load interfaces. Each analog-to-digital converter (ADC) digitizes the output of its corresponding CT sensor or the voltage sensor on every clock signal and stores it in its corresponding register. At regular intervals of multiple periods, the measured current data are multiplexed into the electrical power measurement module, which calculates the consumed electrical power with the power factor for each load interface. A ZigBee transceiver transmits the calculated information to the metering gateway, which functions as the coordinator, and receives control signals wirelessly. Each latching relay turns its load interface on or off The smart load controller architecture decreases the number of transmitter nodes in the wireless network by holding a load controller for multiple load interfaces, which reduces the wireless network overheads as incurred in media access control and routing and increases the performance of the network. A load interface senses the instant current and connects or disconnects an electrical appliance by switching it on or off, respectively. This can be implemented with an outlet, a switch, or connection terminals. Smart load controllers that aggregate the demand data from several appliances can communicate with the gateway in the BAN, and users can monitor the information and send a control signal for on/off switching control of each load interface remotely through the gateway. The architecture has only one electrical power measurement module for multiple load interfaces. By multiplexing the measured current data among all load interfaces, the load controller is able to extract power consumption measurement in every individual load interface. The decrease in the number of electrical power measurement modules reduces the manufacturing cost and the size of the smart load controller.

Transmission optimization algorithm
The main focus of the proposed scheme lies in reducing network traffic load as much as possible while maintaining the same electrical energy value between the smart load controller and the gateway and minimizing the difference between the current and the transmitted power values. The smart load controller periodically measures the power consumption of each home appliance and decides whether to send or skip a transmission of power consumption data at regular intervals. If energy usage spikes and exceeds a specific threshold, called the transmission threshold, the smart load controller sends the calibrated data as well as, if needed, the error between the calibrated data and the electrical measured power. The calibrated data ensure the accuracy of the electrical energy consumption value between the smart load controller and corresponding gateway. Otherwise, if the fluctuation of energy usage is less than the transmission threshold, the smart load controller skips the transmission of the particular data. When the smart load controller skips data transmission for one or more periods of time, the gateway simply retains the last power consumption data transmitted. The proposed design significantly reduces traffic load by constraining the power consumption value as recognized by the gateway within acceptable margins of error. Between measurements, the smart load controller calculates the accumulated power difference and its ratio over the last transmitted power. The accumulated power difference d sum is the sum of the difference in each power value measured during the intervals between the last transmitted power, which is the last transmission session power value P (n -1), and the power consumption value that was measured in the smart load controller since the last transmission: where d i = M (i) − P (n -1) and M (i) is the electrical power consumption measured at time t = iT . If the accumulated power difference ratio d sum over the last transmission power value P (n -1) exceeds the transmission threshold x , the calibrated power data are transmitted to update the accumulated power values in the gateway. The calibrated data calculate the value by adding the mean of the accumulated power difference during the skip intervals s into its last transmitted power value P (n -1). The calibrated data are the mean of the power consumption during the skip intervals in the current transmission session n . Once the transmission decision based on the transmission threshold x is made, the smart load controller sends the calibrated data and, if needed, the error between the calibrated data and the current measured power only to ensure the accuracy of the instant power values present in the gateway. Otherwise, if the ratio is less than the transmission threshold, the smart load controller does not transmit data and the gateway retains the last power value transmitted.
The error rate between the measured power consumption, M (k) , and the last session value of electric power consumption, P (n -1), at time kT is defined as: where the current time kT exists within the transmission session n . The incremental error rate at time kT is calculated as: where the e (k) range is limited to [e min , e max ] . The transmission threshold x(k) at time kT is the function of the transmission threshold x (k -1) at time (k -1) T and the incremental error rate at time kT defined as: The threshold values are limited to the range [x min , x max ] . The step size of a threshold value by which the threshold value x changes as a unit is given as: where N x is the total number of steps in the threshold value x . λ e is the incremental error rate coefficient and is the size of e (k) , which changes the threshold x by ∆ x .
As incremental error rate e (k) increases at time kT , the transmission threshold x (k) decreases to allow the smart load controller a higher chance to transmit the calibrated data to the gateway. The greater the changes to the power consumption value, the more chances the transmission has. On the contrary, the opposite holds true. Any source of electronic noise, radio interference, and latency could potentially cause bit errors and lost or damaged packets, which result in packet errors. A smart load controller guarantees delivery of session data by using an acknowledgment (ACK) mechanism to make sure that the data are received by the gateway. If the smart load controller does not receive an ACK packet until the timer, called the retransmission timeout (RTO) timer, times out, it will retransmit the first previously sent and unacknowledged session data. The value of round-trip time (RTT) is a few milliseconds. The value of RTO is larger than 2*RTT and usually ranges in a few hundred milliseconds. In the proposed algorithm, the value of RTO is set to be 200 ms.
A smart load controller retransmits the session data of the packet {mN o, sN o, P (n)} when it assumes that the data have been lost: either no ACK packet has been received for the data and a timeout occurs or an ACK packet for other data has been received. The smart load controller performs a retransmission of what seems to be the missing session data up to three times in a row whenever a timeout happens. If more than three timeouts occur in a row, the smart load controller believes that the session data cannot be transmitted to the gateway due to a packet error in the network. The proposed algorithm is shown in Figure 2. The following summarizes the abbreviations used in the algorithm.

Description of abbreviations:
M (k) : Current power consumption measured at t = kT , where T is the basic measurement period and k = 0, 1, 2, 3 · · · . n : Session number that the current time t = kT belongs to. P (n) : Power consumption value to transmit for transmission session n .
s : Skip counter in the transmission session n , which adds up the numbers of continuous decisions on nontransmission since the last transmission. d sum : Accumulated power difference, which is the sum of the difference in each power value measured during the transmission session n, between the last session power value P (n -1) and the power consumption value that was measured in the smart load controller since the last transmission.

Power consumption pattern analysis
The measured data of power consumption share qualities of highly similar patterns with the power usage data values of an average household. The data rarely deviate from their previous values in time and thus The four types of power consumption patterns are shown in Figure 3. SL, SS, CW, and CN patterns are the data measured for 2 h from the fan, TV, refrigerator, and desktop, respectively. Power consumption patterns are characterized by their autocorrelation coefficients. To confirm the efficiency of the algorithm, the autocorrelation coefficient of the measured data of power consumption is identified. The autocorrelation coefficient, r (h) , is given as follows: where  As r (h) approaches the value of 1, the similarity between the value of the measurement data at any given time and the value that lags behind it by a measurement of h increases. Conversely, as r (h) approaches a value of 0, the similarity between the two values decreases. If r (h) is negative, the trend of the measurement data dictates that one of the two values is lower than the mean value of the measurement data and the other is higher. As r (h) increases in negative value, the range of changes in measurement data values is meant to increase.
In the case of SL and SS patterns, as the value of h increases, the change in value of r (h) is relatively slower than in the case of CW and CN patterns. The packet saving rates of SL and SS patterns can be relatively higher than the rates of CW and CN patterns. The r (h) values of the SS pattern change relatively faster than the r (h) values of the SL pattern. The SS pattern expects to have lower packets saving rates than the SL pattern. The r (h) of the CW pattern is higher than the r (h) values of the CN pattern as the value of h is increased to approximately 200, which means the similarity of the CW pattern within approximately every 200 different, consecutive measure times is larger than the similarity of the CN. The packets saving rate of the CW pattern can be higher than the packets saving rate of the CN pattern. Thus, the autocorrelation coefficients of the measured data for four types of power consumption patterns, as shown for home appliances of their models of each type, are highly related to their respective packets saving rates, which will be shown in the next section in greater detail.

Performance evaluation
The implementation of the proposed smart load controller is shown in Figure 5. The smart load controller is mounted on a plastic frame of a legacy outlet so that multiple electrical appliances can be powered from five load interfaces in the frame, and it embeds a printed circuit board that sends electrical consumption data of plugged appliances to the gateway and performs on/off controls based on command signals from the gateway.
The printed circuit board contains relays, CT sensors, an electrical power measurement module, and a ZigBee communication module. Table 1 shows the specification of the designed smart load controller. The standby power of the designed smart load controller is under 1 mW. The smart load controller conforms to the ZigBee Smart Energy Profile. The experiment for a test of measurement accuracy used a power meter test bench that includes a program-controlled power source and a built-in high-precision reference meter to evaluate the accuracy of power measurements in the smart load controller. The experimental environment is as follows: the power source of the power meter test bench, simulating a conventional home appliance as an electrical power load, is connected to an outlet on the smart load controller. Through a program, the power values are incrementally increased at 100-W intervals from 100 W to 2600 W. At every interval, the electrical power values of the reference meter are compared to the electrical power values of the smart load controller. The experiment was performed three times to acquire three distinct sets of data. The average measurement error between the electrical power values of the reference meter and the smart load controller was 0.15%.
Through experiments, the performance of the proposed algorithm was evaluated. The experiments involved using a smart load controller with the four types of power consumption patterns, SL, SS, CW, and CN, which are measured from a fan, a TV, a refrigerator, and a desktop computer, respectively, and monitoring the power consumption and data transmission of each home appliance separately. The range of threshold x is limited between 0.003 and 0.08, and the number of steps in threshold x , N x , is given as 100. The range of e (k) is set between -0.02 and 0.02. λ e is set for 0.025% of e (k) to change the threshold x by one step, ∆ x . Figure 3 and Figure 6 show the patterns of the measured and the transmitted power, respectively, from the smart load controller connected with the four types of appliances for a duration of 2 h. The total number of data measurements is 3600 due to the smart load controller measuring the data every 2 s. As the consumed power fluctuates largely, the smart load controller sends data frequently and accordingly. The watt-hours obtained through measurements in consumed power from the smart load controller are essentially equal in value to those obtained by the gateway. Figure 7 shows the total number of data transmissions against the transmission threshold values for each type of home appliance. Figure 8 shows the average error rate against the transmission threshold values for each type of home appliance. As the transmission threshold increases, the total number of data transmissions decreases, but the average error rate increases. Table 2 summarizes the average power consumptions, packet saving rates, and average error rates, which are the errors of the calibrated data over the measured electrical power of individual types of home appliances from the experiments. The average error rates are calculated as normalized root mean square error (NRMSE), given as: where n i is the number of the transmission session that the time iT belongs to.
In the case of the CN pattern, measured from the desktop, the frequent changes in power consumption cause the lowest packet savings rates. The packet savings rate of the CW pattern, obtained from the refrigerator, is higher than that of the CN pattern. On the other hand, the smaller and less frequent changes of power consumption observed in the SL pattern from the fan cause the largest packet savings rates. In the case of the SS pattern from the TV, the packet savings rate is slightly lower than that of the SL pattern from the fan. The proposed algorithm thus confirms that under high similarities in the measured data, the transmission of the measured data is proportionately decreased.
Data transmission occurs in every data measurement if the algorithm is not applied. With the proposed algorithm, transmission threshold becomes the key variable. As the transmission threshold increases, the total number of data transmissions decreases, but the error of instant power increases as shown in Figure 7 and Figure 8. Reduction of data transmissions lowers packet transmission rates, which is the total number of data transmissions over the total number of data measurements, expressed in a percentage value. As the transmission threshold increases, so does the average error rate as shown in Figure 8. Error tolerance in the standardized specifications of watt-hour meters by manufacturers usually tends to be within 1%. Power consumption patterns of electrical appliances can vary. Prior knowledge in power consumption patterns for electrical appliances is not needed, as threshold x (k) can be adaptively determined through the incremental error rate, e (k), at time kT . e (k) depends on the variability of the power consumption pattern.
As the change in power consumption increases at any given time, e (k) increases and x (k) decreases. Therefore, transmission becomes more frequent. Conversely, if the change in power consumption decreases at any given time, the transmission frequency decreases.
Some studies, considered to be state-of-the-art, have been shown to be effective in reducing traffic, which is crucial to future smart grids [17,18]. Regular intervals for measurement are chosen depending on different home appliances and measurement data are aggregated during the intervals before sending them. Best practices are identified for monitoring different home appliances based on their behavior in experiments [17]. A multiple interface management framework coordinates the operation between several interfaces based on tree-based mesh ZigBee topology supporting mesh and tree routing in a single network [18]. The proposed transmission method is based on reducing the transmission nodes in the building area network (BAN) and the amount of transmitted metered data from home appliances without prior knowledge of home appliance behavior or any multiple interface management framework.

Conclusion
This paper proposes a transmission optimization algorithm. This algorithm aims to increase QoS in the wireless metering network by optimizing network traffic and provide more reliability and efficiency with the smart grid. The smart load controller keeps transmitting the average of integrating watts during proper periods of time to the gateway only if the integrating power difference ratio exceeds the transmission threshold. The experimental results show that the smart load controller with the proposed transmission optimization algorithm efficiently reduces traffic load by 53%-92% even if watt-hours calculated in the smart load controllers are the same as the watt-hours in the gateway and the errors of the present values of power consumption interpreted in the gateway fall under the typical tolerance allowed in the specifications of manufacturers of watt-hour meters used in the electrical power industry. This paper introduces a new smart load controller architecture, which is used as a testbed for experiments of the proposed algorithm. For future work, the performance improvement of the architecture needs to be fully analyzed.