Implementation of an IEC 61850-Based Metering Device Using Open-Source Software

The continued adoption of renewable energy and distributed generators has resulted in a rising number of supply points within the traditional electric power grid, necessitating the need for enhanced monitoring capabilities. The IEC 61850 standard can become an enabling technology for enhanced monitoring, but prohibitively high costs and complexity of compliant devices could become an impediment. Open-source IEC 61850 libraries, coupled with single-board computers and digital signal processors, provide a possible low-cost solution. This work presents the process of modelling and implementing such a device using an IEC 61850 open-source library, a Raspberry Pi embedded platform and an ADE9000 analogue front-end. Measurement accuracy and interoperability compliance tests are conducted to determine the suitability of the device for use in an industrial setting. A key contribution of the findings in this paper is the modelling and implementation of a viable, interoperable and low-cost IEC 61850-based power quality monitoring device using off-the-shelf components and an open-source software library. The implementation of this device provides a platform that is easily modifiable for use in a range of applications. Another contribution is the method of modelling IEC 61850 logical nodes and functions to analogue front-end measurement registers. The knowledge demonstrated shows how device modelling techniques can be used to extract additional information for mapping to existing logical nodes or to develop new ones. The paper’s findings result in a low-cost IEC 61850-based power quality monitoring device. The device has applications as a general utility-scale monitor for DER plants, check metering, IEC 61850-based power quality mitigation algorithms and short-term power quality studies. It may also function as a low-cost entry point to IEC 61850-based communications in smaller municipalities, and additionally as a lab test and prototyping tool for technicians, engineers and university students.


Introduction
The continued prominence of open-source software such as Linux and embedded hardware platforms such as Arduino for example have increased the development of cheaper alternatives to expensive vendor-built products for applications traditionally handled by industry-grade products. The adoption of open-source devices has been mostly observed in the field of metering. Digital signal processors (DSP) found in affordable Analogue Front-Ends (AFEs) allow for the accurate computation of complex algorithms at a fraction of the cost when coupled with open-source software and single-board computers. In critical infrastructure systems such as electric power grids, robust monitoring systems can improve situational awareness and response times to system faults.
Distributed Generation (DG) systems have distinct advantages over centralised systems; these include the potential for lower losses, a higher diversity of fuel types such as photovoltaics, fuel cells and wind; and finally, more options for economic dispatch. There are however several concerns that could potentially manifest themselves in terms of the complexity of distributed generation systems, monitoring and most importantly, power quality [1]. In the South African context the continued adoption of Small Scale Embedded Generators (SSEGs) due to frequent Eskom power cuts, rising electricity tariffs and attractive feed-in tariffs [2], has brought about the necessity of building robust monitoring and control infrastructure. With the continuing interest and growing penetration of distributed energy within the electric grid, there is a growing need to monitor and control the various energy generation and storage plants. A 2017 report by the North American Electric Reliability Council (NERC) recognised that the shift from conventional synchronous to asynchronous source such as inverter-based systems necessitated the need for proper modelling of DERs [3]. One of the findings within the NERC report was the use of the IEC 61850 standard as a basis for the information model used for defining data exchange [4]. This paper proposes the design and development of RasPQ, an open-source meter for the measurement, monitoring and transmission of power quality indices. The proposed device aims to be compliant with the IEC 61850 standard to ensure interoperability with available Substation Automation Systems (SAS).
Section II presents a brief literature review while Section III provides a brief introduction to the IEC 61850 standard. Section IV describes the hardware and software used in the realisation of this work and Section V details the implementation process of the device. Section VI describes the building, configuration and implementation of the IEC 61850 software library, Section VII and Section VIII details the MMS service mapping and interoperability testing respectively. Finally, Section IX presents a real-world example of a possible application for the implemented system, and Section X presents a conclusion and makes some recommendations for future research.

