Professional Documents
Culture Documents
Estimate Control Gains From Motor Parameters - MATLAB & Simulink
Estimate Control Gains From Motor Parameters - MATLAB & Simulink
Perform control parameter tuning for the speed and the torque control loops that are part of the Field-Oriented Control
(FOC) algorithm. Motor Control Blockset™ provides you with multiple methods to compute the control loop gains from the
system or block transfer functions that are available for the motors, inverter, and controller:
For each loop that the block tunes, the Field-Oriented Control Autotuner block performs the autotuning experiment in a
closed-loop manner without using a parametric model associated with that loop. The block enables you to specify the order
in which the block tunes the control loops. When the tuning experiment runs for one loop, the block has no effect on the
other loops. For more details about FOC autotuner, see Field Oriented Control Autotuner and Tune PI controllers by Using
Field Oriented Control Autotuner.
You can find the operating points and compute the exact linearizations of the Simulink models at different operating
conditions. Simulink Control Design provides tools that let you compute the simulation-based frequency responses without
modifying your model. For details, see https://www.mathworks.com/help/slcontrol/index.html
Model Initialization Script
This section explains how the Motor Control Blockset examples estimate the control gains needed to implement field-
oriented control. For example, for a PMSM that is connected to a quadrature encoder, these steps describe the procedure
to compute the control loop gain values from the system details by using the initialization script:
1. Open the initialization script (.m) file of the example in MATLAB®. To find the associated script file name:
a. Select Modeling > Model Settings > Model Properties to open the model properties dialog box.
b. In the Model Properties dialog box, navigate to the Callbacks tab > InitFcn to find the name of the script file that
Simulink opens before running the example.
sScript associated with a target model mcb_SetPMSMMotorParameters Input to the function is motor type (for
example, BLY171D).
Note
You can try starting MATLAB in the administrator mode on Windows® system, if you are unable to update the
model initialization scripts associated with the example models.
Control Parameter Category Control Parameter Name MATLAB Workspace Variable
Trated pmsm.T_rated
Nbase pmsm.N_base
Irated pmsm.I_rated
inverter.CtSensBOffset
Note
For the predefined processors and drivers, the model initialization script uses the default values.
The model initialization script uses these functions for performing the computations:
Base speed of the motor mcb_getBaseSpeed Calculates the base speed of PMSM at
the rated voltage and rated load.
Motor characteristics for the given motor mcb_getCharacteristics Obtain these characteristics of the motor.
and inverter • Torque as opposed to speed
characteristics
• Power as opposed to speed
characteristics
• Iqas opposed to speed and Id as
opposed to speed characteristics
Control analysis for the motor and mcb_getControlAnalysis Performs frequency domain analysis for
inverter you are using the computed gains of PI controllers used
in the field-oriented motor control system.
Note
When you call this function (for example, base_speed = mcb_getBaseSpeed(pmsm,inverter)), it returns the base speed
(in rpm) for the given combination of PMSM and inverter. The function accepts the following inputs:
The inverter voltage constraint is defined by computing the d-axis and q-axis voltages:
vdo = − ωeLqiq
(
vqo = ωe Ld id + λ pm )
vdc
G
2 2
vmax = − Rsimax ≥ v + v
G3 do qo
The current limit circle defines the current constraint which can be considered as:
2 2 2
i = i + i
max d q
In the preceding equation, id is zero for surface PMSMs. For interior PMSMs, values of id and iq corresponding to MTPA
are considered.
Using the preceding relationships, we can compute the base speed as:
vmax
ωbase =
1
⋅ G
p (L i ) q q
2
+ (L i
d d
+ λ pm ) 2
where:
• pmsm object
• inverter object
• PU system params
• T_pwm
• Ts_control
• Ts_speed
The function automatically computes the other required parameters (for example, bandwidth, damping) based on the input
arguments.
Perform Control Analysis
The function mcb_getControlAnalysis performs the basic control analysis of the PMSM FOC current control system. The
function performs frequency domain analysis for the computed PI controller gains used in the field-oriented motor control
systems.
Note
This function requires the Control System Toolbox.