MathWorks Technology Session at GE Closed-Loop · PDF fileMathWorks Technology Session at GE...

40
1 © 2012 The MathWorks, Inc. MathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 Brad Hieb Tom Priestley Marc Semma

Transcript of MathWorks Technology Session at GE Closed-Loop · PDF fileMathWorks Technology Session at GE...

Page 2: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

2

Design Controller

Control System Toolbox

Robust Control Toolbox

Model Predictive Control Tbx

Optimize Control System

Simulink Control Design

Simulink Design Optimization

Model Physical Plant

System Identification Toolbox

Model-Based Calibration Tbx

Simscape

data model

Page 3: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

3

Embedded System

Motor

Hardware

Controller

C Code

System Model

Model Based Design for Embedded Controls

Controller

C Code

Controller

Model

Motor

Model

Motor

Hardware

Page 4: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

4

Embedded System

Motor

Hardware

Controller

C Code

System Model

System Modeling and Simulation

GE Tech

Session, Tues.

March 26

Controller

C Code

Controller

Model

Motor

Model

Motor

Hardware

Page 6: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

6 © 2012 The MathWorks, Inc.

Characterizing a Permanent Magnet

Synchronous Machine

Brad Hieb – Application Engineer

Page 7: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

7

Motivation

Why characterize the motor?

– To develop a plant model

Why develop a plant model?

– To simulate the system

Why simulate the system?

– Simulation is a safe environment to try out new ideas without

the risk of damaging prototype hardware.

– Visualization and analysis of the complex data in our system.

– Gain confidence in our controller design before deploying on

hardware.

Page 8: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

8

Example use of simulation

Develop a velocity controller to meet performance

requirements

Page 9: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

9

But Does it Work on Hardware?

Page 10: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

10

Key Point

Create accurate plant models by executing tests,

identify parameter values and verifying against real-

world data

Test Identify

Parameters Verify

Page 11: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

11

What do These Particular Models Look Like?

Page 12: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

12

Surface Mount PMSM Equations

Mechanical Model

Electrical Model

𝑣𝑑 = 𝑅𝑖𝑑 − 𝐿𝑞𝑝𝜔𝑟 𝑖𝑞 + 𝐿𝑑

𝑑

𝑑𝑡𝑖𝑑

𝑣𝑞 = 𝑅𝑖𝑞 + 𝑝𝜔𝑟 𝐿𝑑 𝑖𝑑 + 𝜆 + 𝐿𝑞

𝑑

𝑑𝑡𝑖𝑞

𝜔𝑒 = 𝑝𝜔𝑟

𝑇𝑒 = 1.5𝑝 𝜆𝑖𝑞 + 𝐿𝑑 − 𝐿𝑞 𝑖𝑑 𝑖𝑞

𝑇𝑒 = 𝐾𝑡𝑖𝑞 𝑎𝑠𝑠𝑢𝑚𝑒𝑠 𝑟𝑜𝑢𝑛𝑑 𝑟𝑜𝑡𝑜𝑟, 𝐿𝑑 = 𝐿𝑞

𝑑

𝑑𝑡𝜔𝑟 =

1

𝐻 𝑇𝑒 − 𝑠𝑔𝑛 𝜔𝑟 𝐽0 − 𝑏𝜔𝑟 − 𝑇𝑙𝑜𝑎𝑑

Page 13: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

13

Required Parameters

Electrical Model

Mechanical Model

𝑣𝑑 = 𝑅𝑖𝑑 − 𝐿𝑞𝑝𝜔𝑟 𝑖𝑞 + 𝐿𝑑

𝑑

𝑑𝑡𝑖𝑑

𝑣𝑞 = 𝑅𝑖𝑞 + 𝑝𝜔𝑟 𝐿𝑑 𝑖𝑑 + 𝜆 + 𝐿𝑞

𝑑

𝑑𝑡𝑖𝑞

𝜔𝑒 = 𝑝𝜔𝑟

𝑇𝑒 = 1.5𝑝 𝜆𝑖𝑞 + 𝐿𝑑 − 𝐿𝑞 𝑖𝑑 𝑖𝑞

𝑇𝑒 = 𝐾𝑡𝑖𝑞 𝑎𝑠𝑠𝑢𝑚𝑒𝑠 𝑟𝑜𝑢𝑛𝑑 𝑟𝑜𝑡𝑜𝑟, 𝐿𝑑 = 𝐿𝑞

𝑑

𝑑𝑡𝜔𝑟 =

1

𝐻 𝑇𝑒 − 𝑠𝑔𝑛 𝜔𝑟 𝐽0 − 𝑏𝜔𝑟 − 𝑇𝑙𝑜𝑎𝑑

Page 14: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

14

Mapping parameters to PMSM model