Literature Review
Typical power quality measurement systems are comprised of several modules that remain the same regardless of implementation. The following modules or stages are included in the typical power quality measurement system [5]: a) Signal conditioning: Manipulates the signal to prepare it for the next stage of processing b) Analogue-to-digital converter: Converts an analogue signal (typically a sinusoidal wave) into a digital signal. Translating it for data processing purposes c) Digital signal processing (DSP): a microprocessor mathematically manipulates digitised real-world signals such as voltage signals d) Data storage and management: Data is stored as either plain text or in a database as raw data e) Postprocessing: The data is further manipulated, typically to be transmitted via a specific communications protocol or scaled to a more readable format. f) Communications module: Handles the communications procedures between the data acquisition device and external devices g) Control subsystem: Control may be required to make adjustments to the output signal using a control algorithm.
An amalgamation of the previously mentioned modules produces the system architecture shown in Figure 1.  [5] According to Figure 1 as well as existing literature, an effective metering system requires the utilisation of digital signal processors for data acquisition, processing and postprocessing as demonstrated in [6], [7], [8] and [9]; with a notable example may be found at [10]. In [10], a data acquisition system consisting of a MAX180 connected to an Altera Stratix II EPS2S60 FPGA programmed to run algorithms for IEC 61000-4-30 and IEC 61000-4-7 standard measurements. A novel digital filtering approach is applied to estimate harmonics and interharmonics. The advantage of this approach is that it can be applied to any compatible FPGA, making it possible to develop a low-cost power quality monitoring instrument. The use of low-cost embedded systems such as microcontrollers, ARM-based single-board computers or the aforementioned FPGA for data processing, calculation algorithms and communications stack implementation is also a key enabling technology; this is demonstrated in [11], [10], [9], [12], [13] and [14].
Existing literature also indicates that the use of the IEC 61850 standard for data modelling, mapping and high-speed Ethernet-based communications is a critical aspect of modern monitoring systems. The implementation of the IEC 61850 standard for data modelling and mapping is demonstrated in [15], [16], [17], [18] and [19], and the utilisation of high-speed Ethernet-based communications networks for data transfer is shown in [20], [21], [13] and [22]. When more closely examining examples of the aforementioned literature, the IEC 61850 modelling approach described by [15] may be seen as a framework with which [16] uses to develop the network of PV plants communicating with deployed PQ monitors via IEC 61850. In this example, field events are transmitted between devices using Generic Object-Oriented Substation Event (GOOSE) messaging, allowing for faster response times for voltage ramping and smoothing. The advantage of high sampling rates, multicast sampled values, and the use of synchrophasors coupled with Phasor Data Concentrators (PDCs) networked with IEC 61850-based power quality monitors are showcased in both papers. For utility applications, a secure yet vendor interoperable system is vital, particularly with the increase in the use of fluctuating renewable resources that require a quick response when power quality issues are detected and demonstrated by [16]. This implementation yielded better power quality by mitigating the variability in PV generation; this is only possible in a network comprising of interoperable vendor instruments. Research on the use of open-source hardware and software development platforms for the implementation of power quality monitoring systems is discussed in [13] and [23]. In [23], a modular open-source platform for power quality monitoring in which the software could be modified according to the user's needs is presented. The use of open-source software enables the development of a license-free tool for energy and power quality monitoring. It is noted that the implemented system made it easy to deploy and modify a system using low-cost embedded systems and smart sensors.
The literature review reveals several common trends and technologies in the research and development of power quality monitoring systems. Based on the analysis performed during the literature review and the examples presented, the proposed RasPQ device is designed and developed to be accurate, flexible, modular, cost-effective, open-source, compliant with the IEC 61850 standard and small in footprint for easier deployment at SSEG/DG. The next section details the key concepts of the IEC 61850 standard.

Information Model
The IEC 61850 standard describes a broad set of object-oriented data models; these are used to describe processes, equipment and functions that are implemented and controlled in a typical substation environment. Service models to describe the interactions between devices commonly found in substations, and to facilitate the transfer of data to and from IEDs are some of the available features. Data objects, known as logical nodes, are used to standardise IED data, and this enables the possibility of readily sharing information in a network, regardless of the implementation. [24].
The IEC 61850 standard describes a virtual model of the real-world behaviour of primary and secondary substation equipment; this concept is depicted in Figure 1. This approach is used to model common information found in substation devices; the standard defines all of the information available for exchange with other devices. In the IEC 61850 standard, common information refers to the information that vendors and users have agreed to make available for open exchange between devices. Abstract models are used to define the information and information exchange; this along with the use of virtualisation allows engineers to represent aspects of real devices that are of interest in a particular implementation.
IEC 61850-5 describes the decomposition of an application into its smallest entities. These entities are then used to exchange information and are known as Logical Nodes (LN). Using Figure 1 as an example, as defined in IEC 61850-7-4, XCBR1 (yellow box) is a logical node that describes the functionality of a circuit breaker. A combination of logical nodes builds a logical device, which in the case of Figure 2 is the bay unit contained within the blue box. Logical devices may only exist on a specific IED; thus, logical devices may not contain logical nodes from other IEDs. Logical Nodes contain a list of available data ("Position" and "Mode" as in the case of XCBR1).

