Top Banner
© 2011 ANSYS, Inc. November 23, 2014 1 Scripting in Maxwell 2D for Computationally – Efficient FEA with Optimization Algorithms Gennadi Sizov and Peng Zhang Marquette University Electrical and Computer Engineering advisors: Professors Demerdash and Ionel
40

Chicago UGM-8_ANSYS Conference - 08292011

Nov 16, 2015

Download

Documents

Ki Chun

sfs
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 2011 ANSYS, Inc. November 23, 2014

    1

    Scripting in Maxwell 2D for Computationally Efficient FEA with Optimization Algorithms

    Gennadi Sizov and Peng Zhang

    Marquette University Electrical and Computer Engineering

    advisors: Professors Demerdash and Ionel

  • 2011 ANSYS, Inc. November 23, 2014

    2

    Introduction Model-based optimization

    difficulties choice of a modeling approach

    Computationally Efficient Finite Element Analysis (CEFEA) Electric circuit symmetry

    vector potentials, flux linkages, induced voltages

    Magnetic circuit symmetry core loss calculation

    Torque calculation

    Design Optimization Objective function selection (single weighted

    function vs. multi-objective) Optimization algorithm

    Differential Evolution

    Optimization of 9-slot, 6-pole IPM Motor Design objectives Optimization study (10,000 candidate designs)

    eleven independent stator and rotor variables

    significant design improvements are achieved

    Scripting Maxwell 2D RMxprt geometric primitives Simple interfacing of Maxwell 2D to Matlab Optimization of Toyota Prius IPM motor

    Overview

  • 2011 ANSYS, Inc. November 23, 2014

    3

    Model-based optimization of electric machinery Difficulties:

    Complex geometries (large number of geometric variables) Nonlinear material properties Multi-domain (physics) modeling (electromagnetic, thermal, stress, etc.) Multiple design objectives Population based design is problematic Search of large design spaces

    Choice of modeling approach Tradeoffs

    Speed vs. Accuracy Analytic/Lumped Parameter (MEC) vs. FEA

    Computationally Efficient FEA [Trans. on IA 2010/2011, ECCE 2010, IEMDC 2011] Fast simulation of synchronous machinery Accurately estimates EMFs, average torques, cogging torque, on-load torque ripple, and

    core losses.

    Introduction

  • 2011 ANSYS, Inc. November 23, 2014

    4

    Maximum Torque per Ampere MTPA Optimum operating point depends on design

    variables Every design requires additional model evaluations increasing computational time

    Field Weakening Operation Depends on design variables. Requires further design evaluations increasing computational time Computational savings are possible by employing

    solutions from MTPA search

    Difficulties in Optimization of Interior-PM Machines

    0

    5

    10

    15

    20

    0 30 60 90 120 150 180

    Ave

    rage

    torq

    ue [N

    m]

    Torque angle, [deg. el.]

    0

    0.25

    0.5

    0.75

    1

    1.25

    0 1 2 3 4 5 6

    Torq

    ue [p

    u]

    Speed [pu]

    Field Weakening Operation

    Maximum Torque per Ampere MTPA

    MTPA

    MTPA

  • 2011 ANSYS, Inc. November 23, 2014

    5

    10,000 designs in less than 51 hours! 6 static FE solutions (20 seconds/per design) CE-FEA (seconds) vs. time-stepping FE (minutes) several days vs. months! large scale FEA-based optimization studies

    The fundamentals of CE-FEA fully exploits symmetries of electric and

    magnetic circuits to reduce simulation time minimum number of magnetostatic solutions,

    correlated with the maximum order of significant field harmonics

    one-to-two orders of magnitude reduction of simulation time

    suitable for most types of synchronous machines.

    Computationally Efficient Finite Element Analysis (CEFEA)

    5 10 15 20 250

    5

    10

    15

    20

    25

    30

    35

    Shaft Torque [Nm]

    Torq

    ue R

    ippl

    e [%

    ]

    Goo

    dnes

    s [N

    m/s

    qrt(W

    loss

    )]

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

  • 2011 ANSYS, Inc. November 23, 2014

    6

    What is not included in CE-FEA?

    Why is time-stepping (transient) FEA still needed? PM loss Eddy currents in conductors Current regulation in unconventional controllers (which may

    require coupled simulations with Simplorer) Motor-drive-controller simulations

    Fault conditions Unbalanced operation

    Machine asymmetries, for example due to tolerances, e.g. air-gap eccentricity

    More detailed space (i.e. multiple points) and time (e.g. PWM switching) info for core losses

    Computationally Efficient Finite Element Analysis (CEFEA)

  • 2011 ANSYS, Inc. November 23, 2014

    7

    CE-FEA is applicable to design and analysis of both surface-PM and interior-PM machines.

    Assumptions: Machine model is excited by instantaneous values of a set of

    balanced three-phase sinusoidal currents. Assumption is well justified in motor-drive systems with well tuned

    current regulators.

    Principle: 2-D magnetostatic finite element formulation is utilized:

    Instantaneous values of rotor position, mech, phase currents, iR, iY, iB,

    are inputs to the model and the magnetic vector potentials (MVPs), A, are the outputs used in the post-processing stage to extract flux-densities, flux-linkages, energies (energy/co-energy).

    Computationally Efficient Finite Element Analysis (CEFEA)

    PMJJyA

    yxA

    x=

    +

    11

    Determination of number of solutions and rotor positions

    FEA 2-D (static)

    Post Processing: Flux linkages, emfs Flux densities Energies (energy/co-energy) Torques Losses

    mechiR ()

    A

    iY () iB ()

    CE FEA

  • 2011 ANSYS, Inc. November 23, 2014

    8

    Principle (flux linkages and back emfs): Symmetry of electric circuit results in the following:

    where, A, is the average MVP in the coil side. Similar expressions can be developed for all the other coil sides.

    From the coil side MVPs tooth fluxes, , and phase flux linkages, , can be estimated as follows:

    where, lFe, is the effective stack length and, Nph, is the number of series turns per phase.

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( ) ( ) ++ =+ YoR AA 60( ) ( ) ++ =+ BoR AA 120

    ( ) ( ) ( )( ) + = RRFeR AAl

    ( ) ( ) RphR N =

    AY+

    AB+

    AR+

    AR-

    AR+

    R

  • 2011 ANSYS, Inc. November 23, 2014

    9

    Principle (flux linkages and back emfs):

    Flux linkages, , can be written in Fourier series form as:

    Accordingly, resulting back emfs, e, can be written in Fourier series form as:

    Here, the maximum harmonic order, vM, is related to the number of magnetostatic FE solutions, s, as follows:

    Note: due to aliasing, the minimum number of FE solutions is limited by the highest harmonic present in the flux linkage waveform.

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( ) ( )=

    +=M

    R

    1cos

    13 = sM

    ( ) ( )=

    +==M

    dtd

    dde RR

    1sin

  • 2011 ANSYS, Inc. November 23, 2014

    10

    ( ) ( ) ++ =+ YoR AA 60( ) ( ) ++ =+ BoR AA 120

    Principle (flux linkages and back emfs): Coil side MVP, AR+

    -0.0100

    -0.0080

    -0.0060

    -0.0040

    -0.0020

    0.0000

    0.0020

    0.0040

    0.0060

    0.0080

    0.0100

    0 20 40 60 80 100 120 140 160 180

    [Wb/

    m]

    [deg. el.]

    R+

    Y+

    B+

    -0.01

    -0.008

    -0.006

    -0.004

    -0.002

    1.2E-17

    0.002

    0.004

    0.006

    0.008

    0.01

    0 20 40 60 80 100 120 140 160 180

    [Wb/

    m]

    [deg. el.]

    R+

    Y+

    B+

    -0.0100

    -0.0080

    -0.0060

    -0.0040

    -0.0020

    0.0000

    0.0020

    0.0040

    0.0060

    0.0080

    0.0100

    0 20 40 60 80 100 120 140 160 180

    [Wb/

    m]

    [deg. el.]

    R+

    Y+

    B+

    Computationally Efficient Finite Element Analysis (CEFEA)

    Five magnetostatic FE solutions

    AY+

    AB+

    AR+

    R

    One magnetostatic FE solution

  • 2011 ANSYS, Inc. November 23, 2014

    11

    Principle (flux linkages and back emfs): Coil side MVP, AR+ 5 - solutions Assuming lack of even order harmonics (half-wave symmetry)

    Computationally Efficient Finite Element Analysis (CEFEA)

    Five magnetostatic FE solutions

    -0.0100-0.0080-0.0060-0.0040-0.00200.00000.00200.00400.00600.00800.0100

    0 60 120 180 240 300 360

    [Wb/

    m]

    [deg.el.]

    Single magnetostatic FE solution yields six equally spaced points on MVP waveform! Using five static FE solutions yeilds thirty samples of MVP Flux EMF!

  • 2011 ANSYS, Inc. November 23, 2014

    12

    Principle (flux linkages and back emfs):

    Selection of the number of static solutions Has to be chosen to avoid aliasing in Fourier series Example 9-slot, 6-pole IPM with 5-static FE solutions (no aliasing) Spectrum of back emf, eR Rated-load, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    0255075

    100125150175200225250

    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

    EM

    F H

    arm

    onic

    Mag

    nitu

    de, |

    e a| [

    V]

    Harmonic Order

    Estimated from 5 solutions

    No significant harmonic content

    beyond 13th order

    no aliasing

  • 2011 ANSYS, Inc. November 23, 2014

    13

    Principle (flux linkages and back emfs): Verification (5-solutions): With respect to time-stepping FE Phase flux-linkage, R, and back emf, eR Open-Circuit, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( ) ( )=

    +=M

    R

    1cos ( ) ( )

    =

    +==M

    dtd

    dde RR

    1sin

    -300

    -200

    -100

    0

    100

    200

    300

    0.00 2.78 5.56 8.33 11.11 13.89 16.67Time, [ms]

    EMF,

    eR

    , [V]

    -300

    -200

    -100

    0

    100

    200

    3000 60 120 180 240 300 360

    Rotor Position, [el. deg.]

    TSFEeq. (3)

    -0.2

    -0.15

    -0.1

    -0.05

    0

    0.05

    0.1

    0.15

    0.2

    0.00 2.78 5.56 8.33 11.11 13.89 16.67Time, [ms]

    Flux

    Lin

    kage

    , R

    , [W

    b]

    -0.2

    -0.15

    -0.1

    -0.05

    0

    0.05

    0.1

    0.15

    0.20 60 120 180 240 300 360

    Rotor Position, [el. deg.]

    TSFEeq. (2)

  • 2011 ANSYS, Inc. November 23, 2014

    14

    Principle (flux linkages and back emfs): Verification (5-solutions): With respect to time-stepping FE Phase flux-linkage, R, and back emf, eR Rated-load, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( ) ( )=

    +=M

    R

    1cos ( ) ( )

    =

    +==M

    dtd

    dde RR

    1sin

    -0.2

    -0.15

    -0.1

    -0.05

    0

    0.05

    0.1

    0.15

    0.20 60 120 180 240 300 360

    -0.2

    -0.15

    -0.1

    -0.05

    0

    0.05

    0.1

    0.15

    0.2

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [deg. el.]

    Flux

    Lin

    kage

    , a

    [Wb]

    Time [ms]

    TSFESamples (5 solutions)eq. (2)

    -300

    -200

    -100

    0

    100

    200

    3000 60 120 180 240 300 360

    -300

    -200

    -100

    0

    100

    200

    300

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [el. deg.]

    Indu

    ced

    Vol

    tage

    , ea

    [V]

    Time [ms]

    TSFEeq. (3)

  • 2011 ANSYS, Inc. November 23, 2014

    15

    Principle (stator core flux densities): Magnetic circuit symmetry

    Symmetry of magnetic circuit [PAS 1981, IAS 2011] results in the following relationships for elemental radial and tangential components of stator core flux-densities at different rotor positions:

    where, k, is a positive integer, s, is the slot-pitch in electrical measure.

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( )strstr krtBrktB

    +=

    + ,,,, ,,

  • 2011 ANSYS, Inc. November 23, 2014

    16

    Principle (stator core flux densities): Magnetic circuit symmetry

    Using the same magnetostatic solutions used for estimation of flux-linkages and back emfs and assuming the lack of even order harmonics (half-wave symmetry), Fourier series of elemental flux densities can be created:

    Radial and tangential components of elemental flux densities will be used for estimation of stator core losses (efficiency).

    Computationally Efficient Finite Element Analysis (CEFEA)

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0 60 120 180 240 300 360

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0.00 2.78 5.56 8.33 11.11 13.89 16.67

    Rotor Position, [el. deg.]

    Flux

    Den

    sity,

    [T]

    Time, [ms]

    s 2s

    e1

    e2

    e3

    ( ) ( )=

    +=M

    BB tr

    1, cos

  • 2011 ANSYS, Inc. November 23, 2014

    17

    Principle (stator core flux densities): Magnetic circuit symmetry Verification (5-solutions):

    With respect to time-stepping FE Flux densities at locations: 1, 2 Full-load, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    Location 1 (Yoke) Location 2 (Tooth-Yoke Junction)

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    20 60 120 180 240 300 360

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [el. deg.]

    Flux

    Den

    sity

    [T]

    Time [ms]

    B r TSFE magnify x10B r eq. (11) magnify x10B t TSFEB t eq. (11)

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    20 60 120 180 240 300 360

    -2

    -1.5

    -1

    -0.5

    0

    0.5

    1

    1.5

    2

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [el. deg.]

    Flux

    Den

    sity

    [T]

    Time [ms]

    B r TSFE B t TSFEB r eq. (11) B t eq. (11)

    4

    3

    2

    1

  • 2011 ANSYS, Inc. November 23, 2014

    18

    Principle (stator core flux densities): Magnetic circuit symmetry Verification (5-solutions):

    With respect to time-stepping FE Flux densities at locations: 1, 2 Full-load, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    Location 3 (Tooth) Location 4 (Tooth Tip)

    -2.5-2-1.5-1-0.500.511.522.5

    0 60 120 180 240 300 360

    -2.5-2

    -1.5-1

    -0.50

    0.51

    1.52

    2.5

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [el. deg.]

    Flux

    Den

    sity

    [T]

    Time [ms]

    B r TSFEB t TSFE magnify x10B r eq. (11)B t eq. (11) magnify x10

    -2.5-2-1.5-1-0.500.511.522.5

    0 60 120 180 240 300 360

    -2.5-2

    -1.5-1

    -0.50

    0.51

    1.52

    2.5

    0.00 0.93 1.85 2.78 3.70 4.63 5.56

    Rotor Position [el. deg.]

    Flux

    Den

    sity

    [T]

    Time [ms]

    B r TSFE B t TSFEB r eq. (11) B t eq. (11)

    4

    3

    2

    1

  • 2011 ANSYS, Inc. November 23, 2014

    19

    ( ) ( )=

    +=W

    mcogmstored N

    1

    cosWW

    ( )=

    +=W

    mcogcogm

    stored NNd

    d

    1

    sin WW

    Principle (torque calculation): Creating a Fourier series of the energy stored in the magnetic circuit:

    Taking the derivative:

    Using flux-linkages obtained earlier the electromagnetic torque can be estimated using the following expression:

    Computationally Efficient Finite Element Analysis (CEFEA)

    ( ) ( ) ( ) ( )( ) ( ) ( )( )

    ( )

    =

    ===

    ++

    +++++=

    ++=

    W

    MMM

    mech

    oB

    oYR

    mech

    storedBB

    YY

    RRem

    W

    iiiP

    ddW

    ddi

    ddi

    ddiPT

    1

    111

    sin

    240sin120sinsin2

    2

    alignment and reluctance cogging

  • 2011 ANSYS, Inc. November 23, 2014

    20

    Principle (torque calculation): Cogging torque With respect to time-stepping FE Open-circuit, 3600 r/min

    Computationally Efficient Finite Element Analysis (CEFEA)

    16.7

    16.8

    16.9

    17

    17.1

    17.2

    17.3

    17.40 10 20 30 40 50 60

    -3-2.5

    -2-1.5

    -1-0.5

    00.5

    11.5

    22.5

    3

    0 10 20 30 40 50 60

    Stored E

    nergy [J]

    Cog

    ging

    Tor

    que

    [Nm

    ]

    Rotor Position [el. deg.]

    Cogging - TSFE Cogging - eq. (8)Energy (5 solutions) Energy - eq. (5)

  • 2011 ANSYS, Inc. November 23, 2014

    21

    Principle (torque calculation): On-load With respect to time-stepping FE Electromagnetic torque Open-circuit, half-load, rated-load (3600 r/min)

    Computationally Efficient Finite Element Analysis (CEFEA)

    -5

    0

    5

    10

    15

    200 60 120 180 240 300 360

    -5

    0

    5

    10

    15

    20

    0 60 120 180 240 300 360

    Torq

    ue [N

    m]

    Rotor Position [el. deg.]

    eq. (8)TSFE

  • 2011 ANSYS, Inc. November 23, 2014

    22

    Principle (torque calculation):

    Average torque calculation Error in estimation of the average torque as a function of number of static FE

    solutions. Compared to TSFE (based on Maxwell Stress Tensor)

    Computationally Efficient Finite Element Analysis (CEFEA)

    -1-0.5

    00.5

    11.5

    22.5

    33.5

    44.5

    55.5

    1 2 3 4 5 6 7 8 9 10

    Ave

    rage

    torq

    ue e

    stim

    atio

    n er

    ror [

    %]

    Number of magnetostatic FE solutions, s

  • 2011 ANSYS, Inc. November 23, 2014

    23

    Model-based optimization: Conflicting requirements on the modeling approach used for optimization

    (accuracy vs. execution time). Need for search of very large design spaces to find optimum design. Large number of design variables (geometry, materials, etc.) CE-FEA can be used for fast and accurate evaluation of very large number of

    candidate designs.

    Design Optimization

  • 2011 ANSYS, Inc. November 23, 2014

    24

    Objective function selection: Single weighted objective function:

    Pros: simple implementation Cons: choice of weights, wn, conflicting vs. non-conflicting objectives

    Multi-Objective (Pareto-based Optimization)

    Pros: meaningfully accounts for tradeoffs between multiple design goals, no weights, results in a family of best compromise designs

    Cons: implementation

    Design Optimization

    =

    =N

    nnn fwf

    11 )(x

    FeCu

    em

    pkpk( em

    PPT

    f :maximize

    Tf :minimize

    +=

    =

    2

    )1 min(Torque Ripple)

    max(Goodness) measure of average electromagnetic torque with respect to total losses

  • 2011 ANSYS, Inc. November 23, 2014

    25

    ][ qPPMPMTTSSTSi w, ,h , w, ,d ,d ,l , wg, ,D =x

    9-slot, 6-pole IPM: 11 geometric variables

    Only outer diameter is fixed 7Arms/mm2, 0.3 slot fill factor Search of MTPA for every design

    Optimization of 9-slot, 6-pole IPM Motor

  • 2011 ANSYS, Inc. November 23, 2014

    26

    Optimization results: Generations = 100, Population = 100 Total of 10,000 candidate design evaluations

    51 hours on a single core (single license) Search of maximum torque per amp (MTPA ) for every design

    Optimization of 9-slot, 6-pole IPM Motor

    M-1

    M-2 M-3

    Typ

    M-1: High Specific Torque

    M-2: Compromise between Specific Torque and Ripple

    M-3: Low Ripple

    Typ: Machine of Normal Proportions

  • 2011 ANSYS, Inc. November 23, 2014

    27

    Optimized machines:

    Optimization of 9-slot, 6-pole IPM Motor

    M-1: High Specific Torque

    M-2: Compromise Specific Torque and Ripple

    M-3: Low Ripple

    Typ: Machine of Normal Proportions

    max. Bmid-tooth = 1.75T, min. BPM = 0.76T

    max. Bmid-tooth = 1.71T, min. BPM = 0.75T

    max. Bmid-tooth = 1.65T, min. BPM = 0.73T

    max. Bmid-tooth = 1.67T, min. BPM = 0.78T

  • 2011 ANSYS, Inc. November 23, 2014

    28

    Electromagnetic Torque at Rated-Load (MTPA): Verified with time-stepping FEA (2nd order elements)

    Optimization of 9-slot, 6-pole IPM Motor

    14

    15

    16

    17

    18

    19

    20

    21

    22

    0 10 20 30 40 50 60

    Elec

    tro m

    agne

    tic to

    rque

    [Nm

    ]

    Position [deg. el.]

    M-1 Tem = 20.84Nm, Ripple = 4.93%

    M-2 Tem = 18.55Nm, Ripple = 2.72%

    M-3 Tem = 15.79Nm, Ripple = 0.45%

    Typ Tem = 15.21Nm, Ripple = 10.64%

  • 2011 ANSYS, Inc. November 23, 2014

    29

    Electromagnetic Torque at Open-Circuit (Cogging): Verified with time-stepping FEA (2nd order elements)

    Optimization of 9-slot, 6-pole IPM Motor

    -1.00

    -0.75

    -0.50

    -0.25

    0.00

    0.25

    0.50

    0.75

    1.00

    0 10 20 30 40 50 60

    Elec

    tro m

    agne

    tic to

    rque

    [Nm

    ]

    Position [deg. el.]

    M-1 Tpk-pk = 0.41Nm M-2 Tpk-pk = 0.29Nm M-3 Tpk-pk = 0.19Nm Typ Tpk-pk = 1.87Nm

  • 2011 ANSYS, Inc. November 23, 2014

    30

    7.5Hp rating (15Nm, 3600 r/min) axial-length is scaled to achieve the desired rating

    Optimization of 9-slot, 6-pole IPM Motor

    Axial length PM Mass

    0.931.05

    1.25

    1.00

    0

    0.25

    0.5

    0.75

    1

    1.25

    1.5

    M-1 M-2 M-3 Typ.

    PM M

    ass

    [pu]

    0.75 0.810.92

    1.00

    0

    0.25

    0.5

    0.75

    1

    1.25

    M-1 M-2 M-3 Typ.

    Tota

    l Mac

    hine

    Mas

    s [pu

    ]

    Total Mass

    0.730.82

    0.96 1.00

    0

    0.25

    0.5

    0.75

    1

    1.25

    M-1 M-2 M-3 Typ.

    Axia

    l Len

    gth

    [pu]

  • 2011 ANSYS, Inc. November 23, 2014

    31

    Separation of Losses 7.5Hp rating (15Nm, 3600 r/min) Equal split between copper and core losses for optimized designs

    Optimization of 9-slot, 6-pole IPM Motor

    182.7 167.4 170.8 206.1

    164.9 170.5 184.0167.2

    050

    100150200250300350

    M-1 M-2 M-3 Typ.

    Pow

    er L

    oss

    [W]

    Copper

    Core

    347.6W 337.9W 354.8W 373.3W

    Note a 9.5% reduction of losses with optimized machine M-2!

  • 2011 ANSYS, Inc. November 23, 2014

    32

    RMxprt geometric primitives Large number of predefined parameterized

    geometries: Stator slot shapes Rotor topologies (various interior-PM and

    surface-PM layouts) Primitives are accessible through scripting Custom geometries can be created through low-

    level primitives such as lines, arcs, etc.

    Simple interfacing of Maxwell 2D to third party software Communicates to any software that uses

    Common Object Module (COM) Matlab, MS Office Excel, Visual Basic, etc.

    Optimization exercise for Toyota Prius IPM type motor 48-slot, 8-pole, V-shaped IPM rotor topology Three parameters:

    PM width, PM length, V depth

    Scripting Maxwell 2D

  • 2011 ANSYS, Inc. November 23, 2014

    33

    Advice/hint: Use Tools\Record Script To File to get an idea of how to write your own script!

    ENABLE Record Script To File PERFORM the functions using Graphical User Interface (GUI)

    THEN look at the recorded text file to get an idea how to script.

    Opening Maxwell from Matlab environment Create COM object, open Maxwell, start new Maxwell 2D project, select transient

    solver % Maxwell COM object: iMaxwell=actxserver('AnsoftMaxwell.MaxwellScriptInterface'); Desktop=iMaxwell.GetAppDesktop(); % remove set from the object definitions Desktop.RestoreWindow % Create project in Maxwell or open an existing project Project=Desktop.NewProject; invoke(Project,'Rename','C:\Users\labadmin\Desktop\Optimization

    Project\Scripting\ANSOFT\Scripting\IPM2.mxwl',true) invoke(Project,'InsertDesign','Maxwell 2D','Design1','Transient','') Design=Project.SetActiveDesign('Design1'); invoke(Design,'SetSolutionType','Transient','XY') Editor=Design.SetActiveEditor('3D Modeler'); invoke(Editor,'SetModelUnits',{'NAME:Units Parameter','Units:=','mm','Rescale:=',false}) %

    Setup units [mm]

    Scripting Maxwell 2D

  • 2011 ANSYS, Inc. November 23, 2014

    34

    Execution of Maxwell models from Matlab environment Changing Maxwell params. from Matlab

    % Input parameters Imax=250; % Imax: the magnitude of phase currents Thet_deg=20; % Thet_deg: the load angle in degree, initial value: 20deg O2=7.28; % O2: Distance form duck bottom to shaft surface TM=6.48; % TM: Magnet thickness WM=32; % WM: Total width of all magnet per pole

    Passing values to Maxwell using invoke/ChangeProperty commands Make sure to add units to all dimensions (using Matlabs strcat function). Also change all numerical values to strings (using Matlabs num2str function) before passing

    them to Maxwell. O2S=strcat(num2str(O2),'mm');TMS=strcat(num2str(TM),'mm');WMS=strcat(num2str(WM),'mm'); % Change these 5 parameters: invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab

    les'},... {'NAME:ChangedProps',{'NAME:Imax','Value:=',num2str(Imax)}}}}) invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab

    les'},... {'NAME:ChangedProps',{'NAME:Thet_deg','Value:=',num2str(Thet_deg)}}}}) invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab

    les'},... {'NAME:ChangedProps',{'NAME:O2','Value:=',num2str(O2S)}}}}) invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab

    les'},... {'NAME:ChangedProps',{'NAME:TM','Value:=',num2str(TMS)}}}}) invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab

    les'},... {'NAME:ChangedProps',{'NAME:WM','Value:=',num2str(WMS)}}}})

    Scripting Maxwell 2D

  • 2011 ANSYS, Inc. November 23, 2014

    35

    Execution of Maxwell models from Matlab environment Running the simulation

    % Run program: invoke(Design,'Analyze','Setup1');

    Extracting results (Post-processing) % Create reports of flux linkages, energy and torque: Module=Design.GetModule('ReportSetup'); % Create the report of three phase flux linkages: invoke(Module,'CreateReport','XY Plot 1','Transient','Rectangular Plot','Setup1 :

    Transient',{'Domain:=','Sweep'},... 'Time:=',{'All'},'Poles:=',{'Nominal'},'Speed_rpm:=',{'Nominal'},'Thet_deg:=',{'Nominal'},'Imax:=',{'Nominal

    '}},... {'X Component:=','Time','Y

    Component:=',{'FluxLinkage(PhaseA)','FluxLinkage(PhaseB)','FluxLinkage(PhaseC)'}},{}) invoke(Module,'RenameReport','XY Plot 1','FluxLinkages') % Create the report of torque: invoke(Module,'CreateReport','Torque','Transient','Rectangular Plot','Setup1 :

    Transient',{},{'Time:=',{'All'},'Poles:=,{'All'},'Speed_rpm:=',{'All'},'Thet_deg:=',{'All'},'Imax:=',{'All'}},{'X Component:=','Time','Y Component:=',{'Moving1.Torque'}},{})

    % Calculate the energy: Module=Design.GetModule('FieldsReporter'); invoke(Module,'EnterQty','Energy') invoke(Module,'EnterVol','AllObjects') invoke(Module,'CalcOp','Integrate') invoke(Module,'AddNamedExpression','WEnergy','Fields') % Create the report of energy: invoke(Module,'CreateReport','XY Plot 2','Fields','Rectangular Plot','Setup1 :

    Transient',{'Domain:=','Sweep'},... {'Time:=',{'All'},'Poles:=',{'Nominal'},'Speed_rpm:=',{'Nominal'},'Thet_deg:=',{'Nominal'},'Imax:=',{'Nomina

    l'}, 'O2:=',{'Nominal'},'TM:=',{'Nominal'},'WM:=',{'Nominal'}},{'X Component:=','Time','Y Component:=',{'WEnergy'}},{})

    invoke(Module,'RenameReport','XY Plot 2','Energy')

    Scripting Maxwell 2D

  • 2011 ANSYS, Inc. November 23, 2014

    36

    Execution of Maxwell models from Matlab environment

    Saving results % Export all data to .csv files: invoke(Module,'ExportToFile','FluxLinkages','C:\Users\labadmin\Desktop\Optimization

    Project\Scripting\ANSOFT\Scripting\Fluxlinkages.csv') % The file path can be changed invoke(Module,'ExportToFile','Energy','C:\Users\labadmin\Desktop\Optimization

    Project\Scripting\ANSOFT\Scripting\Energy.csv') % The file path can be changed invoke(Module,'ExportToFile','Torque','C:\Users\labadmin\Desktop\Optimization

    Project\Scripting\ANSOFT\Scripting\Torque.csv') % The file path can be changed

    These basic step summarize show how to:

    Create a Maxwell 2D model using RMxprt primitives Change model parameters from Matlab environment Solve using Maxwell Extract the results

    Scripting Maxwell 2D

  • 2011 ANSYS, Inc. November 23, 2014

    37

    Toyota Prius IPM type motor: Objective function: Single objective function:

    Single constraint maintain torque of 243Nm Goal reduce PM usage while maintaining same torque!

    Differential Evolution Optimizer Settings Three design variables (rotor only)

    PM length, PM width, V-depth Strategy DE/best/1 with jitter, F = 0.85, Cr = 1 Np = 15 candidates per population Ng = 10 generations Total candidate design evaluations = Ng*Np = 150 designs Simulation time approximately 30 minutes

    Optimization exercise

    PM Mass :maximize 1

    emTf =

    PM length

    PM depth

  • 2011 ANSYS, Inc. November 23, 2014

    38

    Optimization exercise

  • 2011 ANSYS, Inc. November 23, 2014

    39

    Toyota Prius IPM type motor:

    Optimization results Original motor (Toyota)

    PM mass = 2.1 kg @ 243Nm Optimized motor

    PM mass = 1.75 kg @ 245Nm Possible reduction of up to 20% of PM mass

    Optimization exercise

    Original (Toyota) Optimized

    min. BPM = 0.65 T min. BPM = 0.61 T

  • 2011 ANSYS, Inc. November 23, 2014

    40

    1. F. A. Fouad, T. W. Nehl, and N. A. O. Demerdash, Magnetic field modeling of permanent magnet type electronically operated synchronous machines using finite elements, IEEE Trans. on PAS, vol. PAS-100, no. 9, pp. 4125-4133, 1981

    2. D. M. Ionel and M. Popescu, Finite element surrogate model for electric machines with revolving field - application to IPM motors, IEEE Trans on Ind. Apps., vol. 46, no.6, pp. 2424-2433, Nov/Dec 2010.

    3. G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, Modeling and design optimization of PM AC machines using computationally efficient finite element analysis, IEEE Energy Conversion Congress and Exposition ECCE, pp. 578-585, Atlanta, Georgia, September 2010, updated version accepted for publication at IEEE Transactions on IES.

    4. G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, Multi-Objective Optimization of PM AC Machines Using Computationally Efficient - FEA and Differential Evolution, IEEE International Conference on Electric Machines and Drives IEMDC, pp. 1537-1542, Niagara Falls, Canada, May 2011.

    5. G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, A Review of Efficient FE Modeling Techniques with Applications to PM AC Machines, IEEE Power and Energy Society General Meeting (PES-2011), Detroit, Michigan, July 24-28 2011.

    6. G. Y. Sizov, P. Zhang, D. M. Ionel, N.A.O. Demerdash, and M. Rosu, Automated Multi-Objective Design Optimization of Integral-MW Direct-Drive PM Machines Using CE-FEA, IEEE Energy Conversion Congress and Exposition ECCE 2011, Phoenix, Arizona, September 2011.

    7. K. V. Price, R. M. Storn, and J. A. Lampinen, Differential Evolution - A Practical Approach to Global Optimization, Springer-Verlag Berlin Heidelberg, 2005.

    References

    Scripting in Maxwell 2D for Computationally Efficient FEA with Optimization AlgorithmsOverviewIntroductionDifficulties in Optimization of Interior-PM MachinesComputationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Computationally Efficient Finite Element Analysis (CEFEA)Design OptimizationDesign OptimizationOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorOptimization of 9-slot, 6-pole IPM MotorScripting Maxwell 2DScripting Maxwell 2DScripting Maxwell 2DScripting Maxwell 2DScripting Maxwell 2DOptimization exerciseOptimization exerciseOptimization exerciseReferences