*Article* **Supervisory Control for Wireless Networked Power Converters in Residential Applications†**

#### **S. M. Rakiul Islam 1,\*, Sung-Yeul Park 1, Shaobo Zheng 2, Song Han <sup>2</sup> and Sung-Min Park <sup>3</sup>**


Received: 25 March 2019; Accepted: 13 May 2019; Published: 18 May 2019

**Abstract:** This paper presents a methodology to design and utilize a supervisory controller for networked power converters in residential applications. Wireless networks have been interfaced to multiple power factor correction (PFC) converters which are proposed to support reactive power. Unregulated reactive power support from PFC converters could cause reactive power deficiency and instability. Therefore, a supervisory controller is necessary to govern the operation of PFC converters. WiFi and WirelessHART networks have been used to implement the supervisory controller. Different nodes of the power network are connected by wireless communication links to the supervisory controller. Asynchronous communication links latency and uncertain states affect the control and response of the PFC converters. To overcome these issues, the supervisory controller design method has been proposed based on the system identification and the Ziegler-Nichols rule. The proposed supervisory controller has been validated by using a hardware-in-the-loop (HIL) test bed. The HIL testbed consisted of an OP4510 simulator, a server computer, Texas Instrument-Digital Signal Controllers (TI-DSCs), WiFi and WirelessHART modules. Experimental results show that the proposed supervisory controller can help to support and govern reactive power flow in a residential power network. The proposed method of controller design will be useful for different small-scale power and wireless network integration.

**Keywords:** networked power converters; PFC converters; reactive power resources; supervisory controller; HIL Testbed

#### **1. Introduction**

According to the US Department of Energy, residential loads have consumed 20.44% of the total energy in 2017 [1]. Residential loads consume both active and reactive power. Reactive power demand in a home is usually fulfilled from the grid. Recently, power factor correction converters have been integrated into some of the residential appliance, which minimizes reactive power consumption from the grid [2–5]. A recent study shows that additional reactive power could be supported from renewable resources and power factor correction (PFC) converters in residential applications [6,7]. However, unregulated reactive power support from PFC converters could cause reactive power deficiency and instability. To utilize the additional reactive power resources in a residential power network, a supervisory controller is necessary. A supervisory controller should monitor and control the reactive power flow in the residential power network. This paper presents a methodology to design

a supervisory controller which governs reactive power flow in a residential power network. Wireless networks were used to implement the proposed supervisory controller.

The supervisory controller for large power and energy management systems are well established technology. It is known as supervisory control and data acquisition (SCADA) [8]. Because of the scalability, SCADA is not an appropriate tool to control reactive power flow in a small residential power network. Distributed controllers for power converters have been developed using communication network [9,10]. It has potential for wireless network integration but does not provide a centralized solution for reactive power management. A supervisory controller has been validated using an FPGA for power converters in Reference [11]. Reference [11] has only a single controller for multiple converters, which manages all PWM signals without a communication network. Other power and energy management systems have been implemented using fuzzy logic, distributed, model predictive and supervisory controller in References [12–17]. However, these solutions don't give the opportunity to control power flow using a communication network in a residential application. As a result, a solution has been proposed by assuming that there are reactive power resources as well as a communication network available in the residential applications [18,19].

The possible energy sources in residential applications include utility grid, solar panel, wind generator, stored energy, and so forth. These energy sources supply both active and reactive power. In the residential applications, energy is consumed by different kinds of loads , which include high-consumption applications such as HVAC systems, ovens or refrigerators, along with low-power devices such as televisions and light fixtures. Conventional residential loads consume both active power, *P* and reactive power, *Q*. However, smart loads which use PFC converters could contribute reactive power, *Q*, rather than consuming [6]. Examples of smart loads include HVAC systems, electric vehicle (EV) chargers, computers, televisions and other digital appliances [20–22]. Typically, this is accomplished through the use of boost PFC converters [23,24]. As a result, these appliances have the readily available converters to support reactive power. The main role of these converters is to supply specified current and voltage to the appliances. However, these converters can contribute a specified amount of reactive power to the grid without hampering their main functionality.

Recent advances in technology has has trended towards connecting residential appliances to networks. The connectivity to networks and management of appliance features is represented by smart technologies and Internet of Things [21]. The connectivity to appliances has been implemented using WiFi, WirelessHART, Bluetooth, Zigbee and Ethernet [25–28]. By using this connectivity, some specific parameters of power converters can be monitored and controlled [19].

Appliances as reactive power resources and the connection to a wireless network facilitates the opportunity to implement supervisory controller. However, the reactive power management system now becomes more complex because of the integration of power network and wireless network. This system has multiple power nodes which are connected by communication links. Multiple wireless communication links have different delays, asynchronous latency and uncertainty. These factors affects the operation of PFC converters which ultimately affects the reactive power management system. Due to the system complexity and delays, the top-level supervisory controller can't be designed accurately using a conventional state space averaging method. To address this issue, a system identification-based supervisory controller design method has been proposed in this paper. The proposed method considers uncertainty, complexity and delays. It uses the Ziegler-Nichols rule to design a proportional-integral (PI) controller. The proposed supervisory controller has been implemented in a server computer and validated using an hardware in the loop (HIL) test bed set up.

The HIL test bed was built to simulated a residential power network in real-time using OPAL-RT OP4510 [29]. The power converters of have been controlled by Texas Instrument Digital Signal Controllers (TI DSC) [30]. WirelessHART and Wi-Fi networks were used for connectivity [31,32]. Level shifting and scaling circuit were built to make the TI DSC compatible for OP4510.

