75
1 Formal Synthesis of Control Strategies for Dynamical Systems Calin Belta Tegan Family Distinguished Professor Mechanical Engineering, Systems Engineering, Electrical and Computer Engineering Boston University

Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Embed Size (px)

Citation preview

Page 1: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

1

Formal Synthesis of Control Strategies for Dynamical Systems

Calin Belta

Tegan Family Distinguished Professor Mechanical Engineering, Systems Engineering,

Electrical and Computer Engineering

Boston University

Page 2: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

A textbook problem in formal methods

Page 3: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

Specification: “If x is set infinitely often, then y is set infinitely often.”

A textbook problem in formal methods

Page 4: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

Specification: “If x is set infinitely often, then y is set infinitely often.”

Check if all the possible behaviors of the circuit satisfy the specification

A textbook problem in formal methods

Page 5: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

Specification: “If x is set infinitely often, then y is set infinitely often.”

Formalization

Temporal Logic Formula

A textbook problem in formal methods

⇤♦x→⇤♦y

Page 6: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

Model

Mathematical modeling

{x}{y}

∅ {x, y}

Formalization

Temporal Logic Formula

Specification: “If x is set infinitely often, then y is set infinitely often.”

A textbook problem in formal methods

⇤♦x→⇤♦y

Page 7: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

Model

Mathematical modeling

Model checking (verification)

Formalization

Temporal Logic Formula

{x}{y}

∅ {x, y}

Specification: “If x is set infinitely often, then y is set infinitely often.”

A textbook problem in formal methods

⇤♦x→⇤♦y

Page 8: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

A textbook problem in dynamics

Page 9: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

Specification: “drive from A to B.”

A

B

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

A textbook problem in dynamics

Page 10: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

Specification: “drive from A to B.”

A

B

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

A textbook problem in dynamics

Generate a robot control strategy

Page 11: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

Specification: “drive from A to B.”

Model

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

Mathematical modeling

A

B

A textbook problem in dynamics

Page 12: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

Specification: “drive from A to B.”

Model

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

Mathematical modeling

A

B

Formalization

Stabilization Problem: “make B an asymptotically stable equilibrium”

A textbook problem in dynamics

Page 13: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Process

Specification: “drive from A to B.”

Model

S. Sastry – Nonlinear Systems: analysis, stability, and control, Springer, 1999

Mathematical modeling

A

B

Formalization

Stabilization Problem: “make B an asymptotically stable equilibrium”

Control

A textbook problem in dynamics

Page 14: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Formal methods vs. dynamics

Process

Model

Specification “Drive from A to B.” “If x is set infinitely often, then y is set infinitely often.”

Page 15: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Formal methods vs. dynamics

Process

Model

Specification

Simple

Complex

Complex

Simple

“Drive from A to B.” “If x is set infinitely often, then y is set infinitely often.”

Page 16: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Need for formal methods in dynamical systems

x

y

z

photo

upload

upload

unsafe

extinguish

assist

Ulusoy, Belta, RSS 2013, IJRR 2014

Vehicle Control Strategy ?

Solution later in this talk

Spec: Off-line: “Keep taking photos and upload current photo before taking another photo. On-line: Unsafe regions should always be avoided. If fires are detected, then they should be extinguished. If survivors are detected, then they should be provided medical assistance. If both fires and survivors are detected locally, priority should be given to the survivors.”

NSF NRI

-  Ideal controllers and sensors -  Known map -  Perfect localization

Page 17: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Spec: Maximize the probability of satisfying: “Always avoid all and Visit , , , and infinitely often and should only be used for

Northbound travel and should only be used for Southbound travel. Uncertainty should always be below 0.9 m2 and when crossing bridges it should be below 0.6 m2.”

Need for formal methods in dynamical systems

Vehicle Control / Communication Strategies

?

Obstacle:!

River!

Obstacle:!Highway!

Obstacle:!

Highway!Obs!

Obstacle:!Highway!

Bridge!

2!

Bridge!

1!

Bridge!

1!

Marsh!

Plaza!Kenmore!Square!

Audubon!Circle!

Stadium!

NSF CMMI