Data Model
Logical nodes can provide several specified data. Part IEC 61850-7-4 of the IEC 61850 standard describes the data provided by each specific logical node; each data item contains data attributes. Figure 3 is an example of a data model for the MMXU logical node. This data model presents a metering device capable of reading phase voltage (PhV), frequency (Hz), active power (W) and current (A), where these quantities represent the data objects. Data objects are divided into data classes as defined in part IEC 61850-7-3 of the IEC 61850 standard.
In the case of the data objects mentioned above, all except Hz are part of the phase-to-ground/neutral related measured values of a three-phase systems (WYE) data class, whilst Hz forms part of the Measured Value (MV) data class. The data classes determine the types of data attributes the data object contains. Each data object contains several data attributes, as shown in Figure 3 where A contains the phsA, phsB and phsC sub-data objects which represent the current measurements for each of the three phases. The phsA to C sub-data objects form a part of the Complex Measured Values (CMV) data class, which contains a large number of data attributes. It should be noted that Logical Node Zero (LLN0) is mandatory for all logical devices.

Communications Model
In the IEC 61580 standard, data is exchanged using various applications protocols via Specific Communication Service Mapping (SCSM) and Abstract Communications Service Interface (ACSI). Available application protocols include Manufacturing Message Specification (MMS), Transport Control Protocol/Internet Protocol (TCP/IP) and Ethernet.
One of the primary methods of transporting data between devices in the IEC 61850 standard is by mapping services and objects to the Manufacturing Message Specification (MMS or ISO 9506). MMS allows the exchange of real-time data and supervisory control information within a network or between applications [26]. The main advantages of MMS are that it is not dependent on the specific function being performed and is vendor agnostic, which allows for greater interoperability, which makes it ideal for use within the IEC 61850 standard.

Open-Source IEC 61850 Software Library
This section details the configuration and testing of the open-source IEC 61850 library. The LibIEC61850 open-source library developed by Michael Zillgith is chosen as the software library of choice. LibIEC61850 is a server and client library containing services that enable IEC 61850/MMS, IEC 61850/Generic Object Oriented Substation Event (GOOSE) and IEC 61850-9-2/Sampled Values communication protocols; the library may be obtained from [27] or [28]. Figure 4 shows an overview of the communications network with the aforementioned MMS and GOOSE capabilities. The library is compatible with both Windows and Linux operating systems and on these platforms, the Abstract Communication Services interface (ACSI) and GOOSE messaging are implemented as part of the Application Programming Interface (API) shown as the application domain (green boxes on top) in Figure 4. The ACSI is mapped to the MMS, and TCP/IP in the communications stack then transmitted via ISO/IEC 8802-3 (Ethernet) while GOOSE which is a peer-to-peer communication protocol bypasses the TCP/IP stack and maps directly to Ethernet. An unmanaged network switch is suitable for the initial setup and to establish communications.
LibIEC61850 is written in C, meaning that it is more suited for lower-end, resource-constrained hardware such as mobile computing platforms and ARM System-on-Chip (SoC) platforms. The C programming language is a low-level, procedural, compiled language as compared to Java which is high-level, object-oriented and interpreted. In terms of speed and code efficiency, the C language has the edge, which makes it ideal for this project, as the intention is to utilise low-cost, low power hardware and therefore, the LibIEC61850 software library is chosen.