Multiple tests were conducted using the HIL test bed to validate the feasibility and compatibility of the supervisory controller. The performance of the supervisory controller has been evaluated by analyzing the dynamic response for reactive power support. Test results show that PFC converters can support reactive power to the residential application in different conditions with the help of an optimal supervisory controller. Section 2 of this paper describes the proposed scenario for this power network. Section 3 describes the proposed supervisory controller design method. HIL testbed and experimental results are presented in Sections 4 and 5, respectively.

#### **2. Networked Power Converters**

Considering the wireless connectivity to smart residential appliances, a scenario for a residential power network has been proposed in the following.

#### *2.1. Power Network Configuration*

The proposed residential power network configuration is shown in Figure 1 which has both conventional lagging load and PFC connected smart loads. A supervisory controller has been implemented in the power network using wireless nodes. Figure 1 shows the active and reactive power supplies from grid. Conventional loads with a lagging power factor are represented by a single block in Figure 1. Three separate PFC connected smart loads are distributed and are assumed to contribute reactive power. Based on the active and reactive power supply and consumption, the balanced power condition could be described by (1) and (2).

$$P\_{\mathcal{S}} = P\_L + \sum\_{n=1}^{N} P\_n \tag{1}$$

$$Q\_{\mathcal{S}} = Q\_L - \sum\_{n=1}^{N} Q\_n \tag{2}$$

where, *Pg* is the active power consumption from grid, *Qg* is the reactive power consumption from grid, *PL* is the active power consumption of conventional residential loads, *QL* is the reactive power consumption of conventional residential loads, *Pn* is the active power consumption of PFC connected loads, *Qn* is the reactive power consumption or contribution of PFC connected loads.Here, *n* denotes the PFC number and *N* is the number of available PFC connected resources. The reactive power resources and loads are described pictorially in Figure 1 for *N* = 3.

**Figure 1.** Reactive power resources in wireless networked residential loads.

#### *2.2. PFC Connected Smart Residential Load*

PFC converters for the appliance in Figure 1 can support reactive power. The circuit configuration for a PFC converter supporting reactive power is shown in Figure 2. Bridgeless unidirectional single phase boost PFC converter topology has been used in Figure 2. This converter has two diodes, *D*1, *D*<sup>2</sup> and two semiconductor switches, *Q*1, *Q*2, input inductor, *L* and DC bus capacitor, *C*. The detailed analysis of the circuit is available in References [6,7,33]. Each converter is controlled by using a PFC controller. It generates complementary pulse width modulated (PWM) signals for *Q*<sup>1</sup> and *Q*<sup>2</sup> [34].

The controller for PFC converter can supply a specified amount of reactive power.

**Figure 2.** Circuit diagram of a bridgeless ac-dc boost power factor correction (PFC) converter.

This type of PFC controller is shown in Figure 3. The controller takes *Q*∗ as reactive power reference and contributes *Q* to the power network.

**Figure 3.** Control diagram of a bridgeless ac-dc boost PFC converter.

The controller initially maintains the proper DC bus voltage and in-phase current. Then, by controlling current, it makes the PFC converter the leading load and contributes reactive power to the network. This controller uses both feedback and feedforward terms to maintain inner current and outer voltage loops. Output current, DC link voltage and reactive power measurements are used as feedback signals for PI controllers. Phase angle, *ωt*, is determined by phase lock loop (PLL) using grid voltage, *Vg* .Feedback and feedforward duty cycle values are added before the generation of PWM signals.

The inner current loop is the fastest control loop in this controller and maintains leading-phase current based on the compensation angle, *θcom* and the output of the voltage control. DC voltage feedback control is maintained by a PI controller, voltage reference, *V*∗ *dc* and feedback *Vdc*. The *θcom* is determined by using a PI controller and reactive power feedback. A sinusoidal signal is reconstructed using PLL and a cosine function. The reactive power compensation loop has 2 key Equations (3) and (4).

$$Q\_{err}(t) = Q^\*(t) - Q(t) \tag{3}$$

$$
\theta\_{\rm com}(s) = (k\_p + \frac{k\_i}{s}) Q\_{\rm crr}(s) \tag{4}
$$

The DC output voltage is maintained by generating current reference, *I*(*s*), using (5) and (6).

$$V\_{dc\_{err}}(t) = V\_{dc}^\*(t) - V\_{DC}(t) \tag{5}$$

$$I(\mathbf{s}) = (k\_p + \frac{k\_i}{\mathbf{s}}) V\_{d\mathbf{c}\_{wr}}(\mathbf{s}) \tag{6}$$

AC current reference, *i* ∗ *<sup>s</sup>* , is obtained by *I*, *ωt* and *θcom*.

$$i\_s^\*(t) = I \times \cos(\omega t - \theta\_{\text{com}}) \tag{7}$$

Error in the inner current loop is calculated by applying the following equation.

$$i\_{err}(t) = i\_s^\*(t) - i\_s(t) \tag{8}$$

Current error is compensated by feedback duty, *df b*, using (9).

$$d\_{fb}(\mathbf{s}) = (k\_p + \frac{k\_i}{\mathbf{s}})i\_{err}(\mathbf{s})\tag{9}$$

Feedforward duty, *df b* is generated from (10).