ONR MURI

Map unknown environment

Localization and control Example later in the talk

-  Noisy controllers and sensors -  Unknown map -  Probabilistic localization

Page 18: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Need for formal methods in dynamical systems

NSF CPS

Coogan, Aydin Gol, Arcak, Belta, ACC 2015, IEEE TCNS 2016 Sadradini, Belta, ACC 2016, CDC 2016 Coogan, Arcak, Belta, ACC 2016, CSM 2017

•  always the network is not congested •  each queue at a junction will be actuated at least once every two minutes •  whenever the number of vehicles on a link exceeds 40, within 3 min it should

decreases below 20

Traffic light and ramp meter control strategies ?

Example later in the talk

Spec:

Page 19: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Need for formal methods in dynamical systems

Fuel Control System

[0,60) [9.7,59.7) 3 [0.1,59.7) 4 [0.5,59.7) 4F (( 0.875) ( 0.98) ( 0.29))G x G x G x< ∧ < ∧ >

i.e., “EGO is less than 0.875 for all times in between 9.7s and 59.7s and MAP is less than 0.98 for all times in between 0.1s and 59.7s and MAP is greater than 0.29 for all times in between 0.5s and 59.7s.

2. Supervised / unsupervised learning (good behavior)

1. Off-line / on-line data collection

3. Monitoring and anomaly mitigation (formal synthesis)

Not in this talk Jones, Kong, Belta, CDC 2014 Kong, Jones, Ayala, Gol, Belta, HSCC 2014 Bombara, Vasile, Penedo, Belta, HSCC 2016

DENSO Corporation, Japan

Page 20: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Need for formal methods in dynamical systems

Haghighi, Jones, Kong, Bartocci, Grosu, Belta, HSCC 2015, CDC 2016 Not in this talk

1. Off-line / on-line data collection

2. Supervised / unsupervised learning (good behavior)

“Always, for each of the four ‘neighborhoods’, the power consumption level m is below 300 and the power consumption is below 200 in each of the neighborhoods’ quadrants at least once per hour. After 6 hours, the power consumption in all residential areas is above level 3.”

3. Monitoring and anomaly mitigation (formal synthesis)

ONR

Low Earth Orbit (LEO) satellites can gather temporal-spatial data (the figure shows the intense-traffic Strait of Gibraltar)

shutterstock.com

Page 21: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Need for formal methods in dynamical systems

Not in this talk

NSF CPS Frontier

hiPS cells (Weiss lab)

Pattern formation using synthetic biology and micro-robotics

Formal methods approaches to pattern synthesis in biological systems -  Pattern classifiers are learnt as formulae in spatial temporal logics with quantitative semantics -  Parameters are determined through optimizations minimizing closeness to desired patterns

Vasculogenesis (Kamm lab)

Pattern formation using synthetic biology

NSF STC

pancreatic beta cells (Weiss and Hammond labs)

Simulation patterns in a Turing reaction diffusion system

Page 22: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 23: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 24: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

(Fully-observable) nondeterministic (non-probabilistic) labeled transition systems with finitely many states, actions (controls), and observations (properties)

TL verification and control for finite systems

u1q

1q2

{π1}

u3

{π2,π

3}

{π1}

u4

u5

{π3,π

4}

q3

q4

u2

Finite system

Page 25: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Linear Temporal Logic (LTL)

eventually always until

Syntax

♦π2 ♦⇤(π3 ∧ π4) (π1 ∨ π2)Uπ4

TL verification and control for finite systems

Page 26: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Linear Temporal Logic (LTL)

Word:

Syntax

Semantics

eventually always until

♦π2 ♦⇤(π3 ∧ π4) (π1 ∨ π2)Uπ4

{π1}{π2,π3}{π3,π4}{π3,π4} · · ·

TL verification and control for finite systems

Page 27: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Linear Temporal Logic (LTL)

Run (trajectory):

Word:

Syntax

Semantics

{π1}{π2,π3}{π3,π4}{π3,π4} · · ·

q1, q4, q3, q3, . . .

eventually always until

♦π2 ♦⇤(π3 ∧ π4) (π1 ∨ π2)Uπ4

