Design Through Simulation of an Interior Permanent Magnet ...€¢ The output from FEA is a direct...

Preview:

Citation preview

Design Through Simulation of an Interior Permanent Magnet

Machine and Controller ITEC Tutorial June 28, 2016

David Farnia

Engineer – JMAG USA, Powersys Solutions

And

Dakai Hu, Ph.D.

Application Engineer, MathWorks

Part 1 – Basic Machine Modeling Creating an accurate machine model

David Farnia

Engineer – JMAG USA, Powersys Solutions

Part 2 – Controller Design Improving the controller design process using an FEA model

Dakai Hu, Ph.D.

Application Engineer, MathWorks

Overview

• Proper machine control is critical to achieving peak system performance.

• Traditionally, workflow of the machine design team and the control team have not had a common point of intersection. • The machine design team provides rated performance parameters • The control team then uses a simplified machine model to design the controller

• This makes it difficult to develop a system level simulation that is accurate across the full operating range.

Different types of Combined Testing in Model-Based Design

• What do we mean by HILS/SILS?

MILS/SILS

Virtual world

Real world

Plant models Motor models

Control device models Controller models Inverter models

Real plants Real motors Real transformers

Control devices Real controllers Real inverters

HILS

Combined testing

Physical Test

Transformer models

Requirements for Model-Based Design

• Real devices have nonlinear and non-sinusoidal properties, and cannot be described by simplified models

• Accurate modeling requires the plant model to be nearly identical in performance

to the actual device

Motor Controller

Inverter Saturation properties Spatial Harmonics

Dead time Device properties

Communication Barrier

• Traditional machine specifications are based on average properties at rated points, and do not accurately capture motor performance • This leads to an incomplete picture

when modeling a device’s performance

Machine Specifications Rated torque = ? Nm Magnet Flux Linkage = ? Wb Ld/Lq = ? mH Rated Power = ? kW Maximum Speed = ? rpm

What about the performance in this area?

Subaru Report on Using HILS

• Companies have already started working toward an approach that integrates multi-domain high fidelity models

*From report to NI on HILS Testing

Basic Machine Modeling Creating an accurate representation of a machine system

Typical Motor Design Steps

• Step 1: Identify Performance Targets and Dimensional Constraints • Step 2: Build model

• Can use JMAG Express to get a rough idea for a machine

• Step 3: Test machine performance using Finite Element Analysis • Output power • Efficiency • Demagnetization • etc

• Step 4: Send rated performance parameters to control team?

Step 1: Machine Performance Targets

• Let’s design a traction motor based on the following constraints: • 50kW at 1200rpm • At least 400Nm torque between 0-1500rpm • Max speed of 6000rpm • 500Vdc bus • Size envelope: 300mm OD x 200mm Height

• Assumptions: • Will need field weakening • End windings will be half the total height • Use 8 Rotor Poles and 48 Stator Slots

Step 2: JMAG Express First Pass

• Using the requirements in the previous slide, we can get a rough idea of a configuration in JMAG Express

JMAG’s Rough Design Estimate

JMAG Express Improvements

• There are some features that seem incorrect, so we can go through and clean those up • The back iron looks too thin • The tooth tips are too thick • Etc

• This is where is helps to have a starting point • Previous design • Iterating with the full design process in JMAG

Designer

• In the end, we wind up with on the right

Results in JMAG Express

• The JMAG Express model is a starting point, so it allows us to test rated operating points • We can ensure the design meets specific criteria, but…

• The model does not fully capture saturation • The Express model does not show results in the full operating range

At rated current, the Torque and Power are lower than

predicted since we are running with a zero degree

phase angle

Running a Quick Operating Range Test

• Operating range test options • We can move the model into JMAG Designer to manually run a full analysis or use a simple design

script to generate a speed/torque curve • We can export the model as an equation driven look up table (RT Block)

• The RT Block can then be used in a control program to create a simple operating range simulation

JMAG RT-Viewer

• The RT Block can be used in a separate control program • It can also be used in

JMAG’s RT Viewer

Inverter Rating, Bus Voltage, Max Current

Open the model in JMAG’s RT-

Viewer