$$d\_{ff}(\mathbf{s}) = 1 - \frac{V\_{\mathbf{g}}}{V\_{dc}} \tag{10}$$

Finally, feedback and feedforward duty is added to generate PWM signal.

$$d(\mathbf{s}) = d\_{fb}(\mathbf{s}) + d\_{ff}(\mathbf{s}) \tag{11}$$

The detailed description and design of the PFC controller for reactive power support is available in Reference [6]. The waveforms of input current, duty and PWM switching signal are shown Figure 4.

**Figure 4.** Waveforms during PFC switching.

#### *2.3. Wireless Network and Supervisory Reactive Power Control*

To improve the overall power factor in the proposed scenario, a supervisory controller has been included in Figure 1 using the wireless connectivity. The proposed power network has three PFC converters.These PFC converter can contribute a specified amount of reactive power *Q*∗ as discussed in Section 2. However, reactive power demand could change with time. In demand-varying conditions, the supervisory controller identifies the reactive power demand and maintains equal amount of reactive power support from the PFC converters. If the load demand for reactive power increases, the supervisory controller ensures more reactive power. On the other hand, if the load demand decreases, the supervisory controller decreases reactive power supplied. Through this method, the supervisory controller tries to maintain unity power factor for the proposed scenario. It is recommended to maintain the grid's power factor (*p*. *f* .) as close to 1.00 possible [35]. From the definition of power factor, the following equation can be written.

$$p.f. = \cos\phi = \frac{P\_{\mathcal{S}}}{\sqrt{P\_{\mathcal{S}}^2 + Q\_{\mathcal{S}}^2}}\tag{12}$$

From (12), it is clear that the power factor will be unity if and only if *Qg* = 0. In that case, the condition of (2) becomes the condition of (13).

$$Q\_L = \sum\_{n=1}^{N} Q\_n \tag{13}$$

In dynamic conditions, (13) can be expressed by (14).

$$Q\_{\mathcal{S}}(t) = Q\_L(t) - \sum\_{n=1}^{N} Q\_n(t) \tag{14}$$

where, *t* represents time. The grid reactive power is minimized by making *Qg*(*t*) close to 0. To minimize *Qg*(*t*), the supervisory control technique was applied as shown in Figure 5. In this proposed technique, a proportional integral (PI) controller is used to compensate *Qg*(*t*) to 0.

The supervisory controller is shown in Figure 5 and named as supervisor. Supervisor is comprised of a PI controller, reference and distributor. *Qref* is set to zero, so that *Qg* become zero. From the difference of the *Qref* and *Qg*, the error is generated. Based on the error, the PI controller sets a reference of total reactive power demand, *Qd*. *Qd* is total reactive power that need to be fulfilled by all available PFC converters. Using a distributor, this demand is distributed and assigned to individual PFC controllers. Individual PFC controllers get command for reactive power references of *Q*∗ <sup>1</sup>, *Q*<sup>∗</sup> <sup>2</sup>, ..., *Q*<sup>∗</sup> *N*. The commands are obtained though wireless network. After performing the control, PFC converters contribute *Q*1, *Q*2, ..., *QN* amounts of reactive power to the power network. Individual PFC converter has individual local control loops to maintain reactive power support. These local controllers get the reference from supervisory controller based on their capacity.

The response time, wireless communication delay and capacity of the PFC converters are factors of the supervisory control design consideration. The supervisor is a single input multiple output (SIMO) system. The power network of the smart home is considered as a multiple input single output system (MISO). The whole system is a single input single output (SISO) feedback system. A host program maintains the supervisory controller. A varmeter measures reactive power consumption from the grid, *Qg*. *Qg* is the feedback for the supervisory controller.

**Figure 5.** Supervisory control for reactive power resources using wireless connectivity.

#### **3. Supervisory Controller Design**

The supervisory controller governs the distributed PFC connected loads using wireless communication link and a server. The response of the supervisory controller is slower than the individual PFC controllers. The control system configuration, design challenges and solution are discussed below.

#### *3.1. Control System Configuration*

The functional block diagram of the supervisory reactive power control scheme is shown in Figure 5 for the power network of Figure 1. Figure 5 describes the role of the supervisor which is comprised of a PI controller and a distributor. To design the proper PI controller, the system should be analyzed in the control system perspective. By that manner, supervisory reactive power compensation system can be modeled as in the control system as shown in Figure 6.

**Figure 6.** Control block diagram for reactive power compensation with multiple PFCs.

In the control block diagram, *W*1, *W*<sup>2</sup> and *W*<sup>3</sup> are the weighting factors of the distributor. *Gdelay*\_*n*(*s*) is the transfer function of the communication delay due to wireless links. *Gload* is the transfer function for conventional loads. *Gp*1(*s*), *Gp*2(*s*) and *Gp*3(*s*) are transfer functions of the PFC converters including their controllers for reactive power compensation. To design the proper PI controller, all PFC converters, delays and loads transfer functions have been put together and considered as plant, *Gplant*(*s*). The output of the PI controller determines the reactive power demand, *Qd*. The transfer function of the overall feedback loop can be written as in (15).

*Energies* **2019**, *12*, 1911

$$H(\mathbf{s}) = \frac{\mathbf{G}\_{PI}(\mathbf{s})\mathbf{G}\_{delay\\_4}(\mathbf{s})\mathbf{G}\_{plant}(\mathbf{s})}{1 + \mathbf{G}\_{PI}(\mathbf{s})\mathbf{G}\_{delay\\_4}(\mathbf{s})\mathbf{G}\_{plant}(\mathbf{s})} \tag{15}$$

