35
Object-Oriented Modelling from a Object-Oriented Modelling from a Control Engineer's Perspective: Control Engineer's Perspective: Past, Present, and Future Past, Present, and Future Francesco Casella Francesco Casella ([email protected]) ([email protected]) Dipartimento di Elettronica e Informazione Dipartimento di Elettronica e Informazione Politecnico di Milano Politecnico di Milano

Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

Embed Size (px)

Citation preview

Page 1: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

Object-Oriented Modelling from aObject-Oriented Modelling from aControl Engineer's Perspective:Control Engineer's Perspective:

Past, Present, and FuturePast, Present, and Future

Francesco CasellaFrancesco Casella([email protected])([email protected])

Dipartimento di Elettronica e InformazioneDipartimento di Elettronica e InformazionePolitecnico di MilanoPolitecnico di Milano

Page 2: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

2

The control engineer's perspective

Object-Oriented Modelling Tools

Computer-Aided Control System Design Tools

Page 3: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

3

Requirements for control-oriented physical modelling

• Modularity– modular modelling– physical, a-causal interfaces– hierarchical system decomposition

• Flexibility– appropriate level of detail– replaceable component and sub-system models

• Reusability– do not reinvent the wheel– capitalize on past modelling investment

• Generality– multi-domain system modelling

• Extensibility / Customizability– overcome the “component not available” syndrome– including proprietary information

• Plant-Control Integration– closed-loop Modelica model– Modelica plant + external controller (Simulink, HIL, etc)

Page 4: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

4

Common activities in control system design

• Open-loop analysis

– steady-state operation

– step responses

– numerical linearization

• Closed-loop analysis

– evaluation of different control strategies

– verification of control system performance

– empirical tuning of parameters

– study of operating scenarios

• Identification of uncertain parameters

– ad-hoc experiments (e.g. friction in motion control applications)

– optimization-based fitting of transients

Page 5: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

5

The ideal setting

Plant Control

Co-Design

Early design stages

Detailed design & engineering

Commissioning

Operation Revamping

Page 6: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

6

Early design stages

• Few details available• Evaluation of alternatives• Closed-loop testing

• Example: solar power plant

Page 7: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

7

Early design stages – cont'd

• Model inversion for actuator sizing• Example: satellite attitude control

Page 8: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

8

Detailed design

• Refinement of sensors and actuators– satellite attitude control

– pump/valves in thermo-fluid systems

• Refinement of plant model– more accurate physical model

– second-order physical phenomena

• Refinement of control system model– digital control algorithms

– start-up / shutdown / trip handling

Page 9: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

9

Detailed design – cont'd

• Evaluation of critical plant dynamics• Example: machining tool

Page 10: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

10

Commissioning

• Anticipating problems that might arise on-site during commissioning• Reducing number of tests for CS acceptance• Help understanding results of tests• Example: power/frequency control in a 400 MW power plant

Page 11: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

11

How did all of this evolve?

Page 12: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

12

The Pastor

The Heroic '90s

Page 13: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

13

MOSES

• O-O Modelling tool developed @ Politecnico di Milano 1993-1998– effort led by prof. Claudio Maffezzoni

– Roberto Girelli's PhD thesis

– contributions by Emanuele Carpanzano and others

• Features– Equation-based, O-O models in an O-O database

– Hierarchical composition

– Multibody mechanical systems

– Index reduction and automatic differentiation

– Tearing

– DASSL as ODE integrator

Page 14: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

14

Modelling of an agricultural tracked vehicle

Page 15: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

15

Modelling of an agricultural tracked vehicle – cont'd

0 5 10 15 20 25 30 35 40-0.1

-0.08-0.06-0.04-0.02

00.020.040.060.080.1

x (m)

y (m

)

0 1 2 3 4 5 6 7 81.31.41.51.61.71.8

time (s)

0 1 2 3 4 5 6 7 8-0.10

0.10.20.30.4

time (s)

0 1 2 3 4 5 6 7 8-10-505

101520

time (s)

a)

∆ zir ∆ zil

∆ zsr ∆ zsl,

,

rollpitch

yaw

jrjl

b)

c)

Page 16: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

16

The heroic early '90

• Equation-based, Object-Oriented modelling paradigm emerges

• Early tool implementations

• Prototype tools developed mostly in universities

• Proof-of-concept

• Heroic efforts in order to support real-life engineering projects

Page 17: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

17

The Present

2000-2010

Page 18: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

18

A well-established paradigm

• Modelica language evolves and into gets mainstream• Increasing number of simulation tools available• Used for real-life system engineering (and control engineering)• Success stories

– Automotive– Power plants– Robotics– Mechatronic systems– Aerospace– …