Initial RT-Viewer Results

• RT Viewer can then create a torque/speed curve based on simple controller approximations • The RT-Viewer model shows that we have achieved our targets!

Moving into JMAG Designer Now that the model in Express meets our targets, we can do a more in depth analysis in JMAG Designer

Moving From Express into Designer

• The Express model can be imported directly into JMAG Designer • This model is ready to run in Designer

The Study and all the conditions are set and

ready to run!

Step 3: Operating Point Test

• In JMAG Designer, we can run a variety of analyses • Open circuit back EMF • Load Torque • Torque versus Phase Angle • Demagnetization analysis • Efficiency/loss analyses • Etc.

Back EMF Voltage Torque at 250Apk, 0deg Torque vs Phase Angle And some ripple torque… There are some harmonics…

Additional Tests

• JMAG Designer can account for non-linear behavior • This applies to the steel as well as the magnets

Magnetic Flux Density Demagnetization

FEA Machine Model

• We now have a very accurate representation of our machine • The model uses phase values • In this first set of designs, we are assuming pure sinusoidal excitation currents • The output from FEA is a direct calculation

• Input: Current/Phase Angle ---- Output: Torque • The machine’s inductance is included in the calculation

But what should we give the control designer….

FEA Machine Limitations

• The FEA model is very accurate, but the control team only wants rated values • What about cogging torque? • Will saturation be a problem? • There are a lot of winding harmonics, will this be a problem?

So what can we do?

Simplifying the Machine Model

• To increase our system simulation’s accuracy, we must simplify the machine model • This will allow us to calculate performance across the entire operating range • A simple model can run in Real Time • This simple model can then be used by a control designer

Convert

High Fidelity Model in a look-up table

Motor properties calculated with FEA (torque, inductance, linkage flux, iron loss)

Inputs from

Controller Simulation

Outputs based on

High Fidelity

Machine Model

Simplified Machine Model A little background information

End Goal for Simplified Model

• We need to define equations that will quickly predict machine performance • The Voltage and Torque equations below will capture the machine’s performance • Both the torque and voltage are shown in a DQ Reference frame

• This is the first level of simplification that we can investigate

Voltage Equation

Torque Equation

Q: Why DQ Inductance for torque, what about Flux Linkage?

A: The DQ Inductance based torque is the form I encounter most often.

Vq = Rsiq + ωr(Ldid + λf) + ρLqiq

Vd = Rsid - ωrLqiq + ρ(Ldid + λf)

Te = 32P (λfiq + (Ld - Lq)iqid)

3 Phase Applied Stator Field in ABC Reference Frame

• The image below shows a simple 3 Phase Stator

A Axis

Phase A Voltage/Current

B Axis

C Axis

Phase B Voltage/Current

Phase C Voltage/Current

• Often times machine equations are not expressed in the ABC frame • Typically the stationary ABC frame is converted to the rotating DQ reference frame

• The DQ Reference frame is attached to the rotor • Inductance from the stator reference can vary with time due to rotor saliency • Under steady state operation, from the rotor point of view, flux and mmf interactions become constant

Conversion to DQ Reference Frame

y p p

Phase A Voltage/Current

Q Axis

D Axis

Rotating

DQ Transform

• We can now convert the ABC values to DQ values based on Park’s Transformation • Works for Current, Voltage and Flux Linkage • Does not work directly for Inductances

• We can also do a reverse transform and change the DQ variables into ABC variables

What Does This Look Like?

• In JMAG, the Phase Current settings would look like the image below • The resulting currents are displayed as well

5 Apk

0 Degrees Phase Shift

Pros and Cons of DQ Modeling

Pros • DQ Values are constant with rotor

position • Makes life easy for motor control

• Simplifies calculations

Cons • Does not capture magnetic saturation • Does not capture items like ripple

torque driven by geometry

DQ Conversion

• The Theta in Park’s Transformation is actually the angle between the rotor’s flux linkage and the excitation value (current in the above example) • So we have to convert Theta into electrical degrees and then find the axis of rotor

flux linkage • In a PM machine, the axis of rotor flux linkage is the D-axis of the magnet • In a synchronous reluctance machine, the D and Q axis are switched, so the axis would align with

