data-enabled predictive control: in the shallows of the deepc · data-enabled predictive control :...

40
Data-Enabled Predictive Control : In the Shallows of the DeePC Florian D ¨ orfer Automatic Control Laboratory, ETH Z¨ urich

Upload: others

Post on 20-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer Automatic Control Laboratory, ETH Zurich

Page 2: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Acknowledgements

Linbin Huang

Jeremy Coulson

Brain-storming: P. Mohajerin Esfahani, B. Recht, R. Smith, B. Bamieh, and M. Morari

John Lygeros 1/34

Page 3: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Big, deep, intelligent and so on • unprecedented availability of

computation, storage, and data • theoretical advances in optimization,

statistics, and machine learning • . . . and big-data frenzy → increasing importance of data-centric

methods in all of science / engineering

Make up your own opinion, but machine learning works too well to be ignored.

2/34

Page 4: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Feedback – our central paradigm

physical

world

information

technology

“making

sense of

the world”

automation

and control

“making a

difference

to the world”

inference and

data science

actuation sensing

3/34

Page 5: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

data-driven

control

u2

u1 y1

y2

Control in a data-rich world • ever-growing trend in CS and robotics:

data-driven control by-passing models • canonical problem: black/gray-box

system control based on I/O samples

Q: Why give up physical modeling and reliable model-based algorithms ?

Data-driven control is viable alternative when • models are too complex to be useful

(e.g., fuid dynamics & building automation)

• frst-principle models are not conceivable (e.g., human-in-the-loop & perception)

• modeling & system ID is too cumbersome (e.g., robotics & power applications)

Central promise: It is often easier to learn control policies directly from data, rather than learning a model. Example: PID

4/34

Page 6: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Snippets from the literature 1. reinforcement learning / or

stochastic adaptive control / or approximate dynamic programming

with key mathematical challenges • (approximate/neuro) DP to learn approx.

value/Q-function or optimal policy • (stochastic) function approximation • exploration-exploitation trade-o�s

and practical limitations • ineÿciency: computation & samples • complex and fragile algorithms • safe real-time exploration ø suitable for physical control systems

with real-time & safety constraints ?

unknown system

actio

n

ob

se

rva

tion

reward

estimate

reinforcement learning control

5/34

Page 7: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Snippets from the literature cont’d 2. gray-box safe learning & control • robust → conservative & complex control • adaptive → hard & asymptotic performance • contemporary learning algorithms

(e.g., MPC + Gaussian processes / RL)

→ non-conservative, optimal, & safe ø limited applicability: need a-priori safety

robust/adaptive

control

u

y

?

3. Sequential system ID + control • ID with uncertainty quantifcation

followed by robust control design → recent fnite-sample & end-to-end ID

+ control pipelines out-performing RL ø ID seeks best but not most useful model

u2

u1 y1

y2

+ ?

ø “easier to learn policies than models” 6/34

Page 8: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Key take-aways

• claim: easier to learn controllers from data rather than models • data-driven approach is no silver bullet (see previous ø) • predictive models are preferable over data (even approximate) → models are tidied-up, compressed, & de-noised representations → model-based methods vastly out-perform model-agnostic ones

ø deadlock ?

• a useful ML insight: non-parametric methods are often preferable over parametric ones (e.g., basis functions vs. kernels)

→ build a predictive & non-parametric model directly from raw data?

7/34

Page 9: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Colorful idea

y4y2

y1y3 y5

y6

y7

u2 = u3 = · · · = 0

u1 = 1

x0=0

If you had the impulse response of a LTI system, then . . . • can build state-space system identifcation (Kalman-Ho realization)

• . . . but can also build predictive model directly from raw data : ⎡

ufuture(t) ⎤

ufuture(t − 1)⎢ ⎥yfuture(t) =

� y1 y2 y3 . . .

� · ⎢ufuture(t − 2)

⎥⎢ ⎥⎣ .

⎦. .

• model predictive control from data: dynamic matrix control (DMC)

• today: can we do so with arbitrary, fnite, and corrupted I/O samples ? 8/34

