EECE 396 1 Hybrid and Embedded Systems Computation

  • Slides: 40
Download presentation
EECE 396 -1 Hybrid and Embedded Systems: Computation T. John Koo, Ph. D. Institute

EECE 396 -1 Hybrid and Embedded Systems: Computation T. John Koo, Ph. D. Institute for Software Integrated Systems Department of Electrical Engineering and Computer Science Vanderbilt University 300 Featheringill Hall April 1, 2004 john. [email protected] edu http: //www. vuse. vanderbilt. edu/~kootj

Application: Time Automata

Application: Time Automata

Outline n Motivation n Hybrid Systems n Verification of Timed Automata n A Design

Outline n Motivation n Hybrid Systems n Verification of Timed Automata n A Design Example n Future Works

Distributed Sensing and Sensor Networks n Creation of a fundamental unifying framework for real-time

Distributed Sensing and Sensor Networks n Creation of a fundamental unifying framework for real-time distributed/decentralized information processing with applications to sensor networks System Architecture for Networked Sensor Route map application router sensor appln n. ATMEL 4 Mhz CPU Active Messages n. RFM 916 MHz radio n 64 KB EEPROM packet Radio Packet Serial Packet Temp SW n. Sensor Bus: n 7 Analog sensors byte Radio byte UART i 2 c HW photo n 2 I 2 C buses n 1 SPI bus bit RFM clocks n. Runs Tiny OS n 2 weeks on AA batteries n 1% duty w/ solar power

Distributed Sensing and Sensor Networks n Networked sensors dropped from an aerial vehicle Ad

Distributed Sensing and Sensor Networks n Networked sensors dropped from an aerial vehicle Ad hoc networking

Distributed Sensing and Sensor Networks n Recovering Flow from Distributed Networks In a dense

Distributed Sensing and Sensor Networks n Recovering Flow from Distributed Networks In a dense sensor scenario, environmental data can be interpolated n Over a few time steps, optical flow algorithms are applied to determine flow n Accuracy of results is highly dependent on the smoothness of the flow n Sense temperature at nodes Interpolate to grid points Compute flow

System Architecture for Networked Sensors application Route map router sensor appln Active Messages packet

System Architecture for Networked Sensors application Route map router sensor appln Active Messages packet Radio Packet Serial Packet Temp Radio byte UART i 2 c SW byte bit RFM HW photo clocks n Constrained two-level scheduling model: threads + events n Components: Frame (storage), Threads (concurrency), Commands, and Handlers (events) n Constrained Storage Model n Very lean multithreading n Layering: components issue commands to lower-level components

Tiny. OS n Tiny. OS - component-based operating system Modularity by assembling only the

Tiny. OS n Tiny. OS - component-based operating system Modularity by assembling only the software components to synthesize application from hardware components n Components as reentrant cooperating finite state machines n application packet byte bit sensing application Radio Packet Radio byte RFM clocks photo SW ADC HW command event

Example: Communication Packet Level Byte Level RFM Bit Level Put processor sleep 1 byte

Example: Communication Packet Level Byte Level RFM Bit Level Put processor sleep 1 byte = 18 bits 1 packet = 30 bytes … Event fountain handling Task handling

Design Considerations n Characteristic of sensor networks n Dynamical behaviors depend on the environment

Design Considerations n Characteristic of sensor networks n Dynamical behaviors depend on the environment n Deploy once and leave without future maintenance n Energy consumption varies between applications n We suggest to use formal methods to n verify system performance to guarantee correct operation in every circumstances n predict lifetime of a given application scenario Functional Behaviors +Temporal Behaviors Timed Automata System States = Discrete States + Continuous States(Time + Energy) State Transitions = Discrete Transitions(Events) + Continuous Transitions

What Are Hybrid Systems? n Dynamical systems with interacting continuous and discrete dynamics

What Are Hybrid Systems? n Dynamical systems with interacting continuous and discrete dynamics

