Cyber-Physical Systems Discrete Dynamics

Similar documents
Embedded Real-Time Systems

Discrete Dynamics Finite State Machines גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Finite State Machines. CS 447 Wireless Embedded Systems

Embedded Systems 2. REVIEW: Actor models. A system is a function that accepts an input signal and yields an output signal.

Embedded Systems 5. Synchronous Composition. Lee/Seshia Section 6.2

Model-Based Design. Chapter Modeling Physical Dynamics Newtonian Mechanics

Introduction to Embedded Systems

Comparing State Machines: Equivalence and Refinement

Introduction to Embedded Systems

Models for representing sequential circuits

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Laurea Specialistica in Ingegneria. Ingegneria dell'automazione: Sistemi in Tempo Reale

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Sequential logic and design

Bridging the Semantic Gap Between Heterogeneous Modeling Formalisms and FMI

Using the Principles of Synchronous Languages in Discrete-event and Continuous-time Models

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3

CSEE W3827 Fundamentals of Computer Systems Homework Assignment 3 Solutions

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014

Bridging the Semantic Gap Between Heterogeneous Modeling Formalisms and FMI

A synchronous rendering of hybrid systems for designing Plant-on-a-Chip (PoC)

MEM-BUS ABSOLUTE ENCODER

Using the Principles of Synchronous Languages in Discrete-event and Continuous-time Models

ECE 341. Lecture # 3

Different encodings generate different circuits

Part I: Definitions and Properties

Chapter 3 Digital Logic Structures

Digital Logic Design - Chapter 5

Embedded Systems Development

Sequential Circuits Sequential circuits combinational circuits state gate delay

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

An object-oriented design process. Weather system description. Layered architecture. Process stages. System context and models of use

Digital Design. Sequential Logic

A Deterministic Logical Semantics for Esterel

Theoretical Foundations of the UML Lecture 18: Statecharts Semantics (1)

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

From Sequential Circuits to Real Computers

Embedded systems specification and design

Finite State Machine (FSM)

Time and Schedulability Analysis of Stateflow Models

Hybrid systems and computer science a short tutorial

CSE370 HW6 Solutions (Winter 2010)

CS4026 Formal Models of Computation

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

CDA6530: Performance Models of Computers and Networks. Chapter 8: Discrete Event Simulation (DES)

EECS 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization

Formal Definition of a Finite Automaton. August 26, 2013

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

Random Number Generator Digital Design - Demo

Model Checking: An Introduction

Equivalence of Regular Expressions and FSMs

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

CSCC63 Worksheet Turing Machines

Lecture 05: High-Level Design with SysML. An Introduction to SysML. Where are we? What is a model? The Unified Modeling Language (UML)

2.3 Finite State Machine (FSM) Concept and Implementation

Semantics of S.S.M. (Safe State Machine)

Spacecraft clocks and General Relativity

ENGG 1203 Tutorial. Quick Checking. Solution. A FSM design for a Vending machine (Revisited) Vending Machine. Vending machine may get three inputs

Computation Theory Finite Automata

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

1 Introduction. 2 Process description

CIS 4930/6930: Principles of Cyber-Physical Systems

EGR224 F 18 Assignment #4

Equivalence Checking of Sequential Circuits

Week 4 solutions. March 21, From the left hand side formula we obtain ϕ ψ = ϕ ψ = We transform the left hand side formula as follows.

MTH401A Theory of Computation. Lecture 17

Sequential Logic. Handouts: Lecture Slides Spring /27/01. L06 Sequential Logic 1

EXPERIMENT Traffic Light Controller

Propositional logic (revision) & semantic entailment. p. 1/34

A Hybrid Synchronous Language with Hierarchical Automata

Lecture 13: Sequential Circuits, FSM

From Sequential Circuits to Real Computers

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

Chapter 6. Synchronous Sequential Circuits

TESTING is one of the most important parts of the

EEE2135 Digital Logic Design

IE Advanced Simulation Experiment Design and Analysis. Hong Wan Purdue University

State Machines Composition

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

EE249 - Fall 2012 Lecture 18: Overview of Concrete Contract Theories. Alberto Sangiovanni-Vincentelli Pierluigi Nuzzo

FSM Optimization. Counter Logic Diagram Q1 Q2 Q3. Counter Implementation using RS FF 10/13/2015

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

Hands-on Lab 3. System Identification with Experimentally Acquired Data

MECH 1500 Final Part 2 Review

Synchronous Sequential Circuit Design. Digital Computer Design

Laboratoire Spécification & Vérification. Language Preservation Problems in Parametric Timed Automata. Étienne André and Nicolas Markey

Lab 3: Quanser Hardware and Proportional Control

Time Allowed 3:00 hrs. April, pages

