Creating a Microgrid Energy Management System (MEMS) Using NILabVIEW and DAQ

Author(s):
Cheah Peng Huat – Nanyang Technological University
Siow Lip Kian – Nanyang Technological University
Liang Hong Zhu – Nanyang Technological University
Vo Quoc Nguyen – Nanyang Technological University
Nguyen Dinh Duc – Nanyang Technological University
Gooi Hoay Beng – Nanyang Technological University

Students at the Laboratory for Clean Energy Research (LaCER) at the School of Electronic Engineering (EEE) at Nanyang Technological University (NTU) in Singapore have developed a prototype of a microgrid system. It contains energy sources such as solar PV, wind turbines, fuel cells and battery banks. The entire microgrid is controlled with a web-based MEMS server system. MEMS are responsible for controlling and monitoring different aspects of energy management.

We have developed software programs to manage the collected sensor information, complete load controller and power generation distribution. Figure 1 shows a schematic diagram of the interface between the database and different software modules. Modules such as Advanced Sensing and Communication Systems, Load Prediction (LF), Unit Combination (UC), State Estimation (SE), and Optimal Power Flow (OPF) were developed using LabVIEW.

Advanced Sensing and Communication Systems
In a microgrid, the integration and interaction of sensing and control devices is a challenge because it involves different communication protocols, such as RS-232 serial communication, RS422-/485 modbus communication, etc. To solve this problem, we propose to convert all information to a standard protocol, the Ethernet communication protocol or commonly known as TCP/IP protocol. This conversion can be accomplished easily and economically by using a communication protocol converter.

Sensing and communicating between MEMS servers and power sensors and other control devices such as circuit breakers, programmable AC power supplies, and PLCs are our main design tasks. Thirty-two power sensor units supporting the Modbus protocol are installed throughout the microgrid network for energy monitoring measurements such as voltage, current, active power, reactive power and circuit breaker status. To deploy an economical solution between the MEMS server and all power sensors, the sensors are divided into four groups, each group containing eight sensor units. Each group is ultimately connected to an RS-485 to TCP/IP converter that converts the Modbus protocol to Modbus TCP protocol running on the Ethernet LAN network. Configure a unique IP address for each sensor, and configure a corresponding ID for each group of power sensors.

By entering the IP address, sensor ID, and register address of the power sensor, we use the LabVIEW DSC module to extract the power measurements. The user does not need to define the exact modbus message extraction information, thus saving the user valuable time. All power measurements are sent to LabVIEW global variables, shown in Figure 2 in the main graphical interface, for monitoring. In addition, it can also be used in other applications through global variables. The same method is also used for PLC to control circuit breakers in microgrids.

The use of programmable AC sources is primarily used for testing stand-alone microgrids. To communicate with the power source, we use the TCP protocol function module in LabVIEW. Users only need to input the IP address of the power source, and the power source can be monitored and controlled without any cumbersome program codes.

load forecast
The goal of load forecasting is to forecast the total user load 15 minutes in advance. It has important implications for efficient market operation and control and planning of microgrids. Precise forecast values ​​can save energy and increase the safety of system operation.

The prediction method is based on artificial neural network (ANN). LabVIEW was used to develop the neural network shown in Figure 3. To improve the performance of the LF algorithm, a special solution has been added:

Data acquisition – used to detect errors and outliers, delete or adjust before being used for training.
Early Stop – Speeds up convergence and prevents overfitting of training data.
Anomaly Date Planning – Detects dates where load planning is anomalous and removes them from training so that the load model is not broken. The user is able to update the exception date from the GUI.
Correlation and Linear Regression Analysis – Find a linear relationship between input and target data by using straight lines.
Historical load data was collected from NTU’s Wee Kim Wee Communications and Information Building using an NI data acquisition device, the NI USB-6215. This data was processed using LabVIEW and stored in a database. To collect these daily load data (i.e. the load voltage and current of the distributed grid), we connect the analog input of the data acquisition equipment into the distributed grid of the building through a step-down transformer, and a current-to-voltage converter to obtain the voltage separately and current data.

The LF algorithm has been successfully integrated into the UC of MEMS. The implemented forecasting system is able to make forecasts reliably with satisfactory accuracy.

Unit combination
The unit combination (UC) software module is one of the main components of MEMS. Based on forecast demand, this software module can assist the microgrid to find the optimal power generation schedule to minimize the total operating costs when the microgrid is independent, or maximize the total benefit when the microgrid is connected to the main grid . After the optimization process is complete, the results including the switching states and the allocated kW of power generation sources are sent to the MEMS Optimal Power Flow (OPF) module for processing. UC is the most complex optimization problem in power system management. Using LabVIEW’s MATLAB scripting functions, the software is able to determine an optimized solution with multiple constraints and hundreds of variables in seconds. The main user interface of UC is shown in Figure 5.

Software modules contain the following features:

By using LabVIEW’s MATLAB scripting functions, complex UC problems can be solved in seconds.
Using a graphical interface built with LabVIEW, users can run UC optimizations with default or custom settings at the click of a mouse.
By running LabVIEW’s real-time grab function, the software can execute automatically at a user-defined autostart time.
After the optimization is completed, the results will be automatically saved to the user-specified path in the server system and sent to the MEMS OPF at the same time.
State estimation
State estimation is a MEMS real-time function that verifies and estimates the bus voltage of the power system using SCADA-acquired measurements, circuit breaker states, and voltage regulator positions. The estimated bus voltage amplitude and voltage phase angle are considered to be the reliable state of the system as an input to the OPF, and the processed bus load value is used as the input for load prediction.

The state estimator contains three sub-functions, which are written on the LabVIEW platform using the Matlab programming language. .

Topology Processor: Determines the network configuration by converting the node network to a bus network.
State Estimation: Calculate Bus Voltage Magnitude and Phase
Bad data detection and judgment: check whether the state estimator is good before using it
When writing a state estimator, it is a challenge to ensure that it will work on any power network. So using script modules is a way to increase flexibility when describing complex algorithms. Each subfunction is implemented using a scripting module in LabVIEW. Inputs and outputs (1D and 2D) are created for transferring data from script modules to other or front panels for displaying results. Feedback nodes are also used as filters for erroneous data detection and judgment.

Processing is based on matrix calculations, and LabVIEW provides programming tools to make it easier to write power system applications, so it can save programmers time.

The state estimation function, along with other MEMS functions, has been successfully demonstrated on the Microgrid hardware setup at NTU’s Clean Energy Research Laboratory. The main GUI of the state estimator is shown in Figure 6.

optimal power flow
Optimal power flow (OPF) is one of the online functions of MEMS. The goal of OPF is to find the optimal settings for a given power system network, optimizing system objective functions such as total generation cost or system losses while satisfying its power flow equations and factors such as bus voltage constraints, branch flow constraints, and generation source capacity Restrictions and other device operation restrictions. The input of the OPF contains the network configuration and load information defined by the SE. As the output, the OPF will give the following recommended values

Source active/reactive power output
Regulating transformer ratio under load
These parameters will be sent to the CB controller, inverter controller, generation controller and load regulator controller to ensure that the system operates in a more cost-effective mode.

Secondary programming is used to solve OPF problems. The algorithm was written in MATLAB and then integrated into LabVIEW through a MATLAB script function. Based on the LabVIEW platform, OPF is connected to SE and SCADA to control a microgrid component. By using the LabVIEW toolbox, the main OPF graphical interface of the LaCER microgrid is shown in Figure 7. LabVIEW toolbox, the main OPF graphical interface of the LaCER microgrid is shown in Figure 7.

Author: Yoyokuo