𝑅

𝐿𝑑 , 𝐿𝑞

𝜆

𝐾𝑡

𝐻

𝑏

𝑝

𝐽0

Page 15: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

15

Tests to Characterize Motor and Load

Motor Tests Parameters Identified Identification method

Back EMF Test

Number of Pole Pairs (p)

Flux Linkage Constant (λ)

Torque Constant (Kt)

Calculation

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Curve fitting

Coast Down Test

Rotor Inertia (H) Curve fitting

DC Voltage Step Test Resistance (R)

Inductance (L)

Parameter estimation

Load Tests Parameters Identified Identification method

Bifilar Pendulum Test Disc inertia (Hd) Calculation

Page 16: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

16

Tests to Characterize Motor and Load

Motor Tests Parameters Identified Identification method

Back EMF Test

Number of Pole Pairs (p)

Flux Linkage Constant (λ)

Torque Constant (Kt)

Calculation

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Curve fitting

Coast Down Test

Rotor Inertia (H) Curve fitting

DC Voltage Step

Test

Resistance (R)

Inductance (L)

Parameter estimation

Load Tests Parameters Identified Identification method

Bifilar Pendulum

Test

Disc inertia (Hd) Calculation

Page 17: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

17

Tests to Characterize Motor and Load

Motor Tests Parameters Identified Identification method

Back EMF Test

Number of Pole Pairs (p)

Flux Linkage Constant (λ)

Torque Constant (Kt)

Calculation

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Curve fitting

Coast Down Test

Rotor Inertia (H) Curve fitting

DC Voltage Step Test Resistance (R)

Inductance (L)

Parameter estimation

Load Tests Parameters Identified Identification method

Bifilar Pendulum Test Disc inertia (Hd) Calculation

Page 18: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

18

Coast Down Test

Coast down test used to identify:

Rotor inertia (H)

Test Extract

Parameters Verify

Page 19: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

19

Identify Rotor Inertia (H)

𝑑𝜔𝑟

𝑑𝑡=

1

𝐻𝑇𝑒𝑚 − 𝑏𝜔𝑟 − 𝐽0 − 𝑇𝑙𝑜𝑎𝑑

𝑇𝑙𝑜𝑎𝑑 = 0

𝜔𝑟 = 𝜔𝑟0 + 𝐽0𝑏

𝑒−𝑏𝐻𝑡 −

𝐽0𝑏

NRMSD = Normalized Root Mean Square Deviation

Note: J0 and b are known from friction

test. Curve fit equation for ωr to find H.

Test Extract

Parameters Verify

Page 20: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

20

Validate Coast Down Test

NRMSD = Normalized Root Mean Square Deviation

Test Extract

Parameters Verify

Page 21: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

21

Tests to Characterize Motor and Load

Motor Tests Parameters Identified Identification method

Back EMF Test

Number of Pole Pairs (p)

Flux Linkage Constant (λ)

Torque Constant (Kt)

Calculation

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Curve fitting

Coast Down Test

Rotor Inertia (H) Curve fitting

DC Voltage Step

Test

Resistance (R)

Inductance (L)

Parameter estimation

Load Tests Parameters Identified Identification method

Bifilar Pendulum Test Disc inertia (Hd) Calculation

Page 22: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

22

DC Voltage Step Test

Used to identify:

Phase resistance (R)

Phase inductance (L)

Test Extract

Parameters Verify

Page 23: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

23

Identify Phase Resistance (R)

𝑣𝐼𝑛 𝑡 = 𝑅𝐿𝑖𝑚𝑖𝑡𝑖 𝑡 + 𝑅 𝑖 𝑡 + 𝐿 𝑑𝑖

𝑑𝑡

𝑣𝐼𝑛 𝑡 = 𝑅𝑇𝑖 𝑡 + 𝐿 𝑑𝑖

𝑑𝑡

𝑖 𝑡 = 𝑉𝐼𝑛

𝑅𝑇 1 − 𝑒

−𝑅𝑇𝐿

𝑡

𝑤𝑕𝑒𝑟𝑒: 𝑅𝑇 = 𝑅𝐿𝑖𝑚𝑖𝑡 + 𝑅

𝑅 = lim𝑡→∞

𝑣𝐼𝑛 𝑡

𝑖 𝑡

𝑅 = 𝑅

2

𝐿 = 𝐿

2

Test Extract

Parameters Verify

Page 24: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

24

Identify Inductance (L) using

Parameter Estimation

Test Extract

Parameters Verify

Page 25: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

25

Validate DC Voltage Step Test

NRMSD = Normalized Root Mean Square Deviation

Test Extract

Parameters Verify

Page 26: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

26

Tests to Characterize Motor and Load

Motor Tests Parameters Identified Identification method

Back EMF Test

