您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 资本运营 > 运用PSIM的DLL模块对2.7KW光伏板进行BOOST和MPPT的简单仿真
仿真电路图如下:DLL的程序如下:#includemath.h__declspec(dllexport)voidsimuser(t,delt,in,out)//Notthatallthevariablesmustbedefinedasdoubledoublet,delt;double*in,*out;{//placeyoucodehere........beginstaticdoublelast_Vin=0;//定义初始电压(静态变量)staticdoublelast_Pin=0;//定义初始功率(静态变量)staticdoublelast_Vref=0;//定义初始基准电压(静态变量)doubleVin;//定义电压输入doubleIin;//定义电流输入doublePin;//定义功率输入doubleVcar;//定义载波输入doubledv;//定义电压增量doubledp;//定义功率增量doubleVref;//定义基准电压doubleVstep;//定义扰动步长doubledv_c;//定义载波和基准比较电压Vin=in[0];//定义电压输入Iin=in[1];//定义电流输入Vcar=in[2];//定义载波输入Pin=Vin*Iin;//计算功率dv=Vin-last_Vin;//计算电压增量last_Vin=in[0];//定义下一次的初始电压dp=Pin-last_Pin;//计算功率增量last_Pin=Pin;//定义下一次的初始功率//对扰动步长进行设定-开始if(dp=0){Vstep=0;}else{if(dp0){if(dv0){Vstep=2;}else{Vstep=-2;}}else{if(dv0){Vstep=-2;}else{Vstep=2;}}}//对扰动步长进行设定-结束Vref=last_Vref+Vstep;//计算基准电压last_Vref=Vref;//定义下一次的初始基准电压dv_c=Vref-Vcar;//计算载波和基准比较电压//对扰动步长进行设定-开始if(dv_c0){out[0]=12;}else{out[0]=0;}//对扰动步长进行设定-结束//Outputout[1]=dv;out[2]=Vref;//placeyoucodehere........end波形如下:
本文标题:运用PSIM的DLL模块对2.7KW光伏板进行BOOST和MPPT的简单仿真
链接地址:https://www.777doc.com/doc-4825992 .html