Set parameters on ee_motor_characteristics

1 view (last 30 days)
Hello everyone,
In ee_motor_characteristics
if i want to set up some parameters how can i do that? For example, set the starting torque or the maximum speed. I want to use these 5 different type of motors with "specific parameters".
I m now learning the basics of simscape so please be kind on your answer
Thanks in advance
Alex

Answers (1)

Joel Van Sickel
Joel Van Sickel on 2 Mar 2023
You can change any of the paramters you want by double clicking on the system that you want. If you want to control the motor paramters, just double click on the mask labeled "Electric Motor". You will see a circuit that has a DC Motor (I'm assuming that is the variant that you are using) in the middle. Double click on the motor and you can change the paramters. For the paramters that you want to change, replace the hard coded number with a variable name such as 'MaxTorque'. You can then create a matlab script that changes the value of this variable, run the simulation, change the variable, and run the simulation again. Please see this documentation on how to do that:
Here is some example code using parsim, but you can replace parsim with sim to do the same thing (you might need to put the sim command inside the loop). Unfortunately it won't work as is, but it shows you how to sweep a large range of variables. In your case, you'd just have 5 explicity sets of data for the five different motors. This one permutes three variabes: Vdc_vec, IL_vec and Wm_Vec.
model = 'Analysis_OpPoint_Advanced';
% Create Initial variables (value is irelevant)
VDC_opPoint = 1100; % Voltage of DC bus at output of Boost (V)
I_load_opPoint = 0.5; % Current through boost inductor (pu)
Wm_opPoint = 0.5; % Wind speed/available mechanical power (pu)
% How many data points for operating range
n1 = 5; % Vdc
n2 = 8; % Current
n3 = 5; % Rotor Speed
% Create Range of Operating Points
Vdc_vec = linspace(800,1300,n1);
IL_vec = linspace(0.25,1.1,n2);
Wm_vec = linspace(0.5,1.1,n3);
% create full factorial of test points
tests = fullfact([n1 n2 n3]);
% iterate through tests and get current output
n = length(tests);
Duty_vec = zeros(n,1);
Duty_mat = zeros(n1,n2,n3);
tic
for i = 1:n
% set Variables for Parallel Simulation
in(i) = Simulink.SimulationInput(model);
% Set Variables for Simulation
VDC_opPoint = Vdc_vec(tests(i,1));
IL_opPoint = IL_vec(tests(i,2));
Wm_opPoint = Wm_vec(tests(i,3));
in(i) = in(i).setVariable('VDC_opPoint',VDC_opPoint);
in(i) = in(i).setVariable('IL_opPoint',IL_opPoint);
in(i) = in(i).setVariable('Wm_opPoint',Wm_opPoint);
% Run the Simulation
% out = sim('Analysis_OpPoint_Advanced');
% Save Relevant Simulation Outputs
end
out = parsim(in, 'ShowProgress', 'on',);
for i = 1:n
Duty_mat(tests(i,1),tests(i,2),tests(i,3)) = mean(out(i).yout.signals(1).values(end-100:end));
end
toc
%% Add zero current operating point with 0 duty cycle
IL_vec_mod = [0 IL_vec];
Duty_mat_mod = zeros(n1,n2+1,n3);
Duty_mat_mod(:,2:end,:) = Duty_mat;
%% Plotting Functions
% set color scale for duty cycle
nl = 0:0.05:1;
for i = 1:length(Wm_vec)
figure(i)
contourf(IL_vec_mod,Vdc_vec,Duty_mat_mod(:,:,i),nl)
colorbar()
xlabel('Inductor Current (pu)')
ylabel('DC Voltage (V)')
title(['Wm = ' num2str(Wm_vec(i))])
axis manual
caxis([0 1]);
end

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by