Page 10: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Contents

I. Data-Enabled Predictive Control (DeePC): Basic Idea

J. Coulson, J. Lygeros, and F. Dorfer. Data-Enabled Predictive Control: In the Shallows of the DeePC. arxiv.org/abs/1811.05890.

II. From Heuristics & Numerical Promises to Theorems

J. Coulson, J. Lygeros, and F. Dorfer. Regularized and Distributionally Robust Data-Enabled Predictive Control. arxiv.org/abs/1903.06804.

III. Application: End-to-End Automation in Energy Systems

L. Huang, J. Coulson, J. Lygeros, and F. D¨ ive orfer. Data-Enabled PredictControl for Grid-Connected Power Converters. arxiv.org/abs/1903.07339.

Page 11: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Preview complex 2-area power system: large (n≈ 102), nonlinear, noisy, sti�, & with input constraints

control objective: damping of inter-area oscillations via HVDC but without model

control

( n

o c

on

tro

l )

collect data control

seek method that works reliably, can be eÿciently implemented, & certifable → automating ourselves

9/34

Page 12: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Behavioral view on LTI systems Defnition: A discrete-time dynamical system is a 3-tuple (Z≥0, W, B) where

(i) Z≥0 is the discrete-time axis,

(ii) W is a signal space, and

(iii) B ⊆ WZ≥0 is the behavior.

Defnition: The dynamical system (Z≥0, W, B) is (i) linear if W is a vector space & B is a subspace of WZ≥0 ,

(ii) time-invariant if B ⊆ σB, where σwt = wt+1, and

(iii) complete if B is closed ⇔ W is fnite dimensional.

In the remainder we focus on discrete-time LTI systems.

y

u

10/34

Page 13: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Behavioral view cont’d B = set of trajectories in WZ≥0 & BT is restriction to t ∈ [0, T ]

A system (Z≥0, W, B) is controllable 1if any two trajectories w , w2 ∈ B can

be patched with a trajectory w ∈ BT . 0 T 0

w2

w1

w

→ I/O : B = Bu × By where Bu = (Rm)Z≥0 and By ⊆ (Rp)Z≥0 are the spaces of input and output signals ⇒ w = col(u, y) ∈ B

→ di�erent parametric representations: state space, kernel, image, . . .

→ kernel representation (ARMA) : B = col(u, y) ∈ (Rm+p)Z≥0 s.t. σn σnb0u + b1σu + · · · + bn u + a0y + a1σy + . . . an y = 0

11/34

Page 14: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

LTI systems and matrix time series foundation of state-space subspace system ID & signal recovery algorithms

u(t)

t

u4

u2

u1 u3

u5u6

u7

y(t)

t

y4

y2

y1

y3

y5

y6

y7

�u(t), y(t)

� satisfy recursive [ b0 a0 b1 a1 ... bn an ] spans left nullspace

di�erence equation of Hankel matrix (collected from data) b0ut +b1ut+1 +. . .+bnut+n+ ⎡

(u1 ) (u2 ) (u3 ) · · · �uT −L+1

�⎤y1 y2 y3 yT −L+1

a0yt+a1yt+1+. . .+anyt+n = 0 . ⇒ (u2 .⎢ ) (u3 ) (u4 ) · · · .

⎥y2 y3 y4

(ARMA / kernel representation) HL ( u ) =

⎢⎢(u3 ..

⎥⎥y

⎢y3 ) (

uy44 ) (uy5

5 ) · · · . ⎥⎢ ⎥⎢

. . . . . ⎥

. . . . .⎢

. . . . . ⎥⇐ ⎣ ⎦

(uL (uT yL ) · · · · · · · · · yT )under assumptions

12/34

Page 15: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

The Fundamental Lemma Defnition : The signal u = col(u1, . . . , uT ) ∈ RmT is persistently

⎡ u1 ··· uT −L+1

. ..exciting of order L if HL(u) = . . . ⎦ is of full row rank, .. .

uL ··· uT

i.e., if the signal is suÿciently rich and long (T − L + 1 ≥ mL).

