CN104102526A - Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware - Google Patents
Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware Download PDFInfo
- Publication number
- CN104102526A CN104102526A CN201410317423.6A CN201410317423A CN104102526A CN 104102526 A CN104102526 A CN 104102526A CN 201410317423 A CN201410317423 A CN 201410317423A CN 104102526 A CN104102526 A CN 104102526A
- Authority
- CN
- China
- Prior art keywords
- interface
- module
- pscad
- hardware
- simulation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004088 simulation Methods 0.000 title claims abstract description 34
- 238000011960 computer-aided design Methods 0.000 title abstract 2
- 230000003993 interaction Effects 0.000 claims abstract description 6
- 101100499229 Mus musculus Dhrsx gene Proteins 0.000 claims description 50
- 238000000034 method Methods 0.000 claims description 12
- 230000006870 function Effects 0.000 claims description 10
- 235000013599 spices Nutrition 0.000 claims description 8
- 238000004891 communication Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 9
- 238000012360 testing method Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware. The collaborative interface is characterized by comprising a collaborative module cosim_interface, set through a custom module of the PSCAD; the collaborative module comprises an interface declaration and an interface module; data interaction between the PSCAD and the third-party simulation software or hardware during co-simulation is achieved through the collaborative module cosim_interface, co-simulation of the PSCAD with the third-party simulation software or hardware is achieved, and the blank that the present PSCAD is in short of co-simulation with otherness of the simulation software or hardware is filled.
Description
Technical field
The present invention relates to electric system electronic simulation field, relate in particular to the collaborative interface of PSCAD and third party simulation software or hardware co-simulation.
Background technology
Emulation occupies very important status in electric system and power electronic equipment research and development.
PSCAD/EMTDC software is widely used in electromagnetic transient in power system emulation and power electronic equipment emulation.But there is following shortcoming in it:
1.PSCAD switching device all adopts ideal model, is difficult to the details waveform on artificial circuit.And semiconductor switch in the simulation softwares such as Saber, Spice adopts accurate model, can obtain accurately waveform.
2. power electronic controller part adopts FPGA more at present, and control routine wherein adopts HDL language compilation more.HDL code and main circuit are put together and carried out collaborative simulation and become very meaningful.At present the software such as PSIM, Saber all can carry out collaborative simulation with the software such as Modelsim.But the softwares such as PSCAD shortage and Modelsim carry out the interface of collaborative simulation.
3. hardware-in-loop simulation plays very important effect in opertaing device functional verification, and PSIM, MATLAB/Simulink provide certain hardware-in-loop simulation ability at present.But PSCAD also not support hardware ring emulation.
The solution of above problem all needs PSCAD to provide and the interface of third party's emulation soft (firmly) part.But current PSCAD has just directly supported the collaborative simulation with Matlab therein in core (EMTDC), and not with the emulation interface of other software.Therefore, be necessary the interface of a kind of PSCAD of self-developing and other simulation software or hardware co-simulation.
Summary of the invention
The object of the invention is to solve prior art defect, and the collaborative interface of a kind of PSCAD and third party simulation software or hardware co-simulation is provided, solve PSCAD cannot with the problem of third party's simulation software/hardware co-simulation.
The present invention adopts following scheme for achieving the above object:
The collaborative interface of PSCAD and third party simulation software or hardware co-simulation, it is characterized in that: comprise a cooperative module cosim_interface who utilizes the custom block of PSCAD to arrange, this cooperative module comprises interface statement and interface module, formed by .f and two files of .c, wherein: .f file is interface statement, adopt Fortran language compilation, it is as the bridge calling between interface module and PSCAD, and this interface statement is for stating type, the parameter of .c file interface function; .c file is interface module, adopts C language compilation, and it has realized the repertoire of this cooperative module cosim_interface, the data interaction while realizing PSCAD and third party simulation software or hardware co-simulation.
Also comprise proxy module, data interaction when described interface module realizes PSCAD and third party simulation software or hardware co-simulation by described proxy module.
Cooperative module and proxy module are independently two processes or merge into a process.
In the time that cooperative module and proxy module are independently two processes, the two adopts socket interprocess communication mode to communicate.
When third party simulation software or hardware:
During based on modelsim, described proxy module communicates with third party simulation software or hardware by FLI (Foreign Language Interface); During based on Saber, adopt C module that MAST language was packed to realize described proxy module and third party simulation software or hardware and communicate; During based on Spice, the function of proxy module directly realizes in the model of Spice.
For variable step third party simulation software or hardware, taking third party simulation software or hardware as main emulation, PSCAD are as secondary emulation, after calculating etc. main emulation is each, via described interface module, current step-length, other data are passed to PSCAD, carry out corresponding associated treatment for PSCAD.
The cooperative module cosim_interface that the present invention utilizes the custom block of PSCAD to arrange, data interaction while realizing PSCAD and third party simulation software or hardware co-simulation by cooperative module cosim_interface, realize the object of PSCAD and third party simulation software or hardware co-simulation, made up current PSCAD and lacked and the blank of other simulation software or hardware co-simulation.
Brief description of the drawings
Fig. 1 is the schematic diagram of collaborative interface of the present invention;
Fig. 2 is the schematic diagram of cooperative module cosim_interface in the present invention;
Fig. 3 is the schematic diagram of PSCAD and Modelsim collaborative simulation in the present invention;
Fig. 4 is the workflow diagram of cooperative module cosim_interface in the present invention;
Fig. 5 is the workflow diagram of proxy module agent in the present invention.
Embodiment
Using PSCAD as main simulated program, third party's emulation soft (firmly) part is as secondary simulated program.Emulation starts, arranging etc. of end, simulation step length controlled by PSCAD.Realize by custom block in PSCAD with the mutual of the external world.The function of PSCAD module can only realize by Fortran language or C language, in the time adopting C language to realize, need to state the function interface in C with Fortran language.Because C language carries out System Programming more for convenience, therefore following concrete function all adopts C language to realize.
One, interface forms
As Fig. 1, this interface is divided into 3 parts,
1.PSCAD cooperative module cosim_interface
This module is the custom block in PSCAD.Its symbol in PSCAD schematic diagram is illustrated as Fig. 2.
Wherein left side ins is input signal, and right side outs is output signal, and cosim_interface is this module name.This module realizes and being completed by cosim_interface.f and two files of cosim_interface.c:
A. file cosim_interface.f is interface statement, adopts Fortran language compilation, has stated type, the parameter etc. of interface function in cosim_interface.c, and it is the bridge calling between cosim_interface.c and PSCAD.The following is signal code,
Wherein ins is input signal, and outs is output signal.
B. file cosim_interface.c is interface module, adopts C language compilation.Wherein realize the repertoire of this cooperative module.This program completes from input and obtains data; In the time there is proxy module agent, the process flow diagram of cosim_interface as shown in Figure 4, cosim_interface.c sends the data to agent, wait for interface module (or third party's software and hardware) return data, and output, in the time not there is not agent, cosim_interface.c directly sends the data to third party's software and hardware, and waits for return data; Return data is sent to output.
2.agent
Agent adopts C language compilation, wherein will realize in itself and 1.b communicating by letter and itself and the communicating by letter of third party simulation software (hardware) between cosim_interface.c interface module.Between third party's interface and soft (firmly) part that will work in coordination with, relation is very large, and the interface need to soft according to third party (firmly) part providing is programmed.As Modelsim can utilize its FLI (Foreign Language Interface) interface.For Saber, can adopt the C module that MAST language was packed to carry out.For Spice, can directly in its module, realize interface function.
3. third party's simulated program (hardware)
Third party's simulated program (hardware) carries out emulation to the artificial tasks of distributing to it, and the interface providing by himself and agent communicate.Carry out emulation as the logic that Modelsim realizes HDL language, then by FLI (Foreign Language Interface) interface, simulation result is sent to agent.For Saber, can adopt the C module that MAST language was packed to carry out.For Spice, can directly in its module, realize interface function.
Can be according to the complexity of the requirement of concrete software or realization when specific implementation, 1,2 or 2,3 in above 3 parts are merged or separately independent realization.
Two, interface using method and principle of work
While using this interface method, cooperative module cosim_interface is put into PSCAD simulating schematic diagram from component inventory, the input/output port respectively signal mutual with needs soft with third party (firmly) part is connected.The explanation as an example of PSCAD and Modelsim collaborative simulation example below, as shown in Figure 3.
The groundwork of this model is: module cosim_interface obtains the voltage at resistance two ends, sends to Modelsim to process, and the result obtaining returns to PSCAD, then in PSCAD, marks waveform.
In PSCAD, the input signal of interface module is in1, in2, is output as out1.In Modelsim, adopt verilog as input file.
There are two kinds of modes for the signal name coupling in Liang Ge simulation software.
In 1.PSCAD, in signal name soft with third party (firmly) part, respective signal name is consistent.
In Modelsim, the Verilog of emulation should have following port statement:
module?test(input?in1,in2,output?out1);
...
endmodule
2. corresponding relation is set in proxy module
For example above, if the Verilog of emulation has following port statement in Modelsim:
module?test(input?x,y,output?z);
...
endmodule
Need in Agent, arrange, in1, the input data of in2 send to respectively x, y.The output data of z send to out1.
In each simulation step length, PSCAD calculates the value of each state variable, and calling module cosim_interface.Module cosim_interface obtains current input in1, after the value of in2.Agent process flow diagram as shown in Figure 5, in the time there is agent, cosim_interface crosses socket by information exchanges such as input data and step-lengths and sends to agent, agent carries out sending to third party software (hardware) after necessary processing to these information, and controls third party software (hardware) the step-length time of operation.In the time not there is not agent, cosim_interface directly sends to third party software (hardware) by input data and step-length information etc. by socket, and controls third party software (hardware) the step-length time of operation.Third party software (hardware) completes after the calculating of a simulation step length, and simulation result is returned to module cosim_interface (passing through agent while having agent) by socket.Result is exported to PSCAD by module cosim_interface.The plot module being attached thereto obtains the output of cosim_interface, draws.
For the variable step such as Saber, Spice third party simulation software, their working method is to carry out once-through operation, calculates truncation error, then adjusts step-length according to error dynamics.Its step-length is bad control from outside, so should be taking this class variable step software as main simulated program, PSCAD is as secondary simulated program.After each calculating such as Saber, should current step-length, output data be passed to PSCAD by interface, carry out respective handling for it.
Claims (6)
- The collaborative interface of 1.PSCAD and third party simulation software or hardware co-simulation, it is characterized in that: comprise a cooperative module cosim_interface who utilizes the custom block of PSCAD to arrange, this cooperative module comprises interface statement and interface module, formed by .f and two files of .c, wherein:.f file is interface statement, adopts Fortran language compilation, and it is as the bridge calling between interface module and PSCAD, and this interface statement is for stating type, the parameter of .c file interface function;.c file is interface module, adopts C language compilation, and it has realized the repertoire of this cooperative module cosim_interface, the data interaction while realizing PSCAD and third party simulation software or hardware co-simulation.
- 2. collaborative interface according to claim 1, is characterized in that: also comprise proxy module, data interaction when described interface module realizes PSCAD and third party simulation software or hardware co-simulation by described proxy module.
- 3. collaborative interface according to claim 2, is characterized in that: cooperative module and proxy module are independently two processes or merge into a process.
- 4. collaborative interface according to claim 3, is characterized in that: in the time that cooperative module and proxy module are independently two processes, the two adopts socket interprocess communication mode to communicate.
- 5. collaborative interface according to claim 2, is characterized in that: when third party simulation software or hardware:During based on modelsim, described proxy module communicates with third party simulation software or hardware by FLI (Foreign Language Interface);During based on Saber, adopt C module that MAST language was packed to realize described proxy module and third party simulation software or hardware and communicate;During based on Spice, the function of proxy module directly realizes in the model of Spice.
- 6. collaborative interface according to claim 1, it is characterized in that: for variable step third party simulation software or hardware, taking third party simulation software or hardware as main emulation, PSCAD are as secondary emulation, after calculating etc. main emulation is each, via described interface module, current step-length, other data are passed to PSCAD, carry out corresponding associated treatment for PSCAD.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410317423.6A CN104102526A (en) | 2014-07-04 | 2014-07-04 | Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410317423.6A CN104102526A (en) | 2014-07-04 | 2014-07-04 | Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104102526A true CN104102526A (en) | 2014-10-15 |
Family
ID=51670698
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410317423.6A Pending CN104102526A (en) | 2014-07-04 | 2014-07-04 | Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104102526A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105160137A (en) * | 2015-09-30 | 2015-12-16 | 中国南方电网有限责任公司电网技术研究中心 | PSCAD based electromagnetic-electromechanical transient mixed simulation realization method |
CN105653346A (en) * | 2014-11-19 | 2016-06-08 | 中国航空工业集团公司西安飞机设计研究所 | Universal exciter frame design method for assisting avionics software development |
CN106294901A (en) * | 2015-05-26 | 2017-01-04 | 中国电力科学研究院 | A User-Defined Simulation Method of Power System Based on Hybrid Variable Step Size Simulation |
CN109492301A (en) * | 2018-11-08 | 2019-03-19 | 北京世冠金洋科技发展有限公司 | Software and hardware switching method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6230114B1 (en) * | 1999-10-29 | 2001-05-08 | Vast Systems Technology Corporation | Hardware and software co-simulation including executing an analyzed user program |
CN101996271A (en) * | 2010-08-12 | 2011-03-30 | 武汉大学 | Software interface for automatically generating simulation calculation model of PSCAD power system |
-
2014
- 2014-07-04 CN CN201410317423.6A patent/CN104102526A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6230114B1 (en) * | 1999-10-29 | 2001-05-08 | Vast Systems Technology Corporation | Hardware and software co-simulation including executing an analyzed user program |
CN101996271A (en) * | 2010-08-12 | 2011-03-30 | 武汉大学 | Software interface for automatically generating simulation calculation model of PSCAD power system |
Non-Patent Citations (3)
Title |
---|
张智锐 等: "智能变电站二次系统跨平台联合仿真方法", 《水电能源科学》 * |
袁涛 等: "PSCAD-EMTDC中自定义模型研究及其在有源滤波器控制算法仿真中的应用", 《电气应用》 * |
邹宁 等: "C与PSCAD/EMTDC接口技术在SVC控制系统仿真建模中的应用", 《中国电机工程学会第十二届青年学术会议论文集》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105653346A (en) * | 2014-11-19 | 2016-06-08 | 中国航空工业集团公司西安飞机设计研究所 | Universal exciter frame design method for assisting avionics software development |
CN105653346B (en) * | 2014-11-19 | 2019-01-01 | 中国航空工业集团公司西安飞机设计研究所 | A kind of general driver frame design method assisting avionics software development |
CN106294901A (en) * | 2015-05-26 | 2017-01-04 | 中国电力科学研究院 | A User-Defined Simulation Method of Power System Based on Hybrid Variable Step Size Simulation |
CN106294901B (en) * | 2015-05-26 | 2019-10-15 | 中国电力科学研究院 | A User-Defined Simulation Method of Power System Based on Hybrid Variable Step Size Simulation |
CN105160137A (en) * | 2015-09-30 | 2015-12-16 | 中国南方电网有限责任公司电网技术研究中心 | PSCAD based electromagnetic-electromechanical transient mixed simulation realization method |
CN109492301A (en) * | 2018-11-08 | 2019-03-19 | 北京世冠金洋科技发展有限公司 | Software and hardware switching method and system |
CN109492301B (en) * | 2018-11-08 | 2020-05-22 | 北京世冠金洋科技发展有限公司 | Software and hardware switching method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103678745B (en) | Cross-platform multi-level integrated design system for FPGA | |
CN109783885B (en) | Multi-physical field coupling simulation analysis method and system for intelligent power module | |
Pak et al. | A versatile cluster-based real-time digital simulator for power engineering research | |
US9348960B1 (en) | Method, system, and computer program product for probing or netlisting a multi-fabric electronic design spanning across multiple design fabrics | |
CN103268380B (en) | A kind of method for designing of the analog integrated circuit layout improving layout efficiency | |
US8296699B1 (en) | Method and system for supporting both analog and digital signal traffic on a single hierarchical connection for mixed-signal verification | |
CN100576214C (en) | A SPICE Model Modeling Method of Various Diode Simulator Formats | |
CN106681726B (en) | Python model conversion is the method for Modelica model | |
CN102436534B (en) | Simulating method for electric power system | |
CN104102526A (en) | Collaborative interface for co-simulation of PSCAD (power system computer aided design) with third-party simulation software or hardware | |
CN106844900B (en) | The Construction Method of Electromagnetic Transient Simulation System | |
CN206075597U (en) | Transformer station's virtual reality Comprehensive Simulation Training System | |
CN105653744A (en) | Method and device for designing layout | |
CN103942091A (en) | MATLAB user-defined model and PSASP joint simulation excitation system simulation method and system | |
CN104133955A (en) | Method for extracting circuit parasitic parameters | |
WO2016076963A1 (en) | System and method for preparing partially reconfigurable circuit designs | |
CN107845304A (en) | A kind of relay protection teaching experiment simulation platform and its emulation mode | |
CN104252550A (en) | High-performance real-time simulation method based on FPGA (field programmable gate array) | |
CN105824995A (en) | Three-dimensional electromagnetic field model generation method based on physical layout | |
CN204946009U (en) | Simulation of power electronic system | |
CN101609614A (en) | Simulation platform of semi-physical simulation system and method for online parameter adjustment of target system | |
CN104809297A (en) | Electromagnetic force density transferring method used among special-shaped grids in magnetic field-structure field coupling calculation | |
US20160125109A1 (en) | Polymorphic Circuit Simulation System | |
CN106372359B (en) | A device virtual prototype system | |
CN112417794B (en) | Scattering parameter calculation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20141015 |