├── Base64_Decode
├── Base64ExampleChart.PNG
├── Decode Base64 Using Cryptii.PNG
├── DecodeBase64UsingCryptii.PNG
└── README.md
├── Publications.md
├── QuickChecks.md
├── README.md
├── XML_Datagrams
└── README.md
└── images
├── README.md
└── Three Modules.PNG
/Base64_Decode/Base64ExampleChart.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenPMU/OpenPMUdocs/b1782c5698c382d99d917d772e681f5b04617b42/Base64_Decode/Base64ExampleChart.PNG
--------------------------------------------------------------------------------
/Base64_Decode/Decode Base64 Using Cryptii.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenPMU/OpenPMUdocs/b1782c5698c382d99d917d772e681f5b04617b42/Base64_Decode/Decode Base64 Using Cryptii.PNG
--------------------------------------------------------------------------------
/Base64_Decode/DecodeBase64UsingCryptii.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenPMU/OpenPMUdocs/b1782c5698c382d99d917d772e681f5b04617b42/Base64_Decode/DecodeBase64UsingCryptii.PNG
--------------------------------------------------------------------------------
/Base64_Decode/README.md:
--------------------------------------------------------------------------------
1 | # Decoding OpenPMU V2 Sampled Values from Base64
2 |
3 | This method can be implemented in many development environments. A visual example is given here to help understanding.
4 |
5 | ## Original Base64
6 |
7 | The following is 128 sampled values, 16-bit signed integers, encoded in Base64.
8 |
9 | **In Base64:**
10 |
11 | `JWMmESa8J2QoBCieKTEpuypAKrwrMSufLAYsZSy+LQ8tWS2bLdcuCS40LlUucC6CLn4uai5PLiot/y3KLY4tSSz+LKssUivyK4srGyqoKispqSkfKI8n9ydZJrUmCiVXJJ8j4CMaIk8heyClH8ce4x36HQwcGRsgGiIZIRgbFxEWBBTyE90SxhGqEIwPaw5IDSQL/ArUCaoIfQdRBiME9QPGApYBaAA5/wr92/yt+4H6Vfks+AL23PW49JXzdfJX8T7wJ+8S7gPs9+vt6ujp6Ojs5/XnA+YX5S/kTeNv4pnhyOD94Djfet7D3hLdZ9zC3CXbjtr+2nXZ89l42QTYlg==
12 | `
13 |
14 | The workflow to decode this back to decimal represention is visualised well using https://cryptii.com/
15 |
16 | 
17 |
18 | **In Hex:**
19 |
20 | `2563 2611 26bc 2764 2804 289e 2931 29bb 2a40 2abc 2b31 2b9f 2c06 2c65 2cbe 2d0f 2d59 2d9b 2dd7 2e09 2e34 2e55 2e70 2e82 2e7e 2e6a 2e4f 2e2a 2dff 2dca 2d8e 2d49 2cfe 2cab 2c52 2bf2 2b8b 2b1b 2aa8 2a2b 29a9 291f 288f 27f7 2759 26b5 260a 2557 249f 23e0 231a 224f 217b 20a5 1fc7 1ee3 1dfa 1d0c 1c19 1b20 1a22 1921 181b 1711 1604 14f2 13dd 12c6 11aa 108c 0f6b 0e48 0d24 0bfc 0ad4 09aa 087d 0751 0623 04f5 03c6 0296 0168 0039 ff0a fddb fcad fb81 fa55 f92c f802 f6dc f5b8 f495 f375 f257 f13e f027 ef12 ee03 ecf7 ebed eae8 e9e8 e8ec e7f5 e703 e617 e52f e44d e36f e299 e1c8 e0fd e038 df7a dec3 de12 dd67 dcc2 dc25 db8e dafe da75 d9f3 d978 d904 d896
21 | `
22 |
23 | **In Decimal:**
24 |
25 | `9571 9745 9916 10084 10244 10398 10545 10683 10816 10940 11057 11167 11270 11365 11454 11535 11609 11675 11735 11785 11828 11861 11888 11906 11902 11882 11855 11818 11775 11722 11662 11593 11518 11435 11346 11250 11147 11035 10920 10795 10665 10527 10383 10231 10073 9909 9738 9559 9375 9184 8986 8783 8571 8357 8135 7907 7674 7436 7193 6944 6690 6433 6171 5905 5636 5362 5085 4806 4522 4236 3947 3656 3364 3068 2772 2474 2173 1873 1571 1269 966 662 360 57 -246 -549 -851 -1151 -1451 -1748 -2046 -2340 -2632 -2923 -3211 -3497 -3778 -4057 -4334 -4605 -4873 -5139 -5400 -5656 -5908 -6155 -6397 -6633 -6865 -7091 -7313 -7527 -7736 -7939 -8136 -8326 -8509 -8686 -8857 -9022 -9179 -9330 -9474 -9611 -9741 -9864 -9980 -10090
26 | `
27 |
28 | **Graphically:**
29 |
30 | 
31 |
32 |
33 |
34 | These 128 samples represent half a nominal cycle. On a 50 Hz system, the period of time spanned by these sampled values, and across the x-axis of the chart, is 10 ms.
35 |
36 |
37 | _Looking for more information, or a paper to cite:_
38 |
39 | `D. M. Laverty, J. Hastings, D. J. Morrow, R. Khan, K. Mclaughlin and S. Sezer, "A modular phasor measurement unit design featuring open data exchange methods," 2017 IEEE Power & Energy Society General Meeting, Chicago, IL, USA, 2017, pp. 1-5, doi: 10.1109/PESGM.2017.8273986.`
40 |
--------------------------------------------------------------------------------
/Publications.md:
--------------------------------------------------------------------------------
1 | To follow
2 |
--------------------------------------------------------------------------------
/QuickChecks.md:
--------------------------------------------------------------------------------
1 | _Sampled Values_ are delivered on port **48001**.
2 | _Synchrophasors_ are delivered on port **48003**.
3 |
4 | * Kill old tasks using UDP Port 48001
5 |
6 | `sudo fuser -k 48001/udp`
7 |
8 | * See what's on UDP Port 48001 using netcat
9 |
10 | `nc -l -u 48001`
11 |
12 | -l listen, -u UDP
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenPMU
2 |
3 | OpenPMU is the Open Source Phasor Measurement Unit.
4 |
5 | What's a PMU? Why would you want one? Find out at www.openpmu.org/pmu-fundamentals :)
6 |
7 | We're also easy to get in touch with via www.facebook.com/OpenPMU - Say hi! :D
8 |
9 |
10 | 
11 | __*Fig. 1 - The three modules of the OpenPMU system*__
12 |
13 | OpenPMU is a structured modular system. Waveform **sampled values (SV)** are captured in the Data Acquisition module (red) and transported in an [open XML format](https://github.com/OpenPMU/OpenPMU/tree/master/XML_Datagrams) to the Phasor Estimation module (green). The **estimated phasors** are transported in an [open XML format](https://github.com/OpenPMU/OpenPMU/tree/master/XML_Datagrams) to the Telecoms module (blue) for **onward communication** using protocols including IEEE C37.118.2, IEC 61850-90-5 and STTP.
14 |
15 | The Data Acquisition stage is usually a hardware device measuring real data from a power system. However, it is also possible to feed OpenPMU with simulated data from either our own [XML SV Simulator](https://github.com/OpenPMU/OpenPMU_XML_SV_Simulator) or from a simulation environment such as DIgSILENT. The choice is yours!
16 |
17 | ### Repositories
18 |
19 | Most of our code is written in Python and has been tested using Python 3.9.4.
20 |
21 | We are organising a series of repos for various tools related to OpenPMU. These include:
22 |
23 | * **[OpenPMU Phasor Estimator](https://github.com/OpenPMU/OpenPMU_Phasor_Estimator):** A Python tool for producing synchrophasors from sampled values. Presently private, you will need to request access.
24 | * **[OpenPMU XML SV Simulator](https://github.com/OpenPMU/OpenPMU_XML_SV_Simulator):** Simulator which produces a stream of SV data as you would get from our BeagleBone Black GPS Disciplined ADC system.
25 | * **OpenPMU Data SV Plotter:** A Python tool with a GUI for visualising sampled value data from either an ADC or simulation.
26 |
27 |
28 | We'll be making these repos public soon once we have the source code well commented and explained. In the meantime, [check out our papers](http://www.openpmu.org/publications).
29 |
30 | If you're interested in collaborating, say hi on [Facebook](www.facebook.com/OpenPMU).
31 |
32 | ### Guide to PMU Technology
33 |
34 | Read the [OpenPMU PMU Fundamentals](http://www.openpmu.org/pmu-fundamentals) guide to understand what a PMU is.
35 |
36 | ### Highlighted papers
37 |
38 | * [GPS Disciplined Analogue to Digital Converter for Phasor Measurement Applications](http://ieeexplore.ieee.org/document/7931698/) (Open Access)
39 | * [OpenPMU: Open source platform for Synchrophasor applications and research](https://ieeexplore.ieee.org/abstract/document/6039607/)
40 | * [Synchronous islanded operation of an inverter interfaced renewable rich microgrid using synchrophasors](https://digital-library.theiet.org/content/journals/10.1049/iet-rpg.2017.0406)
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/XML_Datagrams/README.md:
--------------------------------------------------------------------------------
1 | # OpenPMU V2 - XML Datagrams
2 |
3 | The purpose of this document is to describe the XML datagram formats used within OpenPMU V2. There are two main datagrams in use in OpenPMU:
4 |
5 | * XML Sampled Values
6 | * XML Phasor Values
7 |
8 | ## Overview
9 |
10 | In OpenPMU V2, all aspects of the Phasor Measurement Unit data pipeline are rigidly modular. The three important modules in the pipeline are:
11 |
12 | * Data Acquisition (Usually an ADC, sometimes simulator or playback of recordings).
13 | ** Produces a stream of sampled values formatted in XML.
14 | * Phasor Estimation (estimates phasors from sampled values).
15 | ** Produces a stream of phasors formatted in XML.
16 | * Telecommunications (Usually an IEEE C37.118.2 or IEC 61850-90-5 adapter).
17 | ** Provides, for example, a TCP socket with which to connect by IEEE C37.118.2.
18 |
19 | You can find a detailed description of OpenPMU's modular configuration and data flows in [this paper](https://ieeexplore.ieee.org/document/8273986):
20 |
21 | `D. M. Laverty, J. Hastings, D. J. Morrow, R. Khan, K. Mclaughlin and S. Sezer, "A modular phasor measurement unit design featuring open data exchange methods," 2017 IEEE Power & Energy Society General Meeting, Chicago, IL, USA, 2017, pp. 1-5, doi: 10.1109/PESGM.2017.8273986.`
22 |
23 | Although XML is traditionally used to markup data in files, in OpenPMU it is used to markup data in streams of UDP datagrams. This makes the modules in OpenPMU completely plug and play, yielding a highly flexible system.
24 |
25 | The next sections provide a brief description of the XML datagram structures intended to help developers working on the OpenPMU system.
26 |
27 | ## XML Sampled Values (SV) Datagram
28 |
29 | An example of the datagram is given below. The first section of the datagram contains important metadata describing the structure of the sampled values.
30 |
31 | * **Format** indicates that this datagram is a _Samples_ datagram. This field is not required, but recommended.
32 |
33 | * **Date** and **Time** refer to the time at which the first sampled value (SV) in each payload was taken. Note: All channels are synchronously sampled, so sample 0 of Channel_0 was acquired at the same time as sample 0 of Channel_1, etc.
34 |
35 | * **Frame** is a sequence number which is useful to determine if frames of data have been dropped. Normally, the frames are sent at a rate of 2x the nominal system frequency, so on a 50 Hz system the frame number increments from 0 to 99 and then loops to 0. On a 60 Hz system, it loops between 0 and 119.
36 |
37 | * **Fs** is the sampling rate / sample frequency of the ADC. The period between sampled values (_Ts_) is given as _Ts = 1 / Fs_. In this example, the sampling rate is 12,800 Hz, so the period is 78.125 μs. This means that sample 1 occurs at time 22:04:00.000078125, and sample 2 occurs at 22:04:00.00015625, and so on.
38 |
39 | * **n** is the number of sampled values in each _Payload_. Here there are 128 sampled values in each payload. Multiplying _n_ by _Ts_ tells us that the payload represents 10 ms of waveform data.
40 |
41 | * **bits** is the number of bits per sampled value. In this case, 16 means that the sampled values are expressed as 16-bit signed integers.
42 |
43 | * **Channels** is the number of channels of data contained in this datagram. In this case, there are 3 channels.
44 |
45 | Each channel is described as starting with a tag named **Channel_N** where _N_ starts at 0. Within this tag there is metadata which is unique to that channel, and then the payload of sampled values.
46 |
47 | * **Name** is the name of that channel. Here the channel name is '_Belfast_Va_'. This name is used to name the phasors produced by the phasor estimator, and ultimately by the Telecoms interface.
48 |
49 | * **Type** states if the channel is a voltage channel '_V_' or a current channel '_I_'.
50 |
51 | * **Phase** states which phase the channel represents. This is useful when storing data from polyphase circuits as it avoids having to parse such information from the _Name_ tag, which might in the case of some end users may employ an esoteric naming convention. Typically these are labelled '_a_', '_b_', '_c_', '_n_'.
52 |
53 | * **Range** states the full scale deflection of the sampled values. In the case of signed 16-bit integers, this means that a value of 32,768 equates to a voltage of 275 V.
54 |
55 | * **Payload** the payload is the sampled values encoded in Base64. The reason for this is to map the binary data to a set of ASCII characters so that the datagrams can be passed and parsed through virtually any data manipulation tool. There is a trade off as it increases the size of the datagrams, but since these datagrams are intended for inter-module communication, often on the same localhost or devices in the same physical enclosure, this does not lead to any issues re bandwidth on external networks.
56 |
57 | ```xml
58 |
59 | Samples
60 | 2021-02-28
61 |
62 | 0
63 | 12800
64 | 128
65 | 16
66 | 3
67 |
68 | Belfast_Va
69 | V
70 | a
71 | 275
72 | JWMmESa8J2QoBCieKTEpuypAKrwrMSufLAYsZSy+LQ8tWS2bLdcuCS40LlUucC6CLn4uai5PLiot/y3KLY4tSSz+LKssUivyK4srGyqoKispqSkfKI8n9ydZJrUmCiVXJJ8j4CMaIk8heyClH8ce4x36HQwcGRsgGiIZIRgbFxEWBBTyE90SxhGqEIwPaw5IDSQL/ArUCaoIfQdRBiME9QPGApYBaAA5/wr92/yt+4H6Vfks+AL23PW49JXzdfJX8T7wJ+8S7gPs9+vt6ujp6Ojs5/XnA+YX5S/kTeNv4pnhyOD94Djfet7D3hLdZ9zC3CXbjtr+2nXZ89l42QTYlg==
73 |
74 |
75 | Belfast_Vb
76 | V
77 | b
78 | 275
79 | ..Base64..
80 |
81 |
82 | Belfast_Vc
83 | V
84 | c
85 | 275
86 | ..Base64..
87 |
88 |
89 | ```
90 |
91 | ## XML Phasor Values (PV) Datagram
92 |
93 | The structure of the phasor values datagram is largely similar to that of the sampled values datagram above. Much of the metadata, particularly that describing the individual channels, is copied directly from the SV datagram.
94 |
95 | * **Format** indicates that this datagram is a _Phasors_ datagram.
96 |
97 | * **Date** and **Time** indicates the time at which the phasor estimations contained within the datagram are valid. In this case, it is 460 ms past the top of the second.
98 |
99 | * **Frame** is a sequence check. This frame is Frame 23. The number of frames will depend on the rate at which phasors are estimated. If estimating at nominal frequecy, the _Frame_ number will loop between 0 and 49 (50 Hz systems) or 0 and 59 (60 Hz systems). It is useful to check programmatically for missing data.
100 |
101 | * **Algorithm** This is a free text field which is used to state the name of the algoritm in use. This is useful for subsequently comparing / evaluating / debugging various algorithms against the same test conditions.
102 |
103 | * **Channels** is the number of channels of data contained in this datagram. In this case, there are 3 channels.
104 |
105 | Each channel is described as starting with a tag named **Channel_N** where _N_ starts at 0. Within this tag there is metadata which is unique to that channel, and then the phasor values estimated by the phasor estimation algorithm (from the sampled values). Note that, usually, each phase is processed completely independently by the phasor estimator as if it had no knowledge of any of the other phases.
106 |
107 | * **Name**, **Type**, **"Phase**, **Range** are usually copied directly from the SV datagram.
108 |
109 | * **Mag** and **Angle** express the phasor value for that channel in polar form.
110 |
111 | * **Freq** is the frequency estimated for that channel. In IEEE C37.118.2, only one frequency is reported. The Telecoms module will handle this, often by using the frequency of only one channel, or an average, or some other manner selected by the user. In IEC 61850-90-5, frequency is reported for each channel.
112 |
113 | * **ROCOF** is the rate-of-change-of-frequency estimated for that channel. Note similar issue re onward telecoms as with _Freq_.
114 |
115 | ```xml
116 |
117 | Phasors
118 | 2021-02-28
119 |
120 | 23
121 | LSE V1.0 by Xiaodong Zhao
122 | 3
123 |
124 | Belfast_Va
125 | V
126 | a
127 | 275
128 | 240.00001
129 | 0.403
130 | 50.690
131 | 0.001
132 |
133 |
134 | Belfast_Vb
135 | V
136 | b
137 | 275
138 | 239.99988
139 | 120.904
140 | 50.692
141 | 0.000
142 |
143 |
144 | Belfast_Vc
145 | V
146 | c
147 | 275
148 | 239.99532
149 | -120.749
150 | 50.689
151 | -0.002
152 |
153 |
154 | ```
155 |
--------------------------------------------------------------------------------
/images/README.md:
--------------------------------------------------------------------------------
1 | Folder to store images for the Wiki.
2 |
3 | Unless otherwise stated, all images are copyright www.OpenPMU.org.
4 |
5 | Note to students: These images should not be used in student reports.
6 |
--------------------------------------------------------------------------------
/images/Three Modules.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/OpenPMU/OpenPMUdocs/b1782c5698c382d99d917d772e681f5b04617b42/images/Three Modules.PNG
--------------------------------------------------------------------------------