Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 ·...

43
Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor: Stephen Boyd February 5, 2018

Transcript of Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 ·...

Page 1: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Control of Electric Motors and Drives

via Convex Optimization

Nicholas Moehle

Advisor: Stephen Boyd

February 5, 2018

Page 2: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Outline

1. waveform design for electric motors

– permanent magnet

– induction

2. control of switched-mode converters

2

Page 3: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Waveform design for electric motors

I traditionally:

– AC motors driven by sinusoidal inputs (and designed for this)1

– based on reference frame theory, c. 1930

I now:

– more computational power

– power electronics can generate near-arbitrary drive waveforms2

I our questions:

– given a motor, how to design waveforms to drive it?

– which waveform design problems are tractable? convex?

1Hendershot, Miller. Design of Brushless Permanent-Magnet Machines. 1994.2Wildi. Electrical Machines, Drives and Power Systems. 2006.

3

Page 4: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Motor model

!; �

1

n

+

v

1

+

v

n

i

1

i

n

...

I

n windings, each with an RL circuit.

I electrical variables:

– voltage v(t) 2 Rn

– current i(t) 2 Rn

– flux �(t) 2 Rn

4

Page 5: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Motor model

!; �

1

n

+

v

1

+

v

n

i

1

i

n

...

I the rotor has

– torque � (t)

– speed ! = onst: (high inertia mech. load)

– position �(t) = !t

I goal is to manipulate v to control �

4

Page 6: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Stored energy

I stored magnetic energy is E(�; �)

– magnetic coupling depends on mechanical position

I

E is 2�-periodic in �

I inductance equation relates current and flux:

i = r

E(�; �)

I torque given by

� = �

��

E(�; �)

I in general, both are nonlinear in �

5

Page 7: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Torque

I the average torque is:

�� = lim

T!1

1

T

Z

T

0

� (t) dt

I torque ripple is

r = lim

T!1

1

T

Z

T

0

� (t)� ��

2

dt

6

Page 8: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Power loss

R

11

R

nn

...

I

R 2 Sn++

is the (diagonal) resistance matrix

I resistive power loss is iTRi

I average power loss is

p

loss

= lim

T!1

1

T

Z

T

0

i

T

Ri dt

7

Page 9: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Circuit dynamics

1

n

+

v

1

+

v

n

i

1

i

n

...

I dynamics from Kirchoff’s voltage law, Faraday’s law:

v(t) = Ri(t) +

_

�(t)

I dynamics coupled across windings by inductance equation

i = r

E(�; �).

8

Page 10: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Winding connection

+

u

1

+

u

m

......

v

1

v

n

I often, winding voltages v not controlled directly

I (e.g., wye/delta windings, windings contained in rotor)

I indirect control through terminal voltages u(t) 2 Rm

Ci(t) = 0; v(t) = C

T

e(t) +Bu(t);

I

C 2 Rp�n is the connection topology matrix

I

B 2 Rn�m is the voltage input matrix

I

e(t) 2 Rp are floating node voltages

9

Page 11: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Winding connection examples

v

1

v

1

v

2

v

3

u

1

u

2

u

3

v

1

v

2

v

3

u

1

u

2

u

3

v

1

v

2

v

3

u

1

u

2

u

3

0

Ci(t) = 0; v(t) = C

T

e(t) +Bu(t);

I simple delta, wye, and independent winding connections

I some windings may be controlled only through induction

– e.g., windings on the rotor

10

Page 12: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Optimal waveform design

I waveform design problem:

minimize p

loss

+ r

subject to �� = �

des

;

torque equation

inductance equation

circuit dynamics

winding pattern

I variables are i, v, u, e, �, � (all functions on R+

)I problem data:

– tradeoff parameter � 0

– resistance matrix R 2 Sn++

– energy function E : Rn � R+

! R+

– shaft speed ! 2 R

– desired torque �des

2 R

– winding connection parameters B 2 Rn�m and C 2 Rp�n

11

Page 13: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

I nonconvex in general, due to nonlinear torque and inductance

equations

