Resolving the Error: Compilation of model 'motor' failed while trying to resolve underspecified signal dimensions
10 views (last 30 days)
Show older comments
Hello, while simulating the model from the article Modeling and Simulation of Three-Phase Squirrel Cage Induction Machine for Broken Rotor Bars Diagnostics, I'm having an issue with the size of one signal.
The relevant part of the paper:
In case you don't have access to it.
SYSTEM OVERVIEW AND MODELLING
The squirrel-cage induction machine is modeled with a three-phase supply and non-zero resistive torque; the model shown takes into account the essential space harmonics of the stator winding .
We assume the following:
- Linearity of the magnetic circuit.
- Winding resistances are constant, and the skin effect is negligible.
- Machine iron losses, capacitive effects, and thermal effects are neglected.
- Magnetic circuit saturation, hysteresis, and eddy currents can be neglected.
- With those assumptions, voltage and flux expressions of a three-phase induction motor with n rotor bars can be derived, which will be presented in the following.
Electrical equations
Referring to the stator's equivalent diagram in Figure 1, we develop the stator resistances and inductances matrices.

With

x


With

Where:
and are stator phase voltages, stator resistances, stator phase currents, stator flux, stator inductances, mutual inductances between the stator and the rotor, rotor current, angular position of the rotor, number of pole pairs, number of rotor bars, leakage inductances of the three stator phases (assumed identical), and stator phase magnetization inductances, respectively. Rotor equations:
According to the equivalent diagram of the rotor shown in Figure 2, we develop the rotor resistances and inductances matrices.





Where
and
are rotor voltages, rotor resistances, rotor flux, rotor inductances, mutual inductances between the rotor and the stator windings, magnetizing inductance of each rotor bar, leakage inductance of the rotor bar, bar resistance, ring leakage inductance, ring resistance, and mutual inductance between two rotor bars, respectively 
Global equations:
With



We use the Park transformation to move from a three-phase abc system to a two-phase dq system to model the machine in a two-phase plane. It takes us from the abc reference frame to the
reference frame and then to the moving dq reference frame. It forms an angle θ with the fixed frame
, called the angle of the Park transformation or Park angle. The matrix of Park transformation is written as:


We use a new transormation matrix
(the matrix from abs to da) to apply the Park transform to the matrices of our system of equations.


By applyting the Park transform to equaiong
, we obtain the following system:

Where


Mechanical equations
Modeling an induction machine involves equating electrical and magnetic quantities (voltage, current, and flux) and mechanical quantities: electromagnetic torque and rotor speed.
The electromagnetic torque is obtained by deriving the co-energy:





By applying the Laplace transform, it follows that

Where
and
are viscous friction coefficient, inertia moment, torque load, rotor speed, stator inner radius, active motor length, air gap, number of coils per stator phase, magnetic permeability of the air gap, and maximum mutual inductance, respectively.
and
are viscous friction coefficient, inertia moment, torque load, rotor speed, stator inner radius, active motor length, air gap, number of coils per stator phase, magnetic permeability of the air gap, and maximum mutual inductance, respectively.The initialized parameters(from the Section 3 of article and some assumptions)
% Stator parameters
Rs = 6.28; % Stator resistance (ohms)
L_fs = 0.048; % Stator leakage inductance (H)
L_ms = 0.542; % Stator magnetization inductance (H)
% Rotor parameters
Rb = 0.0003; % Bar resistance (ohms)
Lb = 0.00012; % Bar inductance (H)
Re = 1e-5; % End ring resistance (ohms)
Le = 1e-6; % End ring inductance (H)
n = 16; % Number of rotor bars
% Mutual inductance
M = 0.0046; % Maximum mutual inductance (H)
% Mechanical parameters
p = 1; % Number of pole pairs
J = 0.0054; % Moment of inertia (kg·m²)
F = 0.0006; % Friction coefficient (Nms)
Tl = 1; % Load torque (N·m)
% Supply parameters
V_line = 220; % Line voltage (V, RMS)
f = 50; % Frequency (Hz)
omega = 2 * pi * f; % Angular frequency (rad/s)
Vm = sqrt(2) * V_line / sqrt(3); % Peak phase voltage (V)
The structure of my simulink file:
Three main subsystems:

1. Three-Phase Voltage
inside this block threre are three Sine wave blocks with the amplitude Vm, frequeny Omega and with phases
respectively. the output of all three is given as input to a mux and output of the mux is named Vs.

2. Electrical Parts (where the promlem occures)