Fundamental lemma [Willems et al, ’05] : Let T, t ∈ Z>0, Consider • a controllable LTI system (Z≥0, Rm+p, B), and

d• a T -sample long trajectory col(u , yd) ∈ BT , where • u is persistently exciting of order t + n (prediction span + # states).

Then colspan (Ht ( uy )) = Bt .

13/34

Page 16: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Cartoon of Fundamental Lemma u(t)

t

u4

u2

u1 u3

u5u6

u7

y(t)

t

y4

y2

y1

y3

y5

y6

y7

persistently exciting controllable LTI suÿciently many samples

xk+1 =Axk +Buk

yk =Cxk +Duk

colspan

( u1y1 ) ( u2

y2 ) ( u3y3 ) . . .

( u2y2 ) ( u3

y3 ) ( u4y4 ) . . .

( u3y3 ) ( u4

y4 ) ( u5y5 ) . . .

.... . .

. . .. . .

︸ ︷︷ ︸ ︸ ︷︷ ︸parametric state-space model non-parametric model from raw data

all trajectories constructible from fnitely many previous trajectories 14/34

Page 17: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Data-driven simulation [Markovsky & Rapisarda ’08]

Problem : predict future output y ∈ Rp·Tfuture based on • input signal u ∈ Rm·Tfuture → to predict forward

• past data col(ud, yd) ∈ BTdata → to form Hankel matrix

Assume: B controllable & ud persistently exciting of order Tfuture + n

Solution: given (u1, . . . , uTfuture) → compute g & (y1, . . . , yTfuture) from ⎡

⎢⎢⎢⎢⎢⎢⎢⎢⎢⎣

ud 1 ud

2 · · · ud T −N+1

. . . . . .

. . . . . .

ud Tfuture

ud Tfuture+1 · · · ud

T

yd 1 yd

2 · · · yd T −N+1

. . . . . .

. . . . . .

yd Tfuture

yd Tfuture+1 · · · yd

T

⎥⎥⎥⎥⎥⎥⎥⎥⎥⎦

g =

⎢⎢⎢⎢⎢⎢⎢⎢⎢⎣

u1 . . .

uTfuture

y1 . . .

yTfuture

⎥⎥⎥⎥⎥⎥⎥⎥⎥⎦

Issue: predicted output is not unique → need to set initial conditions! 15/34

Page 18: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Refned problem : predict future output y ∈ Rp·Tfuture based on • initial trajectory col(uini, yini) ∈ R(m+p)Tini → to estimate initial xini

• input signal u ∈ Rm·Tfuture → to predict forward

• past data col(ud, yd) ∈ BTdata → to form Hankel matrix

Assume: B controllable & ud persist. exciting of order Tini +Tfuture+n

Solution: given (u1, . . . , uTfuture) & col(uini, yini) ⎡Up

⎤ ⎡uini

→ compute g & (y1, . . . , yTfuture) from Yp g = yini⎢⎢

Uf

⎥⎥ ⎢⎢u

⎥⎥⎣ ⎦ ⎣ ⎦

⇒ if Tini ≥ lag of system, then y is unique Yf y

⎡ ⎤ ⎡ ⎤d d d d· · · u · · · yu y1 1T −Tfuture−Tini+1 T −Tfuture−Tini+1

⎢⎢⎢⎢⎥ ⎢⎥ ⎢ ⎥⎥⎥⎥

.... . .... .... . .... ⎥ h

Ypi ⎢⎥ ⎢h

Upi d d d d· · · · · ·u u y yT −Tfuture T −TfutureTini Tini⎢ ⎥ Yf

, ⎢ ⎥Uf , d d d d· · · u · · · yu yT −Tfuture+1 T −Tfuture+1Tini+1 Tini+1⎢⎢⎣

⎥⎥ ⎢⎢⎦ ⎣ ⎥⎥⎦.... . ....

.... . .... d d d d· · · u · · · yu yTini+Tfuture T Tini+Tfuture T 16/34

Page 19: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Output Model Predictive Control The canonical receding-horizon MPC optimization problem :

Tfuture −1 2 2 quadratic cost with

minimize X

kyk − rt+kkQ + kukkRu, x, y R � 0, Q � 0 & ref. r k=0

subject to xk+1 = Axk + Buk, ∀k ∈ {0, . . . , Tfuture − 1}, model for prediction yk = Cxk + Duk, ∀k ∈ {0, . . . , Tfuture − 1}, over k ∈ [0, Tfuture − 1]

xk+1 = Axk + Buk, ∀k ∈ {−Tini − 1, . . . , −1}, model for estimation yk = Cxk + Duk, ∀k ∈ {−Tini − 1, . . . , −1}, (many variations)

uk ∈ U , ∀k ∈ {0, . . . , Tfuture − 1}, hard operational or yk ∈ Y, ∀k ∈ {0, . . . , Tfuture − 1} safety constraints

For a deterministic LTI plant and an exact model of the plant, MPC is the gold standard of control : safe, optimal, tracking, . . .

17/34

Page 20: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Data-Enabled Predictive Control DeePC uses non-parametric and data-based Hankel matrix time series as prediction/estimation model inside MPC optimization problem:

Tfuture −1 2 2 quadratic cost with

minimize X

kyk − rt+kk + kukkQ R k=0

g, u, y R � 0, Q � 0 & ref. r ⎡Up

⎤ ⎡uini

⎤ non-parametric

subject to ⎢Yp ⎥ g =

⎢yini ⎥ , model for prediction ⎢Uf

⎥ ⎢u

⎥and estimation⎣ ⎦ ⎣ ⎦

Yf y

uk ∈ U , ∀k ∈ {0, . . . , Tfuture − 1}, hard operational or yk ∈ Y, ∀k ∈ {0, . . . , Tfuture − 1} safety constraints

• Hankel matrix with Tini + Tfuture rows from past data collected o�inehUp

i d) and