what would be the Q axis in a PM Machine • In an Induction Machine, the axis of the rotor flux linkage is aligned with the rotor field

Example

• Let’s take a look at the DQ Axes in our motor

D-Axis

Q-Axis

Steps to Solve for DQ Inductance (1)

• Align the magnet’s D-axis with the A-Phase of the stator • In the example below, the rotor’s D-axis is already aligned with the A-Phase

D-Axis

A-Axis

A-Phase

0 Degrees

Steps to Solve for DQ Inductance (2)

• Apply a balanced 3 Phase Current of 250Apk at 80Hz • Rotor speed = 1200 rpm, Electrical Frequency = 80Hz

Phase A

Phase B

Phase C

Steps to Solve for DQ Inductance (3)

• Plot the Phase Flux Linkages and Phase Currents

• Convert the ABC values to DQ values • In a 8 pole machine, Theta will be four times

the mechanical angle

• Divide the Q-Axis Flux Linkage by the Q-Axis current to get Lq

• This will not work for Ld! • Since there is a Permanent Magnet in the

circuit, the D-axis flux is comprised of the stator flux and the magnet flux

• You can either eliminate the D-Axis magnet flux by doing a Frozen Permeability Calculation or by using a differential inductance calculation

Solving for D-Axis Inductance

• The Frozen Permeability Method works by: • Running the load point • Taking the permeability of each element and applying it to a different model • Create another model and replace the magnet with air, then apply the permeabilities calculated

in the first case to the new model • The flux linkage is now only a function of the stator coils (since there is no magnet in this model)

• The differential permeability method works by: • Add a second analysis point close to the first point • Use the differential inductance calculation

L = λPoint 1 - λPoint 2

iPoint 1- iPoint 2

Create a Second Test Point

• In this case, create a point at 250.012Apk and 0.579 degrees • Repeat step 3 • Solve for the differential inductance

DQ Inductances versus Electrical Angle

• The DQ Inductances are shown below

Interesting… Will this have an effect

on our results?…

DQ Inductance Tool

• JMAG has a DQ Inductance tool • This will sweep the results across a given operating range

DQ Inductances As a function of Phase Amplitude and Angle

Constant Magnet Flux Based on Open Circuit EMF

Limitations

• As shown in the previous slide, inductance is not constant with electrical angle • But, the DQ Inductance is a single value each operating point

• The single value can be thought of as an average inductance as a function of position • But if the machine is in very non-linear operation, the peak to peak inductance differences can be

very large

Even Worse Limitations

• If we only give the control designer the rated results • DQ Inductance • Open Circuit Magnet Flux • Pole Pairs

• They can solve the torque and voltage equation below

Is this a bad thing?

Yes, if they assume this is how the machine will respond across its

entire operating range!

Voltage Equation

Torque Equation

Vq = Rsiq + ωr(Ldid + λf) + ρLqiq

Vd = Rsid - ωrLqiq + ρ(Ldid + λf)

Te = 32P (λfiq + (Ld - Lq)iqid)

Constant DQ versus Lookup Table

• Using the basic torque equation, we can plot torque versus Peak Phase Current and Phase Angle • For the Lookup DQ torque,

we will just use the DQ Inductances with a fixed flux linkage • As shown at the right,

there are some differences in the results

Adding Flux Linkage to the Lookup Table

• We can take this a step farther and use the average torque to calculate an operating point specific magnet flux • Now, the nonlinearity of the

response is even more pronounced

Problem!

Work Around: Option 1

• Use a better torque equation • The torque equation below uses DQ Flux Linkage values which can be

calculated at each operating point • This equation is better at capturing saturation • But it will still use average values over 1 electrical cycle

• No ripple

Te = 32P (λdiq - λqid)

Better Torque Equation

Work Around: Option 2

• Use a calculated Magnet Flux at each operating point based on the FEA prediction for Electromagnetic Torque (Te) • We have the DQ Inductance Sweep results, so we can then calculate the magnet

flux from the torque and inductances Flux Linkage Calculation From Excel

Torque Equation

T_Mag T_Rel

Simple Comparison of Torque Equations

