0% found this document useful (0 votes)
392 views

PyPMU - Open Source Python Package For Synchrophasor Data Transfer

SEP

Uploaded by

wvargas926
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
392 views

PyPMU - Open Source Python Package For Synchrophasor Data Transfer

SEP

Uploaded by

wvargas926
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

pyPMU Open Source Python Package for

Synchrophasor Data Transfer


Stevan andi, Boo Krstaji, Member, IEEE, and Tomo Popovi, Senior Member, IEEE

AbstractpyPMU is an open source Python package library during the transmission of synchrophasor data. The evaluation
that implements the IEEE C37.118 standard protocol for tools need to be simple to use and install with minimal
synchrophasor data transfer. Synchrophasor measurements dependency on third party libraries which sometimes might
provide a precise and time-synchronized phasor measurements have problems with installation. The pyPMU is made to meet
collected throughout power grid. The pyPMU library offers requirements mentioned above [10]. Python programming
various functions for supporting synchrophasor applications and
it enables rapid synchrophasor test bed implementations. The language, which is extremely popular and easy for scripting
paper provides detailed overview of the pyPMU package, its tasks, will ensure cross-platform compatibility. The well-
installation, and usage examples. The most interesting use documented library should enable simple application or test
scenarios include PMU simulator and PMU data stream splitter, bed development.
which have been described in the paper. The discussion The pyPMU library should represent solid ground for
illustrates initial benchmarking results and current issues. building complete suite for synchrophasor tools for
Finally, the paper outlines future work on the improvements and
practical applications. The pyPMU project is published under 3- simulation, communication and evaluation tools. The project
clause BSD license and made available at GitHub. aims are:
To provide high quality, well-documented and
KeywordsSynchrophasor; Phasor Measurement Unit; simple-to-use implementation of IEEE C37.118
Phasor Data Concentrator; Stream Splitter; IEEE C37.118. synchrophasor communication protocol: the library is
providing building elements needed to implement
various test scenarios, scalable test beds and
I. INTRODUCTION evaluation tools for synchrophasor applications. The
Synchrophasors represent a precise and time-synchronized library, in the form of a Python package, can be used
phasor measurements collected throughout power grid. to support the development of synchrophasor
Satellite synchronized clocks are used to enable time-stamped applications as well.
measurements, which make synchrophasor data aligned to the To facilitate research and education in
reference time base. Synchrophasor measurements provide an synchrophasors: pyPMU allows researchers and
accurate, dynamic and comprehensive view of a power system students in power systems to learn more about
[1]. Synchrophasor support tools play an important role in the synchrophasor in general. It enables researchers to
development of Wide Area Monitoring, Protection, and gain hands-on experience with synchrophasor
Control (WAMPAC) solutions, because they enable networking, testing, and applications. Researchers
validation of Phasor Measurement Units (PMUs), Phasor Data can further adjust and develop the source code,
Concentrators (PDCs), communication network and which allows them to learn about synchrophasors and
resources, phasor estimation algorithms and end-to-end tests software engineering.
[2][3][4][5]. The review of existing synchrophasor support To address industry challenges: if further developed,
tools revealed opportunities for the development of IEEE the pyPMU software package may provide the
C37.118 support tools suite independent of the platform and industry with a set of accessible and reliable
operating system [6][7][8]. Furthermore, such tools are synchrophasor tools, without having to invest
necessary to support synchrophasor application development significant energy into development or utilization of
and their evaluation [9]. An example is PMU simulator expensive commercial packages. Companies may
capable of sending realistic synchrophasor data streams, find it useful for development of supporting script
which may include phasor data corresponding to various test and evaluation tools.
scenarios such as pre-defined measurement, power system
faults, synchrophasor commands, etc. As for network testing, The paper is organized as following: after the Introduction
it is important to evaluate latencies, errors, and throughput section, Section 2 provides the project overview, which
discusses the structure of the Python package. In Section 3,
Stevan andi and Boo Krstaji are with Faculty of Electrical Engineering, the use of the library is illustrated with implementations of a
University of Montenegro, Dorda Vaingtona bb, 81000 Podgorica, PMU simulator and PMU data stream splitter. The Discussion
Montenegro (e-mails: [email protected], [email protected]). section covers known issues and the current roadmap for the
Tomo Popovi is with University of Donja Gorica, Donja Gorica bb,
81000 Podgorica, Montenegro (e-mail: [email protected]). project. Conclusions and references are given at the end.

978-1-5090-4086-5/16/$31.00 2016 IEEE