For asynchronous unequal delays and dynamic loading conditions the transfer function of the plant can be written as in (16).

$$\mathbf{G}\_{\text{plant}}(\mathbf{s}) = \mathbf{G}\_{\text{ball}}(\mathbf{s}) - tr \left( \begin{pmatrix} \mathbb{W}\_1 \ \mathbf{0} & \mathbf{0} \\ \mathbf{0} \ \mathbb{W}\_2 \ \mathbf{0} \\ \mathbf{0} & \mathbf{0} \ \mathbb{W}\_3 \end{pmatrix} \begin{pmatrix} \mathbb{G}\_{\text{d}dday\text{-}1}(\mathbf{s}) & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbb{G}\_{\text{d}dday\text{-}2}(\mathbf{s}) & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbb{G}\_{\text{d}dday\text{-}3}(\mathbf{s}) \end{pmatrix} \begin{pmatrix} \mathbb{G}\_{\text{p1}}(\mathbf{s}) & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbb{G}\_{\text{p2}}(\mathbf{s}) & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbb{G}\_{\text{p3}}(\mathbf{s}) \end{pmatrix} \right) \tag{16}$$

where, *Gplant*(*s*) = *Qg*(*s*) *Qd*(*s*), *Gp*1(*s*) = *<sup>Q</sup>*1(*s*) *Q*∗ <sup>1</sup> (*s*), *Gp*2(*s*) = *<sup>Q</sup>*2(*s*) *Q*∗ <sup>2</sup> (*s*), *Gp*3(*s*) = *<sup>Q</sup>*3(*s*) *Q*∗ <sup>3</sup> (*s*). *tr* denotes trace of the matrix. Although Equations (15) and (16) are seem like deterministic representation of the feedback system, the dynamic nature of *Gplant*(*s*) can cause this representation to yield inaccurate results. *Gplant*(*s*), changes with the change of *Gload*(*s*), *Gdelay*(*s*), *Gp*1(*s*), *Gp*2(*s*) , *Gp*3(*s*) , *W*1, *W*<sup>2</sup> and *W*<sup>3</sup> . *Gload*(*s*) changes with the change of load demand. The response of *Gp*1(*s*), *Gp*2(*s*) and *Gp*3(*s*) are mutually independent and asynchronous because of the different command schedules for different PFC converters. The transfer functions for *Gp*1(*s*), *Gp*2(*s*) and *Gp*3(*s*)) can be determined from Section 2.2. *Gdelay*(*s*) is the reason for multiple phase shifts between commands. *W*1, *W*<sup>2</sup> and *W*<sup>3</sup> are variable with respect to the capacity of the PFC converters. As a result, *Gplant*(*s*) has uncertainty, non-linearity and multiple asynchronous phase shifts in dynamic conditions.

#### *3.2. System Identification*

Because of the uncertainty, non-linearity and asynchrony, accurate *Gplant* can't be determined from (16) at any instant. So, alternative method is proposed to get the transfer function response characteristics. System identification method is applied to get the characteristic of the system. The system has been identified for *Gplant*, *Gp*1, *Gp*<sup>2</sup> and *Gp*<sup>3</sup> by applying step input and measuring settling time. The settling time is the main feature that has been used to design supervisory controller considering it is an asynchronous distributed system. The settling time depends on the transfer function of the system.

#### *3.3. Solution for Multiple Asynchronous Phase Shift*

Different settling time, wireless communication delay time and overall response time for the proposed supervisory control system are explained by timing diagram in Figure 7. The timeslots *t*1, *t*<sup>2</sup> and *t*<sup>3</sup> are communication delay time for PFCs; in other words those are settling time of *Gdelay*\_*n*. After these time slots PFCs execute their received command from supervisory controller within their settling times. The received commands are reference amount of reactive power assigned for the individual PFC converters. The necessary times for reactive power compensation of PFC's are *t*1\_*<sup>s</sup>* , *t*2\_*<sup>s</sup>* and *t*3\_*s*; in other words these are settling time of *Gp*1, *Gp*<sup>2</sup> and *Gp*3. *tw* is a flexible waiting time before getting reactive power measurement from varmeter.

*tg* is the communication time slot assigned for varmeter to send data to supervisor. The optimal value of *tw* and *tg* are determined by from the experiments. The value of *t*1\_*<sup>s</sup>* , *t*2\_*<sup>s</sup>* , *t*3\_*<sup>s</sup>* , *tw* and *tg* are determined by system identification method as discussed in Section 3.2. The overall value of *t*1, *t*<sup>2</sup> and *t*<sup>3</sup> depends on the communication link and should be determined with certainty. The value of *tw* can be adjusted to ensure certainty of the response. All the time slots are added in (17) to get the minimum optimal sample time, *Ts*, for the supervisory controller.

$$T\_s = t\_w + t\_\xi + t\_1 + \sum\_{n=1}^{N=3} t\_{n,s} \tag{17}$$

**Figure 7.** Time slots consideration for supervisory controller design.

#### *3.4. PI Controller Design*