constants_elec is a [10 1] vector containing [Rs, L_fs, L_ms, Rb, Lb, Re, Le, n, p, M]; from workspace and the initial condition of integrator is zeros([3+n+1 1]).
also
function dI_dt = Electrical_equations(I, constants_elec, Vs, theta_r, Omega_r)
% Separating constants
Rs = constants_elec(1);
L_fs = constants_elec(2);
L_ms = constants_elec(3);
Rb = constants_elec(4);
Lb = constants_elec(5);
Re = constants_elec(6);
Le = constants_elec(7);
n = constants_elec(8);
p = constants_elec(9);
M = constants_elec(10);
% Stator resistance matrix (3x3)
Rs_mat = Rs * eye(3);
% Stator inductance matrix (3x3, simplified)
Ls = L_fs * eye(3) + L_ms * (ones(3) - eye(3)) * cos(2*pi/3) + L_ms * eye(3);
% Rotor resistance matrix (17x17)
Rr = zeros(n+1, n+1);
for k = 1:n
Rr(k,k) = 2*Rb + 2*Re/n;
Rr(k, mod(k,n)+1) = -Rb;
Rr(mod(k,n)+1, k) = -Rb;
Rr(k, n+1) = -Re/n;
Rr(n+1, k) = -Re/n;
end
Rr(n+1, n+1) = Re;
% Rotor inductance matrix ((n+1)x(n+1), simplified)
Lr = Lb * eye(n+1);
% Mutual inductance stator-rotor (3x(n+1))
Msr = zeros(3, n+1);
for k = 1:n
angle = theta_r + 2*pi*(k-1)*p/n;
Msr(1,k) = M * cos(angle);
Msr(2,k) = M * cos(angle - 2*pi/3);
Msr(3,k) = M * cos(angle + 2*pi/3);
end
% Full matrices ((3+n+1)x(3+n+1))
R = [Rs_mat, zeros(3,n+1); zeros(n+1,3), Rr]; % [3+n+1 3+n+1] matrix
L = [Ls, Msr; Msr', Lr]; % [3+n+1 3+n+1] matrix
% dL_dt due to rotor motion (only Msr changes)
dMsr_dt = zeros(3, n+1);
for k = 1:n
angle = theta_r + 2*pi*(k-1)*p/n;
dMsr_dt(1,k) = -M * sin(angle) * Omega_r;
dMsr_dt(2,k) = -M * sin(angle - 2*pi/3) * Omega_r;
dMsr_dt(3,k) = -M * sin(angle + 2*pi/3) * Omega_r;
end
dL_dt = [zeros(3,3), dMsr_dt; dMsr_dt', zeros(n+1,n+1)]; % [3+n+1 3+n+1] matrix
% Full voltage vector: [Vs; zeros for rotor]
V = [Vs; zeros(n+1,1)]; % [3+n+1 1] vector
% I is a [3+n+1 1] vector
% dI/dt equation
dI_dt = L \ (V - R*I - dL_dt*I);
end
Based on the first equation in global equation section
, which is how the output of Electrical_equations is calculated, following the rules of matrix mulitplication the derivative of current or dI_dt should be a [3+n+1 1] or in this case [20 1] with
. but no mather how I define the n (as global variable, simply defining it in function block or as it shown in the code from a constant block) I would always get an error.
Of course this is not the first time I'm tweaking the settings as I have done some changes the simulation setting such as
1. setting the Underspecified dimensions to warning (nothing changed)

2. Manually setting the size of signal dI_dt to [3+n+1 1] (in our case [20 1] with n=16)
the error changed to:
A signal of unbounded array type is not supported on 'Input Port 1' of block 'motor_simulation_second_attempt/Electrical Parts/Integrator'. For a list of supported data types, see the block documentation page.
but I doubt it's the integrator issue and it's more about the size of dI_dt signal.

i apologize for my lengthy question but I needed to give all the necessary information that might be needed in answering this question. I've also attached the simulink file I used for further clarification.
I sincerely thank you in advance for you patience and kindness.
--------------------------------------------------
Refrences
B. Boudmane, A. Rachid, I. Mortabit, S. Laaroussi and M. A. Tahiri, "Modeling and Simulation of Three-Phase Squirrel Cage Induction Machine for Broken Rotor Bars Diagnostics," 2024 4th International Conference on Innovative Research in Applied Science, Engineering and Technology (IRASET), FEZ, Morocco, 2024, pp. 1-6, doi: 10.1109/IRASET60544.2024.10548802. keywords: {Vibrations;Torque;Fault detection;Velocity control;Rotors;Motors;Mathematical models;Squirrel Cage Induction Machine;Broken Rotor Bars;Software modeling},
0 Comments
Answers (0)
See Also
Categories
Find more on Electrical Systems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!