Hardware Platform
The Analog Devices manufactured ADE9000 is selected as an Analog Front-End. The device supports the IEC 61000-4-30 as well as IEC 61000-4-7 standards. IEC 61000-4-30 provides a standard for measurement and interpretation of results, whilst IEC 61000-4-7 provides methods for harmonic analysis. The quantities measured by the ADE9000 are in line with the standards required to accurately determine values of the dip level, swell level and total harmonic distortion. In systems with sensitive equipment, obtaining reliably accurate data with standard measurement techniques is vital for maintaining the quality of supply.
For the selection of a single-board computer; small size, low-cost, Ethernet capabilities and the ability to interface with the ADE9000 via SPI communications are primary requirements, with an added requirement of running Linux, WIN32, Mac OS X or FreeBSD operating systems. The primary focus is cast on Advanced RISC Machine (ARM) based development boards with Linux compatibility. These types of development boards form an ideal platform for prototyping and building the LibIEC61850 software library, mainly due to the versatile, standardised nature of the ARM hardware architecture and the mature development of open-source Linux distributions compiled to run on ARM-based hardware. ARM's standard instruction set and workflow allow for greater interoperability between implementations of the same system, hence the ease at which various Linux distributions can be ported and compiled on ARM-based systems. The Raspberry Pi hardware platform is selected, primarily for the inclusion of Gigabit Ethernet and low price point. Gigabit Ethernet speeds are advantageous for interfacing with industrial-grade, data network switches that require lower latency and higher speeds for GOOSE messaging. Table 1 shows the data registers available on the ADE9000 along with their respective IEC 61850 logical node mappings. All measurements and events can be extracted per phase on the ADE9000. Each register name is suffixed or prefixed with an "x", in place of the phase (A, B or C The data registers mapped with their equivalent logical nodes, can be represented as a data model, as shown in Figure 5. Figure 5 shows the data model of the New Power Quality Device (RasPQ) developed in this research, extrapolated from the mappings in Table 1. On the input side, a Current Transformer (CT) and Voltage Transformer (VT) provide the raw analogue data to be processed by the ADE9000 to produce status and measurement data. The status and measurement data are extracted via the selected registers to create a logical device containing the QVVR, MMXU and MHAI logical nodes.   Figure 6 illustrates in block form, the components and the resultant system when combined. The voltage and current sensing interface consist of a voltage divider circuit and a burden resistor circuit. The voltage divider resistor circuit is used to lower the AC voltage from the secondary side of the VT or 230V mains to a value that is within the full-scale value of the analogue to digital converter. The current sensing circuit consists of two centre tapped burden resistors to generate a differential, antiphase signal from the CT output current and an antialiasing RC filter.

Data Acquisition System
In the ADE9000, the ADC receives the filtered signals and converts them to digital values according to predefined full-scale codes. The digital values are sent to digital signal processing functions which calculate and process various predefined indices, and stores the results in data registers. Finally, the ADUM6404 and ADUM4151 provide digital isolation for serial peripheral interface data transferred to and from the Raspberry Pi. Isolation is essential to protect sensitive devices as well as prevent electrocution from the 230 V input. Figure 7 shows the manufactured printed circuit board, with all of the stages defined in Figure 6 identified by the coloured rectangular numbered outlines. Component sizing for the voltage and current sensing circuits may be determined by calculating resistor divider and burden resistor value, respectively. The ADE9000 user guide contains procedures for calibrating and configuring the measurement outputs of the ADE9000. First, transfer functions are determined using several system parameters. These system parameters are user-defined, based on the component selection and the type of system to be measured, for example, burden resistor values are used for determining the transfer function for current readings and voltage divider resistor values for voltage readings.  Table 2 shows the final derived conversion constants; the conversion constants are multiplied by the raw register data value to convert the register value to the equivalent physical analogue quantity.