The minimum sample time, *Ts*, is used to design the discrete PI controller. The block diagram for the discrete PI controller is shown in Figure 8a. The integrator for the PI controller has a sample time of *Ts*. The output of the PI controller is *Qd*, which is the reactive power demand from all of the PFC converters. Since the system has certainty of response using the sampling time of *Ts*, Ziegler-Nichols rule can be used to design PI compensator for this system [36–38]. Using the rule, the values of *Kp* and *Ki* are determined by (18) and (19) for the ultimate gain *Ku*.

$$K\_p = 0.5K\_u \tag{18}$$

$$K\_{\bar{i}} = 0.45 K\_u \tag{19}$$

For the wireless communication, communication time is much higher than response time of PFC converters that is, *t*<sup>1</sup> >> *t*1\_*<sup>s</sup>* . The value of ultimate gain *Ku* is 1 for such system.

**Figure 8.** Detail diagram of supervisory control (**a**) proportional-integral (PI) controller (**b**) Distributor.

#### *3.5. Distributor Design*

The value of the *Qd* is distributed by the weighting factors *W*1, *W*<sup>2</sup> and *W*3. The weighting factors are determined from the maximum reactive power support capacities (*Q*1\_*max*, *Q*2\_*max* and *Q*3\_*max*) of the PFC converters. The value of weighting factors can be determined from (20).

$$\mathcal{W}\_{\text{ll}} = \frac{Q\_{n\text{-max}}}{Q\_{1\text{-max}} + Q\_{2\text{-max}} + Q\_{3\text{-max}}} \tag{20}$$

#### **4. Testbed Description**

The configuration for hardware-in-the-loop (HIL) testbed for the proposed supervisory controller and scenario is shown in Figure 9.

**Figure 9.** Block diagram of the testbed.

The testbed consists of an Opal-RT real-time simulator OP4510, TI-DSCs, scaling and level shifter circuits, AwiaTech wirelessHART modules [39], ESP8266 Wi-Fi modules [40] and communication links. The proposed power network has been simulated in real-time using OP4510 real-time simulator. The waveforms of voltages, currents and reactive power were observed from both the oscilloscope and the computer console connected to the OP4510. The real time simulation data is also stored in .mat files from the console for further analysis. The measured voltages, currents and reactive powers from OPAL-RT are scaled down using the Op-Amp based circuit to use in the ADC of the TI-DSCs. One of the TI-DSCs transmits the value of reactive power consumption from the grid input power node. The rest of the TI- DSCs are designated to control the PFC converters. The controller of Figure 3 has been implemented to those TI-DSCs. TI-DSCs were programmed using Code Composer Studio v.6 (CCS6). All the TI-DSCs are connected to AwiaTech wirelessHART modules and ESP8266 Wi-Fi modules via serial (UART) connections for the communication links to the supervisor. Communication nodes are numbered from 0 to 5 in Figure 9. The connections of ESP8266 Wi-Fi and AwiaTech wirelessHART modules were switchable in the node 1–4. Node 5 has different configurations based on the communication preference. The description of wireless network configuration will be discussed in the Subsection 4.3.1.

The HIL testbed is validated by three types of physical devices: wireless modules, digital controllers and real time simulator. The actual testbed setup is shown in Figure 10. OP4510 is used to simulate the power stages in real time; TI-DSCs are used as controllers of the PFC converters; AwiaTech wirelessHART or ESP8266 Wi-Fi modules are used as interface of communication link; Op-Amp based circuits have been used for the ADC scaling and buffers have been used for the level shifting of PWM signals; a supervisory controller have been implemented in the computer that is connected to the internet and the master AwiaTechHART module. The supervisory controller ensures zero reactive power consumption from the grid. The components of the test bed are described in the following subsections.

**Figure 10.** Hardware in the loop testbed set up.

#### *4.1. Hardware Description*

#### 4.1.1. Real Time Simulator

The power stages of the PFC converters, loads, measurement of voltage and current and active and reactive power are simulated in real-time (RT) using OPAL-RT real-time simulator, OP4510. It has 128 I/O channels, a quad core INTEL Xeon 3.3 GHz processor as well as a Kintex 7 FPGA for sub-microsecond simulation time steps [41]. Each core of the processor has the capability to simulate up to 20 μs time step. The system is compatible with Simulink and the SimPowerSystems library. The OP4510 is also connected to an oscilloscope to monitor voltage, current and reactive power in real time. For this testbed, analog values of voltages and currents are routed from the FPGA based model to the DAC channels directly. The PWM signals are interfaced with digital input pins which drive the FPGA based modesl of IGBTs. These two steps ensure sub-microsecond RT simulation. The reactive power is calculated using Fourier transform in the CPU core at a step of 25 μs and later routed to DAC channels.

#### 4.1.2. ADC Scaling and Level Shifting Circuit

The analog output signals for V, I and Qs are ±16 V in OP4510. The ADC level of TI-DSCs is limited to 0–3.3 V. To interpret and match the analog signal level properly, Op-Amp (TL082C) based scaling and offsetting circuits have built. The GPIO of TI-DSC has a logic level of 3.3 V and OP4510 takes 5 V PWM input. As a result, a 74HC240D IC has been used as a buffer for level shifting. The level shifting and ADC scaling circuit has been built up in the same PCB as shown in Figure 10. The PCB also has connectivity to Opal-RT by two DB37 connectors and connect TI-DSCs with the 20 pin connectors. This circuit has 32 analog and 32 digital re-routable channels. The ADC scaling and level shifting circuit is shown in Figure 11.

**Figure 11.** Interface circuit: (**a**) level shifting (**b**) ADC scaling.

