Real-time energy management system for public laundries with demand charge tariff

A building energy management system can be deﬁned as a building automation system that can facilitate demand response by controlling building-side energy resources. Here, a real-time Energy Management System (EMS) is developed to reduce the energy costs charged by the demand charge tariff for a speciﬁc commercial building that consists of a public laundry. The authors model the public laundry energy management problem as a multi-task scheduling problem and design a set of algorithms to heuristically control the operations of washing machines and clothes dryers by taking into account the customer-speciﬁed task requirements and the laundry owner’s budget. Numerical case studies are conducted to validate the proposed EMS.


INTRODUCTION
Thanks to the Advanced Metering Infrastructure (AMI), modern buildings possess the capabilities of interacting with the external power grid and performing Demand Response (DR) [1]. Through the bilateral communication channels of AMI, buildings can receive energy pricing and incentive signals from the utility and based on it, re-shape their energy consumption profiles.

Related works of building energy management system
As part of building automation technology, Building Energy Management Systems (BEMSs) [2] have drawn increasing attentions in recent years. Acting as the agent of the user, BEMSs interact with both the user and the grid to plan the operations of the building-side energy resources. In the literature, the development of BEMS has been widely studied and briefly outlined in the following. Some works [3][4][5][6] focus on developing BEMSs for residential buildings. For example, [3] optimally schedules plug-in hybrid vehicles and household appliances in a residential building to minimize the household's energy cost. [4] proposes a multi-stage home energy management system that minimizes the household's energy cost by considering predic-This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. © 2021 The Authors. The Journal of Engineering published by John Wiley & Sons Ltd on behalf of The Institution of Engineering and Technology tion errors of renewable energy and ambient temperature. [5] proposes a home energy management model based on vehicleto-home integration and occupant's indoor thermal comfort modelling. [6] proposes a load commitment model that determines the schedules of household's appliances by taking into account both time-varying tariff and the utility's load reduction instructions.
Other research works [7][8][9][10] design BEMSs for commercial and industrial buildings. [7] proposes a BEMS to improve energy efficiency and reduce energy cost for a commercial building with heating, cooling and electrical energy zones. [8] proposes an energy management scheme for an industrial building to reduce electricity cost by scheduling its cooling loads and local PV power sources. In [9], a predictive control algorithm is implemented in a commercial BEMS through neural networks, which maintains comfort thermal levels for the building. [10] proposes an adaptive strategy based on model predictive control for a commercial building with renewable energy generation, with the objective of reducing the building's energy cost.

FIGURE 1
Snapshot of a self-service public laundry [11] charge based on the maximum power recorded during an entire billing cycle. The typical billing cycle of DCT is usually a calendar month. This means that a customer would be charged by the DCT rate on the maximum power consumed over the whole calendar month. Some studies have been conducted on designing demand side energy management strategies with DCT. [13] develops an economic dispatch model for power generation resources in a microgrid with DCT penetration. [14] proposes a finite horizon based dynamic optimization model for scheduling the charging/discharging power of a battery energy storage system to control the customer's peak power and minimize the expected DCT charging cost. In the second and third authors' recent work [15], a heuristic home energy management scheme is proposed to manage appliances' operations, aiming at mitigating the risk of high DCT penalty.

Contribution of this paper
The main contribution of this paper is to investigate the energy management problem with penetration of DCT for a specific commercial building that is commonly seen in modern cities and that consists of public laundries ( Figure 1). To the best of the authors' knowledge, energy management of laundries has not been previously studied in the literature. A public laundry is a business entity that offers clothes washing and drying services to users through multiple on-site washing machines and clothes dryers (referred to as "machines" in this paper). This paper develops a BEMS that manages the operation of multiple washing machines and clothes dryers in a public laundry, so as to mitigate the high energy cost for the laundry owner while ensuring the quality of laundry services delivered to the customer. In the proposed BEMS, the daily operation environment of a public laundry is modelled as two coupled multi-task queues, that is, a cloth washing task queue and a cloth drying queue. A washing/drying task is defined as an electricity demand that lasts for a time period and requires a certain power level. Based on this, we develop a set of real-time control algorithms to manage the machines, with the aim of controlling the DCT cost to be within the laundry business owner's budget. By properly managing the public laundry's power consumption, the proposed method can enable the public laundry to contribute to the external grid's peak load control. The rest of this paper is organized as follows: Section 2 presents the modelling methodology of a public laundry's operational environment; Section 3 introduces the proposed laundry energy management system; Section 4 reports the simulation results; and the conclusion and future work are presented in Section 5.

