Creating A Microgrid Energy Management System Using NI LabVIEW and DAQ
Creating A Microgrid Energy Management System Using NI LabVIEW and DAQ
Creating A Microgrid Energy Management System Using NI LabVIEW and DAQ
The Challenge:
Meeting Singapores energy needs by exploring sustainable energy resources and enhancing the efficiency of the current supply system.
The Solution:
Using NI LabVIEW software and NI data acquisition (DAQ) hardware to develop a low-cost microgrid energy management system (MEMS) that
includes information and communications technology (ICT), smart meters, and advanced optimization applications to manage distribution systems
that serve as a platform for incorporating renewable energy resources.
Author(s):
Cheah Peng Huat - (www.ntu.edu.sg)
Siow Lip Kian - (www.ntu.edu.sg)
Liang Hong Zhu - (www.ntu.edu.sg)
Vo Quoc Nguyen - (www.ntu.edu.sg)
Nguyen Dinh Duc - (www.ntu.edu.sg)
Gooi Hoay Beng - (www.ntu.edu.sg)
Students at the Laboratory for Clean Energy Research (LaCER) in the School of Electrical and Electronic Engineering (EEE) at Nanyang Technical
University (NTU) created a microgrid prototype. It consists of energy resources such as solar photovoltaics (PVs), wind turbines, fuel cells, and battery
banks. The entire microgrid is controlled by the Web-based MEMS server, which controls and monitors different aspects of power management.
We developed software programs to manage information collected from the sensors and perform load control and generation dispatch. Figure 1 shows the
interface diagram between the database and different software modules. We used LabVIEW (http://www.ni.com/labview/) software to develop modules for
advanced sensing and communication, load forecasting, unit commitment, state estimating, and optimal power flow.
Load Forecasting
The objective of load forecasting is to predict the total customer load 15 minutes in advance. It has a significant market impact on efficiently operating,
controlling, and planning microgrids. Accurate forecast values result in economic savings and enhance system operation security.
The prediction method is based on the artificial neural network (ANN), which we developed using LabVIEW (see Figure 3). To enhance the performance
of the load forecasting algorithms, we added the following special features:
Data preprocessing to identify bad and irregular data so we can remove or adjust it before using it for training.
Early stopping to speed up convergence and prevent over-fitting the training data.
Abnormal days scheduling to identify days that have abnormal load profiles and to exclude them in the training so the load model isnt corrupted. Users
can update the abnormal days from the GUI.
Correlation and linear regression analysis to discover the linear relationship between input and target data by using a straight line.
We use the NI USB-6215 (http://sine.ni.com/nips/cds/view/p/lang/en/nid/203483) DAQ device to collect historical load data from the Wee Kim Wee School
of Communication and Information building at NTU. We process and store the data in a database we developed using LabVIEW. To collect the daily load
data, we connect the analog inputs of the DAQ device to the distribution grid in the building through a step-down voltage transformer, which is connected
to additional current and voltage sensors to obtain the voltage and current data, respectively.
We successfully integrated the load forecasting algorithm with the software modules in the MEMS unit. The implemented forecasting system is reliable
and accurate.
Unit Commitment
The unit commitment software module is an essential component of MEMS. Based on a forecasted demand profile, the software module assists the
microgrid operators in finding an optimized power generation schedule that minimizes the total operating cost if the microgrid is isolated or maximizes the
total benefit if the microgrid is connected to the main grid. Once the optimization process is complete, the results, including the on/off status and the
amount of kW dispatched from the generating sources, are sent to the MEMS optimal power flow module for processing. Unit commitment is one of the
most complex optimization problems in power system management. By using the scripts we created using the LabVIEW MathScript RT Module (
http://sine.ni.com/nips/cds/view/p/lang/en/nid/207267), it takes the software only seconds to determine the optimized solution of the formulated problem
based on several constraints and hundreds of variables (see Figure 5).
The software module includes the following features:
By using the LabVIEW MathScript RT Module, it can solve a complex unit commitment problem within seconds.
With the GUI built in LabVIEW, users can easily run the unit commitment module with default/customized settings.
By using the real-time capturing function of LabVIEW, the software automatically executes at a user-defined start time.
Once the optimization completes, the results are automatically saved in a user-defined path on the server and sent to the MEMS optimal power flow
1/7
www.ni.com
Once the optimization completes, the results are automatically saved in a user-defined path on the server and sent to the MEMS optimal power flow
module.
State Estimation
State estimation is a MEMS real-time function that uses measurements, circuit breaker status, and voltage regulator tap positions collected by Supervisory
Control and Data Acquisition (SCADA) to verify and estimate bus voltages in power systems. The estimated bus voltage magnitudes and voltage phase
angles are considered reliable state values of the system and are used as one of the inputs to the optimal power flow module. Its processed bus load
values are used as inputs to the load forecasting module.
The state estimation module has three subfunctions coded in the The MathWorks, Inc. MATLAB programming language based on the LabVIEW platform:
1. Topology processor determines network configuration by converting a node-oriented network into a bus-oriented network.
2. State estimation calculates bus voltage magnitudes and angles.
3. Bad data detection and identification verifies that the raw measurements are good before using them in the state estimation module.
When coding the state estimation module, it is challenging to ensure that it runs in any power network. Therefore, we used script blocks to increase the
flexibility when describing complex algorithms. Each subfunction is implemented using script blocks in LabVIEW. The inputs and outputs (1D and 2D)
transfer data between script blocks or to the front panel to display the results. A feedback node is also used to detect and identify bad data.
When formulating and processing matrix calculations, LabVIEW provides programming tools to code power system applications more easily, which saves
programming time.
We successfully incorporated the state estimation function with other MEMS functions and the microgrid hardware setup at LaCER, NTU (see Figure 6).
Unit Commitment
The Unit Commitment (UC) software module acts as one of the essential components of MEMS. Based on a forecasted demand profile, the software
module is able to assist the microgrid operators to find an optimized power generation schedule that minimizes the total operating cost while the microgrid
is isolated or to maximize the total benefit while the microgrid is connected to the main grid. Once the optimization process is complete, the results which
include the on/off status and the dispatch kW amount of the generating sources will be sent to the Optimal Power Flow (OPF) module of MEMS for
processing. UC is one of the most complex optimization problems in power system management. By using the MATLAB Script function of LabVIEW, the
software is able to determine within seconds the optimized solution of the formulated problem with several constraints and hundreds of variables. The
main GUI of UC is shown in Figure 5.
The software module has the following features:
By using MATLAB Script function of LabVIEW, a complex UC problem can be solved within seconds.
With the graphical interface built in LabVIEW, users can easily run the UC optimization with default/customized settings via simple clicks.
By using the real-time capturing function of LabVIEW, the software can be executed automatically at a user-defined Auto Start time.
Once the optimization completes, the results are automatically saved in a user-defined path of the server system and at the same time they are sent to
OPF of MEMS.
State Estimation
State Estimation is a MEMS real-time function which uses measurements, circuit breaker status and voltage regulator tap positions collected by SCADA to
verify and estimate bus voltages in power systems. The estimated bus voltage magnitudes and voltage phase angles are considered as the trustable state
values of the system and will be used as one of the inputs to OPF and its processed bus load values as inputs to Load Forecasting.
State Estimator has 3 sub-functions coded in Matlab programming language based on the LabVIEW platform.
1. Topology Processor: It determines network configuration by converting a node-oriented network into a bus-oriented network.
2. State Estimation: It calculates bus voltage magnitudes and angles
3. Bad Data Detection and Identification: It verifies that the raw measurements are good before using them in State Estimator.
When coding State Estimator, it is a challenge to ensure that it runs in any power networks. Therefore using script blocks is a way to increase the flexibility
when describing complex algorithms. Each sub-function is implemented by using script blocks in LabVIEW. The inputs and outputs (1D and 2D) are
created to transfer data from the script blocks to others or to Front Panel for displaying the results. A feedback node is also used as a filter of Bad Data
Detection and Identification.
When formulation and processing are based on matrix calculations, LabVIEW provides programming tools to code power system applications more easily
so it can save time for programmers.
The SE function has been successfully demonstrated in corporation with other MEMS functions and the microgrid hardware setup in the Laboratory for
Clean Energy Research, NTU. The main GUI for State Estimator is shown in Figure 6.
2/7
www.ni.com
Author Information:
Gooi Hoay Beng
(www.ntu.edu.sg)
School of Electrical and Electronic Engineering (S2-B7c-05) Nanyang Technological University
Singapore 639798
Singapore
Tel: +65-67905481
Fax: +65-67933318
[email protected] (mailto:[email protected])
3/7
www.ni.com
Figure 2: MEMS Main GUI developed using LabVIEW 2009 for monitoring all the power sensors installed.
4/7
www.ni.com
5/7
www.ni.com
Figure 6: Main GUI for State Estimation Function developed using LabVIEW
6/7
www.ni.com
Figure 7: Main GUI for Optimal Power Flow Function developed using LabVIEW
Legal
This case study (this "case study") was developed by a National Instruments ("NI") customer. THIS CASE STUDY IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (
http://ni.com/legal/termsofuse/unitedstates/us/ (http://ni.com/legal/termsofuse/unitedstates/us/)).
7/7
www.ni.com