4.1.3. Texas Instruments Digital Signal Controller

The TI-DSC, TMS320F28335, was selected to control the PFC converters that were simulated in real-time on the OP4510. In addition, the DSC code includes UART communication which interfaces either the AwiaTech wirelessHART or the ESP8266 Wi-Fi modules. The TMS320F28335 is a 32 bit floating point processor with clock speeds up to 150 MHz and 18 PWM channels [42].

#### 4.1.4. WirelessHART and AwiaTech Wireless 220 Module

To implement the communication system for the testbed, AwiaTech WirelessHART (Wireless Highway Addressable Remote Transducer) modules were chosen. WirelessHART is a simple, secure, reliable, real-time and open-standard networking technology, operating in the 2.4 GHz ISM radio band [43]. It uses a time-synchronized, self-organizing and self-healing mesh network architecture. At the bottom of its communication stack, WirelessHART adopts IEEE 802.15.4-2006 [31] as the physical layer. On top of that, WirelessHART defines its own time-synchronized data link layer. In WirelessHART, communications are precisely scheduled based on Time Division Multiple Access (TDMA) and employ a channel hopping scheme for added system data bandwidth and robustness [43]. AwiaTech Wireless provides a variety of interfaces such as UART, JTAG, SPI/I2C and USB, which provides us the flexibility for interconnecting the TI DSC. The features of this module are shown in Figure 12a.

**Figure 12.** Wireless communication modules.

#### 4.1.5. WiFi and ESP8266 Module

Four ESP8266 modules have been used in the test bed [40]. ESP8266 has serial communication (UART) features as in Figure 12b. It can give any microcontroller access to your WiFi network and maintain TCP/IP protocol by IEEE standard 802.11/b/g/e [32]. These modules have been programmed using an Arduino programming environment.

#### *4.2. Software Components Description*

#### 4.2.1. TI DSC Code Architecture

The PFC controller has a 20 μs sample time. It generates a 50 kHz PWM signal. One interrupt has been used to compute ADC values, scaling, controller operation and the PWM update. For the low speed communication links, a polling method has been used. The communication function is executed in an infinite while loop. All the functions are executed within a 20 μs window.

The ADC interrupt and controller computations consume only 12 μs and the remaining 8 μs is designated for communication through UART. Figure 13 describes the interrupt and while loop structure.

**Figure 13.** (**a**) Code structure of TI DSC (**b**) Execution time of code sections.

#### 4.2.2. Host Program

AwiaTech wireless provides a Java package "Host" which is encapsulated within a series of APIs, enabling users to write programs which process all the data acquired from WirelessHART network. Based on these APIs, "Host" software is customized as an interface between the wireless network and the supervisory controller. This design separates communication and control, which provides scalability to use other wireless communication technologies without modifying the controller code. In addition, this architecture enables the convenient use of other languages. The host program has been modified using TCP/IP link as well. The TCP/IP link has been used to maintain communication links to the ESP8266.

#### 4.2.3. Supervisory Controller Implementation

The supervisory controller gives the control signal to the power converters. It is also capable of collecting data from the input port of the power network. The algorithm for the supervisory controller is written in C++ code and later called from the JAVA platform which maintains communication functions. The supervisory controller has a low speed proportional integral controller with a limiter and distributor as discussed in Section 3.

#### 4.2.4. Dataflow

A complete dataflow is presented in Figure 14. The data flow in the test bed is composed of 8 steps, starting from a TI DSC and ending in a TI DSC. First, a TI-DSC sends a HART-IP command containing data to the AwiaTech wireless (device) through UART. Second, AwiaTech wireless forwards this command to the access point based on WirelessHART standard. Third, the access point sends data to a desktop running Host and Gateway software with UART over USB using a FTDI chip. Fourth, after Host receives the data, it forwards it to the supervisory controller. For the WiFi network, HART-IP has been decoded at ESP8266 and sent to the AP and host through the Wi-Fi. Our Host program will exchange messages with the controller through Stdin and Stdout. The dataflow in the other direction will follow the same steps in reverse.

**Figure 14.** Dataflow between TI DSC and supervisory controller.

#### *4.3. Communication Link Description*

#### 4.3.1. Wireless Communication Set Up

The communication network topology for WiFi and WirelessHART has been shown in Figure 15. Either all ESP8266 or all AwaiaTech modules are connected to the TI-DSC through UART. The UART to module connections are switchable for Wi-Fi and wirelessHART. Four AwiaTech modules maintain communication links with a fifth AwiaTech wireless module, which is connected to a host computer, where the supervisory controller is running.

On the other hand ESP8266 is connected to the internet via Wi-Fi and a router. The supervisory controller can use internet to control the PFC converters for Wi-Fi network preference. Multiple unidirectional PFC converters contribute reactive power support by following a reference command by a supervisory controller via wireless modules. Real-time algorithms or strategies for energy and power management systems can validate their performance in this testbed. The network topology in our experiments is shown in Figure 16, the blue circles are devices connected to TI DSCs; the yellow circle is the access point and the red circle is the gateway. A dotted line indicates the wireless communication through WirelessHART or WiFi. The solid line indicates the wired communication through USB or Ethernet. The numbers on the lines show the signal strength of the wireless links. The Figure 16 shows all the components in our network and their unique IDs, types and scan periods.

**Figure 15.** Wireless network topologies for testbed (**a**) WirelessHART (**b**) WiFi.

**Figure 16.** Wireless network topology.