• If we create a DQ Inductance Table based on sweeping various operating points, we can then calculate the torque with different methods • The plot on the right is based on

case index (not the best x-axis) • The Measured Torque is the

most accurate • As the torque increases, the

simple torque equations have very poor results

50Apk

100Apk 150Apk 200Apk 250Apk

Phase Angle 0 -70

Degrees

Predicting Operating Points

• In the DQ Frame, we have two levels of simplification • Constant DQ Inductance, Constant Magnet Flux • Lookup DQ Inductance, Constant Magnet Flux

• As shown previously, the Constant Magnet Flux assumption does not hold up during saturated operation • We can create a DQ Flux Linkage table at each operating point • We can add an approximation for the magnet flux from the average torque • We could also use the Frozen Permeability method to separate out the magnetic flux at each

operating point

• Or we can just add Torque to the lookup table

• This model would also be able to capture spatial phenomena such as cogging torque

Automatically Create a Simplified Model Different levels of simplification have different uses

Steps to Generate an RT File from Designer

Step 1: Create FEA Model

Step 2: Choose RT Fidelity

Step 3: Set Analysis Conditions

Step 4: Generate RT File

JMAG RT – Load the Model File

• Create the JMAG Model • Export the Model JCF file to a new

location • Open the RT Tool

• Select “New” and set the motor type • Choose the complexity for the RT Model • Set the JCF File

Two Levels of Complexity

• LdLq model • Spatial Harmonic model

• This will capture torque in the lookup table

• It will also use Phase inductances instead of DQ Inductances

Terminal Voltage Calculations

• The DQ based model and the Spatial Harmonic model both use the voltage equation below • The DQ model will convert DQ values to Phase values • The Spatial Harmonic model will calculate phase values directly

Torque Calculations

• The DQ Model will use the basic torque equation below • The Spatial Harmonic Model will capture the torque as a function of mechanical

angle, phase amplitude and phase angle

Torque Equation

Te = 32P (λfiq + (Ld - Lq)iqid)

Magnet Flux Calculations

• The DQ Model will use a constant flux linkage based on the open circuit Back EMF results • The Spatial Harmonic model will calculate the Magnet Flux linkage at each

operating position

Our Model Results

• Now we come back full circle • We made a very simple

RT model from JMAG Express to check if the motor met operating range targets • Now we have our model

in Designer, so we can use the RT Tool to generate an RT block covering our entire operating range

RT Block Operating Range

• We will create both a DQ and Spatial Harmonic Model • The current will be tested every 50Apk from 0-800Apk • The phase angle will be evaluated every 5 degrees from 0-90 degrees • All these calculations will be done with a mechanical resolution of 3 degrees

(mechanical) • This will ensure that our waveform captures the cogging torque waveform

RT Block Tips

• The DQ Model is based on a per phase approximation • Check the results based on a simple model before delving into a very long run • Use a mechanical angle that will accurate represent a cogging torque waveform • In a DQ Model, JMAG will automatically calculate the D-axis reference, so initial

rotor position is not important • In a Delta Connection, the 3 Phase Current source with a phase angle of 0 degrees actually

corresponds to a phase angle of +30 degrees • Check your actual phase currents! Not just the current source

• Always set a test point well above your maximum otherwise, JMAG will use the last test point instead of extrapolating • Always set a near zero test point for the same reason

RT Block Simple Predictions

• The RT Block can be used with RT-Viewer to capture torque/speed or efficiency/speed curves • We can also export the file for the use in control simulation programs

Part II Creating an Accurate Control Simulation

Motor control design is improved using an FEA model

• Align with the motor design engineer early during development • The FEA model serves as a good starting point for the motor control engineer to build a

system level simulation, allowing a high level of plant fidelity and accuracy. • Explore different operating conditions without out-of-bounds worries. • Accurate torque ripple profile facilitates the development of torque ripple mitigation

algorithms.

• Reduce expenses and time spent testing on the dyno

• Dyno time has many factors to consider: operation time, operation cost, safety and failures (machine, inverter,…). It is a common goal to minimize dyno time.

• DoE setup requires an understanding of the machine characteristics and simulation can help determine a minimum number of points to test.