MODELLING OF PUBLIC LAUNDRIES' OPERATIONAL ENVIRONMENT
The operation environment of a public laundry can be depicted as shown in Figure 2. The laundry consists of multiple washing machines and clothes dryers that provide services to public users. Users put clothes into an idle machine, set washing/drying task parameters and task deadlines, and monitor the tasks' progresses through the smartphone app. There is a Laundry Energy Management System (LEMS) that manages the operation of the machines through a wireless communication network (e.g. WiFi or Zigbee), aiming at optimizing the laundry's energy usage to mitigate the high DCT cost risk while satisfying the users' task requirements.
In this context, the energy management problem of a public laundry can be modelled as a multi-task control problem. In this section, the modelling methodology of the public laundry's operation environment is presented.

Modelling of public laundry
Consider a laundry with N machines. Denote the number of washing machines and clothes dryers in the laundry as N 1 and N 2 , respectively; therefore, N = N 1 + N 2 . Each machine is assigned with an index n, that is, n = 1, 2, …, N. Denote the index and total number of the laundry's control time interval as t and T, respectively, that is, t = 1, 2, …, T. Denote the duration of each time interval in terms of Δt (hour). The laundry is considered to be charged by the demand charge tariff. The DCT charges for the peak power consumption over a whole calendar month. That is, at the end of the billing month, the DCT cost (C dct ) is determined as: where andP represent the DCT rate ($/kW) and the peak power of the month (kW), respectively. As many BEMSs, the LEMS performs energy management on a daily basis. Since the DCT is charged for the peak power over the period of a month, it would be hard for the LEMS to estimate if the peak power in the current day would define the DCT cost that ends up being charged at the end of the month. Some works [13][14][15] perform energy management with one-day ahead predictions on renewable power load. From our viewpoint, this strategy can be hardly applied to the public laundry's operation environment because a public laundry's load, which depends on the public users' tasks, is highly stochastic and hard to predict in dayahead time scales. In this study, we adopt a budget-based strategy to cope with DCT in which the laundry owner is assumed to work against a budget (denoted as C budg for the monthly DCT payment). Based on this, the peak power threshold of the laundry (denoted as P lim ) subjected to the owner's budget is: The objective of the LEMS is then to control the laundry's peak power within P lim as much as possible.

Modelling of laundry machines
Both the washing machine and clothes dryer are considered to be interruptible, which means the machines can be paused and resumed at a later time. A machine can be turned off only after the task running in the machine completes. Each machine has three operational states, denoted as: 0-OFF, 1-PAUSED, and 2-RUN. Denote the state of the machine i at time interval t as s i,t , then there is For each machine, we assume that it consumes the rated power P rate i (kW) when it is running and the base power P base i when it is paused. The base power consumption remains often within a small amount (usually several watts). The machine consumes zero power when it is turned off.
For each washing machine, it is assumed it can have three operation modes: (1) normal wash mode, lasting for 30 min; (2) super wash mode, lasting for 40 min; (3) super plus wash mode, lasting for 1 h. These 3-mode settings are obtained from the washing machines in the public laundry of the Hillington Hospital, London. For each clothes dryer, the clothes drying task's duration is set by the user, which is an integer in the range of [20, 120] (in minutes).
Each machine is subjected to a minimum continuous online time constraint. That is, it cannot be paused/resumed too frequently, in order to protect the rotor of the machine: where on i,t −1 is the accumulated running time of the ith machine at time t-1; on,min i is the minimum online time threshold for the ith machine.

