APP下载

Matlab/Simulink代码生成技术在RTDS上的应用

2020-06-19赵晓龙陈卓李强胜何俊贤

现代电子技术 2020年9期
关键词:模型系统

赵晓龙 陈卓 李强胜 何俊贤

摘  要: 针对实际电力系统运行和控制的复杂性与Matlab仿真非实时性的矛盾,提出跨平台联合仿真。采用基于Matlab/Simulink代码生成技术与RTDS实时仿真系统相结合的方法,以高压直流输电系统模型为研究对象,利用Embedded Coder開发工具对系统的控制模块进行代码生成,并在RTDS中完成代码移植实验。通过对比仿真波形,验证得到结果行为一致。由此表明,该方法能够有效利用Simulink良好的开发环境和RTDS的实时仿真特性,在离线仿真成功的基础上,完成实时仿真测试,使工作便捷高效,同时保证结果精准可信。

关键词: 代码生成技术; 跨平台联合仿真; Matlab/Simulink; 实时仿真测试; 高压直流输电系统建模; 模型参数计算; 控制模块代码移植; 仿真波形对比

中图分类号: TN710?34; TM721.1                    文献标识码: A                  文章编号: 1004?373X(2020)09?0161?05

Application of Matlab/Simulink?based code generation technology in RTDS

ZHAO Xiaolong, CHEN Zhuo, LI Qiangsheng, HE Junxian

(College of Electrical Engineering, Guizhou University, Guiyang 550025, China)

Abstract: In view of the contradiction between the complexity of actual power system operation and control and the non?real?time characteristic of Matlab simulation, the cross?platform co?simulation is proposed. A method on the basis of the combination of Matlab/Simulink?based code generation technology and RTDS?based (real time digital simulator) real?time simulation system is adopted. By taking the high voltage DC transmission system model as the research object, the development tool Embedded Coder is used to generate code for the control module of the system and complete the code transplantation experiment in RTDS. It is verified that the result and the behavior are consistent by contrasting the simulation waveforms. Therefore, it shows that the proposed method can effectively utilize the excellent development environment of Simulink and the real?time simulation characteristics of RTDS to complete real?time simulation test on the basis of successful off?line simulation, which makes the work convenient and efficient and ensures the accuracy and credibility of the results.

Keywords: code generation technology; cross?platform co?simulation; Matlab/Simulink; real?time simulation test; high voltage DC transmission system modeling; model parameter calculation; control module code transplantation; simulation waveform contrast

0  引  言

Matlab/Simulink是一款功能强大的高效计算机仿真软件,但其仿真大多为非实时仿真,在对于仿真实时性要求较高的任务中,单纯的Matlab/Simulink仿真难以胜任。如文献[1?2]中利用软硬件协同控制,文献[3?4]中采取重新建模的方式,都是可行的方法,但是缺点也很明显,其中有的工程化不完全,有的步骤繁琐,内容重复,并不是最佳方案。

在对仿真实时性要求高或者需要跨平台硬件测试的情况下,使用Simulink Coder或者专门针对嵌入式系统的Embedded Coder工具箱,将Simulink模型转换为C/C++语言模型,即通常所说的C代码,根据目标配置能够生成不同环境下的程序文件,载入到RTDS等平台进行硬件扩展,可以与测试对象进行实时互动,由此实现动态系统的硬件调试,得到高效实时的仿真结果。……

登录APP查看全文

猜你喜欢

模型系统
一半模型
Smartflower POP 一体式光伏系统
WJ-700无人机系统
ZC系列无人机遥感系统
重尾非线性自回归模型自加权M-估计的渐近分布
基于PowerPC+FPGA显示系统
半沸制皂系统(下)
连通与提升系统的最后一块拼图 Audiolab 傲立 M-DAC mini
3D打印中的模型分割与打包
FLUKA几何模型到CAD几何模型转换方法初步研究