hYp

i d) (could be adapted online)

Uf = HTini+Tfuture (u Yf

= HTini+Tfuture (y

• past Tini ≥ lag samples (uini, yini) for xini estimation updated online 18/34

Page 21: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Correctness for LTI Systems Theorem: Consider a controllable LTI system and the DeePC & MPC optimization problems with persistently exciting data of order Tini +Tfuture +n. Then the feasible sets of DeePC & MPC coincide.

Corollary: If U , Y are convex, then also the trajectories coincide.

Aerial robotics case study :

19/34

Page 22: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Thus, MPC carries over to DeePC . . . at least in the nominal case.

Beyond LTI, what about measurement noise, corrupted past data, and nonlinearities ?

Page 23: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Noisy real-time measurements

minimize g, u, y

subject to

Tfuture−1 2 2

X kyk − rt+kk + kukk + λyQ R

k=0 ⎡Up

⎤ ⎡uini

⎤ ⎡ 0 ⎤

Yp yini σyg = + ,⎢⎢ ⎥⎥ ⎢⎢

u

⎥⎥ ⎢⎢0

⎥⎥⎣Uf ⎦ ⎣ ⎦ ⎣ ⎦

Yf y 0

uk ∈ U , ∀k ∈ {0, . . . , Tfuture − 1}, yk ∈ Y, ∀k ∈ {0, . . . , Tfuture − 1}

Solution : add slack kσyk1 to ensure feasibility

with ` 1-penalty ⇒ for λy suÿciently large σy 6= 0 only if constraint infeasible

c.f. sensitivity analysis over randomized sims

100

102

104

106

106

108

1010

cost

average cost

100

102

104

106

0

5

10

15

20

dura

tio

n v

iola

tio

ns (

s)

average constraint violations

20/34

Page 24: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Hankel matrix corrupted by noise

minimize g, u, y

subject to

Tfuture−1 2 2

X kyk − rt+kk + kukk + λgkgk1Q R

k=0 ⎡Up

⎤ ⎡uini

Yp yini g = ,⎢⎢ ⎥⎥ ⎢⎢

u

⎥⎥⎣Uf ⎦ ⎣ ⎦

Yf y

uk ∈ U , ∀k ∈ {0, . . . , Tfuture − 1}, yk ∈ Y, ∀k ∈ {0, . . . , Tfuture − 1}

Solution : add a ` 1-penalty on g

intuition: ` 1 sparsely selects {Hankel matrix columns}= {past trajectories}= {motion primitives}

c.f. sensitivity analysis over randomized sims

0 200 400 600 8000

1

2

3

4

5

6

7

cost

107 average cost

0 200 400 600 8000

5

10

15

20

dura

tio

n v

iola

tio

ns (

s)

average constraint violations

21/34

Page 25: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Towards nonlinear systems . . . Idea : lift nonlinear system to large/∞-dimensional bi-/linear system → Carleman, Volterra, Fliess, Koopman, Sturm-Liouville methods → exploit size rather than nonlinearity and fnd features in data

→ exploit size, collect more data, & build a larger Hankel matrix → regularization singles out relevant features / basis functions

case study : regularization for g and σy

-1.5

1

-1

0.5-0.2

-0.5

00

0

0.2-0.5 0.4

0.5

0.6-1

1

1.5

2

0 10 20 30 40 50 60

s

-3

-2

-1

0

1

2

3

m

DeePC

xDeePC

yDeePC

zDeePC

xref

yref

zref

Constraints

22/34

Page 26: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

recall the central promise : it is easier to learn control policies directly from data,

rather than learning a model

Page 27: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Comparison to system ID + MPC Setup : nonlinear stochastic quadcopter model with full state info DeePC + ` 1-regularization for g and σy

MPC : system ID via prediction error method + nominal MPC

0 10 20 30 40 50 60

s

-3

-2

-1

0

1

2

3

m

DeePC

xDeePC

yDeePC

zDeePC

xref

yref

zref

Constraints

0 0.5 1 1.5 2

Cost 107

5

10

15

20

25

30

Num

ber

of sim

ula

tions

Cost

DeePC

System ID + MPC

single fg-8 run

random sims

0 10 20 30 40 50 60

s

-3

-2

-1

0

1

2

3

4

5

m

MPC

xMPC

yMPC

zMPC

xref

yref

zref

Constraints

0 2 4 6 8 10 12 14 16 18 20

Duration constraints violated

0

5

10

15

20

Num

ber

of sim

ula

tions

Constraint Violations

DeePC

System ID + MPC

23/34

Page 28: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

from heuristics & numerical promises

to theorems

Page 29: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Robust problem formulation 1. the nominal problem (without g-regularization)

Tfuture−1 2 2

minimize X

kyk − rt+kk + kukk + λykσyk1Q Rg, u, y k=0 ⎡Ucp

⎤ ⎡uini

⎤ ⎡ 0 ⎤

Yp yini σysubject to ⎢⎢c⎥⎥

g = c

+ ,⎢Uf

⎥⎢⎢

u

⎥⎥ ⎢⎢0

⎥⎥⎣c⎦ ⎣

y

⎦ ⎣

0

Ybf uk ∈ U , ∀k ∈ {0, . . . , Tfuture − 1}

where b· denotes measured & thus possibly corrupted data

2. an abstraction of this problem minimize f �Uf g, Ybf g

� + λy

Ycpg − yini

1

cg ∈ G

c

nwhere G = g : Ucpg = uini & Ucf g ∈ U

o

24/34

Page 30: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

c ξ, g minimize P [c (ξ, g)] g ∈ G g ∈ G

with G = ng : Upg = uini & Uf g ∈ U

o , measured ξb=

�Yp, Ybf , yini

� ,

3. a further abstraction minimize �b

� = Eb

c c c c

& Pb = δξb denotes the empirical distribution from which we obtained ξb

4. the solution g? of the above problem gives poor out-of-sample performance for the problem we really want to solve: EP [c (ξ, g?)]

where P is the unknown probability distribution of ξ

inf sup EQ [c (ξ, g)]5. distributionally robust formulation g∈G Q∈B�(Pb)

where the ambiguity set B�(Pb) is an �-Wasserstein ball centered at Pb :

B�(Pb) =

P : inf Z kξ − ξ0kW dΠ ≤ �

where Π has marginals P and P Π

25/34

Page 31: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

inf sup EQ [c (ξ, g)]5. distributionally robust formulation g∈G Q∈B�(Pb)

where the ambiguity set B�(Pb) is an �-Wasserstein ball centered at Pb :

B�(Pb) =

P : inf Z kξ − ξ0kW dΠ ≤ �

where Π has marginals P and P Π

Theorem : Under minor technical conditions:

inf sup EQ [c (ξ, g)] ≡ min c ξ, g� + �λy kgk?

�b

W g∈G

g∈G Q∈B� (Pb) Cor: ` ∞-robustness in trajectory space ⇔ ` 1-regularization of DeePC

Proof uses methods by Kuhn & Esfahani: semi-infnite problem becomes fnite after marginalization & for discrete worst case

10-5

10-4

10-3

10-2

10-1

100

0

0.5

1

1.5

2

2.5

3

3.5

Cost

105

cost

ǫ26/34

Page 32: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Relation to system ID & MPC 1. regularized DeePC problem 2. standard model-based MPC

(ARMA parameterization) minimize f(u, y) + λgkgk2

2 g, u ∈ U , y ∈ Y minimize f(u, y)⎡ ⎤ ⎡ ⎤

u ∈ U , y ∈ Y Up uini Yp yini

⎡ ⎤uinisubject to

⎢ ⎥g =

⎢ ⎥⎢Uf

⎥ ⎢u

⎥subject to y = K yini⎣ ⎦ ⎣ ⎦ ⎣ ⎦

Yf y u

?3. subspace ID y = Yf g 4. equivalent prediction error ID 2?where g = g?(uini, yini, u) solves ⎡

uinid⎤j

minimize X

yj

d − K yinij d

arg min kgk2 ⎣ ⎦2 K d g j uj⎡

Up⎤ ⎡

uini⎤

⎡ ⎤subject to Yp ⎦ g = yini

uini⎣ ⎣ ⎦ → y = K yini = Yf g?

Uf u ⎣ ⎦

u 27/34

Page 33: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

subsequent ID & MPC

minimize f(u, y) minimize f(u, y) u ∈ U , y ∈ Y u ∈ U , y ∈ Y

⎡uini

⎤ �y� �

Yf �

subject to = gsubject to y = K u Uf⎣yini⎦

u ≡ where g solves where K solves arg min kgk2

2 2 g⎡

uinij

arg min X

yj − K yinij

⎡Up

⎤ ⎡uini

⎤⎣ ⎦K j uj subject to Yp ⎦ g = yini⎣ ⎣ ⎦

Uf u

regularized DeePC ⇒ feasible set of ID & MPC

minimize f(u, y) + λg kgk2 2 ⊆ feasible set for DeePC g, u ∈ U , y ∈ Y ⎡

Up⎤ ⎡ ⎤

uini ⇒ DeePC ≤ MPC + λg · ID Yp yinisubject to

⎢ ⎥g =

⎢ ⎥⎢Uf

⎥ ⎢u

⎥⎣

Yf

⎦ ⎣

y

⎦ “easier to learn control policies from data rather than models” 28/34

Page 34: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

application: end-to-end automation in energy systems

Page 35: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Grid-connected converter control Task: control converter (nonlinear, noi-sy & constrained) without a model of the grid, line, passives, or inner loops

AC Grid

gabcIabcI

Three-Phase VSC

!"PI

!"PI

dq

abc

dq

abc

abcV

abcIdI

qI

dV

qV

qVθ

*abcU abcV abcU

FLgL

gRFC

*

dU

*

qU

dI

qI

refdI

refqI

LCL

Line

Power Part

Control Part

PIω

Current Control LoopPLL

1u 2u1y

2y

3y

!"! !"# !"$ !"% !"& '"! '"# '"$

!"!

!"(

'"!

'"(

#"!

!"! !"# !"$ !"% !"& '"! '"# '"$

)!"#

)!"'