. SCL File Creation and Static Model Generation
The LibIEC61850 library uses an IED Capability Description (ICD) file to generate an IED model. The file is written in the standard syntax of a Substation Configuration Language (SCL) file as described in IEC 61850-6. The ICD file is used to describe the capabilities of an IED. The SCL file contains a communications section that describes the communications network and an IED section describes the data sets, reports and GOOSE control block defined in the configuration. A data type template section used to define the data types used in the data set is also present. The following datasets are defined based on the logical nodes identified in Table 3. Referring to Table 3, in the QVVR dataset, three Functional Constraint Data Attributes (FCDA's) are present for data objects VarStr, DipStr and SwlStr in the QVVR_Event dataset. All three belong to the MET logical device instance and QVVR logical node class. The functional constraint is "ST", meaning all three are constrained to only status functions, and finally, the data attribute is "stVal" or status value.
The dataset for MHAI_Measurement is shown to have FCDA's for instances of MET and the logical node class MHAI, the functional constraint (FC) is MX, logical node instance is 1, the data object is ThdA or ThdPhV, and finally, the data attribute is "phsA.cVal.mag.f". The FCDA is replicated for all three phases for both ThdA and ThdPhV. The dataset for MMXU_Measurement is configured similarly to MHAI_Measurement, only with three data object types (A, PhV and PF) instead of the two present in the dataset mentioned before. Each dataset is configured with a GOOSE control block (GoCB) to enable GOOSE publishing. The GoCB is vital for enabling GOOSE communications. Each GoCB has a unique name ("name") that describes the specific instance of the GOOSE Control Block and the name of the dataset ("datSet") to be sent The GOOSE Control Blocks mentioned above have been defined according to Table 4.
The written ICD file is used to generate a static model for IEC 61850 configuration on the Raspberry Pi. The static model is a conversion of the XML-based ICD document to standard C code; this allows the device to access the datasets and logical node definitions programmatically. Static model generation is achieved using the included java program, genmodel.jar. Figure 8 shows the ICD file selected in the static model generator, executing the program results in the generation of the static model, which results in static_model.c, the command used to run the generation procedure is "java -jar genmodel.jar scl_file_name.icd". The generated C code is available in static_model.c, whose function and macro declarations can be accessed by including the static_model.h header file in the main program. Generation of the static model requires the ICD file and the genmodel.jar program file to be in the same folder.

MMS Server and GOOSE Publishing
The last consideration in terms of software is the source code for the IEC 61850 functions. Although the LibIEC61850 library supports a large number of functions, only a few are required to implement GOOSE publishing and an MMS server on the Raspberry Pi. Figure 9 shows a snippet of source code to create an IED server within the open-source library. An IED server object is created using the static model generated in the previous section. The function "IedServer_start()" is invoked with the "IedServer" object as an argument, within the main program, the server is continuously listening for client connections. MMS clients may also be implemented using LibIEC61850, as shown in Figure 10. Instead of an IED model, the IedClient requires a connection; the connection is comprised of an IP address and port no. The IP address is the address of the IED server, and the port number is the TCP port number. This implementation does not make use of a client connection since it connects with an RTU or SCADA system; as such, the focus is primarily on the implementation of an MMS server.  Figure 11 shows a flow chart of the necessary start-up procedure of the LibIEC61850 MMS server and GOOSE publishing. The procedure is standard for any source code containing GOOSE and MMS communications within the LibIEC61850 library. The following is a summary of the procedure: 1. The generated IEC 61850 model is imported from the SCL file 2. Necessary variables are declared 3. Create a new server configuration object and set parameters if necessary 4. Check command line input for specific GOOSE interface. 5. If the interface is entered in the command line: GOOSE interface ID = entry. else, GOOSE interface ID = eth0 6. New IEC 61850 server instance is created using a configuration object 7. Start MMS server and begin listening for clients on port 102 8. Enable GOOSE Publishing The read function forms the basis of the integration between LibIEC61850 functions and a critical component of the "main loop", the return values from reading functions are used to update data attributes. In Figure 12, the result of the ADE9000 register readCurrent () function is stored in float variable AIRMS. The value of the variable above is then written to the IED server as a data attribute in the MMXU logical node instance using one of the built-in LibIEC61850 update functions. The timestamp and float attributes are both updated in the IED server in this example. Data attributes are read and written in this manner and transmitted either using GOOSE or MMS depending on the desired communication protocol.  Finally, an enclosure is constructed using two sheets of acrylic. As shown in Figure 13, the PCBs of both the Raspberry Pi and data acquisition boards are sandwiched between the acrylic sheets using spacers. The final implemented device has a small footprint suitable for installation in smaller cabinets.

Measurement Accuracy Confirmation
With the implementation of the measurement system completed, voltage and current signals may be injected to confirm measurement accuracy. The signal injection is performed by the OMICRON CMC 356 and the Quick CMC Test Module software. Figure 14 shows the Quick CMC Test Module software with Current and Voltage outputs configured. A reference value is obtained by first measuring the injected signals with a digital multimeter; then the reference measurement is compared to the one obtained from the implemented device. The results are shown in Figures 15 and 16, which compares current and voltage readings taken from the digital multimeter and developed metering device (RasPQ) in the form of a graph. In Figure 14, ten voltage samples ranging from 150 V to 240 V are injected. Readings are taken using the digital multimeter and then the developed metering device (RasPQ). The results indicate a high level of consistency and accuracy when compared to the digital multimeter.  The remaining power quality measurements are computed using the voltage and current signals. Achieving a high level of accuracy when calibrating the current and voltage ensures an equal level of accuracy for the power quality measurements as long as calibration is performed and conversion factors are correctly calculated.

Procedure Overview
Testing the open-source implementation of IEC 61850 at a functional level is done using the IED Explorer software. IED Explorer is a free, open-source software package that allows the end-user to connect to an IED, inspect MMS variables and capture MMS packets, among other features [29]. The IEDExplorer software is ideal for testing the conformance of various MMS and ACSI services on the implemented device. Figure 17 is a diagram that illustrates the structure of the communications network used for testing MMS and ACSI services using IED Explorer. The software is installed on a Windows PC, which is networked with the Raspberry Pi via a Local Area Network. IED Explorer functions as an MMS client, sending MMS service requests, but can also be configured to send GOOSE messages. The MMS service requests are sent using the MMS protocol via TCP/IP, the messages are received by the Raspberry Pi and mapped with ACSI services according to IEC 61850-8-1 SCSM. The response from the Raspberry Pi is sent using LibIEC61850 functions, which are mapped back from ACSI to MMS services. The IP address of the device (192.168.1.96) is entered in the software configuration along with the TCP Port number. Initiating the MMS transactions causes packets to appear in the "CaptureView" window, as shown in Figure 18. The MMS read service can be mapped to various ACSI services depending on the type of data being read. Figure  18 shows a Protocol Data Unit (PDU) for requesting data from the MET logical device along with the subsequent response from the device; the read MMS service is mapped with the GetAllDataValues ACSI service. The data being requested is of the functional constraint DC (Description), which encompasses the device information (nameplate, vendor, swRev and d).
The response provided by the device contains unique nameplate information found only in the ICD file (vendor name "vendor", software revision "swRev", and device "d"). Subsequent read requests are sent to acquire the remaining data values, such as Goose control blocks, data sets and the functional constraints of the remaining logical node instances. The packets received, prove the conformance of the device as per the MMS read standard described in IEC 61850-8-1 Page 102 [30] as well as its mapping with the GetAllDataValues ACSI service.
Next, Figure 19 shows the GetNameList request PDU sent by the IED Explorer software and the response PDU sent by the PQM device. The XML tree shows the contents for both the request and the response MMS PDUs. GetNameList of ObjectClass 9 is requested, the prescribed response for the GetNameList service contains a mandatory "list of identifier" sequence, according to the conformance statement table for GetNameList in IEC 61850-8-1 Page 100 [31]. By examining the screenshot in Figure 18, the following conclusions can be made:  The example featured in Figure 19 returns RasPQMET, which is the name of the IED (RasPQ) and the Logical Device (MET) within the IED.  The second GetNameList transaction observed in IED Explorer returns a list of the logical nodes configured within the logical device, MET.  It thus may be concluded that the PQM device conforms with the standard GetNameList service by responding with a "list of identifier" sequence.
The GetNamedVariableListAttribute request is sent for each of the datasets available on the IED, along with the responses from the MMS GetVariableAccessAttributes and read service requests, an overview of an existing IED's configuration and structure can be built within the IED Explorer software. Figure 20 shows a snapshot of the IED structure once all of the required MMS responses have been received from the PQM device. All logical node instances, data sets and reports configured on the device are reported along with their contents.  In Figure 21, the number of GOOSE messages received from the device is presented in the information bar above the captured data. The information bar is useful for confirming where the GOOSE messages are originating. Confirmation may be done by cross-referencing the MAC address using the address resolution protocol "arp -a" command in the command line. The "Goose Rcvd" statistic provides a live update of the number of Goose messages currently published. Table 5 shows the MMS and ACSI service mappings confirmed using IED Explorer. The successful confirmation of these services proves that the metering device may be discovered in the same fashion as any other vendor-built IED and LibIEC61850's implementation of the standard is accurate. LibIEC61850 supports 60 ACSI services and are listed at [32], but not all can be and need to be tested within the scope of device implementation. MMS services mapped to ASCI services such as GeAllDataValues, GetDataDirectory and GetDataSetDirectory are proved to be correctly mapped within the IEC 61850 library. GOOSE messaging is also successfully tested and confirmed.

Setup and Configuration
A SEL RTAC (Real-Time Automation Controller) 3555 is selected as the vendor-built device for testing interoperability. SEL uses the AcSELerator Architect software to configure the IEC61850-based communications on the RTAC along with a wide range of IEDs. The software also allows for the importation of IEDs from other vendors using an ICD file, which provides SEL devices with the ability to interact with dataSets originating from other vendors in the form of MMS client inputs and GOOSE subscriptions.
The SCL file created earlier and used to generate the static model is inserted into the software's IED palette and used to create an IEC 61850 project. The defined datasets within the ICD file are used as client inputs, and the RTAC 3555 subscribes to the GOOSE control block in the SCD file generated by AcSELerator RTAC. The SCD file may then be loaded into the AcSELerator RTAC software as an IEC 61850 configuration. Uploading the RTAC project concludes the configuration of RTAC 3555 to receive MMS and GOOSE messages from the implemented device. Finally, an HMI display, as shown in Figure 25, is created using the AcSELerator Diagram Builder Software by importing the tags generated by the RTAC project uploaded to the RTAC 3555. Successfully uploading the configuration to the RTAC means it is possible to test the interoperability of the implemented device by attempting communications with the automation controller. Figure 22 shows the testbed for demonstrating the implemented device's ability to communicate with the RTAC automation controller. The device is connected to an ethernet switch to network the device with the RTAC; the CMC 356 is used for signal injection of voltage and current values for demonstrating measurement data attribute updates.

Figure 22 Interoperability Demonstration Testbed Setup
Starting the MMS server as on the Raspberry Pi opens a connection between the MMS client and server, and also initiates GOOSE publishing. Communications may be monitored by starting a Wireshark capture; the resulting capture may be used to confirm the data acquisition method as specified in the SCD file. Figure 23 shows a Wireshark capture of the mandatory initiate MMS service as described in section VI; in this case, the SEL RTAC initiates communications with the Raspberry Pi as the MMS client. Being a mandatory service, the "initiate-RequestPDU" is present in MMS transactions of both data acquisition methods. Once initialisation between the client and server is complete, the MMS transactions differ based on the data acquisition method. Figure 24 shows a screenshot of the MMS requests and responses for the polled dataset configuration as well as report or unsolicited report communications method present in the second SCD configuration file. In the polled dataset configuration, the MMS client (IP address 192.168.1.170) requests datasets "MMXU_Measurement" and "MHAI_Measurement" from the MMS server (IP address 192.168.1.96). The report configuration transmits the datasets without the need of request PDUs from the MMS client, and reports are sent periodically from the server without the need for client requests or confirmations. Figure 25 shows data updating on the HMI display. 230V and 1 A is injected via Quick CMC, this causes the Amps and Voltage data attributes, along with the computed Frequency, Power Factor, Active Power, Apparent Power, VTHD and ATHD attribute to update and be transmitted to the RTAC via MMS. Dip and Swell data attributes may also be toggled and are updated using GOOSE messaging. The RTAC being able to receive the MMS and GOOSE messages proves interoperability and that the implemented device may be used with commercially available controllers. The device is recognised in the same way any third-party device would be by the SEL software and communicates without any issues

DER Control and Monitoring
In Figure 26, a detailed information model for a small-scale embedded generator or DER plant is presented. In IEC 61850-7-420, logical nodes specifically developed for DERs are described, it is possible to model and implement the logical nodes on the PQM device. Along with the existing logical nodes from the power quality (Q) and metering (M) logical node classes, the functionality of the device could feasibly be expanded to control and monitor DER with an extensive utility-scale network.
Using the logical nodes defined in IEC 61850-7-420, the components and equipment related to the monitoring and control of a photovoltaic plant may be accurately modelled. The several components that photovoltaic plants are comprised of such as the Maximum Power Point Tracking (MPPT) controller, inverter unit and battery storage bank can be modelled using IEC 61850-7-420 logical nodes. To interface with the photovoltaic plant devices, the RasPQ Meter can be modelled as a DER controller also according to the IEC 61850-7-420 part of the standard.
Along with monitoring and controlling the DER unit, the device may also be used for check metering alongside a utility revenue meter due to the inclusion of kWh energy readings within the ADE9000's DSP computations as shown in Figure 26. The data may then be transmitted to a substation controller such as the RTAC and then a central SCADA control system. A bidirectional energy meter may also be implemented, as demonstrated by [33] whose prototype of a bidirectional meter explicitly designed for DER's utilises the ADE9000 as the data acquisition device.

Practical Use Cases
Besides the control and monitoring of DERs and bidirectional metering, several potential applications may also be made available for implementation by extending the functionality of the implemented device. The examples presented would require minimal modification to effectively implement working prototypes, which could prove useful for further expanded research investigating possible use cases.

Smart Metering
The simplest use case for the implemented device is as a low-cost smart meter in an advanced metering infrastructure (AMI) environment. In [34], an example of an IEC 61850 standard-compliant device is presented. IEC 61850 device models for smart metering functions are formulated and used to implement a system of distributed, interoperable, intelligent smart meters that can effectively communicate and increase situational awareness. In the current implementation, the device has the required capabilities for smart meter operation.

PQDIF and COMTRADE File Transfers
File transfers of metering and disturbance data via the implementation of the COMTRADE (Common format for Transient Data Exchange) or PQDIF (Power Quality Data Interchange Format) file formats. The Raspberry Pi's Ethernet capabilities combined with the LibIEC61850 implementation would allow for the transfer of disturbance recorder files using COMTRADE logical nodes RDRE, RADR and RBDR. In its current state, the device can compile and transmit COMTRADE files with minor source code modifications and implemented within a power quality monitor or smart meter.

Power Quality Mitigation and Compensation
Power quality mitigation and compensation systems like photovoltaic ramp-rates. Power ramp-rate control is used to limit the fluctuations in the PV output power under dynamically changing irradiance conditions, such as temporary cloud cover [35]. Ramp-rate control algorithms can be programmed on the Raspberry Pi and setpoints sent to the MPPT controller using GPIO interfacing pins and the IEC 61850-420 logical nodes. Additional hard interfaces and software are required to interface with a third-party PV controller, but the device in its current form would form a good base for implementation.

Conclusions and Recommendations
This paper showcased the use of open-source IEC 61850 libraries coupled with low-cost ARM-based single-board computers, and DSP-based analogue front ends to develop and implement a metering device for power quality monitoring.
The following deliverables are achieved:  A brief literature review is performed to provide context and direction for the proposed implementation of the measurement of the device.  The IEC 61850 standard is explained and described to demonstrate the suitability of the standard for the intended implementation.  An overview of the open-source software package (LibIEC61850 software library) and hardware platforms (Raspberry Pi and ADE9000) selected for the implementation is provided.  The conception of the IEC 61850 device model and data acquisition system is described, then a PCB is designed and manufactured.  Next, an ICD file with the relevant data objects is written for static model generation. The open-source IEC 61850 library is built, customised and implemented on the Raspberry Pi, and the data acquisition software is written to interface with the ADE9000.  Finally, measurement accuracy, MMS and ACSI service mapping conformance, and interoperability with IEC 61850 compliant devices are verified and tested. An example of a real-world application using the implemented device is also presented.
A device such as the one described in this paper would prove useful for monitoring small-scale embedded generators and distributed generation plants. Additional applications include their potential use at educational institutions as a training tool for students learning about embedded programming, computer systems and substation automation. Technicians and engineers could also utilise the device for prototyping new logical nodes and algorithms before implementing them in a substation environment.
A comprehensive case study performed by simulating a real electricity network using a hardware-in-the-loop simulation system such as the real-time digital simulator (RTDS), would be beneficial toward proving the device's efficacy as an IEC 61850 compliant IED. The simulation could then be followed by a subsequent real-world pilot over several months in a similar network, after the required hardening of the hardware for industrial use.