单闭环交流调压调速系统系统的仿真模型源文件
时间: 2023-10-23 20:10:46 浏览: 47
以下是一个基本的单闭环交流调压调速系统的Simulink仿真模型源文件:
```matlab
% Simulink Model for Single Closed Loop AC Voltage and Speed Control System
% Define the model parameters
R = 1; % Resistance (ohms)
L = 0.1; % Inductance (H)
J = 0.01; % Moment of Inertia (kg.m^2)
B = 0.1; % Friction Coefficient (N.m.s)
Ke = 0.1; % Back EMF Constant (V/rad/s)
Kt = 0.1; % Torque Constant (N.m/A)
Vp = 220; % Peak AC Voltage (V)
f = 50; % AC Frequency (Hz)
Vref = 110; % Reference Voltage (V)
wref = 100; % Reference Speed (rad/s)
% Define the simulation parameters
tstop = 10; % Simulation Time (s)
% Define the Simulink model
model = 'SingleLoopControl';
open_system(model);
new_system(model);
% Add the AC Voltage Source block
add_block('simulink/Sources/Sine Wave', [model '/AC Voltage Source']);
set_param([model '/AC Voltage Source'], 'Amplitude', 'Vp/2', 'Frequency', 'f');
% Add the AC Motor block
add_block('simulink/Continuous/Transfer Fcn', [model '/AC Motor']);
set_param([model '/AC Motor'], 'Numerator', 'Kt', 'Denominator', '[J B Kt]');
add_block('simulink/Commonly Used Blocks/Sum', [model '/Speed Error']);
add_block('simulink/Commonly Used Blocks/Gain', [model '/Speed Controller']);
set_param([model '/Speed Controller'], 'Gain', '0.1');
add_block('simulink/Commonly Used Blocks/Integrator', [model '/Speed Integrator']);
add_block('simulink/Commonly Used Blocks/Gain', [model '/Voltage Controller']);
set_param([model '/Voltage Controller'], 'Gain', '0.1');
add_block('simulink/Commonly Used Blocks/Integrator', [model '/Voltage Integrator']);
add_block('simulink/Commonly Used Blocks/Gain', [model '/Voltage Amplifier']);
set_param([model '/Voltage Amplifier'], 'Gain', '2*pi');
% Connect the blocks
add_line(model, 'AC Voltage Source/1', 'AC Motor/1');
add_line(model, 'AC Motor/1', 'Speed Error/1');
add_line(model, 'Speed Error/1', 'Speed Controller/1');
add_line(model, 'Speed Controller/1', 'Speed Integrator/1');
add_line(model, 'Speed Integrator/1', 'Voltage Controller/1');
add_line(model, 'Voltage Controller/1', 'Voltage Integrator/1');
add_line(model, 'Voltage Integrator/1', 'Voltage Amplifier/1');
add_line(model, 'Voltage Amplifier/1', 'AC Motor/2');
% Set the block parameters
set_param([model '/AC Motor'], 'Position', [220 50 295 95]);
set_param([model '/Speed Error'], 'Position', [345 61 365 79]);
set_param([model '/Speed Controller'], 'Position', [420 64 465 96]);
set_param([model '/Speed Integrator'], 'Position', [515 60 535 80]);
set_param([model '/Voltage Controller'], 'Position', [345 105 390 137]);
set_param([model '/Voltage Integrator'], 'Position', [435 105 455 125]);
set_param([model '/Voltage Amplifier'], 'Position', [515 105 535 125]);
set_param([model '/AC Voltage Source'], 'Position', [50 60 90 100]);
% Set the simulation parameters
set_param(model, 'StopTime', 'tstop');
set_param(model, 'SolverType', 'Fixed-step');
set_param(model, 'FixedStep', '0.01');
% Save the model
save_system(model);
% Run the simulation
sim(model);
```
在该模型中,我们使用了Sine Wave模块作为交流电压源,使用Transfer Fcn模块作为电机的传递函数,使用Sum、Gain和Integrator模块作为速度和电压闭环控制器的组成部分,并使用Voltage Amplifier模块将控制信号转换为电压信号,驱动电机。