T U M I N S T I T U T F Ü R I N F O R M A T I K. Tests for mixed discrete-continuous systems. G. Hahn, J. Philipps, A. Pretschner, T.

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

LECTURE 18: Uniform Circular Motion (UCM)

Models. Lecture 25: Model Checking. Example. Semantics. Meanings with respect to model and path through future...

Lecture 13: Sequential Circuits, FSM

EECS150 - Digital Design Lecture 23 - FSMs & Counters

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Lecture 7: Sequential Networks

Transcription:

Cyber-Physical Systems Discrete Dynamics ICEN 553/453 Fall 2018 Prof. Dola Saha 1

Discrete Systems Ø Discrete = individually separate / distinct Ø A discrete system is one that operates in a sequence of discrete steps or has signals taking discrete values. Ø It is said to have discrete dynamics. Ø A discrete event occurs at an instant of time rather than over time. 2

Discrete Systems: Example Design Problem Ø Count the number of cars that are present in a parking garage by sensing cars enter and leave the garage. Show this count on a display. 3

Discrete Systems Ø Example: count the number of cars in a parking garage by sensing those that enter and leave: 4

Discrete Systems Ø Example: count the number of cars that enter and leave a parking garage: Ø Pure signal: up: R {absent, present} Ø absent: no event at that time ; present: event at that time 5

Discrete Systems Ø Example: count the number of cars that enter and leave a parking garage: Ø Pure signal: up: R {absent, present} Ø Discrete actor: Counter : (R {absent,present}) P (R {absent} N) P = {up,down} 6

Demonstration of Ptolemy II Model ( Program ) 7

Actor Modeling Languages / Frameworks Ø LabVIEW Ø Simulink Ø Scade Ø Ø Reactors Ø StreamIT Ø 8

Reaction / Transition For any t R where up(t) = absent or down(t) = absent the Counter reacts. It produces an output value in N and changes its internal state. State: condition of the system at a particular point in time Encodes everything about the past that influences the system s reaction to current input 9

Inputs and Outputs at a Reaction For t R the inputs are in a set Inputs =({up, down} { absent, present}) and the outputs are in a set Outputs =({count} { absent} N), 10

Question Ø What are some scenarios that the given parking garage (interface) design does not handle well? For t R the inputs are in a set Inputs =({up, down} { absent, present}) and the outputs are in a set Outputs =({count} { absent} N), 11

State Space A practical parking garage has a finite number M of spaces, so the state space for the counter is States = {0,1,2,,M}. 12

Garage Counter Finite State Machine (FSM) Guard g Inputs is specified using the shorthand which means up down g = {{up}}. Inputs(up) = present, Inputs(down) = absent 13

Garage Counter Finite State Machine (FSM) Initial state 14

Garage Counter Finite State Machine (FSM) Output 15

Ptolemy II Model 16

FSM Modeling Languages / Frameworks LabVIEW Statecharts Simulink Stateflow Scade 17

Garage Counter Mathematical Model Formally: (States, Inputs, Outputs, update, initialstate), where States = {0,1,,M} Inputs =({up, down} { absent, present} Outputs =({count} { absent} N) update : States Inputs States Outputs initialstate = 0 The picture above defines the update function. 18

FSM Notation Input declarations Output declarations Extended state declarations state initial state transition self loop 19

Examples of Guards for Pure Signals true Transition is always enabled. p 1 Transition is enabled if p 1 is present. p 1 Transition is enabled if p 1 is absent. p 1 p 2 Transition is enabled if both p 1 and p 2 are present. p 1 p 2 Transition is enabled if either p 1 or p 2 is present. p 1 p 2 Transition is enabled if p 1 is present and p 2 is absent. 20

Guards for Signals with Numerical Values p 3 Transition is enabled if p 3 is present (not absent). p 3 = 1 Transition is enabled if p 3 is present and has value 1. p 3 = 1 p 1 Transition is enabled if p 3 has value 1 and p 1 is present. p 3 > 5 Transition is enabled if p 3 is present with value greater than 5. 21

Example of Modal Model: Thermostat 22

When does a reaction occur? Ø Suppose all inputs are discrete and a reaction occurs when any input is present. Then the below transition will be taken whenever the current state is s1 and x is present. Ø This is an event-triggered model. 23

When does a reaction occur? Ø Suppose x and y are discrete and pure signals. When does the transition occur? Answer: when the environment triggers a reaction and x is absent. If this is a (complete) event-triggered model, then the transition will never be taken because the reaction will only occur when x is present! 24

When does a reaction occur? Ø Suppose all inputs are discrete and a reaction occurs on the tick of an external clock. Ø This is a time-triggered model. 25

More Notation: Default Transitions Ø A default transition is enabled if it either has no guard or the guard evaluates to true. When is the below default transition enabled? 26

Default Transitions Ø Example: Traffic Light Controller 27