Evaluation in Engineering Design Process Modeling and FSM

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

Unit 7 Discrete Controllers
Algorithm and Complexity Analysis
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
Finite state machines.
Finite State Machines Control Circuits Example: Vending Machine Takes only quarters and dollar bills Won't hold more than $1.00 Sodas cost $.75 Possible.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
ENGG1100 Lecture7: Introduction To Engineering Design (Digital Logic) Part 2 Kin Hong Wong ENGG1100. Ch7-Digital Logic (part 2) 16/02/15 1.
Open and Closed Loops Standard Grade Computing Studies.
ENGG1100 Introduction to Engineering Design Digital Logic (Part 2) Prof. Kin Hong Wong Department of Computer Science and Engineering.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
Finite-State Machines with Output
Finite State Machines (FSMs) and RAMs and inner workings of CPUs COS 116, Spring 2010 Guest: Szymon Rusinkiewicz.
Control Technology and Automation
Application of Data Programming Blocks. Objectives  Understand the use of data programming blocks and their applications  Understand the basic logic.
Implementing software in IEC Languages in IEC IEC uses the following languages Instruction List – Assembly level programming using.
Finite State Machines (FSMs) and RAMs and CPUs COS 116, Spring 2011 Sanjeev Arora.
DLD Lecture 26 Finite State Machine Design Procedure.
State Table Problem #1 An electronic lock is controlled by a keypad, which has three buttons labeled A, B, and R. The keypad is restricted such that, at.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.

Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
State Machines State diagrams SE-2030 Dr. Mark L. Hornick 1.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
4) Design the logic to control the motor on a simple remote control car. There are two buttons on the remote control for the motor. If neither button is.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
PLC programming Part 3: Problems with solutions. Topics  Every problem is devided into three parts:  Technology description contains the general properties.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Finite State Machines ENGR 110 #7 2016
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
EECE6017C Lab 1 Introduction to Altera tools and Circuit Simulation
AS Computer Studies Finite State Machines 1.
1.3 Finite State Machines.
ROBOTC for VEX Online Professional Development
ROBOTC for VEX On-Site Professional Development
Discrete Mathematics and its Applications
ROBOTC for VEX Online Professional Development
Programming Scratch to Control a K’NEX Fairground Ride
Loops and Switches Pre-Quiz
Beyond the Engineering Design Process -- Business Planning and Market Prediction Case Study: Sonar Panel Capacity Optimization Using Monte Carlo Simulation.
Discrete Mathematics and its Applications
Line Following Behavior
Lecture 24 Logistics Last lecture Today HW7 due today
While Loops and If-Else Structures
An Introduction to VEX IQ Programming with Modkit
Introduction to Sequential Circuits
Discrete Mathematics and its Applications
While Loops and If-Else Structures
Maze Challenge Maze Challenge activity > TeachEngineering.org
While Loops and If-Else Structures
While Loops and If-Else Structures
Lecture 21 Logistics Last lecture Today HW7 due Wednesday
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 24 Logistics Last lecture Today HW7 due today
While Loops and If-Else Structures
Lecture 20 Logistics Last lecture Today Graded HW back today
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Discrete Mathematics and its Applications
While Loops and If-Else Structures
Lego MINDSTORMS EV3.
While Loops And If-Else Structures
Announcements Assignment 7 due now or tommorrow Assignment 8 posted
Finite State Machine Continued
State Machine Design State Machine Design Digital Electronics
Lecture 19 A bigger FSM example: Hungry Robot Ant in Maze.
Discrete Mathematics and its Applications
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

Evaluation in Engineering Design Process Modeling and FSM Yinong Chen 11/10/2018

The Engineering Design Process Define Problem and requirement Research Define Alternative solutions Modeling Analysis Simulation Prototyping Final Selection Implementation and testing

Roadmap: Modeling and FSM 1 Engineering Models Finite State Machine (FSM) Mode 2 3 FSM Application: Vending Machine 4 Different Maze Navigation Algorithms in FSM 11/10/2018

Mathematical Models for Engineering Mathematical Models: Based on logical and quantitative relationships among model components. Deterministic Models: Predictable behavior, always give the same answer each time we run the model. Graph Model Truth table for ALU design Finite State Machine for circuit design and software design Stochastic Models: Element of chance built into model different unpredictable answer each time we run the model Coin flipping experiment Monte Carlo Model Reliability model of computer hardware and software 11/10/2018

Deterministic Model: Finite State Machine (FSM) A truth table specifies the input – output relations of a system, but it does not have states (memory); Many systems need to have states, so that they can complete the computation in a number of steps. A FSM has a finite number of states and transitions between those states: Transitions occur because of inputs Output can be given in any state

Model For a Stateless Vending Machine For a given input, it gives an output immediately Parameters: coins and products Range of values for each parameter: Coins: 1, 5, 10, 25 Products : sicker, candy, pencil, and marker Constraints/Relationships/Solution: Coins Penny (1) Nickel (5) Dime (10) Quarter Products Sicker candy pencil marker 11/10/2018

A Stateless Vending Machine VPL Implementation: No variable is used 11/10/2018

Why does a coin-operated washing machine take all coins at the same time? 11/10/2018

A four-way intersection has red/green traffic lights that are controlled with timers. Traffic can only move in one direction at a time: NS or EW. W E S