#### 4.3.2. Integrity of the Specification

The Figure 17 shows an example of simplified network schedule which is shared with all the devices and the access point in the network. The super-frame size is 500 ms and two up-links and down-links for each device are statically allocated inside one superframe. In Figure 17, a time slot is represented by a small square with a number and an arrow. For example, 2 ↑ means the time slot is scheduled for Device 2 as an up-link. The wireless message exchanging sequence is shown in Figure 17. At the beginning of a super-frame, the TI-DSC sends measurement to Device 1.

**Figure 17.** Communication schedule configuration.

Then Device 1 sends the data to an access point within its own timeslot. After receiving the data, the access point sends the data to the host. Next, the Host software will send what it just received to the supervisor controller for calculation. After that, the controller will send data back to control the TI DSC. It will go through the path in reverse. The access point will get the data and wait for the time slot allocated for Device 1. Once the time slot arrives, the access point sends the data down to Device 1 and then Device 1 sends data to the TI-DSC through UART. Theoretically, if we set the super-frame length to be 500 ms and within one super-frame and we allocate two time slots as up-links, the smallest sampling period would be 250 ms. However, due to the noisy wireless environment, we chose a much larger sampling rate and super-frame length. From the wireless link test, we were able to make the super-frame size 1.5 s without any data loss.

#### **5. Experimental Results**

The test bed has been implemented to validate the supervisory controller for reactive power support using the proposed power network of Figure 1. OP4510 has simulated the power network in real-time. It takes PWM signal as input and gives analog signals as output. Rest of the components are actual physical device in the HIL test bed. Multiple tests have been conducted to validate the idea of reactive power support and supervisory controller.

#### *5.1. Reactive Power Compensation in a Single PFC Converter*

Reactive power has been supported by applying controller of Figure 3 to a PFC converter. The wave form of voltage and current in a PFC converter for different conditions has been captured using an oscilloscope and shown in the following figure. The waveforms are collected from the analog output of the OP4510 real-time simulator. PFC 1 has been built up as in the circuit of Figure 2 using *rL* = 1 mΩ, *L* = 2 mH, *C* = 2000 μF and *rC* = 2 mΩ. PFC 1 is rated for *Vin* = 120 V(rms), *f* = 60 Hz, *Pout* = 1.1 kW, *Vout* = 250 V(DC) and *RLoad* = 56.79753 Ω. Different power conversion criteria for PFC 1 under conditions of Figure 18 are shown in the Table 1.

Figure 18a shows the input current and voltage waveforms without applying any control that is, current flows through the diode only.

**Figure 18.** Input voltage and current waveforms in PFC 1: (**a**) no controller, (**b**) in phase controller, *θ* ≈ 0 and (**c**) leading phase controller, *θ* < 0.



This condition has very poor performance and can not fulfil the rated conditions. It has very high total harmonic distortion (THD) for the input current. After applying the reactive power compensation algorithm of Figure 3, voltage and current are almost in phase as in Figure 18b. Reactive power has not been injected for this case that is, reactive power reference is zero, *Q*∗ <sup>1</sup> = 0. Although *Q*<sup>∗</sup> <sup>1</sup> is equal to zero but, *Q*<sup>1</sup> is not exactly zero because of delays, offset and measurement errors. In this case, current distortion is minimum. Leading phase of current has been achieved as in Figure 18c as *Q*∗ <sup>1</sup> has been set to negative values. Hence, reactive power has been supported by PFC 1. In this case, the current is not a pure sine wave at zero crossing because of zero crossing distortion. The distortion phenomenon has been considered to determine the maximum capacity of reactive power support (*Qmax*1) for PFC 1. Since, the household load is very small with respect to grid, the voltage supply has been considered to be coming from an infinite bus. As a result, distortion for input voltage, *THDVg* is zero in the realtime simulation.

#### *5.2. Reactive Power Support Using Supervisory Controller*

After setting up the communication networks successfully, the HIL test was conducted for the proposed residential power network. For the proposed scenario, rated grid voltage is 120 V(rms), 60 Hz. Conventional load is 1500 VA with 0.8 power factor that is, *PL* = 1200 W, *QL* = 900 VAR. Rated output voltage, *Vout*, of all three PFCs is 250 V(DC). Output power, *Pout*, rating of the PFC's are 1.1 kW, 1.5 kW and 1.7 kW.

Weighting factors used in supervisory controller *W*1, *W*<sup>2</sup> and *W*<sup>3</sup> are 0.25, 0.35 and 0.4 respectively. Reactive power has been supported by the PFC converters to the load as shown in the in Figure 19. In this case, real-time simulation has been conducted for communication and control sample time, *Ts* =4s. Supervisory controller engagement time has been set as reference, *T* = 0, on the time axis. Logged data from OP4510 shows that reactive power consumption from grid *Qg* becomes 0 VAR within 75 s of applying the controller. The initial and final value of the reactive power for the grid, the load and the PFCs is shown in the Table 2.

**Figure 19.** Reactive power support by 3 PFC converters and supervisory controller. **Table 2.** Reactive power in different nodes of the proposed power network.


#### *5.3. Reactive Power Support in Different Conditions*

The performance of the supervisory controller has been tested for different conditions.

#### 5.3.1. Variation of Load

The designed supervisory controller has been tested for loading conditions of (*PL* = 1350 W, *QL* = 654 VAR), (*PL* = 1200 W, *QL* = 900 VAR) and (*PL* = 1050 W, *QL* = 1072 VAR). For all loading conditions, *Qg* become 0 VAR within 75 s.

