摘要: |
数字仿真技术在继电保护开发过程中具有不可替代的作用。在PSCAD环境中利用自定义模块接口技术,将C源代码以自定义元件形式嵌入到仿真模型中,实现数字化保护的源代码级闭环仿真。针对实施C源代码级仿真方法效率低下的问题,改进了“调用接口”和“数据接口”,通过一个实例详细阐述了实现过程和效果。通过在自定义元件的Script脚本中调用Fortran接口函数实现调用接口,简化了C源代码的调用、修改及调试。直接利用自定义元件的输入、输出端口实现数据接口,避免使用复杂的公用数组。该方法简洁、灵活,可以完整验证实际装置的保护逻辑源代码,尤其适合于从保护原理研究到装置开发的过渡阶段,使开发者不依赖于物理装置即可验证软件代码,提高了开发效率。 |
关键词: PSCAD 保护逻辑 C语言 自定义模块 源代码 仿真 |
DOI:DOI: 10.19783/j.cnki.pspc.200334 |
投稿时间:2020-03-30修订日期:2020-07-01 |
基金项目:湖南省科技重大专项资助(2016GK1003)“全钒液流电池储能系统关键技术研发及应用” |
|
A PSCAD-based simulation method for protection logic at C source code level |
LIU Wei |
(Xuchang University, Xuchang 461000, China) |
Abstract: |
Simulation technology plays an irreplaceable role in the development of relay protection. C source code can be embedded in the simulation model by the interface technology of custom modules in PSCAD. This can realize closed-loop simulation at source code level for digital relays. To solve the problem of low efficiency in the implementation of C source code level simulation, the method in this paper has improved the calling interface and the data interface. The realization process and effects are explained by an instance. The calling interface is implemented by calling a Fortran function in the Script of custom components. This makes debugging the C source code much simpler. The data interface is realized directly by the input and output ports of custom components, and this will avoid the use of complex public arrays. The proposed method can be used to verify the source code embedded in an actual protective relay flexibly and simply. It is particularly suitable in the transition stage between studying principles and developing a device, because developers can validate the source code independently of a physical device. This will greatly improve the efficiency.
This work is supported by Key Research and Development Program of Hunan Province (No. 2016GK1003) “Research and Application of Key Technology of Vanadium Flow Battery Energy Storage System”. |
Key words: PSCAD protection logic C language custom module source code simulation |