Skip to content

Motor 001 - Permanent magnet synchronous electric motor

In this tutorial, a 3D permanent magnet synchronous electric motor is considered under magnetostatic conditions using the φ-formulation.

Model definition

Instead of the whole motor, only a 1/8 slice of the motor is modeled. The 1/8 slice functions as a symmetry cell, which can be set up to simulate the whole motor with symmetry conditions. The symmetry cell has its periodic face aligned with the X-axis.

Tutorial image

ElementDimensions [m]
Stator steel outer radius0.1000.100
Stator steel inner radius0.0590.059
Rotor steel outer radius0.0550.055
Rotor steel inner radius0.0250.025
Permanent magnet outer radius0.0580.058
Air gap thickness0.0010.001

Material Data

  • Linear steel
PropertyValue
Magnetic permeability2000×μ0=2000×4π×107 H/m2000 \times \mu_0 = 2000 \times 4 \pi \times 10 ^{-7} ~ \rm H/m

Boundary conditions

NameTypeValue
left and right Y-planesperiodicity: rotationantiperiodic
rotor-stator interfacecontinuitypotential equality on both sides

Output Results

  • Torque [Nm]

Step-by-step guide

Here you’ll find a detailed step-by-step tutorial on how to simulate a permanent magnet synchronous electric motor in Quanscient Allsolve.

Step 1 - Build the geometry

  1. Start with a new project and name it PMSM Electric motor.

  2. Import the STEP file containing the motor slice geometry. File download link: pmsm-electric-motor.step

    Tutorial image

  3. Add a Translate operation targetting the rotating region:

    NameElement typeTargetTranslation [m]Copy
    translateTranslate operationVolumes 1-5X: 0No
    Y: 0
    Z: 0.02

    The Translate operation is done in this tutorial to separate the rotor and stator for meshing, and to have a duplicate mesh on the rotor-stator interface.

    Tutorial image

    The rotor is moved back into place at simulation time.

Step 2 - Define shared expressions, materials and shared regions

  1. Go to the Properties section.

  2. Define shared expressions:

    NameDescriptionExpression
    ICurrent amplitude [A]300
    alphaMechanical angle [deg]27
    phaseElectrical angle [deg]0
  3. Add the Air material:

    MaterialTarget
    Airpermanent magnet domain and all air domains (volumes 6-9, 17-20)

    Tutorial image

  4. Add the Carbon steel AISI 1020 material:

    MaterialTarget
    Carbon steel AISI 1020steel domain (volumes 13-16)

    Tutorial image

  5. Instead of nonlinear permeability, linear permeability is applied to the steel in this tutorial. Edit Carbon steel AISI 1020 material properties:

    PropertyUpdated value
    Magnetic permeability2000 * mu0
  6. Define shared regions:

    Region nameRegion typeTarget
    rotorVolumeall rotating regions with half of the airgap (volumes 16-20)
    airgapVolumevolumes 6, 20

    Tutorial image

    Tutorial image

Step 3 - Define the physics and apply boundary conditions

  1. Go to the Physics section.

  2. Add the Magnetism φ physics:

    PhysicsTarget
    Magnetism φAll volumes except the windings (volumes 6-9, 13-20)

    Tutorial image

  3. Add a Constraint interaction to Magnetism φ:

    NameInteraction typeTargetValue
    ConstraintConstrainta corner point on the permanent magnet0

    This constraint is the gauge condition for the scalar potential φ. It will guarantee the uniqueness of the solution.

    Tutorial image

  4. Add a Remanence interaction to Magnetism φ:

    Interaction nameInteraction typeTargetValue [X; Y; Z]
    RemanenceRemanencePermanent magnet volume[0.5*x/sqrt(x*x+y*y); 0.5*y/sqrt(x*x+y*y); 0]

    This introduces a 0.5 T0.5 ~ \rm T radial magnetization to the motor.

    Tutorial image

  5. Add a Periodicity interaction and select target surfaces:

    Interaction nameInteraction typePeriodicity target 1Periodicity target 2
    PeriodicityPeriodicitySide surfaces parallel to X-axisSide surfaces opposite to target 1

    Tutorial image

    Tutorial image

  6. Select remaining options in the Periodicity interaction:

    Interaction nameInteraction typeTypeRotation center [X; Y; Z]Rotation angle [X; Y; Z]Antiperiodicity
    PeriodicityPeriodicityRotation[0; 0; 0][0; 0; 45]Yes

    Tutorial image

  7. Add a Continuity interaction:

    Interaction nameInteraction typeContinuity target 1Continuity target 2
    ContinuityContinuityStator interface surface 23Rotor interface surface 143

    Tutorial image

    Tutorial image

  8. Add Lump I/V cut interactions to introduce current sources on the windings:

    Interaction nameInteraction typeTargetActuation modeCurrent
    Lump I/V cutLump I/V cutCounterclockwise loop around left-most windingCurrentI * sin((phase + 4.0 * alpha - 120.0) * pi/180.0)
    Lump I/V cut 2Lump I/V cutCounterclockwise loop around middle windingCurrentI * sin((phase + 4.0 * alpha - 60.0) * pi/180.0)
    Lump I/V cut 3Lump I/V cutCounterclockwise loop around right-most windingCurrentI * sin((phase + 4.0 * alpha - 0.0) * pi/180.0)

    Tutorial image

    Tutorial image

    Tutorial image