#### 5.3.2. Variation of Wireless Network

The supervisory controller was tested using WirelessHART and Wi-Fi. It compensated grid reactive power for both networks as shown in Figure 20a.

**Figure 20.** Performance of supervisory controller: (**a**) network variation, (**b**) sampling time variation and (**c**) gain variation.

#### 5.3.3. Sampling Time Variation

The effect of different communication sampling times has been evaluated in Figure 20b. For four and six second sampling times, supervisory controller regulated *Qg* to 0 VAR. The higher the sampling time, the slower the response time for overall reactive power compensation. Minimum stable communication and control sampling time for this system has been measured to be 1.5 s. This sampling time has been used for optimal controller.

#### 5.3.4. Gain Variation and Optimal Controller

To verify the optimal supervisory controller, the response of reactive power compensation has been compared for different *ku*, *kp* and *ki* gains. The response has been judged by settling time, overshoot, undershoot and stability. Figure 20c shows performance of supervisory controller with different gains. This controller has used *Ts* = 1.5 s communication sampling time. The settling time and other factors of performance for the PI compensator are shown in Table 3.


**Table 3.** Supervisory controllers performance with different PI gains.

#### *5.4. Reactive Power Support in Dynamic Load*

Different load profiles of Table 4 have been applied to test the supervisory controller. Reactive power demand were changed as the load changed.

Load profile 1 has been applied for the conditions of Figure 21a,c. Load profile 2 has been applied and results have been gathered in Figure 21b. The PFC converters used for Figure 21a,b have the power rating(*Pout*) of *P*<sup>1</sup> = 1.1 kW, *P*<sup>2</sup> = 1.5 kW and *P*<sup>3</sup> = 1.7 kW. The maximum reactive power supply capacity of those PFC converters are *Qmax*<sup>1</sup> = −300 VAR, *Qmax*<sup>2</sup> = −400 VAR and *Qmax*<sup>3</sup> = −600 VAR. *Qmax*1, *Qmax*<sup>2</sup> and *Qmax*<sup>3</sup> have determined the weighting factors *W*1, *W*<sup>2</sup> and *W*<sup>3</sup> by (20). Load profile 1 is based on the power factor change and load profile 2 is based on apparent power demand increment.

Dynamic response of Figure 21c used load profile 1 but it used identical 3 PFC converters. In this case, *P*<sup>1</sup> = 1.5 kW, *P*<sup>2</sup> = 1.5 kW, *P*<sup>3</sup> = 1.5 kW, *Qmax*<sup>1</sup> = −400 VAR, *Qmax*<sup>2</sup> = −400 VAR, and *Qmax*<sup>3</sup> = −400 VAR. As a result, reactive power contribution from PFC converters is equal at different times in the real time simulation.

Load profiles have been implemented by changing the loads using an external switch. As a result there is a transient reactive power spike and an unequal load profile duration. For all of these conditions, the optimal controller has been used, which ensured the stable and quickest response. *THDVg* and *THDIg* have also been recorded for all the tests. *THDVg* for all the tests is 0% as the grid has been considered as an ideal voltage source in the real-time simulation. *THDIg* has varied between 4% to 10.65% for all the loading conditions after the settling times. It was observed that an increase in real and reactive power consumption ratio correlated with a decrease in *THDIg* .

**Figure 21.** Reactive power support in dynamic loads: (**a**) load profile 1, (**b**) load profile 2 and (**c**) Load profile 1 with equal reactive power support capability.


**Table 4.** Load profiles for dynamic performance test.

#### **6. Conclusions**

The PFC converters are considered as reactive power resources in this paper. The supervisory controller is proposed to manage those resources. The WiFi and WirelessHART have provided the interface between the supervisory controller and reactive power resources. The optimal sampling time of the supervisory controller has been determined by various tests. The optimal gain is explained theoretically and validated experimentally. The dynamic performance of the supervisory controller has been validated using different load profiles with the reactive power demand, PFC capacity and load variations. The HIL test results prove the concept and feasibility of additional reactive power support from PFC converters in residential applications. The proposed controller design method will be useful for other small-scale power and wireless network integration.

**Author Contributions:** All the authors contributed substantially to the manuscript.Contributions of each author are as follows: conceptualization, S.M.R.I. and S.-Y.P.; methodology, S.M.R.I., S.-M.P. and S.Z.; software, S.M.R.I. and S.Z.; validation, S.M.R.I. and S.-Y.P.; formal analysis, S.M.R.I.; investigation, S.M.R.I.; resources, S.M.R.I. and S.-M.P.; data curation, S.M.R.I.; writing—original draft preparation, S.M.R.I.; writing—review and editing, S.M.R.I. and S.-Y.P.; visualization, S.M.R.I.; supervision, S.-Y.P. and S.H.; project administration, S.-Y.P.; funding acquisition, S.-Y.P.

**Funding:** This research was funded by National Science Foundation OF FUNDER grant number 1446157.

**Acknowledgments:** This work was supported by the National Science Foundation under grant no. 1446157. However, any opinions, findings, conclusions or recommendations expressed here in are those of the authors and do not necessarily reflect the views of the National Science Foundation.

**Conflicts of Interest:** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses or interpretation of data; in the writing of the manuscript or in the decision to publish the results.

#### **References**


c 2019 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 (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