I problem data 2�-periodic, but periodicity of solution not known

– in practice, solutions often not 2�-periodic in �

12

Page 14: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor

NNSS

NN SS

u

1

u

2

u

3

u

4

u

5

I magnets in rotor change magnetic flux through windings as they

pass, producing voltage across the windings

I by simultaneously pushing current through the windings, electrical

energy is extracted (or injected)

13

Page 15: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor

I energy function is quadratic:

E(�; �) = �

T

A� + b(�)

T

(quadratic part independent of rotor angle)

I inductance equation is linear:

� = Li+ �

mag

(�)

L is the inductance matrix, �mag

is the flux due to rotor magnets

I torque equation is affine:

� = k(�)

T

i+ �

og

(�)

k(�) is the motor constant, � og

is the cogging torque

14

Page 16: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor

I dynamics, with �, are

v(t) = Ri(t) +

_

�(t)

I eliminating �:

v(t) = Ri(t) + L

di

dt

(t) + !k(�)

15

Page 17: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor, waveform design

I optimal waveform design problem is convex

I

2�-periodicity of problem data with convexity implies 2�-periodicity

of a solution, if one exists3

3Boyd, Vandenberghe. Convex Optimization, page 189. 2004

16

Page 18: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor, waveform design

I waveform design problem:

minimize