• Reusable libraries• European Projects

– EuroSysLib– ModProd– Modelisar– …

• Link with Systems Engineering Community

Page 19: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

19

but...

Page 20: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

20

A (not so nice) anecdote

Page 21: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

21

The dark side of O-O modelling

Page 22: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

22

Dynamic modelling problems

Description of model behaviour

+Description of initial state

Page 23: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

23

Initial state descriptions

• Problem #1: the initialization problem is a system-level problem– issues with component-wise initial equation setting

– singular configurations (e.g. closed fluid systems)

• Problem #2: the initial equations might be difficult to solve– nonlinear algebraic equations require initial guesses

– steady-state initialization → large systems of equations

• Problem #3:given initial state values sometimes unsuitable– fluid and thermofluid systems: unphysical transient

outside model validity range

– “rest” state might be problematic (singular problem)

– control studies often requires equilibrium as initial state

How to specify initial conditions conveniently?

How to solve the initialization problem reliably?

Page 24: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

24

The Futureor

2011 and beyond...

Page 25: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

25

Reliable automatic initialization

• Getting a meaningful initial state is a key ingredient in dynamic modelling

• Shouldn't require a PhD in simulation methods

• Should be easy for the average engineer

• Should be easy to specify unambiguously

• Robust methods for initialization problems (no human intervention)

• Meaningful diagnostic feedback for engineers and domain experts

• Embed domain-specific knowledge into model (and meta-model) libraries

Page 26: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

26

Homotopy-based initialization

• Define a simplified problem which is easier to solve

• Continuously transform into the actual problem

• New Modelica operator homotopy(actual, simplified)

• Beware of singularities!

Fs(x) = 0

(1 – λ) Fs(x) + λ F

a(x) = 0

Page 27: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

27

Homotopy-based initialization – First results

• Multibody systems with multiple configurations

• Analog electronic circuits

• Hydraulic networks

• Calibration of air-conditiong systems

• Large power plants

• Two papers at the next Modelica Conference

• One possible way to embed expert knowledge to help the end user

Page 28: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

28

Improved support for troubleshooting

• The strange case of the steam generator

• “Wrong” parameters → no steady-state solution!

• Dynamic analysis

• Meaningful hints for the end-user?

• Substantial research needed to find general solutions!

Page 29: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

29

Improved support for troubleshooting – cont'd

• Troubleshooting singular initialization problems

• The case of steady-state initialization of closed-loop circuits

• How to give meaningful feedback to end-users in this case?

dM 1

dt=w1−w2

dM 2

dt=w2−w1

dM 1

dt=0

dM 2

dt=0

Page 30: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

30

Off-line and on-line optimal control

• System model described in Modelica• Additional settings described in Optimica (small extension of Modelica)• Jmodelica tool: optimization back-ends

– IPOPT (direct collocation method)– ACADO (multiple-shooting)

• Off-line optimization• On-line optimization (MPC)

Page 31: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

31

Transformation of models into control-oriented formalism

• Beyond simulation: model transformation

• Control design methods require models with special structure as input

– linear state-space

– nonlinear state-space

– piecewise linear or affine

– linear-parameter-varying (LPV)

– linear fractional representation (LFR)

• Modelica front-end helps closing the theory-practice gap

Page 32: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

32

Modelica → LFR

• Prototype implementation of Modelica → LFR transformation– developed @ Politecnico– uses OMC+ Maxima + LFR toolbox (ONERA/DLR)

• Application– Robust control– Gain-scheduling control– Gray-box identification

Page 33: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

33

Nonlinear Model Order Reduction

• Simulation oriented models usually too complex for direct use inmodel-based control system

• Model reduction techniques required

• Define refererence scenario(s)• Define maximum acceptable error• Rank terms in equations according to sensitivity on output error• Eliminate / approximate them progressively

• Used in behavioural modelling of digital IC's (Analog Insydes)• Prototype tool Univ. Duisburg (→ fast real-time performance)

Accurate / general simulation models

Fast / smooth / low-ordercontrol-oriented models

Page 34: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

34

Conclusions

• OOM is a blessing for the control engineer (esp. w.r.t. block-oriented)

• Initialization is currently Achille's heel

• Models mainly used for simulation\

• More reliable, automatic, and user-friendly specification and solutionof initialization problems

• More end-user relevant feeback in case of trouble

• Model Order Reduction

• Model transformation into control-oriented formalism

• Direct support for optimal control and MPC

Page 35: Object-Oriented Modelling from a Control Engineer's ... · Control Engineer's Perspective: Past, Present, and Future ... • Used for real-life system engineering ... – fluid and

35

Thank you for you kind attention!