!"!

!"'

!"#

!"! !"# !"$ !"% !"& '"! '"# '"$

!"%

!"&

'"!

'"#

'"$

inject noise

collect data

open

loop

activate

DeePC

DeePC

open

loop

DeePC

open

loop

DeePC

open

loop

DeePC tracking constant dq-frame references subject to constraints

29/34

Page 36: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

E�ect of regularizations

Opt

imiza

tion

cost

DeeP

Ctim

e-do

mai

n co

st

𝜆𝑔 𝜆𝑔DeePC time-domain cost

!"#$%$&'#$()*+(,#

!"

DeePC

Sys ID + MPC

Optimization cost 2 2 2 2 =

Pk kyk − rkkQ + kukkR =

Pk kyk − rkkQ +kukkR +λgkgk2

(closed-loop measurements) (closed-loop measurements)

30/34

Page 37: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Data length Tini = 40 , Tfuture = 30 Sys ID + MPC

PEM

-MP

C t

ime

-do

mai

n c

ost

𝑇𝑖𝑛𝑖

Dee

PC

tim

e-d

om

ain

co

st

𝑇

works like a charm for T large, but → card(g) = T − Tini − Tfuture + 1

→ (possibly?) prohibitive on µDSP

!"! !"# !"$ !"% !"& '"!