Number of Pole Pairs (p)

Flux Linkage Constant (λ)

Torque Constant (Kt)

Calculation

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Curve fitting

Coast Down Test

Rotor Inertia (H) Curve fitting

DC Voltage Step Test Resistance (R)

Inductance (L)

Parameter estimation

Load Tests Parameters Identified Identification method

Bifilar Pendulum

Test

Disc inertia (Hd) Calculation

Page 27: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

27

Bifilar Pendulum Test

Bifilar pendulum test used to

identify:

Disc inertia (Hd)

Test Extract

Parameters Verify

Page 28: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

28

Identify Disc Inertia (Hd)

𝐻𝑑 = 𝑚𝑑𝑔 𝑇2𝑏2

4𝜋2𝐿

𝑤𝑕𝑒𝑟𝑒: 𝑚𝑑 = 𝑚𝑎𝑠𝑠 𝑜𝑓 𝑑𝑖𝑠𝑐 𝑔 = 𝑎𝑐𝑐𝑒𝑙𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑔𝑟𝑎𝑣𝑖𝑡𝑦 𝑇 = 𝑝𝑒𝑟𝑖𝑜𝑑 𝑜𝑓 𝑑𝑖𝑠𝑐 𝑟𝑜𝑡𝑎𝑡𝑖𝑜𝑛

Measurements:

L = 2.356 (m)

b = 0.0565 (m)

md = 0.0425 (kg)

T = 2.21 (sec)

Test results

Hd = 6.993e-5 (kg-m2)

Test Extract

Parameters Verify

Page 29: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

30

Validate Bifilar Pendulum Test

Simulation result

T = 2.21 (sec)

Parameters:

L = 2.356 (m)

b = 0.0565 (m)

md = 0.0425 (kg)

Hd = 6.993e-5 (kg-m2)

Test result

T = 2.21 (sec)

Test Extract

Parameters Verify

Page 30: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

31

Key Point

Create accurate plant models by executing tests,

identify parameter values and verifying against real-

world data

Test Identify

Parameters Verify

Page 31: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

32

Putting the pieces together

Page 32: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

33

Control Design

Page 33: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

34

Compare Closed Loop Simulation with

Hardware

Page 34: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

35

Where can I find more information?

Explore a demo on generating C code from a controller and verifying its compiled behavior and execution time

>> docsearch "Field-Oriented Control of Permanent Magnet

Synchronous Machine"

http://mathworks.com/products/demos/shipping/rtw/rtwdemo_pmsmfoc_script.html

Watch a recorded webinar: “Embedded Code Generation for AC Motors” http://www.mathworks.com/company/events/webinars/wbnr61549.html

Watch 2012 MathWorks Automotive Conference recording of: “Parameterizing and Verifying a Permanent Magnet Synchronous Motor Model” http://www.mathworks.com/company/events/conferences/automotive-conference-michigan/2012/proceedings/registration.html?video=3

Enroll in SAE Course: “Model Based Design: Delivering Quality Electronic Products Faster” http://www.sae.org/pdevent/C0806

Page 35: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

36

Questions

Page 36: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

37

End

Page 37: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

38

Backup Slides

Page 38: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

41

Tests to Characterize Motor and Load

Motor Tests Parameters Identified

Back EMF Test

Number of Poles (P)

Flux Linkage Constant (Λ𝑝𝑚)

Torque Constant (Kt)

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Coast Down Test

Rotor Inertia (H)

DC Voltage Step Test Resistance (R)

Inductance (L)

Load Tests Parameters Identified

Bifilar Pendulum Test Disc inertia (Hd)

Page 39: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

42

Tests to Characterize Motor and Load

Motor Tests Parameters Identified

Back EMF Test

Number of Poles (P)

Flux Linkage Constant (Λ𝑝𝑚)

Torque Constant (Kt)

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Coast Down Test

Rotor Inertia (H)

DC Voltage Step Test Resistance (R)

Inductance (L)

Load Tests Parameters Identified

Bifilar Pendulum Test Disc inertia (Hd)

Page 40: MathWorks Technology Session at GE Closed-Loop  · PDF fileMathWorks Technology Session at GE Closed-Loop Motor Control Development February 28, 2013 ... Bifilar Pendulum Test

43

Tests to Characterize Motor and Load

Motor Tests Parameters Identified

Back EMF Test

Number of Poles (P)

Flux Linkage Constant (Λ𝑝𝑚)

Torque Constant (Kt)

Friction Test

Viscous Damping Coefficient (b)

Coulomb Friction (J0)

Coast Down Test

Rotor Inertia (H)

DC Voltage Step Test Resistance (R)

Inductance (L)

Load Tests Parameters Identified

Bifilar Pendulum Test Disc inertia (Hd)