Modelling of laundry tasks
There are two types of tasks in a public laundry's business: washing task and drying task. It is assumed that there are a total of K tasks over the T time intervals, which form a task queue denoted can be defined for the kth task (k = 1:K) and it includes the following attributes: 1. task type ( k ), which is a binary variable. k = 0 means it is a washing task; k = 1 means it is a drying task; 2. machine index ( k ), which is an integer variable 1 ≤ k ≤ N indicating the machine that executes the task; 3. task duration (D k ), which is an integer variable indicating the duration of the task, measured as the number of time intervals. D k = {3, 4, 6} when k = 0; 2 ≤ D k ≤ 12 when k = 1; 4. task submission time (t 1 k ), which is an integer variable1 ≤ t 1 k ≤ T ; and 5. task deadline (t 2 k ), which is an integer variable indicating the time interval before which the task must complete. 1 ≤ t 2 k ≤ T and t 1 k + D k ≤ t 2 k ≤ T . Based on the above task properties, the Scheduling Margin of a task k at time interval t (denoted as g k ,t ) is defined and calculated as: where d k,t is the duration that the task has already been executed up to time interval t. In Equation (4), the numerator indicates how much time is left to reach the deadline, while the denominator indicates how much subtasks are left before completion.

REAL-TIME ENERGY MANAGEMENT SCHEME FOR PUBLIC LAUNDRY WITH DEMAND CHARGE TARIFF
In this section, the energy management scheme for the laundry is presented based on the modelling methodology of the laundry's operational environment. The overall objective of the LEMS is to decide the operational status of each machine at each time interval. More conveniently, for N machines, these decision variables can be expressed as a N × T -dimensional matrix S, where the entry s i,t represents the ith machine's state at time interval t. The LEMS determines S to make the total power consumption of the laundry below the threshold: where P total t is the total power consumption of the laundry at time t (kW), which is calculated as Equations (5) and (6). Equation (3) means that the EMS needs to ensure that in every time interval, the DCT charge cannot exceed the laundry owner's budget; Equation (4) ensures that all the washing/drying tasks can be completed before the task deadline.

Algorithm 1: Main workflow
The workflow of the proposed real-time energy management scheme for public laundry is shown in Algorithm 1. In the beginning. the algorithm initializes the laundry's operation environment (Lines 1-3). Then at each time interval, the algorithm checks if there are new tasks arrived (Line 5). If so, the algorithm handles the tasks with the ascending order of the task deadline (Lines 6-9). For each newly arrived task, the algorithm firstly checks if the host machine is turned on, whether the laundry's total power consumption would exceed the threshold P lim (Lines 10-12); if so, the algorithm executes a sub-routine (Algorithm 2) to temporarily pause one or more machines that are currently running tasks to maintain the laundry's total below the power threshold (Line 13); otherwise, the algorithm turns on the host machine and proceeds to handle the next task (Lines 15-17). When all the waiting tasks at the current time interval are handled, the algorithm moves to the next time interval and invokes a sub-routine (Algorithm 3) to update the machines' states. Above control logics repeat until the end of the control horizon is arrived (Lines 19-24).

