1 / 34

Design Methodology for State based Embedded Systems Case Study: Robot Controller

Design Methodology for State based Embedded Systems Case Study: Robot Controller. Phaneendra Vanka Graduate Student (Masters’ Program). Contents. Introduction Demo Design Methodology for Time-Triggered State Machine based systems Case Study: Robot Controller Questions. Introduction.

tirza
Download Presentation

Design Methodology for State based Embedded Systems Case Study: Robot Controller

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Design Methodology for State based Embedded SystemsCase Study: Robot Controller Phaneendra Vanka Graduate Student (Masters’ Program)

  2. Contents • Introduction • Demo • Design Methodology for Time-Triggered State Machine based systems • Case Study: Robot Controller • Questions

  3. Introduction

  4. Behavior Control • Behavior – tasks that process external/internal sensory information and issues an action. • Reactive robot control architecture. • Complex behavior – series of alternations of simple behaviors. • Hierarchical Model.

  5. LEGO MINDSTORMS • Robotics Invention System Kit consists of motors, touch sensors, light sensors, bricks, gears etc. • RCX Brick - Hitachi H8/3292 series microcontroller. - 16 MHz of clock speed. - 16Kb ROM. - 32 Kb external RAM.

  6. leJOS • Java Platform for the RCX Brick. • leJOS API - java.lang, java.util and java.io - classes to control motors, sensors, buttons, IR communication, navigation etc.

  7. Behavior Control API Behavior boolean takeControl( ) void action( ) void suppress( ) Arbitrator public Arbitrator (Behavior[ ] behaviors)

  8. Robot Controller • A modification of the Navigator robot as given in Brian Bagnall’s book “Core Lego Mindstorms Programming”. • Sensors and Inputs: Touch sensor, Timer and two Rotation Sensors. • Actuators: Three motors.

  9. Behavior’s of Robot Controller • MOVE (true): • Travel to a random point • COMMAND (Input from IR transceiver): • Travel to a predefined point. If there is an obstacle go around that obstacle • BUMP (Input from touch sensor): • Travels 20 units in backward direction. • GO HOME (Timer as input): • Travel to the starting point • ARM ROTATE (Timer as input): • Rotate the arm .

  10. Robot Controller’s Behavior Model Timer GO HOME S Touch Sensor BUMP S COMMAND Command Default Motors MOVE S Timer ARM ROTATE S Point of Suppression

  11. DEMO

  12. Design Methodology for Time-Triggered State Machine based systems

  13. Rational Unified Process Class Diagrams Use-Case realizations Actors Use-Cases Implementation Use-Case Model (what) Analysis/Design (how) Actual code

  14. Use-Case realizations WAKEUP WAIT

  15. Use-Case realizations with asynchronous waits • Allocating a thread for each scenario with synchronization code • Finite State Machine based implementation

  16. Allocating a thread for each scenario Class Diagrams Use-Case realizations Actors Use-Cases Component code Identify regions in which synchronization is required Complete code Global invariants (patterns) Coarse-grained solution Fine-grained code A Structured Approach to Develop Concurrent Programs in UML, Masaaki Mizuno, Gurdip Singh, Mitchell Nielsen

  17. Finite State Machine based implementation Revised Class Diagram Scenarios for threads Actors Use-cases Class Diagrams Use-case realizations Original Class Diagram + State information + Active Classes Implementation Time Triggered

  18. Event Triggered Systems Boundary Class Other Classes

  19. Time Triggered Systems Boundary Class Active Class Other Classes

  20. From the above discussion we have the following combinations • Time Triggered State Machine based implementation • Event Triggered Thread for each scenario

  21. Case Study : Robot Controller

  22. Use Cases for Robot Controller • MOVE (true): • Pick up a random point (x,y) to reach. • Calculate the angle and distance to (x,y). • Rotate for the angle and travel the distance in straight line. • COMMAND (Input from IR transceiver): • Calculate the angle and distance to (MAXX, MAXY). • Rotate for the angle and travel the distance in straight line. • BUMP (Input from touch sensor): • Travel 20 units in backward direction. • 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. • ARM ROTATE (Timer as input): • Rotate the arm in forward direction for 2 seconds • Rotate the arm in backward direction for 2 seconds STEER (Inputs from Rotation Sensors): • Uses rotation sensor to find angle rotated and distance traveled. • Keeps the travel in straight line.

  23. Use Case Model for Robot Controller

  24. Class Diagram

  25. Use Case Realization Example Robot Controller : MOVE Behavior Wait Until MOVE is triggered Pick a new point (x, y) Calculate angle and distance Start the motors Wait Until required angle is rotated Stop motors Update geometry Start the motors Wait Until required distance is traveled Stop motors Update geometry

  26. Use Case Realization Example Robot Controller : MOVE Behavior Asynchronous waits Wait Until MOVE is triggered Pick a new point (x, y) Calculate angle and distance Start the motors Wait Until required angle is rotated Stop motors Update geometry Start the motors Wait Until required distance is traveled Stop motors Update geometry

  27. Finite State Machine Method actions • Each behavior is a set of actions. • After completing one action it goes to the next action of the behavior. • Describe the entire system using finite state machine. • Allocate threads to traverse through the state machine. • Needs only mutual exclusion of shared variables. Behavior Action

  28. Use Case Realization Example States Tippy Senior : MOVE Behavior Wait Until MOVE is triggered Pick a new point (x, y) Calculate angle and distance Start the motors Wait Until required angle is rotated Stop motors Update geometry Start the motors Wait Until required distance is traveled Stop motors Update geometry

  29. Revised Class Diagram

  30. Use Case Realization Example Arbitrator Tippy Senior : MOVE Behavior Wait Until MOVE is triggered Pick a new point (x, y) Calculate angle and distance Start the motors Wait until required angle is rotated Stop motors Update geometry Start the motors Wait Until required distance is traveled Stop motors Update geometry Rotation Sensor Thread

  31. Arbitrator thread Action (GO HOME) takeControl GO HOME Action (BUMP) takeControl BUMP takeControl COMMAND DONE takeControl MOVE Action (COMMAND) Action (MOVE)

  32. Rotation Sensor Thread Action (GO HOME) takeControl GO HOME Action (BUMP) takeControl BUMP takeControl COMMAND DONE takeControl MOVE Action (COMMAND) Action (MOVE)

  33. Acknowledgement • Dr. Masaaki Mizuno • Dr. Gurdip Singh • Dr. Mitchell Nielsen

  34. Questions ???

More Related