Why Hybrid Systems? n Modeling abstraction of n Continuous systems with phased operation (e.

Why Hybrid Systems? n Modeling abstraction of n Continuous systems with phased operation (e. g. walking robots, mechanical systems with collisions, circuits with diodes) n Continuous systems controlled by discrete inputs (e. g. switches, valves, digital computers) n Coordinating processes (multi-agent systems) n Important in applications n Hardware verification/CAD, real time software n Manufacturing, communication networks, multimedia n Large scale, multi-agent systems n Automated Highway Systems (AHS) n Air Traffic Management Systems (ATM) n Uninhabited Aerial Vehicles (UAV) n Power Networks

Research Issues n Modeling & Simulation n Control: classify discrete phenomena, existence and uniqueness

Research Issues n Modeling & Simulation n Control: classify discrete phenomena, existence and uniqueness of execution, Zeno [Branicky, Brockett, van der Schaft, Astrom] n Computer Science: composition and abstraction operations [Alur. Henzinger, Lynch, Sifakis, Varaiya] n Analysis & Verification n Control: stability, Lyapunov techniques [Branicky, Michel], LMI techniques [Johansson-Rantzer] n Computer Science: Algorithmic [Alur-Henzinger, Sifakis, Pappas. Lafferrier-Sastry] or deductive methods [Lynch, Manna, Pnuelli], Abstraction [Pappas-Tabuada, Koo-Sastry] n Controller Synthesis n Control: optimal control [Branicky-Mitter, Bensoussan-Menaldi], hierarchical control [Caines, Pappas-Sastry], supervisory control [Lemmon-Antsaklis], safety specifications [Lygeros-Sastry, Tomlin. Lygeros-Sastry], control mode switching [Koo-Pappas-Sastry] n Computer Science: algorithmic synthesis [Maler et. al. , Wong-Toi], synthesis based on HJB [Mitchell-Tomlin]

Verification n Deductive Methods n Theorem-Proving techniques [Lynch, Manna, Pnuelli] n Model Checking n

Verification n Deductive Methods n Theorem-Proving techniques [Lynch, Manna, Pnuelli] n Model Checking n State-space exploration [Alur-Henzinger, Sifakis, Pappas-Lafferrier. Sastry] Reachability Problem Forward Reachable Set

Computational Tools n Verification based on Modal Checking Finite Automata COSPAN SMV VIS …

Computational Tools n Verification based on Modal Checking Finite Automata COSPAN SMV VIS … Timed Automata Timed COSPAN KRONOS Timed HSIS VERITI UPPAAL Linear Automata Linear Hybrid Systems Hy. Tech Requiem Post 23(x 1) Post 2 r(x 2) Postr(F) Post[0, r](F) x 1 d/dt Check. Mate Post 2 r(F) Post[0, 2 r](F) Postr(x 1) Nonlinear Hybrid Systems F x 2 Postr(x 2)

Computational Tools n Simulation n Ptolemy II: ptolemy. eecs. berkeley. edu n Modelica: www.

Computational Tools n Simulation n Ptolemy II: ptolemy. eecs. berkeley. edu n Modelica: www. modelica. org n SHIFT: www. path. berkeley. edu/shift n Dymola: www. dynasim. se n Om. Sim: www. control. lth. se/~cace/omsim. html n ABACUSS: yoric. mit. edu/abacuss. html n Stateflow: www. mathworks. com/products/stateflow n CHARON: http: //www. cis. upenn. edu/mobies/charon/ n Masaccio: http: //www-cad. eecs. berkeley. edu/~tah/Publications/masaccio. html

Computational Tools n Simulation Masaccio CHARON Ptolemy II Dymola Modelica State. Flow/Simulink System Complexity

Computational Tools n Simulation Masaccio CHARON Ptolemy II Dymola Modelica State. Flow/Simulink System Complexity ABACUSS SHIFT Om. Sim Models of Computation

Hybrid Modeling of Sensor Networks n Hy. Tech n Verifies functional and temporal properties

Hybrid Modeling of Sensor Networks n Hy. Tech n Verifies functional and temporal properties of linear hybrid automata n n Based on Model Checking and providing debugging traces Hybrid Automaton with flows which are linear in time n SHIFT n Models and simulates dynamic networks of hybrid automata n n Components created, interconnected, destroyed as the system evolves Components interact through their inputs, outputs and exported events

Hybrid Modeling of Sensor Networks n Hy. Tech Example start of an execution of

Hybrid Modeling of Sensor Networks n Hy. Tech Example start of an execution of the timed automaton

Hybrid Modeling of Sensor Networks n Hy. Tech Reachability Problem: Starting from somewhere in

Hybrid Modeling of Sensor Networks n Hy. Tech Reachability Problem: Starting from somewhere in an initial set, would the set of states eventually reach somewhere in the target set?

Hybrid Modeling of Sensor Networks n Hy. Tech Equivalent Classes 12 x 2 30

Hybrid Modeling of Sensor Networks n Hy. Tech Equivalent Classes 12 x 2 30 x 2 18 x 2 Every point in an equivalent class has the same reachability property.

Hybrid Modeling of Sensor Networks n Hy. Tech Equivalent Classes 12 x 2 30

Hybrid Modeling of Sensor Networks n Hy. Tech Equivalent Classes 12 x 2 30 x 2 18 x 2 Idea: The reachability problem for timed automaton (Transition System) can be answered on a FSM (Quotient Transition System) which is defined on the quotient space of the bisimulation.

Bisimulation-based Abstraction n Transition System n To study the reachability properties of time automata,

Bisimulation-based Abstraction n Transition System n To study the reachability properties of time automata, each timed automaton is converted into a transition system. Both initial and final sets are union of equivalence classes n Consider the equivalence relation, we have the following definitions:

Bisimulation-based Abstraction n Transition System

Bisimulation-based Abstraction n Transition System

Bisimulation-based Abstraction n Consider the transition system and the equivalence relation, we have the

Bisimulation-based Abstraction n Consider the transition system and the equivalence relation, we have the following result: n Therefore, one can define the reachability preserving quotient system of the transition system

Bisimulation-based Abstraction n Transition System and its Quotient System

Bisimulation-based Abstraction n Transition System and its Quotient System

Overall View of Tiny. OS Automata application sensing application transmit_packet receive_pack Radio Packet rx_byte_

Overall View of Tiny. OS Automata application sensing application transmit_packet receive_pack Radio Packet rx_byte_ tx_byte_ ready byte tx_ byte packet_ done_neg packet_ done_pos post_decode Radio byte rfm_ rx_ev rfm_rx_ comp bit rfm_ tx_ev post_encode rfm_tx_ comp rfm_rx_comp Task handler rfm_tx_comp RFM rfm_clock Packet generation

Packet Generation and Application Automata Application Packet_generation idle rt>= cbit_time / rt’=0, pt’=pt+1, sync

Packet Generation and Application Automata Application Packet_generation idle rt>= cbit_time / rt’=0, pt’=pt+1, sync rfm_clock rt<=cbit_time pt<=cidle drt=1 rt=0, pt=0 pt>=cgeneration/ pt>=cidle/ rt’=0, bit’=0, rt’=0, bit’=1, pt’=0, sync rfm_clock rt<=cbit_time pt<=cgeneration drt=1 rt>=cbit_time/ rt’=0, pt’=pt+1, generate sync rfm_clock cbit_time cidle cgeneration at>=cbetween/ at’=0, sync transmit_pack at=0 at<=cbetween dat=1 sync receive_pack/ at’=0, sync trans_packet

Radio Byte rfm_rx_comp From Tiny. OS to Hytech rfm_rx_ev RFM Bit rfm_clock Packet Gen.

Radio Byte rfm_rx_comp From Tiny. OS to Hytech rfm_rx_ev RFM Bit rfm_clock Packet Gen. RFM Energy spent by the transceiver RFM receive drfmt=0 sync rfm_clock/ rfmt’=0, energy’=energy+crec rfmt<=crec_handler drfmt=1 rec_energy transmit sync rfm_rx_comp/ sync rfm_tx_comp/ drfmt=0 sync rfm_tx_comp/ sync rfm_clock/ rfmt’=0, energy’=energy+ctrans drfmt=0 rfmt>=crec_handler/ sync rfm_rx_ev drfmt=0 rec_wait trans_wait rfmt<=ctrans_handler drfmt=1 rfmt>=crec_handler/ sync rfm_tx_ev trans_energy

From Tiny. OS to Hy. Tech Task Handler Energy spent by processing events exec

From Tiny. OS to Hy. Tech Task Handler Energy spent by processing events exec idle sync rfm_rx_comp | sync rfm_tx_comp / sync rfm_clock/ dht=0 dct=0 denergy=cactive sync encode/ ht’=cencode, ct’=0 op-exec sync decode/ ht’=ht+cdecode, ct’=0 sync rfm_rx_comp | sync rfm_tx_comp / dht=0 sync encode/ dct=0 ht’=ht+cencode, denergy=cactive ct’=0 ct>=ctask_post/ sync post_task_done ht<=0/ op ht>=0 dht=-1 dct=0 denergy=cactive Energy spent by sync rfm_clock/ posting tasks sync decode/ ht’=cdecode, ct’=0 ct<=ctask_post dht=0 dct=1 denergy=cactive dht=0 dct=0 denergy=cinactive op-wait Energy spent by processing tasks

Verification of Tiny. OS with Hy. Tech Packet Level … Byte Level RFM Bit

Verification of Tiny. OS with Hy. Tech Packet Level … Byte Level RFM Bit Level transmitting idle receiving packet level byte level

Verification of Tiny. OS with Hy. Tech n Analysis commands for verification: init_reg :

Verification of Tiny. OS with Hy. Tech n Analysis commands for verification: init_reg : = …. . ; final_reg : = loc[rpacket]=transmit & loc[rbyte]=receive; reached : = reach forward from init_reg endreach; if empty(reached & final_reg) then prints “working fine” else print trace to final_reg using reached; endif;

Power Analysis of Tiny. OS with Hy. Tech n Power analysis through variable energy

Power Analysis of Tiny. OS with Hy. Tech n Power analysis through variable energy by using trace generation power feature of Hy. Tech by setting n final_reg = t>300000; n Power Consumption vs. # of Children

Hybrid Modeling of a Sensor Network n Uniform Distribution n 100 node n 100

Hybrid Modeling of a Sensor Network n Uniform Distribution n 100 node n 100 m x 100 m n 4 Macro Clusters n Children determined according to position distribution

Hybrid Modeling of a Sensor Network n 4 Types of Node Automata. n Create

Hybrid Modeling of a Sensor Network n 4 Types of Node Automata. n Create an instance for each node. n Destroy the instance when the node dies. n Distribute the load to its group. n Notify upper group when there is a death.

Hybrid Modeling of a Sensor Network n SHIFT - Describes dynamic networks of hybrid

Hybrid Modeling of a Sensor Network n SHIFT - Describes dynamic networks of hybrid automata Components created, interconnected, destroyed as the system evolves n Components interact through their inputs, outputs and exported events n

Model of a node x – Consumed energy f – Power consumption S –

Model of a node x – Consumed energy f – Power consumption S – Group of nodes

Validation Results n Need powerful nodes in group 1. n Group 1 suffers from

Validation Results n Need powerful nodes in group 1. n Group 1 suffers from high load and backoff time. n Group 4 dies at the same time.

Conclusion n Sensor nodes are aimed to be left without maintenance. n Verification is

Conclusion n Sensor nodes are aimed to be left without maintenance. n Verification is needed for reliability. n Power is a detrimental concern in sensor world. n Power analysis is needed for the life time of the node. n Network power analysis is needed for the life time of the network. n Modeling and Analysis are based on Hybrid Automata n Verification and Power analysis with Hy. Tech. n Network power analysis with SHIFT.

End

End