Cyber-Physical Systems Modeling Physical Dynamics IECE 553/453 Fall - - PowerPoint PPT Presentation

cyber physical systems modeling physical dynamics
SMART_READER_LITE
LIVE PREVIEW

Cyber-Physical Systems Modeling Physical Dynamics IECE 553/453 Fall - - PowerPoint PPT Presentation

Cyber-Physical Systems Modeling Physical Dynamics IECE 553/453 Fall 2019 Prof. Dola Saha 1 Modeling Techniques Models that are abstractions of system dynamics (how system behavior changes over time) Modeling physical phenomena


slide-1
SLIDE 1

1

Cyber-Physical Systems Modeling Physical Dynamics

IECE 553/453– Fall 2019

  • Prof. Dola Saha
slide-2
SLIDE 2

2

Modeling Techniques

Ø Models that are abstractions of system dynamics (how

system behavior changes over time)

§ Modeling physical phenomena – differential equations § Feedback control systems – time-domain modeling § Modeling modal behavior – FSMs, hybrid automata, … § Modeling sensors and actuators –calibration, noise, … § Hardware and software – concurrency, timing, power, … § Networks – latencies, error rates, packet losses, …

slide-3
SLIDE 3

3

Modeling of Continuous Dynamics

Ø Ordinary differential equations, Laplace

transforms, feedback control models, …

slide-4
SLIDE 4

4

Example CPS System: Helicopter Dynamics

slide-5
SLIDE 5

5

Modeling Physical Motion