Algorithm 2: Sub-routine for pausing machines
As shown in Algorithm 1, for a new task, if turning on its host machine would lead to the excess of P lim , a machine pausing sub-routine is invoked, which attempts to pause one or more running machines to regulate the total power consumption of the laundry. This sub-routine is presented in Algorithm 2. 6 Generate the set Sort the tasks in ′ with ascending order of the task deadline; 9 Get the next task i in ′ ; 10 Set s i ,t = 2; The algorithm firstly accepts the inputs passed from Algorithm 1 (Line 1); then, it selects the machines with the running state, that is, s i,t = 2 (Line 2). For each of these machines, the algorithm calculates the scheduling margin of the task that is running on it (Lines 3-5); then, the running machines are sorted with descending order of the calculated scheduling margins (Line 6). For each of the ordered machines, the algorithm checks if the machine's accumulated online time achieves the minimum required value; if so, the algorithm pauses the machine (Lines 7-12). Then, the algorithms checks if the total power consumption of the laundry is less than P lim ; if so, the algorithm outputs the machines' state matrix S (Lines 13-15); otherwise, it proceeds to the next running machine (Lines 16 and 17).

Algorithm 3: Sub-Routine for updating the machine status
In the main workflow, after handling the task queue in each time interval, a sub-routine is invoked to update the machines' states. The logics of the sub-routine is presented in Algorithm 3. Firstly, the algorithm accepts the inputs (Line 1); then, it sequentially checks the current state and task execution progress for each machine (Lines 2 and 3). For each machine that was paused in previous time intervals, if the task scheduling margin is equal to 1 (which means that the machine cannot be further paused to meet the task deadline), the machine state is set to 2 (Lines 4-7); if the task scheduling margin is larger than 1, the algorithm further checks if the total power consumption of the laundry is larger than the power threshold; if yes, the algorithm continues to pause the machine and sets its state to 1 (Lines [8][9][10][11][12][13][14].

Start
For each machine that is running a task, the algorithm checks if its task has been completed. If so, the algorithm turns off the machine (Lines 15-17); otherwise, the algorithm lets the machine continue the running of the task (Lines 18-20).
By combining the three algorithms, the overall procedures of the proposed energy management scheme for a public laundry is illustrated in Figure 3.

SIMULATION STUDY
Numerical simulations are conducted to validate the proposed LEMS and the results are reported in this section.

Simulation setup
The operating environment of a public laundry is simulated, including four commercial, 9 kg, heavy duty washing machines  and four 10 kg, heavy duty cloth dryers. The rated power of each washing machine and each clothes dryer is 2.05 and 4.6 kW, respectively. Some major specifications of the machines are shown in Table 1. A normal business day is considered, in which the energy management horizon is set between 8 a.m. and 8 p.m. The duration of a control time interval is set to be 10 min; there are thus totally 72 time intervals over the whole energy management horizon. One-day laundry tasks are simulated based on the information from a real-world public laundry [16], which is a queue consisting of multiple pairs of clothes washing and drying tasks. The DCT rate is set to be $8.03 kW/month. The DCT budget (C budg ) of the laundry owner is set to be $165, which means the power threshold is 20.5 kW.
To demonstrate the effectiveness of the proposed method, we compare the LEMS with a benchmark case without energy management. That is, for the benchmark case, each laundry machine starts to operate at the submission time of its hosted task and keeps on running until the task is completed. In the following, we denote the benchmark case and the proposed LEMS as Cases 1 and 2, respectively.

Scenario 1: Energy management with moderate tasks
A total of 62 laundry tasks are simulated in this scenario, which consist of 31 washing tasks and 31 drying tasks. The operation preference settings of the laundry washers and dryers are shown in Tables 2 and 3, respectively. By applying the proposed LEMS to the simulation settings, the power consumption and load profile are obtained. The laundry's numerical operation results are shown in table 4. It can be seen that with the proposed LEMS, the laundry's peak power consumption is largely reduced from 24.55 to 20.03 kW (18.41% reduction) compared to the benchmark case. As a result, the DCT cost is reduced from $197.14 to $163.01, meaning that it is successfully controlled within the budget (i.e. $165).
The total power consumption profiles of the laundry under both cases are shown in Figure 5. The details of the task operations and machine states are shown in Figure 4 where it can be seen that many new tasks are submitted at 10:20 a.m. To avoid exceeding the power threshold, Dryer 4 is paused at 10:20 am, and resumed after 20 min. The effect of this pausing action  is reflected in Figure 5, where the laundry's peak power consumption is reduced from 24.55 to 20.5 kW during the period between 10:20 a.m. and 10:40 a.m. During the following 20 min, Dryer 2 is paused because the scheduling margins of the task on this machine is larger than the one of the other machines. Similar task scheduling actions are performed on other machines at different instants in time.

