function PI_params = mcb_SetControllerParameters(motor,inverter,PU_System,T_pwm,Ts,Ts_speed,varargin)
%mcb_SetControllerParameters  Compute PI Parameters for FOC of motors
% 
%   mcb_SetControllerParameters calculates gains for PI controllers used in 
%   Field Oriented Control of Motor control systems. 
%   
%   For example, PI_params = mcb_SetControllerParameters(pmsm,inverter,PU_System,T_pwm,Ts_control,Ts_speed)
%   returns the gains of following PI Controllers used for Field Oriented Control
%   of PMSM. The function accepts following inputs:
%   motor struct, inverter struct, PU system params struct, T_pwm, Ts_control, Ts_speed
%       T_pwm is PWM switching time period in seconds
%       Ts (or Ts_control) is sample time step for current controller in seconds
%       Ts_speed is sample time step for speed loop in seconds  
% 
%   The design of compensators is based on classical frequency response
%   analysis applied to Motor control systems. Modulus Optimum (MO) based 
%   design is used for current controllers. Speed controller is designed 
%   based on Symmetrical Optimum (SO). 
%   The required parameters like bandwidth, damping, etc are derived 
%   automatically based on input arguments. 

% Copyright 2021 The MathWorks, Inc.

%% ************************************************************************
% calling the internal function

	PI_params=mcb.internal.SetControllerParameters(motor,inverter,PU_System,T_pwm,Ts,Ts_speed,varargin{:});
    
end