Ø Six Degrees of Freedom § Position: x, y, z § Orientation: roll (!"), yaw (!#), pitch (!$)

slide-6
SLIDE 6

6

Notation

Ø Functions of this form are known as continuous-time signals

Orientation can be represented in the same form

slide-7
SLIDE 7

7

Notation

slide-8
SLIDE 8

8

Newton’s Second Law

slide-9
SLIDE 9

9

Orientation

slide-10
SLIDE 10

10

Torque: Angular version of Force

Just as force is a push or a pull, a torque is a twist. Units: newton-meters/radian, Joules/radian

T

y(t ) = r f (t )

angular momentum, momentum

slide-11
SLIDE 11

11

Rotational Version of Newton’s Law

If the object is spherical, this reluctance is the same around all axes, so it reduces to a constant scalar I (or equivalently, to a diagonal matrix I with equal diagonal elements I).

slide-12
SLIDE 12

12

Feedback Control Problem

Control system problem: Apply torque using the tail rotor to counterbalance the torque of the top rotor. A helicopter without a tail rotor, like the one below, will spin uncontrollably due to the torque induced by friction in the rotor shaft.

slide-13
SLIDE 13

13

For a spherical object

slide-14
SLIDE 14

14

Simplified Model

Ø Model-order Reduction

slide-15
SLIDE 15

15

Simplified Model of Helicopter

Ø the force produced by the tail rotor must counter the torque

produced by the main rotor

Ø Assumptions:

§ helicopter position is fixed at the origin § helicopter remains vertical, so pitch and roll are fixed at zero

Ø the moment of inertia reduces to a scalar that represents a

torque that resists changes in yaw

slide-16
SLIDE 16

16

Actor Model

Ø Mathematical Model of Concurrent Computation Ø Actor is an unit of computation Ø Actors can § Create more actors § Send messages to other actors § Designate what to do with the next message Ø Multiple actors may execute at the same time

slide-17
SLIDE 17

17

Actor Model of Systems

ØA system is a function that accepts

an input signal and yields an output signal.

ØThe domain and range of the

system function are sets of signals, which themselves are functions.

ØParameters may affect the

definition of the function S.

slide-18
SLIDE 18

18

Actor Model of the Helicopter

Ø Input is the net torque of the tail

rotor and the top rotor. Output is the angular velocity around the y- axis.

Ø Parameters of the model are

shown in the box. The input and

  • utput relation is given by the

equation to the right.

slide-19
SLIDE 19

19

Composition of Actor Model

slide-20
SLIDE 20

20

Actor Models with Multiple Inputs

slide-21
SLIDE 21

21

Modern Actor Based Platforms

Ø Simulink (The MathWorks) Ø Labview (National Instruments) Ø Modelica (Linkoping) Ø OPNET (Opnet Technologies) Ø Polis & Metropolis (UC Berkeley) Ø Gabriel, Ptolemy, and Ptolemy II (UC

Berkeley)

Ø OCP, open control platform (Boeing) Ø GME, actor-oriented meta-modeling

(Vanderbilt)

Ø SPW, signal processing worksystem

(Cadence)

Ø System studio (Synopsys) Ø ROOM, real-time object-oriented

modeling (Rational)

Ø Easy5 (Boeing) Ø Port-based objects (U of Maryland) Ø I/O automata (MIT) Ø VHDL, Verilog, SystemC (Various)

slide-22
SLIDE 22

22

Example LabVIEW Screenshot

slide-23
SLIDE 23

23

Synchronous Dataflow (SDF)

Ø Specialized model for dataflow Ø All actors consume input tokens, perform their computation and

produce outputs in one atomic operation

Ø Flow of control is known (predictable at compile time) Ø Statically scheduled domain Ø Useful for synchronous signal processing systems Ø Homogeneous SDF: one token is usually produced for every

iteration

slide-24
SLIDE 24

24

Multirate SDF Model

Ø The firing rates of the actors

are not identical

Ø The Spectrum actor requires

256 tokens to fire, so one iteration of this model requires 256 firings of Sinewave, Channel, and SequencePlotter, and one firing of Spectrum.

slide-25
SLIDE 25

25

Balance Equations

Ø When A fires, it produces M tokens on its output port Ø When B fires, it consumes N tokens on its input port Ø M and N are non-negative integers Ø Suppose that A fires qA times and B fires qB times Ø All tokens that A produces are consumed by B if and only if

the following balance equation is satisfied qAM=qBN

Ø The system remains in balance if and only if the balance

equation is satisfied

slide-26
SLIDE 26

26

Example

Ø Suppose M=2, N=3 Ø Possible Solution: § qA=3, qB=2 § Example Schedule : {A, A, A, B, B} OR {A, B, A, A, B} Ø Another Possible Solution: § qA=6, qB=4 § Example Schedule: {A,A,A,A,A,A,B,B,B,B}

slide-27
SLIDE 27

27

Strategy for firing

Ø Streaming applications: arbitrarily large number

  • f tokens

Ø Naive strategy: fire actor A an arbitrarily large

number qA times, and then fire actor B qB times

§ Why naive? Ø Better strategy: § smallest positive qA and qB that satisfy the balance equation Ø Unbounded execution with bounded buffers

slide-28
SLIDE 28

28

Solving the Balance Equation

Ø Every connection between actors results in a balance equation Ø The model defines a system of equations, and the goal is to

find the least positive integer solution

Ø The least positive integer solution to these equations is

§ qA = qB = 1, and qC = 2

Ø The schedule {A, B, C, C} can be repeated forever to get an

unbounded execution with bounded buffers

slide-29
SLIDE 29

29

Inconsistent SDF

Ø An SDF model that has a non-zero solution to the

balance equations is said to be consistent.

Ø If the only solution is zero, then it is inconsistent. Ø An inconsistent model has no unbounded

execution with bounded buffers.

slide-30
SLIDE 30

30

Feedback Loop

Ø A feedback loop in SDF must include at least one instance of

the SampleDelay actor

Ø Without this actor, the loop would deadlock

§ actors in the feedback loop would be unable to fire because they depend on each

  • ther for tokens.

Ø The initial tokens enable downstream actors to fire and break

the circular dependencies that would otherwise result from a feedback loop

slide-31
SLIDE 31

31

Example Feedback Loop

Ø The least positive integer solution is § qA = 2, qB = 3, so the model is consistent. Ø With 4 initial tokens: consistent Ø With 3 initial tokens: deadlock

slide-32
SLIDE 32

32

Multirate Dataflow Actors

Ø actors that produce and/or consume multiple

tokens per firing on a port

slide-33
SLIDE 33

33

Dynamic Dataflow (DDF)

Ø SDF cannot express conditional firing: an actor

fires only if a token has a particular value

Ø DDF: Firing Rule is required to be satisfied for

firing

Ø Number of tokens produced can vary Ø Example DDF Actor: Select Ø Similar to Go To in Imperative Programming

slide-34
SLIDE 34

34

Example DDF (Conditional Firing)

When Bernoulli produces

true, the output of the Ramp

actor is multiplied by −1

slide-35
SLIDE 35

35

Data Dependent Iteration

slide-36
SLIDE 36

36

Conditional Firing Output

slide-37
SLIDE 37

37

Unbounded Buffer Schedule

Ø The Bernoulli actor is capable of producing an

arbitrarily long sequence of true-valued tokens, during which an arbitrarily long sequence of tokens may build up on input buffer for the false port of the BooleanSelect, thus potentially overflowing the buffer.

slide-38
SLIDE 38

38

DDF

Ø It may not be possible to determine a schedule with

bounded buffers

Ø Not always possible to ensure that the model will not

deadlock

Ø Buck (1993) showed that bounded buffers and

deadlock are undecidable for DDF models.

Ø DDF models are not as readily analyzed. Ø Structured dataflow & higher order actors are used

slide-39
SLIDE 39

39

Structured Dataflow

Ø Higher order actor: combine

multiple actors as components

Ø Example Case: 2 sub-models

§ true that contains a Scale actor with a parameter of −1, and § default that contains a Scale actor with a parameter of 1. § When the control input to the Case actor is true, the true refinement executes one

  • iteration. For any other control input, the

default refinement executes.

slide-40
SLIDE 40

40

Actor Model Implementation

Ø Multiple clocks Ø Multiple domains Ø Buffer: Queue Ø Message: Interprocess communication