双馈风力发电机(DFIG)平均值模型与详细开关模型 MATLAB 仿真

📅 2026/6/23 20:53:28
双馈风力发电机(DFIG)平均值模型与详细开关模型 MATLAB 仿真
一、文件结构DFIG_Simulation/ │ ├── DFIG_Average_Model/ │ ├── DFIG_Average.slx % Simulink 平均值模型 │ ├── DFIG_Average_Controller.m % 控制器参数与初始化 │ └── run_average.m % 运行脚本 │ ├── DFIG_Switch_Model/ │ ├── DFIG_Switch.slx % Simulink 详细开关模型 │ ├── DFIG_Switch_Controller.m % 控制器参数与初始化 │ └── run_switch.m % 运行脚本 │ └── compare_results.m % 两种模型结果对比二、平均值模型Average Model——系统级仿真2.1 模型特点变流器用受控电压源 / 电流源表示忽略开关纹波用平均值方程适合电网稳定性、功率控制、故障穿越研究2.2 核心方程%% DFIG_Average_Controller.m% 双馈风机平均值模型参数clear;clc;% 风机参数Pn2e6;% 额定功率 2 MWVn690;% 定子额定电压 (V)fn50;% 电网频率 (Hz)ws2*pi*fn;% 电角速度% 电机参数标幺值基准SnPn;% 功率基准VbaseVn;% 电压基准IbaseSn/(sqrt(3)*Vbase);ZbaseVbase^2/Sn;Rs0.01;% 定子电阻 (pu)Rr0.01;% 转子电阻 (pu)Ls0.15;% 定子电感 (pu)Lr0.15;% 转子电感 (pu)Lm2.9;% 励磁电感 (pu)% 传动链J100;% 转动惯量 (kg·m²)B0.01;% 阻尼系数Kt0.8;% 转矩系数% 控制器参数Kp_pll0.5;Ki_pll10;Kp_id0.1;Ki_id5;Kp_iq0.1;Ki_iq5;Kp_speed0.5;Ki_speed10;% 初始条件theta0;% 转子位置omega_r1.0;% 转子电角速度 (pu)P_ref0.8;% 有功参考 (pu)Q_ref0.0;% 无功参考 (pu)2.3 Simulink 模型结构DFIG_Average.slx子系统划分[Wind Turbine] ↓ [Drive Train (2-mass)] ↓ [DFIG Machine] ↓ [Grid Side Converter (Average)] [Grid Side Controller] [Rotor Side Converter (Average)] [Rotor Side Controller] ↓ [Grid]关键模块用 MATLAB Function 写functiondi_sstator_current(v_s,flux_r,Rs,Ls,Lm)% 定子电流平均值模型psi_sv_s/ws;% 定子磁链psi_rLm*i_s;% 转子磁链di_s(v_s-Rs*i_s-1j*ws*psi_s)/Ls;end2.4 运行脚本run_average.m%% run_average.mclear;clc;% 加载参数DFIG_Average_Controller;% 运行 Simulinksim(DFIG_Average.slx,StopTime,10);% 绘图figure(Color,w);subplot(2,2,1);plot(tout,P_grid);ylabel(P (pu));grid on;subplot(2,2,2);plot(tout,Q_grid);ylabel(Q (pu));grid on;subplot(2,2,3);plot(tout,speed_r);ylabel(Speed (pu));grid on;subplot(2,2,4);plot(tout,theta_r);ylabel(Rotor Angle (rad));grid on;三、详细开关模型Switch Model——电磁暂态仿真3.1 模型特点变流器用IGBT/二极管开关器件包含PWM 调制、死区、开关损耗适合电磁暂态、谐波分析、硬件在环3.2 Simulink 模型结构DFIG_Switch.slx关键模块[Grid Side Converter] ├─ IGBT Bridge (Universal Bridge) ├─ PWM Generator └─ LC Filter [Rotor Side Converter] ├─ IGBT Bridge ├─ PWM Generator └─ DC Link Capacitor [DFIG Machine] ├─ Stator Winding ├─ Rotor Winding └─ Motion Sensor3.3 控制器DFIG_Switch_Controller.m%% DFIG_Switch_Controller.m% 与平均值模型参数基本一致但增加 PWM 频率fpwm5000;% PWM 频率 5 kHzTdead2e-6;% 死区时间 2 usVdc1200;% 直流母线电压3.4 运行脚本run_switch.m%% run_switch.mclear;clc;% 加载参数DFIG_Switch_Controller;% 设置仿真步长必须很小sim(DFIG_Switch.slx,StopTime,0.5,...Solver,ode23tb,FixedStep,1e-6);% 分析谐波figure;subplot(2,1,1);plot(tout,i_grid);ylabel(Grid Current (A));grid on;subplot(2,1,2);fft_analysis(i_grid,50,1/1e-6);四、对比脚本compare_results.m%% compare_results.mclear;clc;% 加载两种模型结果load(average_result.mat);load(switch_result.mat);figure(Color,w,Position,[1001001200400]);% 有功功率对比subplot(1,3,1);plot(t_avg,P_avg,b,LineWidth,1.5);hold on;plot(t_sw,P_sw,r--,LineWidth,1.5);xlabel(Time (s));ylabel(Active Power (pu));legend(Average Model,Switch Model);grid on;title(有功功率对比);% 无功功率对比subplot(1,3,2);plot(t_avg,Q_avg,b,LineWidth,1.5);hold on;plot(t_sw,Q_sw,r--,LineWidth,1.5);xlabel(Time (s));ylabel(Reactive Power (pu));grid on;title(无功功率对比);% 转子电流 THDsubplot(1,3,3);fft_analysis(i_rotor_sw,50,1/1e-6);title(转子电流谐波分析开关模型);参考代码 双馈风力发电机平均值模型与详细开关模型的matlab仿真文件www.youwenfan.com/contentcsw/81767.html五、关键差异总结特性平均值模型详细开关模型仿真速度快秒级慢分钟级开关纹波无有谐波分析不支持支持适用场景系统稳定性、电网故障穿越电磁暂态、硬件在环精度稳态精确暂态近似全频段精确