function smo = mcb_ComputeSMOParameters(pmsm,Ts,PU_System)
% File          :   SMO Parameter Computation File
% Description   :   Parameters for Sliding Mode Observer by MCB

% Authors       :   A. Podder

% Copyright 2021 The MathWorks, Inc.
%%
% Get basic parameters

    % Compute B using motor parameters
    B = (1-exp(-pmsm.Rs*Ts/pmsm.Lq))/pmsm.Rs;

    % Compute m, currently m is computed for pmsm motors for 7000 R.P.M
    % PU_System.V_base is the maximum back emf for which the SMO is tuned.
    m = (2*pi*PU_System.N_base*2*pmsm.p/60)*PU_System.V_base*Ts;
    
    % For more information on the below mention parameters please refer to
    % the documentation.
    smo.BackEmfObsGain = 0.9;
    smo.CurrentObsGain = 1.1*B*m/smo.BackEmfObsGain;
    % The cutoff frequency for internal low pass filter to remove
    % chattering of SMO.
    smo.CutoffFreq = 3*pmsm.N_base*pmsm.p/60;

end