• The FEA model can be updated with dyno data for improved accuracy, reducing the need for dyno testing.

Example for tutorial

Steps for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• This model consists of a closed-loop current controller and the FEA plant model. • The test can be scripted to sweep the d- and q-axis current commands.

• Step 2: Extracting machine characteristics data • For each id/iq current set, save the steady state average value of id, iq, λd, λq, and Te.

• Step 3: Identifying optimal operation region • Calculate Maximum Torque per Ampere (MTPA) and Maximum Torque per Volt (MTPV) line

based on extracted data.

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency • Different torque commands and speed scenarios.

Steps for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• This model consists of a closed-loop current controller and the FEA plant model. • The test can be scripted to sweep the d- and q-axis current commands.

• Step 2: Extracting machine characteristics data • For each id/iq current set, save the steady state average value of id, iq, λd, λq, and Te.

• Step 3: Identifying optimal operation region • Calculate Maximum Torque per Ampere (MTPA) and Maximum Torque per Volt (MTPV) line

based on extracted data.

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency • Different torque commands and speed scenarios.

“.rtt” file generated from JMAG-RT

MATLAB scripts to automate the sweeping and data-logging

Structure of the sweeping test controller

Steps for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• This model consists of a closed-loop current controller and the FEA plant model. • The test can be scripted to sweep the d- and q-axis current commands.

• Step 2: Extracting machine characteristics data • For each id/iq current set, save the steady state average value of id, iq, λd, λq, and Te.

• Step 3: Identifying optimal operation region • Calculate Maximum Torque per Ampere (MTPA) and Maximum Torque per Volt (MTPV) line

based on extracted data.

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency • Different torque commands and speed scenarios.

Flux Data on the d- and q- axis

* - * )

Torque error between calculated and measured torque

Calculated and Measured Torque

* + ( - )* )

Steps for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• This model consists of a closed-loop current controller and the FEA plant model. • The test can be scripted to sweep the d- and q-axis current commands.

• Step 2: Extracting machine characteristics data • For each id/iq current set, save the steady state average value of id, iq, λd, λq, and Te.

• Step 3: Identifying optimal operation region • Calculate Maximum Torque per Ampere (MTPA) and Maximum Torque per Volt (MTPV) line

based on extracted data.

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency • Different torque commands and speed scenarios.

For each torque contour, locate the operation point that has the minimum stator current

Maximum Torque per Ampere (MTPA)

- *

• At steady state, solving the following equations for

+ *

+

• Please note that is the total d-axis flux linkage.

• becomes the maximum allowable speed at each ( , ) operation point.

• Plot the contours of on the ( , ) plane.

Maximum Torque per Volt (MTPV)

At each /voltage constraint contour, calculate the operation point that generates maximum torque.

Maximum Torque per Volt (MTPV)

The optimal operation area is the enclosed area defined by the MTPA and MTPV line

Optimal Operation Area

Steps for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• This model consists of a closed-loop current controller and the FEA plant model. • The test can be scripted to sweep the d- and q-axis current commands.

• Step 2: Extracting machine characteristics data • For each id/iq current set, save the steady state average value of id, iq, λd, λq, and Te.

• Step 3: Identifying optimal operation region • Calculate Maximum Torque per Ampere (MTPA) and Maximum Torque per Volt (MTPV) line

based on extracted data.

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency • Different torque commands and speed scenarios.

Case 1: Speed is below base speed

Case 2(a): Speed is above base speed & torque is achievable

Case 2(b): Speed is above base speed & torque is NOT achievable

Tcmd

ωfdb

Complete Map of Optimal Operation Data Points (LUT Data Points)

Integrating LUT into a controller design

Summary for generating an optimized controller lookup table • Step 1: Building the simulation model for sweeping tests

• Step 2: Extracting machine characteristics data

• Step 3: Identifying optimal operation region

• Step 4: Selecting LUT points with best achievable torque accuracy & efficiency

Controller Performance

Speed is controlled by the dyno machine

Torque accuracy is achieved both below and above base speed

Controller Performance

Torque ripple matches the FEA result

Controller Performance

Questions ?

Recommended