%% Five-Phase Permanent Magnet Synchronous Machine
%
% This example shows the use of the Five-Phase PMSM and the
% Three-Phase PMSM in a closed-loop speed and current control on two 4.4 kW
% industrial motors..
%
% J-F. Doyon and Louis-A. Dessaint (Ecole de Technologie Superieure,
% Montreal)
% Copyright 1997-2012 Hydro-Quebec, and The MathWorks, Inc.
%%
open_system('power_5phpmmotor')
%% Description
%
% A five-phase motor and a three-phase motor both rated 4.4 kW are each fed by a PWM inverter.
% The PWM inverter outputs goes through Controlled Voltage Source blocks before being applied to the PMSM block's stator windings.
% The load torque applied to each machine's shaft is fixed to 7 N.m.
% Two control loops are used. The inner loop regulates the motor's stator currents. The outer loop controls the motor's speed.
%
% 1. Each machine starts under normal operation (all healthy phases).
%
% 2. At t = 0.06 second, phase ''A'' of both machines is disconnected.
%
% 3. At t = 0.09 second, each controller's current references are varied to compensate for the phase loss.
%
% 4. At t = 0.12 second, phase ''B'' is also disconnected from the five-phase machine.
%
% 5. At t = 0.15 second, the controller's current references of the five-phase machine are varied to compensate for the two phases loss.
%
%% Simulation
%
% Observe that due to the change of current references during the two successive faults, the five-phase machine currents are increased
% to keep the electromagnetique torque at the same value and to prevent large ripple. Also, good speed regulation is maintained.
%
% Less good results are observed with the three-phase machine. It can be seen that the electromagnetic torque has a lot of ripple
% which propagates to the regulated speed.
%
% In summary the five-phase machine can be much more fault-tolerant than the three-phase machine.
%%
clear all
close all
bdclose all