II. THE PROJECT OVERVIEW
from synchrophasor.pmu import Pmu
Project pyPMU became available to the public in March of
2016 in a form of GitHub repository. The main idea behind pmu = Pmu(ip=127.0.0.1, port=1410)
pyPMU project is to offer various set of applications and pmu.set_configuration()
pmu.set_header()
libraries for supporting the measurement of synchrophasors. pmu.run()
The software package is licensed under 3-clause BSD (BSD-
3) license. Publishing the pyPMU software package as open- while True:
if pmu.clients:
source project should enable inclusion of additional individual pmu.send(pmu.ieee_data_sample)
and institutional contributors.
The pyPMU package source-code is well-documented and pmu.join()
Python Enchantment Proposals (PEP) compliant. Cross Figure 2. Creating a PMU simulator using the pmu module.
platform compatibility and minimal third-party library
dependency principals ensure easy installation and usage. If no argument is provided for methods
Project structure is simple and it should be kept for the future set_configuration() and set_header(), the default
updates. Brief description of the project structure shown in configuration and header message will be loaded defined in
Fig. 1 is given below. module (Fig. 2).
To validate that it is really working, a third-party tool called
PMU Connection Tester is used to preview the received
measurements in real-time [12]. Figures 3 and 4 show that the
PMU Connection Tester correctly understood messages sent
by PMU simulator and successfully displayed their content.

Figure 3. Validating the configuration message.

Figure 1. The pyPMU package project structure.

Each file inside synchrophasor folder is single Python


module. Module frame represents the implementation of the
IEEE C37.118 synchrophasor communication protocol [11].
Modules pmu, pdc and splitter utilize frame module to
implement required functionalities. Inside the app folder,
ready to use scripts are provided and the folder examples
contains a set of useful snippets, which explain appropriate
usage of modules available in package. The folder tests is
meant to be a folder for various test and validation scripts.

III. USAGE EXAMPLES Figure 4. Validating measurements sent by the PMU simulator.

In this section, snippets for creating PMU, PDC and data- B. Phasor Data Concentrator
stream splitter are illustrated. The complete source code with Using the pdc module, a simple PDC can be created.
comments can be found inside the examples folder. Although it still has limited functionalities, this PDC will be
A. PMU simulator able to understand received messages and report if CRC of
newly arrived message fails. Current implementation does not
A simple PMU simulator that sends constant values can be
have a feature to aggregate multiple data streams into one and
found inside pmu module. The code snippet in Fig. 2.
send it to other destinations, which is left for future
illustrates how to create a PMU simulator using pmu module.
developments. The code shown in Fig. 5 creates a PDC that port are set to 127.0.0.1 and 1410 and these parameters
acts as a client and receives measurements. identify the source PMU. The listener IP and port are set to
127.0.0.1 and 1411 and these parameters tell the splitter to
from synchrophasor.pdc import Pdc simulate a PMU on that address and port. In the debug log in
Fig. 8, it can be seen that the first PDC has established
pdc = Pdc(pdc_id=9991, communication with the splitter and started receiving the data.
pmu_ip=127.0.0.1, Please note that the IP addresses for all devices in the example
pmu_port=1410)
are 127.0.0.1 since this was a test simulation test on a single
pdc.run() PC. For the practical purposes, it is recommended to disable
header = pdc.get_header() the debug output feature in order to achieve a significant
config = pdc.get_config()
pdc.start() # Request to start sending data
performance improvement in terms of data transmission
latency.
while True:
data = pdc.get() IV. DISCUSSION
if not data:
pdc.quit() In its current version, the pyPMU can be useful for
break researchers to quickly implement Python scripts to create and
Figure 5. Creating PDC using pdc module. manage synchrophasor data streams. One particularly
interesting usage of the library is the simple creation of PMU
simulator instances, which can play a major role in creation
C. Data-stream splitter
various synchrophasor evaluation testbeds. Another
One of the most interesting practical uses of the pyPMU at interesting application of the module is implementing PMU
the moment is implementing a synchrophasor data splitter data stream splitters, which may be useful both for testbeds
(Fig. 6), which is available in the splitter module. and future industry use. The library is expected to continue
growing and gain additional functionalities. The initial
benchmarking results showed that choosing multiprocessing
over multithreading was a good decision since the latency in
data transmission is constant even for bigger reporting rates
and multiple connected clients (i.e. PDC simulators). There is
a multiprocessing issue on the Windows platforms caused by
missing fork() feature [13]. Once this issue is resolved, the
pyPMU project will ensure promised cross-platform
compatibility.
The pyPMU package has the potential to fill in the gap in
the domain of synchrophasor related tools, especially for
research and education purposes. The rising popularity of
Python as a programming language and open platform,
Figure 6. Practical use case: data-stream splitter. together with a large availability of scientific tools, gives the
pyPMU edge in the domain of creation of synchrophasor test
Using the splitter module with just four lines of code a beds. For example, using the pyPMU library, one can
data stream splitter will be up and running, ready to pass data implement synchrophasor stream splitters to interconnect
frames received from source_ip and source_port address between various synchrophasor applications. The
to any PDC client accepted through a listener on implementation of the communication protocol can be
listener_ip and listener_port (see Fig. 7). extended to implement protocol mappers, various
visualizations, real-time synchrophasor data analytics,
from synchrophasor.splitter \
import StreamSplitter evaluation tools, etc. Making the project open source made it
possible for additional researchers and developers to use it,
stream_splitter =
test it, provide constructive feedback, as well as to contribute
StreamSplitter(source_ip=127.0.0.1,
source_port=1410, to it and expand it.
listen_ip=127.0.0.1, There are a few crucial functionalities that are missing in
listen_port=1502) the current release. First of all, User Datagram Protocol
stream_splitter.run() (UDP) transmission method for synchrophasors is not yet
stream_splitter.join() supported, but it is the main topic on the development team's
Figure 7. Creating data-stream splitter using splitter module. roadmap. Another important issue is that the current version
only supports Configuration Frame version 2 from the
A sample of real-time debug output for the data stream standard. Version 1 and 3 need to be added and the class
splitter with two connected PDCs is shown in Fig. 8. The first ConfigFrame needs to be refactored and to be used as an
line illustrates how to run the splitter script. The source IP and interface between all three versions. This will lead to
Figure 8. Data-stream splitter application real-time debug output.

