- Notifications
You must be signed in to change notification settings - Fork53
pyPMU - Python implementation of the IEEE C37.118 synchrophasor standard
License
iicsys/pypmu
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Synchrophasor module represents implementation of IEEE C37.118.2standard in Python.synchrophasor
module is still in development phasebut we have a few very interesting tools.
Synchrophasor module is made to be easy to install and run.
You will needpython3
to run module correctly. Checkyour Python version:
python --version
If you're using Python 2 version you can installPython 3 alongside withPython 2.
Install using
pip
for Python 3:pip3 install synchrophasor
You can download this project as
zip
file and extract it or clone itusing gitgit clone https://github.com/iicsys/pypmu.git
and then runpython3 setup.py install
inside project folder.
Right now we only have one test for frame encapsulation validation. Youcan check it like this:
python3 tests/validate_frames.py
IfAssertionError
isnot shown you're good to go!
Inside examples folder you will find a few useful examples that utilizesynchrophasor
module.
Possible practical use of the synchrophasor module would be data-streamsplitter. In case you need to send phasor measurements to multipledestinations following 4 lines of code will do it:
from synchrophasor.splitter import StreamSplittersp = StreamSplitter(source_ip="127.0.0.1", source_port=1410, listen_ip="127.0.0.1", listen_port=1502)sp.run()
With only few lines of code you can bring up a PMU simulator which willsend constant phasor measurements to connected PDCs.
from synchrophasor.pmu import Pmupmu = Pmu(ip="127.0.0.1", port=1410)pmu.set_configuration() # This will load default PMU configuration specified in IEEE C37.118.2 - Annex D (Table D.2)pmu.set_header() # This will load default header message "Hello I'm tinyPMU!"pmu.run() # PMU starts listening for incoming connectionswhile True: if pmu.clients: # Check if there is any connected PDCs pmu.send(pmu.ieee_data_sample) # Sending sample data frame specified in IEEE C37.118.2 - Annex D (Table D.1)pmu.join()
Here's an example of a very simple PDC. tinyPDC supports only oneconnection to a PMU and still cannot understand measurements orconfiguration but with your help we can learn tinyPDC to readData Frames and Configuration Frames
from synchrophasor.pdc import Pdcpdc = Pdc(pdc_id=7, pmu_ip="127.0.0.1", pmu_port=1410)pdc.run() # Connect to PMUheader = pdc.get_header() # Get header message from PMUconfig = pdc.get_config() # Get configuration from PMUpdc.start() # Request to start sending measurementswhile True: data = pdc.get() # Keep receiving data if not data: pdc.quit() # Close connection break
If you really don't want to know what is inside of these scripts we'veprepared applications for you insideapps
folder.
Make them executable like this:
chmod +x splytter.py
Then you can ask for help like this and you will find usage examplethere:
./splytter --help
If you don't want to bother writing your own script for stream splitteryou can runsplytter
application like this:
./splytter.py -i 10 -sip 127.0.0.1 -sp 1410 -lip 127.0.0.1 -lp 9991'
If you need a PMU simulator for a network test or something like that youcan run thepmy
application which will send constant data frames to allconnected PDCs:
./pmy.py -i 511 -ip 127.0.0.1 -p 1995 -r 30'
Sincesynchrophasor
module is in early development phase we'remissing a few very important things.
- We don't have UDP connection supported yet but TCP looks like it'sworking as it should.
- We don't have Configuration Frame 3 implemented.
- We don't have out-of-the-box data stream aggregation for PDC.
If you feel like you could help us, with testing or developing pleasedo not hesitate to contact us:stevan.sandi@gmail.com ortp0x45@gmail.com.
- Please checkTODO.md to find out where you can help us.
- Fork this repo.
- Create new branch:
git checkout -b fixing-your-stupid-bug
- Commit changes:
git commit -m 'There you go! Fixed your stupid bug.'
- Push changes to the branch:
git push origin fixing-your-stupid-bug
- Submit pull request.
- Tomo Popovic -
synchrophasor
module project leader. - Bozo Krstajic -
synchrophasor
module project adviser. - Stevan Sandi -
synchrophasor
module project developer.
Please checkLICENSE.txt.
- C37.118.2-2011 - IEEE Standard for Synchrophasor Data Transfer for Power Systems,>>
If you use the pyPMU code for your research, please cite the following publication:
S. Sandi, T. Popovic, "pyPMU – Open Source Python Package for Synchrophasor Data Transfer", IEEE 24th Telecommunications Forum (TELFOR), Belgrade, Serbia, Nov 22-23
S. Sandi, T. Popovic, B. Krstajic, "Python Implementation of IEEE C37.118 Communication Protocol", Journal of Electrical Engineering, Faculty of Electrical Engineering, University, Podgorica, Montenegro, Vol. 21, No. 1, December 2015, pp 108-117
About
pyPMU - Python implementation of the IEEE C37.118 synchrophasor standard
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.