BLDC Simulink Tutorial
BLDC Simulink Tutorial
BLDC
Simulink Plug-in Tutorial
Software Version 2020.2
October 2020
Unpublished work. © Siemens 2020
This document contains information that is confidential and proprietary to Mentor Graphics Corporation, Siemens
Industry Software Inc., or their affiliates (collectively, "Siemens"). The original recipient of this document may
duplicate this document in whole or in part for internal business purposes only, provided that this entire notice
appears in all copies. In duplicating any part of this document, the recipient agrees to make every reasonable effort to
prevent the unauthorized use and distribution of the confidential and proprietary information.
This document is for information and instruction purposes. Siemens reserves the right to make changes in
specifications and other information contained in this publication without prior notice, and the reader should, in all
cases, consult Siemens to determine whether any changes have been made.
The terms and conditions governing the sale and licensing of Siemens products are set forth in written agreements
between Siemens and its customers.
No representation or other affirmation of fact contained in this publication shall be deemed to be a warranty or give
rise to any liability of Siemens whatsoever.
SIEMENS MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
AND NON-INFRINGEMENT OF INTELLECTUAL PROPERTY.
SIEMENS SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL OR PUNITIVE
DAMAGES, LOST DATA OR PROFITS, EVEN IF SUCH DAMAGES WERE FORESEEABLE, ARISING OUT OF OR
RELATED TO THIS PUBLICATION OR THE INFORMATION CONTAINED IN IT, EVEN IF SIEMENS HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
LICENSE RIGHTS APPLICABLE TO THE U.S. GOVERNMENT: This document explains the capabilities of
commercial products that were developed exclusively at private expense. If the products are acquired directly or
indirectly for use by the U.S. Government, then the parties agree that the products and this document are considered
"Commercial Items" and "Commercial Computer Software" or "Computer Software Documentation," as defined in 48
C.F.R. §2.101 and 48 C.F.R. §252.227-7014(a)(1) and (a)(5), as applicable. Software and this document may only be
used under the terms and conditions of the applicable license agreement with Siemens as required by 48 C.F.R.
§12.212 and 48 C.F.R §227.7202. The U.S. Government will only have the rights set forth in the End User License
Agreement, which supersedes any conflicting terms or conditions in any government order document, except for
provisions which are contrary to applicable mandatory federal laws.
TRADEMARKS: The trademarks, logos and service marks ("Marks") used herein are the property of Siemens or
other parties. No one is permitted to use these Marks without the prior written consent of Siemens or the owner of the
Marks, as applicable. The use herein of third party Marks is not an attempt to indicate Siemens as a source of a
product, but is intended to indicate a product from, or associated with, a particular third party. A list of Siemens'
trademarks may be viewed at: www.plm.automation.siemens.com/global/en/legal/trademarks.html and
mentor.com/trademarks.
The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds,
owner of the mark on a world-wide basis.
Results
Models’ accuracy
Simscape model (low accuracy)
Linearized model (medium accuracy)
Nonlinear model (high accuracy)
Thermal model
Steady-state operating temperature
Ambient temperature
Stator
Stator type: General round
(selected from drop‐down list)
Number of slots: 48
Note All other parameters represent either the
default value or a re‐ calculated value based on
the modifications
3. From Motor Explorer’s toolbar, click .
The Save Model As dialog appears.
4. Browse to a known location.
5. In the File Name box, type BLDC_Simulink_export_tutorial.
Note When naming the model, the file name
extension is automatically added (e.g. filename.moto). Do
not change this extension.
6. Click Save.
The Input panel for Rotor is active, with some parameters
set at their default values.
2. In the Input panel, make the following modifications:
General
Rotor overhang: ‐0.45
Diameters
Inner diameter: 111
Core
Bridge thickness: 1.485
Gap taper: 0
Post width: 0
Web taper: 0
Web thickness: 13.15
Magnet
Magnet orientation 17.5
Magnet thickness: 6.5
Magnet top gap width: 0
Magnet width: 18.9
Note All other parameters represent either the default
value or a re‐calculated value based on the modifications.
Note the green check mark that indicates that a
parameter has been modified by the user.
3. From Motor Explorer’s toolbar, click .
The BLDC_Simulink_export_tutorial.moto file is updated with
the modifications you’ve made to the rotor.
The Input panel for Stator is active, with most
parameters set at their default values.
2. In the Input panel, make the following modifications:
Diameters
Inner diameter: 162
Teeth
Slot bottom radius: 2.902
Slot depth: 33.5
Slot opening width: 1.93
Slot top width: 3.15
Tooth tang angle: 15
Tooth tip thickness: 1.02
Note All other parameters represent either the
default value or a re‐calculated value based on the
modifications. Note the green check mark that
indicates that a parameter has been modified by the
user.
3. From Motor Explorer’s toolbar, click .
The BLDC_Simulink_export_tutorial.moto file is updated
with the modifications you’ve made to the stator.
The Input panel for Stator Windings is active, with most
parameters set at their default values.
2. In the Input panel, make the following modifications:
Drive
Current hysteresis: 2
Coil Cross Section
Slot liner thickness: 0
Coil separator thickness: 0
Wire
Wire size method: AWG number
Number of strands in hand: 13
Layout
Coil span: 5
Number of layers: 1
Automatic layout: 96.6%
(1 ‐7 13 ‐19 25 ‐31 37 ‐43)
Number of turns: 9
Note All other parameters represent either the
default value or a re‐calculated value based on the
modifications
3. From Motor Explorer’s toolbar, click .
The BLDC_Simulink_export_tutorial.moto file is updated
with the modifications you’ve made to the stator
windings.
The Input panel for Stator End Windings is active, with
most parameters set at their default values.
2. In the Input panel, make the following modifications:
End Effects
Gap height: 0
Inner inset depth: 0.2
Note All other parameters represent either the default
value or a re‐calculated value based on the modifications
3. From Motor Explorer’s toolbar, click .
The BLDC_Simulink_export_tutorial.moto file is updated
with the modifications you’ve made to the stator end
windings.
The Input panel for Materials is active, with most
parameters (i.e. assigned materials) set at their default
values.
2. In the Input panel, select the following options:
Rotor Materials
Rotor core material: M‐19 26 Ga
Rotor magnet material:
Neodymium Iron Boron: 38/15
Stator Materials
Stator back iron material:
M‐19 26 Ga
From Motor Explorer’s toolbar, click .
3. The BLDC_Simulink_export_tutorial.moto file is updated
with the modifications you’ve made to the materials.
The design is now complete. Please note that for the
purposes of this tutorial, we have elected to keep the
default name (i.e. Prototype Design 1).
2. In the Input panel for PWM analysis there is no need to select Prototype Design 1 from the
Designs drop-down list box as, by default, it has already been selected by Simcenter Motorsolve.
Under Resolution & Accuracy, select the “Yes” option for Include iron loss. This will perform and
extra FEA solution to estimate the iron losses in the model. (Note: This step is optional)
3. To export the thermal model, set Include thermal to “Yes” under Result Export Options.
FEA currents percentages:
5, 11, 25, 50, 100, 150, 200
FEA advance angles:
0, 360, 30
6. Select the Simcenter Motorsolve Plug-in for Simulink (*.mdl) option from the dropdown. Browse to
the desired location and click Save.
(Note: Simulink does not accept *.mdl filenames with dashes, spaces or commas but
allows underscores).
2. In the Input panel for PWM analysis there is no need to select Prototype Design 1 from the
Designs drop-down list box as, by default, it has already been selected by Simcenter Motorsolve.
Under Resolution & Accuracy, select the “Yes” option for Include iron loss. This will perform and
extra FEA solution to estimate the iron losses in the model. (Note: This step is optional)
3. To export the thermal model, set Include thermal to “Yes” under Result Export Options.
5. Select the Simcenter Motorsolve Plug-in for Simulink (*.rsm) option from the dropdown. Browse to
the desired location and click Save.
2. In the Input panel for Lumped parameters there is no need to select Prototype Design 1 from
the Designs drop-down list box as, by default, it has already been selected by Simcenter
Motorsolve.
3. Click on the export button.
4. Select the Simscape (*.mdl) option from the drop-down. Browse to the desired location and
click Save.
(Note: Simulink does not accept *.mdl filenames with dashes, spaces or commas but
allows underscores).
3. Open MATLAB. Make sure that the correct version of “Simcenter Motorsolve Plug-in for Simulink”
is installed and its folder directory is added to the path. To check this, click Home →Set path. If
the directory is absent, click on Add Folder and browse to the plug-in’s directory. If there is no
directory present, download the plug-in from Infolytica’s website. (Note: If you are running the 64-
bit version of MATLAB then you will need “Simcenter Motorsolve Plug-in for Simulink (64-bit)”)
The Simulink model of this controller, which generates the desired voltages in d-q space is shown
in this figure. A simple PI control scheme is used to control the motor dynamics through a velocity
and current feedback loops.
6. Set the simulation time to 0.5 second and press run.
2. Open MATLAB. Make sure that the correct version of “Simcenter Motorsolve Plug-in for Simulink”
is installed and its folder directory is added to the path. To check this, click Home →Set path. If
the directory is absent, click on Add Folder and browse to the plug-in’s directory. If there is no
directory present, download the plug-in from Infolytica’s website. (Note: If you are running the 64-
bit version of MATLAB then you will need “Simcenter Motorsolve Plug-in for Simulink (64-bit)”)
3. Create a new Simulink Model by clicking on Home →New→Simulink Model. Then, click on Library
Browser .
4. Under Libraries, select Infolytica: Simcenter Motorsolve then right click on the plug-in. Select Add
block to a new model to open the plug-in in a new Simulink Model.
The Simulink model of this controller, which generates the desired voltages in d-q space is shown
in this figure. A simple PI control scheme is used to control the motor dynamics through a velocity
and current feedback loops.
3. Double-click on the model to open the Block Parameters. Change the inertia to 0.5.
4. If you already have a three-phase drive circuit, copy and paste the plug-in and connect the input
and output pins accordingly. If not, use the circuit attached in the tutorial files:
The Simulink model of this controller, which generates the desired voltages in d-q space is shown
in this figure. A simple PI control scheme is used to control the motor dynamics through a velocity
and current feedback loops.
Speed Torque
Speed Torque
Speed Torque
The graphs above display the differences in accuracy between the three models. The Simscape
model is the least accurate seen from the low torque ripple. This is because this model does not
take into consideration the effect of the slots. On the other hand, the Simscape model is much
faster to generate and simulate from Simcenter Motorsolve and Simulink. In this example, the
simulation of the Simscape model is 2.5 times faster (2s versus 5s) than the linearized model
which in turn is 1.5 times faster (5s versus 7s) than the nonlinear model.
This trade-off between speed and accuracy should be accounted for when using the BLDC export
feature.
Speed Torque
Total Loss
Speed Torque
Total Loss