31
ME 290J ME 290J M d lP di ti C t l M d lP di ti C t l ModelPredictive Control ModelPredictive Control for Linear and Hybrid Systems for Linear and Hybrid Systems Francesco Borrelli Francesco Borrelli Spring 2011 Department of Mechanical Engineering Department of Mechanical Engineering University of California Berkeley, USA

model predictive control

Embed Size (px)

DESCRIPTION

model predictive control tutorial

Citation preview

Page 1: model predictive control

ME 290JME 290JM d l P di ti C t lM d l P di ti C t lModel Predictive Control Model Predictive Control 

for Linear and Hybrid Systemsfor Linear and Hybrid Systems

Francesco BorrelliFrancesco Borrelli

Spring 2011Department of Mechanical EngineeringDepartment of Mechanical Engineering 

University of CaliforniaBerkeley, USA

Page 2: model predictive control

InstructionInstructionI t t F B lli R 5139 EH 643 3871• Instructor: Francesco Borrelli, Room 5139 EH, 643‐3871, 

[email protected]

Office Hours: Tu  and Th 3.30‐4.30

• Teaching Assistant: None – might change.

• Lectures: Tu‐Th 2‐3.30 Room 81, Evans Hall

• Class Notes: Slides distributed before (sometime after) the class• Class Notes:  Slides distributed before (sometime after) the class

• Class Web Site: bSpace

Page 3: model predictive control

MatlabMatlab

• Matlab running the computers in 2109 Etcheverry Hall

C d k i d• Card key  access required

• I will submit class list to so that everyone in the class has• I will submit class list to so that everyone in the class has access to that room

– Please enroll in the class ASAP

• Need additional toolbox/Software distributed through bSpace

Page 4: model predictive control

GradingGrading• 20% Homework

• 50% Final Project

• 30% Oral or Final Test

Page 5: model predictive control

ME290J OverviewME290J OverviewME290J OverviewME290J Overview

Page 6: model predictive control

Model Predictive ControlModel Predictive Controlfuturepast

Predicted outputs

Manipulated (t+k)uInputsInputs

t t+1 t+m t+p

t+1 t+2 t+1+m t+1+p

• Optimize at time t (new measurements)

• Only apply the first optimal move u(t)

• Repeat the whole optimization at time t +1• Repeat the whole optimization at time t +1

• Optimization using current measurements � Feedback

Page 7: model predictive control

MPC AlgorithmMPC Algorithm

At time t:• Measure (or estimate) the current state x(t)Measure (or estimate) the current state x(t)

• Find the optimal input sequence U* ={u*t , u*t+1, u*t+2, … , u*t+N‐1}

l l ( ) * d d d * *• Apply only u(t)=u*t , and discard u*t+1, u*t+2, … 

Repeat the same procedure at time t +1

Multivariable, Model Based

Nonlinear, Constraints Satisfaction, Prediction

Page 8: model predictive control

Important Issues in Important Issues in Model Predictive ControlModel Predictive ControlModel Predictive ControlModel Predictive Control

Even assuming perfect model, no disturbances:

di d l j ipredicted open‐loop trajectories

closed‐loop trajectories

• FeasibilityOptimization problem may become infeasible at some future time step.

• StabilityClosed‐loop stability is not guaranteed.

f• Performance

Goal:Wh t i hi d b t dl i i i iWhat is achieved by repeatedly minimizing• Real‐Time Implementation

Page 9: model predictive control

Feasibility IssuesFeasibility Issues

Infeasible

Terminal region

t+1t+2t+3

tt+1

Page 10: model predictive control

Stability IssuesStability Issues

Terminal region

t+1t+2t+3

tt+1

Page 11: model predictive control

Feasibility and Stability ConstraintsFeasibility and Stability Constraints

Modified ProblemModified Problem(Large Body of Literature)

Xf (Robust) Invariant Set 

p(x) Control Lyapunov Function

Page 12: model predictive control

Real Time ImplementationReal Time Implementation

Page 13: model predictive control

Summarizing…Summarizing…Need:• A discrete‐time model of the system 

(Matlab, Simulink)

• A state observer

• Set up an Optimization Problem• Set up an Optimization Problem 

(Matlab, MPT toolbox/Yalmip)

• Solve an optimization problemSolve an optimization problem 

(Matlab/Optimization Toolbox, NPSOL, NAG, Cplex)

• Verify that the closed‐loop  system performs as desired (avoid infeasibility/stability)

• Make sure it runs in real‐time and code/download for the embedded platformembedded platform

