13.07.2015 Views

Chapter D Finite State Machines

Chapter D Finite State Machines

Chapter D Finite State Machines

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Question 7. Design an FSM controller for a safe lock. The lock should only open ifthe sequence RLLRR is received. Any other sequence should sound the alarm.ACTIVITIES 2Question 8. Load up the FSM Robot Simulator from HERE. Unzip the folder anddrop on your desktop. Now double click on the executable jar file *.jar" Note this isexperimental software currently under development for you. The version we are usingtoday is still a little rough. Fingers crossed.1.1 Make a FSM Table so that the robot will move forwards until its left bumper hits.Then it should move backwards for ever. Load RWorld1.1.2 Make a FSM Table so that the robot moves forwards until it hits the obstaclewhen it should turn right (clockwise) until its bumper is clear, when it should gostraight on.1.3 Single step the machine (brown man). Confirm your expectations. What happenswhen the robot hits the wall? Why does it not respond to the wall?Question 9. Load up "Controller 1" and "World4". The FSM was designed to allowthe robot to move in and then out of the channel. But there's a mistake and it doesn'twork well.9.1 Observe the behavior of the robot.9.2 Look at the FSM table and work out what is going on9.3 There is an error in the table. Find it and correct it. Demonstrate the correct codeto your tutor or friend.Question 10. Let's say we want to get the robot to go around the edge of a squareblock. We could use its left feeler to probe for the edge of the block, and use this leftfeeler as the robot moves around the block. Consider the left feeler touching theblock. How should we instruct the robot to move? Consider the left feeler nottouching the block - the robot is moving away from the block. How should we instructthe robot to move?Drawa state diagram for this problem. Fill out a FSM table and try out your solutionusing "World2" One correct solution is found in "Controller2.txt"ACTIVITIES 3 Digital Electronic <strong>Finite</strong> <strong>State</strong> Machine

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!