u1q

1q2

{π1}

u3

{π2,π

3}

{π1}

u4

u5

{π3,π

4}

q3

q4

u2

TL verification and control for finite systems

Page 28: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

28

LTL verification (model checking)

Given a transition system and an LTL formula over its set of propositions, check if the language (i.e., all possible words) of the transition system starting from all initial states satisfies the formula.

SPIN, NuSMV, PRISM, …

TL verification and control for finite systems

q1

q2

{π1}

{π2,π

3}

{π1}

{π3,π

4}

q3

q4

π1Uπ4 False

(π1 ∨ π2)Uπ4 True

Page 29: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

TL verification and control for finite systems

Given a transition system and an LTL formula over its set of propositions, find a set of initial states and a control strategy for all initial states such that the produced language of the transition system satisfies the formula.

LTL control (synthesis)

u1q

1q2

{π1}

u3

{π2,π

3}

{π1}

u4

u5

{π3,π

4}

q3

q4

u2

Did not receive much attention until recently!

Page 30: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

30

State feedback control automaton

control

state

Rabin game!

TL verification and control for finite systems

Particular cases: -  LTL without “eventually always”: Buchi game -  LTL without “always” (syntactically co-safe LTL): the automaton is an FSA

u1q

1q2

{π1}

u3

{π2,π

3}

{π1}

u4

u5

{π3,π

4}

q3

q4

u2

LTL control (synthesis)

C. Bayer and J-P Katoen, Principles of Model Checking, MIT Press, 2008

C. Belta, B. Yordanov, and E. Gol, Formal Methods for Discrete-time Dynamical Systems, Springer, 2017

Optimal Temporal Logic Control for Finite Deterministic Systems Optimal Temporal Logic Control for Finite MDPs Temporal Logic Control for POMDPs Temporal Logic Control and Learning

Extensions

Svorenova, Cerna, Belta, IEEE TAC, 2015 Ding, Lazar, Belta, Automatica, 2014

Smith, Tumova, Belta, Rus, IJRR, 2011

Ding, Smith, Belta, Rus, IEEE TAC, 2014

Svoreňová, Leahy, Eniser, Chatterjee, Belta, HSCC 2015

Chen, Tumova, Belta, IJRR, 2013

Page 31: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 32: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 33: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

Conservative TL control for small & simple dynamical systems

Page 34: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Page 35: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Page 36: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Page 37: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Assume that in each region we can check for the existence of / construct feedback controllers driving all states in finite time to a subset of facets (including the empty set – controller making the region an invariant)

Conservative TL control for small & simple dynamical systems

Page 38: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Abstraction (bisimulation)

Page 39: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Feedback

automaton

control

state

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Abstraction (bisimulation)

Page 40: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Feedback

automaton

Refinement

control

state

Feedback controller

region

Feedback

hybrid

automaton

“Avoid the grey region for all times. Visit the blue region, then the green region, and then keep surveying the striped blue and green regions, in this order.”

“(pi2 = TRUE and pi4 = FALSE and pi3 = FALSE) should never happen. Then pi4 = TRUE and then pi1 = TRUE should happen. After that, (pi3 = TRUE and pi4 = TRUE) and then (pi1 = TRUE and pi3 = FALSE) should occur infinitely often.”

Conservative TL control for small & simple dynamical systems

Abstraction (bisimulation)

Page 41: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

41

Control-to-facet Stay-inside Control-to-set-of-facets Control-to-face Stay-inside

Control-to-facet Stay-inside

polyhedral Library of controllers for polytopes

•  checking for existence of controllers amounts to checking the non-emptiness of polyhedral sets in U •  if controllers exist, they can be constructed everywhere in the polytopes by using simple formulas

C. Belta and L.C.G.J.M. Habets, IEEE TAC, 2006

M. Kloetzer, L.C.G.J.M. Habets and C. Belta, CDC 2006

L.C.G.J.M. Habets and J. van Schuppen, Automatica 2005

Control-to-set-of-facets

Conservative TL control for small & simple dynamical systems

Dynamics and partitions allowing for easy construction of bisimilar abstractions

