CS684: Embedded System Course

Lab 1: Draw FSM for Line Following


LEARNING RESOURCES

AIM

  • You have to build a FSM for Line Following. You are allowed to go for Moore or Mealy Machine.

  • Objective is to move the robot from Start (S) to End (E) location. [Refer following diagram]

    Alt text

Note: The above image only gives an abstraction of some random path. It is just for reference. It will help you to build different states accurately.

Hint: According to given path, whenever robot encounters an intersection, it should take a respective turn which will lead the robot to End location. (This assumption helps to reduce the number of states in FSM)

  • Inputs for the FSM: 5 White Line Sensors.
  • Outputs for the FSM: 2 for controlling the motion of the Robot based on its direction.
  • Inputs should be taken as binary values while building the FSM in Qfsm.
  • There can be N number of WLF Readings combinations that one can get.
  • The following table shows few such cases:
WLF ReadingsImages
11111Alt text
00100Alt text
00010Alt text
01000Alt text
11100Alt text
  • Outputs:
    • Both outputs are used for Direction of robot.
    • Representation of bits for output: 0 for stop, 1 for forward and -1 for backward.

    Here we are talking about a particular wheel.

    • Following table shows the combination of both the wheels on Robot movement:
Output CombinationsAction
0, 0Stop
1, 1Forward
-1, -1Backward
0, 1Left adjust by 10 deg with Forward
1, 0Right adjust by 10 deg with Forward
0, -1Left adjust by 10 deg with Backward
-1, 0Right adjust by 10 deg with Backward
-1, 1Sharp Left by 10 deg
1, -1Sharp Right by 10 deg
  • Consider the following scenario in which the robot is attempting to align itself by adjusting in the correct direction. This is how the robot will move for two consecutive 10 output combinations.
Alt text
  • Using the above information, draw FSM for Line following of the robot along with states added for describing the stratergy to move the robot from S to E locations.

You are free to make assumptions regarding readings of white line sensors at different instances, distance covered by robot for different motions in single step, distances regarding the paths given in the arena image.


Submission Instructions

  • For Lab-1 submission you have to upload a .tar.gz file.
  • Folder should contain following:
    1. .fsm file: source file of QFSM
    2. .doc file:
    • Containing information about the startergy used, assumptions made and description about the FSM, inputs used for simulation and outputs obtained in a tabular form.
    • Also add youtube link of the video - shoot the screen recording of the simulation of FSM in QFSM for atleast 20 steps with different input combinations.
  • Compress the folder and rename it as <RollNo>_Lab_1.tar.gz
  • Upload the file on Moodle

    Note: Make sure

    • that .fsm file is simulatable on Qfsm
    • to add RollNo in your file name