!"%

!"&

'"!

'"#

'"$

!"! !"# !"$ !"% !"& '"!

(!"#

(!"'

!"!

!"'

!"#

!"! !"# !"$ !"% !"& '"!

!"!

!")

'"!

'")

#"!

'"!

'"!

'"!

31/34

Page 38: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Power system case study extrapolation from previous case study: const. voltage → grid

complex 2-area power system: large (n≈ 102), nonlinear, noisy, sti�, & with input constraints

control objective: damping of inter-area oscillations via HVDC

control

( n

o c

on

tro

l )

real-time closed-loop MPC & DeePC become prohibitive (on laptop) → choose T , Tini, and Tfuture wisely

32/34

Page 39: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Choice of time constants

! " # $ % &! &" &#

!'"(

!'(!

!')(

! " # $ % &! &" &#

!'"(

!'(!

!')(

! " # $ % &! &" &#

!'"(

!'(!

!')(

Tini = 5 , Tfuture = 10

Tini = 10 , Tfuture = 10

Tini = 200 , Tfuture = 80

→ choose T suÿciently large → short horizon Tfuture ≈ 10

→ Tini ≥ 10 estimates suÿciently rich model complexity

PEM

-MP

C t

ime

-do

mai

n c

ost

𝑇𝑖𝑛𝑖

Dee

PC

tim

e-d

om

ain

co

st

𝑇

time-domain cost 2 2

= P

k kyk − rkkQ + kukkR

(closed-loop measurements) 33/34

Page 40: Data-Enabled Predictive Control: In the Shallows of the DeePC · Data-Enabled Predictive Control : In the Shallows of the DeePC Florian Dorfer ¨ Automatic Control Laboratory, ETH

Summary & conclusions • fundamental lemma from behavioral systems • matrix time series serves as predictive model • data-enabled predictive control (DeePC)

X certifcates for deterministic LTI systems X distributional robustness via regularizations X outperforms ID + MPC in optimization metric

→ certifcates for nonlinear & stochastic setup → adaptive extensions, explicit policies, . . . → applications to building automation, bio, etc.

-1.5

1

-1

0.5-0.2

-0.5

00

0

0.2-0.5 0.4

0.5

0.6-1

1

1.5

2

AC Grid

gabcIabcI

Three-Phase VSC

!"PI

!"PI

dq

abc

dq

abc

abcV

abcIdI

qI

dV

qV

qVθ

*abcU abcV abcU

FLgL

gRFC

*

dU

*

qU

dI

qI

refdI

refqI

LCL

Line

Power Part

Control Part

PIω

Current Control LoopPLL

1u 2u1y

2y

3y

Why have these Willems ’07: “[MPC] has perhaps too little system

powerful ideas theory and too much brute force computation in it.”

not been mixed The other side often proclaims “behavioral systems long before ? theory is beautiful but did not prove utterly useful”

34/34