There are 7 interactions in total:

Tutorial image

Step 4 - Generate the mesh

  1. Go to the Simulations section.

  2. Create a new mesh.

  3. Set mesh quality to Expert settings.

  4. Set mesh element max size to 0.001.

  5. Enable Curved mesh.

  6. Add a mesh refinement entity:

    Mesh refinement entity typeTargetMax size
    Volumeair gap volumes0.0005

    Tutorial image

  7. Apply settings and generate the mesh.

  8. Check the preview:

    Tutorial image

Step 5 - Apply simulation settings

  1. Create a new simulation.

  2. Set Analysis type to Steady state.

  3. Select Mesh 1 as the mesh for your simulation.

  4. Add a magnetic flux density B field output. As target, select all volumes except the windings.

    Tutorial image

Step 6 - Modify the script

The following modifications need to be done by scripting:

  • Move the rotor back to its original position and apply rotation.
  • Apply antioperiodicity and rotation for the continuity condition.
  • Calculate the torque.

To do these modifications, do the following:

  1. Open the script for your simulation.

  2. Enable scripting mode.

  3. Add these lines to the script right below the initial mesh loading stage:

    # Moving the rotor back to it's original position and applying rotation
    mesh.mesh.shift(reg.rotor, 0.0, 0.0, -0.02)
    mesh.mesh.rotate(reg.rotor, 0.0, 0.0, expr.alpha)

    Tutorial image

  4. To address the antiperiodicity regarding the rotated position for the continuity condition, add the following arguments on the continuitycondition() function:

    qs.continuitycondition(..., [0,0,0], expr.alpha, 45.0, -1.0)

    Tutorial image

  5. To calculate the torque via Arkkio’s method 1 and via Maxwell’s Stress Tensor, add the following lines to the very end of the script:

    # Calculating torque:
    # The torque is scaled (8*5) to the actual z length of the motor 0.05 m and to take into account full 360 degrees of the motor.
    # 1) Using Arkkio's method
    rs = 0.059 # outer radius of airgap
    rr = 0.058 # inner radius of airgap
    radius = qs.sqrt( qs.pow(qs.getx(),2) + qs.pow(qs.gety(),2) )
    ephi = qs.array3x1(-qs.gety()/radius, qs.getx()/radius, 0.0)
    er = qs.array3x1(qs.getx()/radius, qs.gety()/radius, 0.0)
    Bphi = df.B*ephi
    Br = df.B*er
    dr = (rs-rr)
    magforcedensity1 = (8*5*radius*Br*Bphi/qs.getmu0()/dr)
    torque1 = magforcedensity1.allintegrate(reg.airgap,5)
    # 2) Using Maxwell stress tensor
    leverarm = qs.array3x1(qs.getx(), qs.gety(), 0.0)
    T = 1/qs.getmu0() * ( df.B*qs.transpose(df.B) - 0.5*df.B*df.B * qs.eye(3) )
    magforcedensity2 = qs.on(reg.airgap, T)*qs.normal(reg.airgap)
    torque2 = 8*5*qs.compz(qs.crossproduct(leverarm, magforcedensity2)).allintegrate(reg.continuity_target_2, 5)
    qs.setoutputvalue("Mechanical angle", qs.evaluate(expr.alpha)[0])
    qs.setoutputvalue("Torque (Arkkio)", qs.evaluate(torque1))
    qs.setoutputvalue("Torque (Maxwell's Stress Tensor)", qs.evaluate(torque2))
  6. Save the script.

Step 7 - Running the simulation and checking results

  1. Run Simulation 1.

  2. To follow the simulation progress, open the Logs.

    Tutorial image

  3. Once the simulation has finished, add a B field visualization.

  4. Add a Glyph filter to the visualization:

    FilterLayerMax sample pointsScaling modeScale factor
    GlyphB - Cool to Warm50000data0.005
    0.0002 - 1.0
  5. Activate the visualization.

    Tutorial image

  6. To see the value of torque [Nm] at the applied mechanical angle [deg], see the Summary.

    Tutorial image

References

Footnotes

  1. Arkkio’s Method for Torque Computation, https://www.anttilehikoinen.fi/research-work/arkkios-method-torque-computation/