A four-way intersection has red/green traffic lights that are controlled with timers. Traffic can only move in one direction at a time: NS or EW. W E S traffic light controller block diagram

A four-way intersection has red/green traffic lights that are controlled with timers. Traffic can only move in one direction at a time: NS or EW. W E S timer expired EW green NS red EW red NS green We can show this graphically with a state diagram. timer expired

timer expired or emergency signal A Finite-State Machine (FSM) is a model of the discrete dynamics of a system that has a finite number of discrete states. Transitions between states are caused by events, such as: - the expiration of a timer - a change in a sensor state diagram EW green NS red EW red NS green timer expired or emergency signal state table current state event next state EW grn/NS rd timer exp EW rd/NS grn

The Traffic Lights by Canary Wharf Tower, East London 11/10/2018

Finite-State Machines are often used to design control systems... When button pressed: If state==open then close Else open Open Close

Finite-State Machines are often used to design control systems... A garage door opening system If the door is closed and I press the button (touch sensor), the door begins to move up. When it reaches the top, the door activates a limit switch (touch sensor) and stops. If the door is open and I press the button, the door begins to move down. When it reaches the bottom, the door activates another limit switch and stops.

Finite-State Machines are often used to design control systems... A garage door opening system block diagram button garage door controller motor door limit switch ...we want to design the controller...

Finite-State Machines are often used to design control systems... A garage door opening system states - door closed - door open - door closing - door opening events - button press - limit switch touched (closing finished or opening finished)

Finite-State Machines are often used to design control systems... button pressed door closed door opening stopped button pressed limit tripped limit tripped door closing door open button pressed

Finite-State Machines are often used to design control systems... button pressed button pressed door closed door opening opening stopped button pressed limit tripped limit tripped button pressed closing stopped door closing door open button pressed button pressed

Example: FSM Vending Machine Takes quarters and dollars only Maximum deposit is $1 (or four quarters) Sodas cost $0.75 Possible Inputs (Events): Deposit quarter (25) Deposit dollar (100) Push button to get soda (soda) Push button to get money returned (ret) States: 0, 25, 50, 75, 100, and state transits on input

Example 3: FSM Vending Machine soda 25 50 quarter quarter quarter return 75 Start quarter dolllar 100 Deposit quarter Deposit dollar Push button to get soda (soda) Push button to return money (ret)

FSM With Additional Memory (Variable) If (Sum>75) Sum = Sum – 75 release soda If Sum < 75, do nothing quarter dollar soda > 0 dollar quarter If (Sum== 75) release soda Sum = Sum + 25 Sum = Sum + 100 return 11/10/2018

Example: FSM Vending Machine 11/10/2018

The Project... An autonomous mobile robot must navigate through a maze. An on-line navigation problem: solving a maze from the inside. An on-line algorithm receives its input gradually rather than all at once. It must make decisions based on this partial input.

DistanceMeasured < 400 FSM of Robot in a Maze DistanceMeasured < 400 rightFinished Start Forward Turning Right Turned Right RightDistance  DistanceMeasured DistanceMeasured >= rightDistance Turning Left resum180Finished leftFinished Resume 180 Turned Left DistanceMeasured < rightDistance 11/10/2018

Greedy Algorithm based on the First Working Solution DistanceMeasured < 400 Turning Left Turned leftFinished Spin 180 DistanceMeasured < 800 DistanceMeasured >= 800 Spin180 Finished Start Forward 11/10/2018

Right-Wall-Following Algorithm Variable BaseDistance = Ultrasonic sensor measure; The robot repeats all the following steps in a loop, until the touch sensor is pressed; Robot moves forward; Robot keeps measures the right side-distance in certain interval, and it compares the newly measured distance with the distance stored in variable BaseDistance . If the distance measured is less than BaseDistance - 5, the robot turns one degree left, and then returns to step 2; If the distance measured is greater than BaseDistance + 5, turns one degree right, and then returns to step 2; If the distance measured greater than BaseDistance + 200, turns 90 degree right, and then returns to step 2; Touch sensor is pressed; robot moves backward 0.5 rotations, and then turns left 90 degree; Return to step 2.

Right-Wall-Following Algorithm Forward a bit then turn Turning Right90 DistanceMeasured > BaseDistance + 400 Turned Right rightFinished Turning Left90 Turned Left leftFinished Touch-Sensor Touched Backward then turn Left 1 degree Right 1 degree Forward DistanceMeasured < BaseDistance - 5 DistanceMeasured > BaseDistance + 5 11/10/2018 Start

Wall-Following Diagram in VPL 11/10/2018

FSM for Hard-Coded Turns using Touch Sensor Backward before turning Left Finished Left Finished Touched Touched FW 1 Turning Left90 Turned Left 1 FW 2 Turning Left90 Turned Left 2 Turned Right 2 Turning Right 90 FW 4 Turned Right 1 Turning Right 90 FW 3 Right Finished Touched Right Finished Touched FW 5 Backward before turning 11/10/2018

FSM to model robot navigation (the ‘right-then-left’ algo) do something ! Forward dist < 400mm Turning Right 90 timer exp Turned Right measure distance dist_left >= dist_right Turning Left 180 or timer exp timer exp Turning right 180 measure distance Turned Left dist_left < dist_right

Implementation of the ‘right-then-left’ FSM