Page 42: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Conservative TL control for small & simple dynamical systems

“visit the green regions, in any order, while avoiding the grey regions”

♦q2 ∧ ♦q25 ∧⇤¬(q12 ∨ q13)

Control to one facet Deterministic quotient

Control to sets of facets Non-deterministic quotient

Initial states from which control strategies exist

Multi-affine dynamics

Page 43: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 44: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 45: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Mapping complex dynamics to simple dynamics: I/O linearization

θ

dx

}{F

}{M

ε

dx

dx

θ

!

"

####

$

%

&&&&

=

cosθ

sinθ

0

!

"

###

$

%

&&&w1+

0

0

1

!

"

###

$

%

&&&w2

1

2

ww W

w

⎡ ⎤= ∈⎢ ⎥⎣ ⎦

x = u u U∈

1 Tw E R u

−=

1 0

0E

ε

⎡ ⎤= ⎢ ⎥⎣ ⎦

x = REw

J. Desai, J.P. Ostrowski, and V. Kumar. ICRA, 1998.

Conservative TL control for large & complex dynamics

Fully actuated point

U can be derived from W

Page 46: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Always avoid black. Avoid red and green until blue or cyan are reached. If blue is reached then eventually visit green. If cyan is reached then eventually visit red.”

Conservative TL control for large & complex dynamics

Page 47: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Mapping complex dynamics to simple dynamics: differential flatness

Quadrotor dynamics •  Nonlinear control system with 12 states (position, rotation, and their derivatives) with 4 inputs (total

thrust force from rotors and 3 torques) •  Differentially flat with 4 flat outputs (position and yaw) •  Up to four derivatives of the flat output and necessary to compute the original state and input

Mellinger and Kumar, 2011.; Hoffmann, Waslander, and Tomlin, 2008.; Leahy, Zhou, Vasile, Schwager, Belta, 2015

Conservative TL control for large & complex dynamics

http://sites.bu.edu/robotics/

Page 48: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

x

y

z

photo

upload

upload

unsafe

extinguish

assist

Global spec: “Keep taking photos and upload current photo before taking another photo. Unsafe regions should always be avoided. Local spec: If fires are detected, then they should be extinguished. If survivors are detected, then they should be provided medical assistance. If both fires and survivors are detected locally, priority should be given to the survivors.”

Persistent surveillance with global and local specs

Ulusoy, Belta, RSS 2013, IJRR 2014

Conservative TL control for large & complex dynamics

Page 49: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Mission Specification: Time Window Temporal Logic (TWTL)

“Service site A for 2 time units within [0, 30] and site C for 3 time units within [0, 19]. In addition, within [0, 56], site B needs to be serviced for 2 time units followed by either A or C for 2 time units within [0, 10].”

Persistent surveillance with deadlines and resource constraints

Vasile, Aksaray, Belta, Theoretical Computer Science, 2017 (accepted)

Additional constraints: •  operation time •  charging time •  timed temporal specs

Vasile and Belta, Robotics: Science and Systems (RSS) 2014

Conservative TL control for large & complex dynamics

Page 50: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Persistent surveillance with deadlines and resource constraints

Vasile, Aksaray, Belta, Theoretical Computer Science, 2017 (accepted)

Vasile and Belta, Robotics: Science and Systems (RSS) 2014

Conservative TL control for large & complex dynamics

“Service site A for 2 time units within [0, 30] and site C for 3 time units within [0, 19]. In addition, within [0, 56], site B needs to be serviced for 2 time units followed by either A or C for 2 time units within [0, 10].”

Page 51: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 52: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 53: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

polytopes X,Uxk+1 = Axk +Buk, xk ∈ X, u

k∈U

Problem Formulation: Find a set of initial states and a state-feedback control strategy such that all trajectories of the closed loop system originating there satisfy an scLTL formula over a set of linear predicates

U

X

p1

¬p1

p2

¬p2

p3

¬p3

Less conservative TL control for small and simple dynamics

Language-guided Approach: -  Automaton-based partitioning and iterative refinement -  Polyhedral Lyapunov functions used to construct polytope-to-polytope controllers -  Solution is complete! (modulo linear partition and polyhedral Lyapunov functions)

E. Aydin Gol, M. Lazar, C. Belta., HSCC 2012, IEEE TAC 2014

Page 54: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

“Visit region A or region B before reaching the target T while always avoiding the obstacles”

Example

Less conservative TL control for small and simple dynamics

E. Aydin Gol, M. Lazar, C. Belta., HSCC 2012, IEEE TAC 2014

Page 55: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Initial state: x0

Reference trajectories:

xr

0, xr

1. . .

ur

0, ur

1, . . .

Observation horizon : N

C(xk,uk) = (xk+N − xr

k+N)>LN (xk+N − xr

k+N)

+N�1X

i=0

(xk+i − xr

k+i)>L(xk+i − xr

k+i)

+ (uk+i − ur

k+i)>R(uk+i − ur

k+i)

,

X

U

Less conservative optimal TL control for small and simple dynamics

Optimal TL control

Standard Model Predictive Control (MPC, Receding Horizon)

Page 56: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

X

p1

¬p1

p2

¬p2

p3

¬p3

U

Initial state: x0

Reference trajectories:

xr

0, xr

1. . .

ur

0, ur

1, . . .

Observation horizon : N

C(xk,uk) = (xk+N − xr

k+N)>LN (xk+N − xr

k+N)

+N�1X

i=0

(xk+i − xr

k+i)>L(xk+i − xr

k+i)

+ (uk+i − ur

k+i)>R(uk+i − ur

k+i)

,

Problem Formulation: Find an optimal state-feedback control strategy such that the trajectory originating at satisfies an scLTL formula over linear predicates pix

0

Less conservative optimal TL control for small and simple dynamics

Optimal TL control

Language-guided MPC Approach: -  Work on the refined automaton from the above TL control problem -  Enumerate paths of length given by the horizon and compute the costs. -  Terminal constraints ensuring the acceptance condition of the automaton: Lyapunov-

like energy function -  Solve QP to find the optimal path

E. Aydin Gol, M. Lazar, C. Belta, Automatica 2015

Standard Model Predictive Control (MPC, Receding Horizon)

Page 57: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

O1

O2

T

A

B

N = 2 total cost = 29.688

N = 4 total cost = 0.886

N = 6 total cost = 5.12

Reference trajectory violates the specification Reference trajectory

Controlled trajectory

•  “Visit region A or region B before reaching the target while always avoiding the obstacles”

•  Minimize the quadratic cost with L=LN=0.5I2, R=0.2

Example

E. Aydin Gol, M. Lazar, C. Belta, Automatica 2015

Less conservative optimal TL control for small and simple dynamics

Page 58: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 59: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 60: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Less conservative TL control for large and complex dynamics Iterative Partition vs. Sampling

Mission specification: “visit regions r1, r2, r3 and r4 infinitely many times while avoiding regions o1, o2, o3, o4 and o5”

Do (1) Partition (2) Construct region-to-region controller (3) Find controller for finite abstraction Until A solution is found

Do (1) Sample (2) Construct node-to-node controller (3) Find controller for finite abstraction Until A solution is found

Steve LaValle, 1998 Rapidly-exploring Random Trees (RRT) Rapidly-exploring Random Graphs (RRG) Karaman and Frazzoli, 2010

Page 61: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Less conservative TL control for large and complex dynamics

Construct a transition system that contains a path satisfying the formula

1.  LTL formula is translated to a Büchi automaton;

2.  A transition system is incrementally constructed from the initial configuration using an RRG1-based algorithm;

3.  The product automaton is updated incrementally and used to check if there is a trajectory that satisfies the formula

1S. Karaman and E. Frazzoli. IJRR , 2011.

Important Properties

●  Probabilistically complete

●  Scales incrementally (i.e., with the number of added samples at an iteration) - based on incremental Strongly Connected Component (SCC) algorithm 2

2Bernhard Haeupler, et al.. ACM Trans. Algorithms, 2012. C. Vasile and C. Belta. IROS 2013

Page 62: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Less conservative TL control for large and complex dynamics

“Visit regions r1, r2, r3 and r4 infinitely many times while avoiding regions o1, o2, o3, o4 and o5”

Case study 1: 2D configuration space, 20 runs

Average execution time: 6.954 sec

Platform: Python2.7 on an iMac – 3.4 GHz Intel Core i7, 16GB of memory

Case study 2: 10-dimensional configuration space, 20 runs

Average execution time: 16.75 sec

“Visit 3 regions r1, r2, r3 infinitely often while avoiding obstacle o1

Case study 3: 20-dimensional configuration space, 20 runs

Average execution time: 7.45 minutes

“Visit 2 regions (r1, r2) infinitely often”

C. Vasile and C. Belta. IROS 2013

Page 63: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Less conservative TL control for large and complex dynamics

•  Global mission specification: “visit regions r1, r2, r3 and r4 infinitely many times while avoiding regions o1, o2, o3, o4 and o5”

•  Local mission specification: “Extinguish fires and provide medical assistance to survivors, with priority given to survivors, while avoiding unsafe areas”

Fires and survivors are sensed locally. These service requests have given service radii.

Off-line part: generate a global transition system that contains a path satisfying the global spec

On-line (reactive) part: generate a local plan that does not violate the global spec

C. Vasile and C. Belta, ICRA 2014

Page 64: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Spec: Maximize the probability of satisfying: “Always avoid all and Visit , , , and infinitely often and should only be used for

Northbound travel and should only be used for Southbound travel. Uncertainty should always be below 0.9 m2 and when crossing bridges it should be below 0.6 m2.”

Obstacle:!

River!

Obstacle:!Highway!

Obstacle:!

Highway!Obs!

Obstacle:!Highway!

Bridge!

2!

Bridge!

1!

Bridge!

1!

Marsh!

Plaza!Kenmore!Square!

Audubon!Circle!

Stadium!

-  Noisy controllers and sensors -  Unknown map -  No GPS

Less conservative TL control for large and complex dynamics

Approach: •  Generate a map of the unknown environment using purely vision and homography-based

formation control with multiple quadrotors •  Label the map and define Gaussian Distribution Temporal Logic (GDTL) spec •  Synthesize control policy using GDTL - Feedback Information RoadMaps (GDTL-FIRM) •  Simultaneously track and localize the ground robot with a single aerial vehicle using a

homography – based pose estimation and position-based visual servoing control

E. Cristofalo, K. Leahy, C.-I. Vasile, E. Montijano, M. Schwager and C. Belta, ISER 2016.  C. I. Vasile, K. Leahy, E. Cristofalo, A. Jones, M. Schwager and C. Belta, CDC 2016

Page 65: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Map unknown environment

Localization and control

E. Cristofalo, K. Leahy, C.-I. Vasile, E. Montijano, M. Schwager and C. Belta, ISER 2016.  C. I. Vasile, K. Leahy, E. Cristofalo, A. Jones, M. Schwager and C. Belta, CDC 2016

Less conservative TL control for large and complex dynamics

Spec: “Always avoid all and Visit , , ,

and infinitely often and should only be used for Northbound travel

and should only be used for Southbound travel. Uncertainty should always be below 0.9 m2 and when crossing bridges it should be below 0.6 m2.”

Page 66: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 67: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Outline

TL verification and control for finite systems

Conservative TL control for small & simple dynamical systems

Conservative TL control for large & complex dynamical systems

Less conservative optimal TL control for small & simple dynamical systems

Less conservative TL control for large & (possibly) complex dynamical systems

Less conservative optimal TL control for large & simple dynamical systems

TL = Temporal Logic Limitation

Page 68: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Signal Temporal Logic: Boolean (Qualitative) and Quantitative Semantics

Less conservative optimal TL control for large & simple dynamics

•  Temporal operators are timed

•  Semantics defined over signals

•  Has qualitative semantics: real-valued function

Donze & Maler 2004, Fainekos et.al. 2009

ρ(s,φ)

Boolean: True Quantitative: 0.01

⇤[t1,t2](s ≤ 2.5) ♦[t3,t4](s > 3.5)

Boolean: False Quantitative: -0.2

Bemporad and Morari, 1999

⇤[t1,t2](s ≤ 2.5) ∧ ⌃[t3,t4](s > 3.5)

Boolean: False Quantitative: -0.2

•  Boolean satisfaction of STL formulae over linear predicates can be mapped to feasibility of mixed integer linear equalities / inequalities (MILP feasibility)

•  Robustness is piecewise affine in the integer and continuous variables

Raman et. al, 2014

Sadrardini & Belta, 2015

Page 69: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Optimal STL Control

minuH

J(xH , uH)

subject to

Reduces to solving a MILP!

x+ = f(x, u)

xH, u

H satisfy STL formula over linear predicates

(any MLD system, e.g., piecewise affine)

(any linear cost)

dynamics

correctness

Less conservative optimal TL control for large & simple dynamics

Page 70: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Planar Robot Example

x+= x+ u

ϕ = ⇤[40,50]A ∧ ⌃[0,40]⇤[0,10]B ∧ ⌃[0,30]C

Maximum robustness + Minimum fuel Minimum Fuel Only

H = 50

J = −1000ρ+H−1X

τ=0

�u[τ ]

�J =H−1X

τ=0

�u[τ ]

Sadraddini and Belta, Allerton Conference, 2015

Less conservative optimal TL control for large & simple dynamics

Page 71: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

STL Model Predictive Control (MPC)

Repetitive tasks in infinite time: global STL formulas:

⇤[0,∞]ϕ

uH [t] = argmin J(xH [t], uH [t])subject to x+ = f(x, u)

xH [t] |= ⇤[t−H,t]ϕ

Sadraddini and Belta,, 2015

J = ρ

J = �M(ρ� kρk) + Jc

J = Jc

M is a large number. When , effectively maximize ρ < 0 2Mρ

Terminal constraints are guaranteed!

xH(t) |= ϕ over H

Less conservative optimal TL control for large & simple dynamics

Page 72: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

x+=

1 0.5

0 0.8

x+

0

1

+ w

Example: Double Integrator

Minimize fuel consumption. If the spec becomes infeasible, maximize robustness. J =

t+H−1X

τ=t

�u[τ ]

�c

⇤[0,∞]

⌃[0,4]((x1 ≤ 4) ∧ (x1 ≥ 2)) ∧ ⌃[0,4]((x1 ≥ −4) ∧ (x1 ≤ −2))�

Spec:

Sadraddini and Belta 2015

Less conservative optimal TL control for large & simple dynamics

Page 73: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

⇤[0,∞]ϕ

Takes less than 5 sec. to compute a optimal robust control strategy (MILP in 212 dimensions)

Cost: delay over a given horizon

Congestion free If density ever reaches 3, then in 3

minutes should become less than 3

Mixed urban and freeway traffic network with 53 links, 14 intersections controlled by traffic lights, 4 ramp meters

Spec:

Model: discrete-time piecewise affine system

Example: Traffic network

Sadraddini and Belta 2016

Less conservative optimal TL control for large & simple dynamics

Page 74: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Summary

•  Automata (Buchi, Rabin) games can be adapted to produce conservative TL control strategies for simple and small dynamical systems

•  The above can be extended to conservative strategies for large and complicated systems by using I/O linearization techniques

•  Partition refinement can be used to reduce conservatism for simple and small dynamical systems -> connection between optimality and TL correctness

•  Sample-based techniques can be used to generate probabilistically complete TL strategies in high dimensions

•  TL with quantitative semantics can be used for robust, provably-correct optimal control in high dimensions

Page 75: Formal Synthesis of Control Strategies for Dynamical ... · Formal Synthesis of Control Strategies for Dynamical Systems ... ¥! always the network is not congested ... consumption

Acknowledgements

Jana Tumova (now at KTH)

Ebru Aydin Gol (now at Google)

Alphan Ulusoy (now at Mathworks)

Marius Kloetzer (now at UT Iasi)

Cristian Vasile (now at MIT)

Sadra Sadradini

Kevin Leahy (now at Lincoln Lab, MIT)

Austin Jones (now at Lincoln Lab , MIT)

Derya Aksaray (now at MIT)