MPC in Under supervision of: Dr S.K. Hosseini S. By: S.H. Edjtahed M.G. Farajzadeh D.

Post on 19-Jan-2016

221 views 3 download

Tags:

Transcript of MPC in Under supervision of: Dr S.K. Hosseini S. By: S.H. Edjtahed M.G. Farajzadeh D.

MPC inUnder supervision of:

Dr S.K. Hosseini S.

http://ejtahed.fumblog.um.ac.ir

By:

S.H. Edjtahed

M.G. Farajzadeh D.

MPC in MATLAB:

• MATLAB MPC Toolbox (Morari)

• IMPACT Toolbox (Camacho)

• MPCTools (Akesson)

•BLOM (Berkeley Lib. for Optimization MPC)

•MPT (Multi Parametric Toolbox)

•jMPC (Jonathan Currie)

• SOSTOOLS Toolbox (caltech)

• YALMIP Toolbox (Camacho)

• CVX Toolbox (Johan Löfberg)

• MATLAB LMI Toolbox (Gahinet et al)

• MPC in LabView (Telemark University College)

• MPC with MATLAB (a Book by Wang)

Overview:MATLAB MPC Toolbox

1. MPC Modeling in MATLAB

2. Case Study introduction

3. MPC in GUI (mpctool)

4. MPC in Command Line

5. MPC in Simulink

1. MPC ModelingMATLAB MPC Toolbox

1. MPC Modeling: Plant ModelMATLAB MPC Toolbox

1. MPC Modeling: Plant Model

The MPC controller performs all

the estimation and optimization

calculations using a:

discrete-time,

delay-free,

state-space system,

with dimensionless input and

output variables.

MATLAB MPC Toolbox

1. MPC Modeling: Plant ModelMATLAB MPC Toolbox

1. MPC Modeling: Plant ModelMATLAB MPC Toolbox

1. MPC Modeling: LTI Object propertyMATLAB MPC Toolbox

1. MPC Modeling: MIMO PlantsMATLAB MPC Toolbox

Servo MechanismMATLAB MPC Toolbox

2. Case Study introduction:

MATLAB MPC Toolbox

2. Case Study :Modeling

MATLAB MPC Toolbox

2. Case Study :Plant Definition

MATLAB MPC Toolbox

2. Case Study :Plant Definition

>> mpctool

MATLAB MPC Toolbox

3. MPC in GUI (mpctool)

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Specifying signal properties

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Specifying controller properties

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Specifying controller properties

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Specifying controller properties

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Specifying scenario

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Simulation results

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Correcting controller properties

MATLAB MPC Toolbox

3. MPC in GUI (mpctool): Simulation results

MATLAB MPC Toolbox

4. MPC in Command Line

1.Defining the Plant Model

2.MPC commands

3.Constructing an MPC Object

4.Setting, Getting, and Displaying Object Properties

5.Running a Simulation

6.Plotting the results

Steps:

MATLAB MPC Toolbox

4. MPC in Command Line

1.Defining Parameters

2.Defining Sys model

4.1. Defining the Plant Model:

MATLAB MPC Toolbox

4. MPC in Command Line4.2. MPC commands:

4.3. Constructing an MPC Object

MATLAB MPC Toolbox

4. MPC in Command Line

4.4. Setting, Getting, and Displaying Object Properties

MATLAB MPC Toolbox

4. MPC in Command Line4.5. Running a Simulation

4.6. Plotting the results

MATLAB MPC Toolbox

5. MPC in Simulink

MATLAB MPC Toolbox

5. MPC in Simulink

MATLAB MPC Toolbox

5. MPC in Simulink

Integrated Multiple Predictive Algorithm

Control Tool

The controllers implemented under IMPACT: GPC (Generalized Predictive Control) SPGPC (GPC with Smith Predictor) DMC (Dynamic Matrix Control) PFC (Predictive Functional Control) SSMPC (State Space Model Predictive Control)

add the path of IMPACT directory into the Matlab path in order to run IMPACT correctly.

Type in Command window of MATLAB:>> impact

Containing (Systems + Experiments): All Simulation Examples of the Book

All exercise corresponding to the chapters of the book MPC.

You can add your own!

All Simulation Results is available here in FUMBlog:

For MIMO systemsselect the:

system to simulatecontroller to be usedparameters of MPC

set: durationreference to reachconstraints noisedisturbances

result: outputs , U , DU

The interface is divided in three different parts: SYSTEM: This part loads the system file to be

simulated, changes its properties (matrices) and saves a system created by the user in a file.

CONTROLLER: It sets the kind of MPC controller to be used, and allows changing the specific tuning parameters, such as horizons or weighting matrices.

EXPERIMENT: It establishes the main features of the simulation: time, reference parameters, constraints, noises, disturbances and graphics to be showed

The following forms of modelling a system are accepted by IMPACT.

1. Carima Model.

A and B model the system, and the delay factor (z-d) have been integrated in B.

2. Step Response Model (DMC)

The variable gninputs contains the inputs of the system

3. Space State Model

the variables Mm, Nm and Qm.(PFC and SSMPC)

Error Modelling:

Ap,Bp for the CARIMA--- gp for the Step response--- Mp, Np and Qp for State Space

sinfo:General information about the system in a cell array

2 variables for reference: Constant: vrefc Variable: vrefv

Linear Matrix Inequality in MATLAB

>> lmidem

For all 3 Solvers:Input: an LMI systemOutput: x* (decision variable)

>> lmiedit

Solving LMI:

See Problem Definition at FUMblog: http://ejtahed.fumblog.um.ac.ir

umax=2Q1=[1 0; 0 0]B1=B2=[0 0.1*0.787]’

YQ

An useful MATLAB function for Designing RMPC With LMI

Available at FUMblog: http://ejtahed.fumblog.um.ac.ir

A useful function for Designing CGPC with MATLAB

A useful function for Designing CGPC with MATLAB

Available at FUMblog: http://ejtahed.fumblog.um.ac.ir

MPC in LabView

All Thing is Available at: http://ejtahed.fumblog.um.ac.ir

References:

http://www.mathworks.com/ http://www.i2c2.aut.ac.nz/Resources/Software/jMPCToolbox.html https://www.embotech.com/FORCES-Pro/How-to-use/MATLAB-Interface/Simple-MPC-Example http://www-control.eng.cam.ac.uk/jmm/mpcbook/software/software.html http://www.mpc.berkeley.edu/mpc-course-material http://forces.ethz.ch/doku.php?id=examples:simplempc#simple_mpc_example http://www.control.lth.se/user/johan.akesson/mpctools/ http://www.mpclab.net/Trac/ http://control.ee.ethz.ch/research/software.php http://cvxr.com/cvx/ http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.WhatIsYALMIP http://www.cds.caltech.edu/sostools/ http://ejtahed.fumblog.um.ac.ir/