Scenario 2: Energy management with intensive tasks
To further test the effectiveness of the proposed LEMS, we apply the LEMS to the same laundry settings but with highly intensive laundry tasks. A total of 70 tasks is simulated and this includes 35 washing tasks and 35 drying tasks. The machines' operation details are shown in Figure 6 and the laundry's numerical operation results are summarized in Table 5. From Figure 6(a), it can be seen that every washing machines and cloth dryers are either in an operating state or in a paused state for most hours. At 2:30 p.m., multiple drying tasks are submitted to Dryer 1, 2, 4 and Washers 1 and 3. Meanwhile, Washers 2 and 4 cannot be paused as their hosted tasks are approaching the deadline. With the task scheduling of Figure 6(b), although Dryer 3 is paused, the laundry's total power consumption at that time is still larger than the power consumption threshold. Overall, in this scenario, due to the fact that there are too many laundry tasks to execute, there is no way for the LEMS to control the DCT cost within the budget; nevertheless, the LEMS still tries to reduce the DCT cost as much as possible. Figure 7 compares the laundry's total power consumption profiles for both cases. Again, with the use of the LEMS, the laundry's power profile is much smoother than that observed without the use of the energy management.

One-month evaluation
One-month operation of the proposed LEMS is simulated with the same setting of the DCT rate and the budget previously introduced. We duplicate the one-day task settings from the simulation in Section 4.3 to other days with some modifications, including randomly changing the number, arrive time, and deadlines of tasks and reducing tasks in weekends. We also compare the 1-month operation results with the scenario that does not use the energy management system.  The peak power consumption of each day is shown in Figure 8, and the numerical 1-month optimization results are reported in Table 6. The results show that when there is no energy management, the peak power consumption of the month is 26.6 kW, leading to high DCT cost ($213.6). With the proposed LEMS, the peak power consumption of the month is significantly reduced to 22.51 kW; the corresponding DCT cost is reduced to $180.75. These results confirm that the effectiveness of the proposed LEMS.

Evaluation of LEMS on laundries with different scales
We apply the proposed LEMS to three public laundry models with different scales, that is, with 5, 6, and 7 pairs of washers and dryers, respectively. The configuration of each public laundry is shown in Table 7. To simulate the diversity of the laundry load,  different numbers of laundry tasks with diverse submission time and deadlines are generated and assigned to each laundry. The numerical optimization results are shown in Table 8. Without LEMS, the one-day DCT cost of the public laundry 1 is $234.07; by applying the LEMS, the cost is significantly reduced to $197.78, which is below the threshold, $200. Correspondingly, the peak power of the Laundry 1 is reduced from 29.15 to 24.63 kW. Similar trends can be found in laundries 2 and 3.

CONCLUSION AND FUTURE WORK
This paper proposes a real-time energy management system for public laundries with penetration of demand charge tariff. Based on the instant power consumption of the laundry and a dynamically formed queue of laundry tasks, the proposed laundry energy management system schedules and controls the laundry tasks to control the monthly demand charge cost within a budget. The simulation results show that the developed laundry energy management system can effectively help the laundry owner to reduce the financial risk of demand charge tariff while ensuring the quality of services delivered to laundry users. Even in the scenario with intensive laundry tasks, the proposed energy management scheme can still help to reduce the demand charge cost and peak power consumption.
In future work, it is desirable to account for the penetration of renewable energy and other electricity tariffs in the energy management framework . Other future work can also focus at the possible implementation of Peer-to-Peer (P2P) energy trading between laundry systems and other energy customers.