power lossz }| {

1

2�

Z

2�

0

i(�)

T

Ri(�) d�+

torque ripplez }| {

1

2�

Z

2�

0

(� (�)� �

des

)

2

d�

subject to1

2�

Z

T

0

� (�) d� = �

des

(av. torque)

� = k(�)

T

i+ �

og

(�) (torque)

v(�) = Ri(�) + !Li

0

(�) + !k(�) (dynamics)

Ci(�) = 0

(winding conn.)v(�) = C

T

e(�) +Bu(�)

I variables are i, v, u, e, � (all functions on [0; 2�℄)

17

Page 19: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Permanent magnet motor, waveform design

I a periodic linear-quadratic control problem

– can discretize, solve by least squares

I in fact, many extensions retain convexity:

– voltage limits ju(�)j � u

max

– current limits ji(�)j � i

max

– nonquadratic definitions of torque ripple

I extensions typically involve solving a quadratic program

I more discussion in paper4:

– extensions/variations

– custom fast solver ! online waveform generation

4Moehle, Boyd. Optimal Current Waveforms for Brushless Permanent Magnet

Motors. 2015.

18

Page 20: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Example

I

= 2 W=Nm

2

I left: ! = 300 rad/s, right: ! = 400 rad/s

0 100 200 300�5

0

5

0 100 200 300�50

0

50

0 100 200 3000.25

0.3

0.35

0 100 200 300�5

0

5

0 100 200 300�50

0

50

0 100 200 3000.25

0.3

0.35

� (

Æ

)

� (

Æ

)

i

1

(

A

)

i

1

(

A

)

u

1

(

V

)

u

1

(

V

)

(

N

m

)

(

N

m

)

19

Page 21: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Induction motor

u

1

u

2

u

3

u

4

u

5

I rotor magnets replaced by more windings, which act as

electromagnets (with current)

I rotor current produced my magnetic induction (using stator currents)

20

Page 22: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Induction motor

I Energy function is again quadratic:

E(�; �) = �

T

A(�)�

quadratic part dependent on � (affine part omitted for simplicity)

I inductance equation is linear:

� = L(�)i

I torque is (indefinite) quadratic:

� = �i

T

L

0

(�)i

21

Page 23: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Induction motor, maximum torque problem

I general waveform design problem intractable

I we focus on the maximum torque problem ( = 0):

– torque ripple penalty disappears

– maximize average torque (a nonconvex quadratic function)

– power loss constraint (a convex quadratic function)

22

Page 24: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Induction motor, maximum torque problem

I waveform design problem:

maximize

average torquez }| {

lim

T!1

1

T

Z

T

0

�i(t)

T

L

0

(!t)i(t) dt

subject to lim

T!1

1

T

Z

T

0

i(t)

T

Ri(t) dt � p

loss

(power loss)

v(t) = Ri(t) +

_

�(t) (dynamics)

Ci(t) = 0

(winding conn.)v(t) = C

T

e(t) +Bu(t)

�(t) = L(!t)i(t) (induction)

I variables are i, v, u, e, � (all functions on R+

)

I equivalent to minimizing ploss

with average torque constraint

23

Page 25: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Induction motor, maximum torque problem

I can be converted to a nonconvex linear-quadratic control problemwith a quadratic constraint

– strong duality holds

– original proof due to Yakubovich5

I further details in our paper6

– equivalent semidefinite program (SDP)

– method for constructing optimal waveforms from SDP solution

– proof of tightness

5Yakubovich. Nonconvex optimization problem: The infinite-horizon linear-

quadratic control problem with quadratic constraints. 1992.6Moehle, Boyd. Maximum Torque-per-Current Control of Induction Motors via

Semidefinite Programming. 2016.

24

Page 26: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Example

traditional, sinusoidally wound, 5-phase motor with wye winding:

u

1

u

2

u

3

u

4

u

5

desired torque �des

= 5 Nm, speed ! = 50 rad=s

25

Page 27: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Example

0 2 4 6 8 10 12 14 16 18−100

−50

0

50

100

0 2 4 6 8 10 12 14 16 18−4

−2

0

2

4

0 2 4 6 8 10 12 14 16 180

2

4

6

8

u

(V

)

i

(A

)

(N�

m

)

� (rad)

power loss is 11 W per Nm torque produced

26

Page 28: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Stator fault

Same motor, with open-phase fault:

u

1

u

2

u

4

u

5

27

Page 29: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Stator fault

0 2 4 6 8 10 12 14 16 18−100

−50

0

50

100

0 2 4 6 8 10 12 14 16 18−5

0

5

0 2 4 6 8 10 12 14 16 180

2

4

6

8

u

(V

)

i

(A

)

(N�

m

)

� (rad)

power loss is 14 W per Nm torque produced

28

Page 30: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Outline

1. waveform design for electric motors

– permanent magnet

– induction

2. control of switched-mode converters

29

Page 31: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Controlling switched-mode converters

+

�source

load

I input are switch configurationsI traditionally:7

1. make discrete input continuous, by considering averaged switch

on-time (‘duty cycle’)

2. choose a duty cycle corresponding to desired equilibrium

3. linearize the resulting system around equilibrium, use linear control

I now:

– direct (switch-level) control7Kassakian. Principles of power electronics. 1991.

30

Page 32: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Switched-linear circuit

+

�source

load

I state xt

2 Rn contains inductor currents, capacitor voltages– can be augmented to contain, e.g., reference signal

I for each switch configuration, we have a linear circuit

I switched-affine dynamics:

x

t+1

= A

u

t

x

t

+ b

u

t

; t = 0; 1; : : : ;

I dynamics specified by Ai, bi in mode i

I control input is the mode ut

2 f1; : : : ; Kg

I may include mode restrictions (e.g., for a diode)

31

Page 33: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Switched-affine control

I switched-affine control problem is

minimizeP

T

t=1

g(x

t

)

subject to x

t+1

= A

u

t

x

t

+ b

u

t

x

0

= x

init

u

t

2 f1; : : : ; Kg

I constraints hold for all t

I variables are ut

and x

t

2 Rn

I problem data are dynamics Ai, bi, function g, and initial condition

x

init

I can be solved by trying out KT trajectories

32

Page 34: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

‘Solution’ via dynamic programming

I Bellman recursion: find functions Vt

such that

V

t

(x) = min

u2f1;:::;Kg

g(x) + V

t+1

(A

u

x+ b

u

)

for all x, for t = T � 1; : : : ; 0

I final value function V

T

= g

I optimal problem value is V0

(x

init

) at initial state xinit

I in general, intractable to compute (or store) Vt

33

Page 35: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Model predictive control

I idea: solve switched-affine control problem, implement first control

action u

0

, measure new system state, and repeat

I called model predictive control (MPC) or receding horizon control

I given V = V

1

, MPC policy satisfies

mp

(x) 2 argmin

u2f1;:::;Kg

V (A

u

x+ b

u

)

(ties broken arbitrarily)

34

Page 36: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Approximate dynamic programming policy

I in practice, MPC policy only works for T small

I (system response time measured in �s)

I instead, approximate V as a quadratic function ^

V

I given ^

V , ADP policy satisfies

adp

(x) 2 argmin

u2f1;:::;Kg

^

V (A

u

x+ b

u

)

I evaluating �adp

requires evaluating a few quadratic functions

35

Page 37: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

How to obtain ^

V ?

I quadratic lower bounds on V can be found via semidefinite

programming8

I compute V (x

(i)

) for many states x(i), fit best quadratic function ^

V

– we used this method

– subproblems solved using methods described in paper9

I use exact value function for approximate linear control problem(e.g., linear-quadratic control)

– provides a link to traditional methods

8Wang, O’Donoghue, Boyd. Approximate Dynamic Programming via Iterated

Bellman Inequalities. 2014.9Moehle, Boyd. A Perspective-Based Convex Relaxation for Switched-Affine

Optimal Control. 2015.

36

Page 38: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Inverter example

+

V

d

L

1

L

2

L

1

L

2

L

1

L

2

C C C

I state xt

are inductor currents and capacitor voltages, and desired

output current phasors

I cost function is deviation of output currents from desired

(sinusoidally-varying) values

I model parameters Vd

= 700 V, L1

= 6:5 �H, L2

= 1:5 �H, C = 15

�F, Vload

= 300 V, and desired output current amplitude Ides

= 10

A.

I sampling time 30 �s

37

Page 39: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Result

Policy State cost

ADP policy, 0.70

MPC policy, T = 1 1

MPC policy, T = 2 1

MPC policy, T = 3 1

MPC policy, T = 4 1

MPC policy, T = 5 0.45

I for T < 5 MPC policy is unstable

I running MPC with T = 5 takes several seconds on PC

I ADP takes few hundred flops (can be carried out in �s)

38

Page 40: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Result

In steady state:

0 0.005 0.01 0.015 0.02 0.025 0.03−20

−10

0

10

20

0 0.005 0.01 0.015 0.02 0.025 0.03−400

−200

0

200

400

0 0.005 0.01 0.015 0.02 0.025 0.03−20

−10

0

10

20

Inputcurr.(A

)Cap

.voltag

e(V

)Outputcurr.( A

)

time (s)39

Page 41: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Conclusions

I unconventional motors (asymmetrical, nonsinusoidally-wound,

non-rotary) can be controlled using optimization, by designing the

waveform to the motor

I modern techniques can be used to generate optimal controllers forpower electronic converters, which

– have fast response

– can easily incorporate constraints

– are intuitive to understand and tune

– make good use of modern microprocessor capabilities

40

Page 42: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Sources

I motors– N. Moehle, S. Boyd. Optimal Current Waveforms for Brushless Permanent

Magnet Motors. International Journal of Control, 2015.– N. Moehle, S. Boyd. Maximum Torque-per-Current Control of Induction

Motors via Semidefinite Programming. Conf. on Decision and Control,2016.

– N. Moehle, S. Boyd. Optimal Current Waveforms for Switched-Reluctance

Motors. Multi-Conf. on Systems and Control, 2016.

I converters– N. Moehle, S. Boyd. A Perspective-Based Convex Relaxation for

Switched-Affine Optimal Control. Systems and Control Letters, 2015.– N. Moehle, S. Boyd. Value Function Approximation for Direct Control of

Switched Power Converters. Conf. on Industrial Electronics andApplications, 2017.

41

Page 43: Control of Electric Motors and Drives via Convex Optimization - Nicholas Moehle · 2018-08-27 · Control of Electric Motors and Drives via Convex Optimization Nicholas Moehle Advisor:

Control of Electric Motors and Drives

via Convex Optimization

42