hydro quebec roumy interfacing emtp rv withothersoftware using c++

16

Click here to load reader

Upload: corinne-rocherieux

Post on 26-May-2015

1.437 views

Category:

Technology


5 download

TRANSCRIPT

Page 1: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Jean-Gabriel Roumy

Interfacing EMTP-RV with other software using C++

April 30th, 2009

Page 2: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie2

Overview

> EMTP-RV DLL interface

> Interface implementation using C++

> Usage

• Simulink

• 3rd party software

• Distributed Simulation

> Future work

Page 3: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie3

EMTP DLL Interface

> What is the DLL Interface ?

• DLL is an external, separate piece of code linked to EMTP-RV at run-time

• EMTP-RV offers an API allowing the implementation of user models

• API includes all functions necessary to interact with computational engine

• API functions and structures are written in FORTRAN 95

Page 4: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie4

DLL Interface in C++

> Why C++ ?

• Interface with 3rd-party software

> C++ interface maps EMTP memory space

> C++ skeleton that handles all calls to/from EMTP

> User implements interface functions

Page 5: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie5

Interface Usage

> Linking with control code

> Controllable and observable signals are inputs/outputs to 3rd-party control libraries

> No participation from user model in system matrices

Page 6: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie6

Using Simulink design in EMTP

> Protection relay algorithm developped at IREQ using Simulink

> Impossible to duplicate design in EMTP

> Production code and model code stem from single simulink design

Page 7: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie7

Using Simulink design in EMTP

> Use existing Simulink designs

> Availability of Simulink extensive list of toolboxes

> Complex Simulink models

• Multiple sample times

• C-language S-functions

> Simulink code is portable, compact, fast and efficient

Page 8: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie8

Using Simulink design in EMTP

> C++ code generated with Embedded Real-Time toolbox

> User defines inputs, outputs, tunable parameters

> Compiled design has 3 top-level functions

• Initialise

• Step

• Terminate

Page 9: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie9

Simulink DLL Interface Architecture

E MT P -RV

C+ + DL L

In sta nce 1

Loca l Da ta

Str uct ures

U ser Model

In s tance 2

Loc al D a ta

S tructure s

S im ulink

C o de

Page 10: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie10

Generating Simulink DLL Interface

> Integrate Simulink code to interface code and compile together

> Use observable and controllable signals as input/output pins in EMTP

> Generate symbol in EMTP

Page 11: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie11

Limitations

> If Simulink design is modified, must regenerate and compile

> Each design requires customizing interface code

> Matlab variable initialisation cannot be compiled

> Fixed time step

Page 12: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie12

Linking with 3rd party software

> Coupling with other C++ models

> 3rd party can provide black-box models generated with their own software

> Example : HVDC controller model generated by manufacturer, provided to HQ as black-box model

Page 13: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie13

Distributed Simulation

> High Level Architecture is IEEE standard

> Federation controlled by RTI

> Distributed simulation can be performed with any HLA compatible software

> EMTP DLL interface acts as bridge between EMTP and RTI

Page 14: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie14

Distributed Simulation

> NS2 (telecom simulator) modified to support HLA

> Co-simulation run with NS2 and EMTP

> Drawback : high overhead, not necessary to share at each timestep

> Early steps of development

Page 15: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie15

Future Work

> Get the process of generating a model more user-friendly and generic

> Co-simulation with Simulink

> Development of HLA co-simulation

Page 16: Hydro Quebec Roumy Interfacing Emtp Rv Withothersoftware Using C++

Groupe – Technologie16

The end

> Questions ?