Page 14: model predictive control

Class TopicsClass Topics(Subject to changes)(Subject to changes)

Week 1: Introduction and Fundamentals of Optimization

Week 2/3: Fundamentals of Optimization. 

Week 4: Multiparametric ProgrammingWeek 4: Multiparametric Programming.

Week 5. Convex  and Mixed‐Integer Multiparametric Programming

Week 6: Review of Optimal Control Theory and Dynamic Programming

Week 7: Invariant Set Theory

Week 8/9: Constrained Optimal Control for Linear Systems

Week 10: Predictive Control: FundamentalsWeek 10: Predictive Control: Fundamentals

Week 11: Predictive Control: Stability and Feasibility Theory

Week 12/13: Hybrid systems

Week 14: Predictive Control for Hybrid Systems.

Week 15/16: Applications/Case Studies

Page 15: model predictive control

Class GoalsClass Goals

• Predictive Control Theory• Design and Implement an MPC Controller in Matlab

• Computational Oriented Models of Hybrid Systems

Page 16: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: 

i ib d b b bili i S f C iDistributed, Robust, Probabilistic,  Soft‐Constraints

• Any preference for examples?

Page 17: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

• What I’d like to add: Distributed Robust Probabilistic Soft‐ConstraintsDistributed, Robust, Probabilistic,  Soft Constraints

• Any preference for examples?

Page 18: model predictive control

Why Not Continuous Time Why Not Continuous Time Optimization?Optimization?Optimization?Optimization?

• Choice of this courseChoice of this course

• Issues are the same

S l t d t di ti• Soon or later need to discretize• Software exists (Example: http://tomdyn.com/)

Page 19: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: Distributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?

Page 20: model predictive control

S d M t U d C t l M th d l ft PID

MPC in PracticeMPC in Practice• Second Most Used Control Methodology after PID

Qin, S. J. and T. A. Bagdwell (2003). A survey of model predictive controly ptecnology. Control Engineering Practice 11, 733‐764

• Persistent Control Community Interest (see ACC, CDC  

proceeding)proceeding)

Page 21: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: Distributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?

Page 22: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples ‐Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: Distributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?

Page 23: model predictive control

Example 1Example 1AudiAudi SmartEngineSmartEngineAudi Audi SmartEngineSmartEngine

Vehicle

ACCDesired Speed Actual Speed

ACC

• Design and MPC Controller regulating the desired speed (through an Automatic Cruise Control) in order to reach the destination inan Automatic Cruise Control)  in order to reach the destination in the most fuel‐efficient way

• Prediction: Max and Min Speed of traffic, Grade

• Constraints: Max and Min Speed (of traffic and of vehicle) 

Page 24: model predictive control

Data fromData from PeMSPeMSExample 1Example 1

Data from  Data from  PeMSPeMS

• California Freeway PerformanceCalifornia Freeway Performance Measurement System

• Collects real‐time data on CA freeways via loop detectorsy p

• Able to communicate average traffic speed at loop location every 5 minutes

• Loops typically positioned every 0.3‐3 miles

Page 25: model predictive control

Example 2Example 2BallBall and Plate Experimentand Plate Experiment

y

Ball Ball and Plate Experimentand Plate Experiment

x

''

• Specification of Experiment:

• Specification of Experiment:Angle: -17°… +17° , Plate:-30 cm…+30 cmInput Voltage: -10 V… +10 VC t PENTIUM166Computer: PENTIUM166Sampling Time: 30 ms

Page 26: model predictive control

Example 2Example 2BallBall and Plate Experimentand Plate ExperimentBall Ball and Plate Experimentand Plate Experiment

Page 27: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: Distributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?

Page 28: model predictive control

Catalytic CrackerCatalytic Cracker

ldOpen Folder

Page 29: model predictive control

Predictive Control in Predictive Control in NeuroScienceNeuroScience

• 16:05 Open Folderp

Page 30: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: 

Distributed Robust Probabilistic Soft ConstraintsDistributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?

Page 31: model predictive control

Initial RemarksInitial RemarksMPC N•MPC Name 

• Continuous‐Time versus Discrete‐Time

•MPC in Practice

• Difficulty : The theoretical side and the computation side

• Two simple examples  Models and Simulations

• Non trivial examplesNon trivial examples

•What I’d like to add: 

Distributed Robust Probabilistic Soft ConstraintsDistributed, Robust, Probabilistic, Soft‐Constraints

• Any preference for examples?