design methodology for state based embedded systems case study: maze navigator
DESCRIPTION
Design Methodology for State based Embedded Systems Case Study: Maze Navigator. Vivek Subramaniam Graduate Student (Masters’ Program). Contents. Introduction Design methodology for state based time triggered systems Case Study: Maze Navigator Demo Questions. Introduction. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/1.jpg)
Department of Computing and Information SciencesKansas State University
Design Methodology for
State based Embedded SystemsCase Study: Maze Navigator
Vivek SubramaniamGraduate Student (Masters’
Program)
![Page 2: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/2.jpg)
Department of Computing and Information SciencesKansas State University
Contents
Introduction Design methodology for state based
time triggered systems Case Study: Maze Navigator Demo Questions
![Page 3: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/3.jpg)
Department of Computing and Information SciencesKansas State University
Introduction
![Page 4: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/4.jpg)
Department of Computing and Information SciencesKansas State University
Behavior Control
Behavior – tasks that process external/internal sensory information and issues an action.
Complex behavior – series of alternations of simple behaviors.
Hierarchical Model. Reactive robot control architecture.
![Page 5: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/5.jpg)
Department of Computing and Information SciencesKansas State University
Behavior Control API
Behaviorboolean takeControl( )void action( )void suppress( )
Arbitratorpublic Arbitrator (Behavior[ ]
behaviors)
![Page 6: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/6.jpg)
Department of Computing and Information SciencesKansas State University
Time triggered Architecture
Initiated at predetermined instances of real-time.
Event inputs or interrupts are queued and polled periodically.
Relatively easy to validate, test and certify.
![Page 7: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/7.jpg)
Department of Computing and Information SciencesKansas State University
Maze Navigator
A modification of the Navigator robot as given in Brian Bagnall’s book “Core Lego Mindstorms Programming”.
Sensors and Inputs: Touch sensor, Light Sensor, Timer and two Rotation Sensors.
Actuators: Two motors. Due to limitations of system, a
simulation was developed
![Page 8: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/8.jpg)
Department of Computing and Information SciencesKansas State University
Maze Navigator’s Behavior Model
HOMEHOME
BUMPBUMP
MOVEMOVE
Light SensorLight
Sensor
Touch SensorTouch Sensor
MotorsMotors
SS
SS
SS Point of Suppression
TrueTrue
![Page 9: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/9.jpg)
Department of Computing and Information SciencesKansas State University
Design MethodologyFor
State based Time Triggered systems
![Page 10: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/10.jpg)
Department of Computing and Information SciencesKansas State University
Definition
“Rational Unified Process (RUP) is a framework that can be used to describe specific development process”
- Grady Booch
![Page 11: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/11.jpg)
Department of Computing and Information SciencesKansas State University
Rational Unified Process
ActorsUse-Cases
ActorsUse-Cases
Class DiagramsUse-Case Realizations
Class DiagramsUse-Case Realizations ImplementationImplementation
Use-Case Model(what)
Analysis/Design Models(how)
Actual Code
![Page 12: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/12.jpg)
Department of Computing and Information SciencesKansas State University
Use-Case Realization
WAITWAKEUP
![Page 13: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/13.jpg)
Department of Computing and Information SciencesKansas State University
Use-case realizations with asynchronous waits
Allocating a thread per scenario with Synchronization
Finite State Machine based Implementation
![Page 14: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/14.jpg)
Department of Computing and Information SciencesKansas State University
RUP for Concurrent Programs using Synchronization
ActorsUse-cases
ActorsUse-cases
Class DiagramScenarios
Class DiagramScenarios
Component Code
Component Code
Complete code
Complete code
Global invariants(patterns)
Global invariants(patterns)
Coarse-grained solution
Coarse-grained solution
Fine-grained
code
Fine-grained
code
RUP
Synchronization aspect code development
Specify global invariant
Scenarios identify synchronization regions in which synchronization is required
(A structured approach to develop concurrent programs in UML)
![Page 15: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/15.jpg)
Department of Computing and Information SciencesKansas State University
RUP for time triggered systems using FSM
ActorsUse-Cases
ActorsUse-Cases
Class DiagramsUse-Case realizations
Class DiagramsUse-Case realizations
Revised Class Diagrams
+Scenarios for
threads
Revised Class Diagrams
+Scenarios for
threads
ImplementationImplementation
Use-Case Model
(what)
Analysis/Design Models
(how)
Actual Code
Original Class Diagram +
State information + Active Classes
![Page 16: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/16.jpg)
Department of Computing and Information SciencesKansas State University
Event Triggered Systems
Boundary ClassesBoundary Classes Other ClassesOther Classes
The flow of control is from the Boundary Classes to other classes
![Page 17: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/17.jpg)
Department of Computing and Information SciencesKansas State University
Time Triggered System
Boundary ClassesBoundary Classes Active ClassesActive Classes Other ClassesOther Classes
The flow of control is from Active class to boundary and other classes.
![Page 18: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/18.jpg)
Department of Computing and Information SciencesKansas State University
From this discussion we can see that we have these four options.
Event TriggeredEvent Triggered
Time TriggeredTime Triggered Allocating threadPer scenario
Allocating threadPer scenario
Finite StateMachine
Finite StateMachine
![Page 19: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/19.jpg)
Department of Computing and Information SciencesKansas State University
Methodology
Identify the Use Cases Describe the Use Case realizations
and class diagrams Identify states and thread scenarios Revise Class Diagram and use-case
realization Form the Finite State Machine
Translate to code
![Page 20: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/20.jpg)
Department of Computing and Information SciencesKansas State University
Case Study: Maze Navigator
![Page 21: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/21.jpg)
Department of Computing and Information SciencesKansas State University
Use Cases for Maze Navigator MOVE (true):
Scan for an unvisited/ least visited cell. Determine random No. of steps in the direction of
picked cell. Travel the required No. of steps in that direction.
BUMP (Input from touch sensor): Travels back to the last cell location.
GO HOME (Timer as input): Calculate the angle and distance for initial point (0,0). Rotate for the angle and travel the distance in straight
line. STEER (Inputs from Rotation Sensors):
Uses rotation sensor to find angle rotated and distance traveled.
Keeps the travel in straight line.
![Page 22: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/22.jpg)
Department of Computing and Information SciencesKansas State University
Use Case Model for Maze Navigator
true
Rotation Sensor(right)
Touch Sensor
Light Sensor
Maze Navigator
Motor (right)
Move
Bump
Home
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Rotation Sensor (left)Motor (left)
1
1
1
1
11
1
1
1
1
1
1
Steer
1
1
1
1 1
1
1
1
![Page 23: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/23.jpg)
Department of Computing and Information SciencesKansas State University
Class Diagram
Rotation Sensor
+get direction()+get steps()+travel()+forward()+backward()+stop()+get current state()+set current state()+get command()+set command()
Rotation Navigator
Motor
Touch Sensor
Light Sensor
Move Bump Home
Navigator
11
1
1
+take control()+suppress()+action()
«interface»Behavior
2
1
1 2
1
1
1
11
1
![Page 24: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/24.jpg)
Department of Computing and Information SciencesKansas State University
Use Case Realization Example
Scan for a unvisited or least visited cellCalculate random No. of steps to take in
that directionCalculate angle and distanceStart the motorsWait Until required angle is rotated.Stop motorsUpdate geometryStart the motorsWait Until required distance is traveledStop motorsUpdate geometry
Maze Navigator : MOVE Behavior
Asynchronous waits
![Page 25: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/25.jpg)
Department of Computing and Information SciencesKansas State University
Revised Use Case Realization ExampleWait until input trigger
Move Behavior :Scan for unvisited/ least visited cellCalculate random steps in that cells
directionCalculate angle and distanceStart the motors Wait Until required angle is rotated.
Stop motorsUpdate geometryStart the motorsWait Until required distance is traveledStop motorsUpdate geometry
States
Arbitrator thread
Rotation Sensor thread
![Page 26: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/26.jpg)
Department of Computing and Information SciencesKansas State University
takeControlC
takeControlB
takeControlA
actionA
actionC
actionB
Arbitrator thread
Rotation sensor thread
DONE
Finite State Machine Method – Action Call
Legend:
![Page 27: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/27.jpg)
Department of Computing and Information SciencesKansas State University
Revised Class Diagram
+get next state()+set next state()+get action()+set action()
-next state
State Table
+get current state()+set current state()+next state()
Rotation sensor thread
Rotation Sensor+get direction()+get steps()+travel()+forward()+backward()+stop()+get current state()+set current state()+get command()+set command()
Rotation Navigator
Motor
Touch Sensor
Light Sensor
Arbitrator
Current State
Move Bump Home
Navigator
1
1
1
1
+take control()+suppress()+action()
«interface»Behavior
1
1
1
1
2
1
1
1
11
1 2
1
1
1
1
1
111
![Page 28: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/28.jpg)
Department of Computing and Information SciencesKansas State University
Demo
![Page 29: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/29.jpg)
Department of Computing and Information SciencesKansas State University
Acknowledgement
Dr. Masaaki Mizuno Dr. Rodney R. Howell Dr. Mitchell L. Nielsen
![Page 30: Design Methodology for State based Embedded Systems Case Study: Maze Navigator](https://reader036.vdocument.in/reader036/viewer/2022062408/56813a38550346895da221e9/html5/thumbnails/30.jpg)
Department of Computing and Information SciencesKansas State University
Questions ???