additional simplification of the pmu, pdc and splitter the project is available as an open source software
module. At the moment, the PDC acts as client only, not under the liberal BSD license, which allows users to
capable for data streaming toward other PDCs (also known as use it freely, modify it, contribute to it, and even fork
super PDCs). Future development targets additional features it and create their own projects.
such as aggregating data streams and interfacing
synchrophasor database, which will enable implementations REFERENCES
of a fully functional PDCs. Future releases may also benefit
from methods for measurement extraction and simple [1] IEEE Power Engineering Society, IEEE Std C37.118.1, IEEE
Standard for Synchrophasor Data Transfer for Power Systems,, 2011.
manipulations, capturing the data streams for replaying,
[2] IEEE Standard, Test Suite Specification, IEEE Test Suite Specification
storing the measurements into a database, as well as from Version 2, pp. 1-43, 2015.
GUIs for example applications [14]. [3] I. C. Decker, M. N. Agostini, A. S. e Silva, D. Dotta, Monitoring of a
For the future work, the library will be expanded to include large scale event in the Brazilian power system by WAMS, in Proc.
VIII iREP, pp 1-8, 2010.
timing functionalities and synchrophasor algorithms in order [4] G. Heydt. M. Kezunovic, P. Sauer, A. Bose, J. McCalley, C. Singh, W.
to grow into a full blown suite of synchrophasor tools. Jewell, D. Ray and V. Vittal, Professional resources to implement the
Smart Grid, in North American Power Symposium (NAPS), pp 1-
82011, 2009.
V. CONCLUSION [5] P. Sauer, Educational needs for the Smart Grid workforce, Power and
This paper discusses an open source Python package called Energy Society General Meeting, pp 1-3, 2010.
[6] Grid Protection Alliance, openPDC, https://github.com/
pyPMU. The pyPMU package implements IEEE C37.118 GridProtectionAlliance/openPDC, last accessed: 9.4.2016.
synchrophasor communication protocol and it can be used in [7] iPDC, https://ipdc.codeplex.com, last accessed: 9.4.2016.
various research, development, and educational scenarios. [8] S. andi, T. Popovi, B. Krstaji, Alati za podrku mjerenju
sinhrofazora, IT14, abljak, 2014.
The main contributions of the presented research are: [9] E. National Electric Sector Cybersecurity Organization Resource,
Wide Area Monitoring, Protection and Control Systems (WAMPAC),
a Python library that implements IEEE C37.118 data 2012.
[10] pyPMU Github repository, https://github.com/iicsys/pypmu, last
transfer and works as a cross-platform software with accessed: 9.4.2016.
minimum dependency on third-party tools is [11] IEEE Power Engineering Society, IEEE Std C37.188.2, IEEE
provided; Standard for Synchrophasor Data Transfer for Power Systems, pp. 9-
43, 2011.
the library supports various usage scenarios such as [12] Pmu Connection Tester, https://pmuconnectiontester.codeplex.com/, last
PMU simulators, simple PDCs, synchrophasor data accessed: 9.4.2016.
splitter, which have been illustrated in this paper; [13] Porting UNIX applications directly to Win32,
https://msdn.microsoft.com/en-us/library/y23kc048.aspx, last accessed:
the use of the pyPMU enables implementation of 9.4.2016.
various synchrophasor test beds and provides support [14] pyPMU Roadmap,
for prototyping synchrophasor applications, thus may https://github.com/iicsys/pypmu/blob/master/TODO.md, last
accessed:9.4.2016
have an important role in research and education;

You might also like