iicsys / pypmu

pyPMU - Python implementation of the IEEE C37.118 synchrophasor standard
BSD 3-Clause "New" or "Revised" License
62 stars 46 forks source link

how to simulate arbitrary data which is fed to pypmu? #2

Closed Tibalt closed 7 months ago

Tibalt commented 6 years ago

Hi, Or how do I feed arbitrary data to pypmu to send out in 32.118?

Thanks.

Regards Tibalt

sstevan commented 6 years ago

Hello @Tibalt,

Please check randomPMU.py script inside examples folder.

pmu.send_data(phasors=[(random.uniform(215.0, 240.0), random.uniform(-0.1, 0.3)),
                                   (random.uniform(215.0, 240.0), random.uniform(1.9, 2.2)),
                                   (random.uniform(215.0, 240.0), random.uniform(3.0, 3.14))],
                          analog=[9.91],
                          digital=[0x0001])

Method send_data will pack custom phasor values into data frame. Eg.

pmu.send_data(phasors=[(220.0, 0.01), (221.5, 1.9), (219.0, 3.12)],
                          analog=[9.91],
                          digital=[0x0001])

Where the first element of the tuple (220.0, 0.01) represents the magnitude and the second one represents the angle of the phasor.

Tibalt commented 6 years ago

Hello @sstevan

Thanks for the quick response! I found randomPMU.py yesterday and verified it with PMU connection tester from GridProtectionAlliance. Briefly went through the code and the protocol is separated from communication which make each part easy to understand. Good job.

Since it is in python, I wonder do you have any experience running it in embedded environment? If there is, what hardware is it?

Thanks!

Regards, Tibalt

sstevan commented 6 years ago

We have not tried to run it on embedded hardware, but you should be able to run it if you have Python 3 on it. Performance depends mostly on data reporting rate.