Answer Key: Decisions, Decisions_Unit_Level

Answer Key: Unit Quiz

  1. The flower icon identified the near branch and the mountain icon identifies the far branch.
  2. No, the Switch-Loop is not “special”, it just combines a switch block and a loop in a powerful way.  For Obstacle Detection, the Switch-Loop works by having the Switch block constantly check whether or not an obstacle is present (and stop if it is, Move unlimited if it isn’t) and continue this quick check for as long as the Loop Control specifies.
  3. The tribot will continue to follow the edge of the line for the specified length of time.  Knowing the speed of the tribot will allow you to control the distance the line followers travels by controlling the length of time the line-follower Loop runs.
  4. Senor and Logic inputs can both control the Loop, or it can be set to run forever
  5. The Switch block is controlled by the light sensor.  If the sensor sees “light” (above the threshold) the tribot turns toward the line, and if the sensor sees “dark” (below the threshold) the tribot turns off the line.
  6. Optimized Line Following adjusts the power of the Move blocks (speed of tribot) to go faster on straight sections and more slowly on curves.  In NXT-G this is done by changing the stopped Move blocks to forward Move blocks (but at a lower power setting than the other motor, so the tribot still turns) for straight line following.  For tight curves, the power on the Move blocks are reduced so the tribot does not turn as abruptly (and won’t unintentionally cross over to the other side of the line).
  7. Ziffle’s program will not detect obstacles constantly.  Since the Move block on the “far” branch is set to move for a fixed number of rotations, the robot will move forward this set amount before it checks the Ultrasonic sensor again.  For continuous obstacle detection, Ziffle needs to set the “far” Move block with unlimited duration.
  8. The robot will check for obstacles continuously, however, it will do this forever, not just for 10 rotations.  Ziffle set the Loop Control to use a rotation sensor, but she left the sensor on the default “Port A” setting.  Since the robot’s movement is being controlled with Motor B & C, Motor A will never move the 10 rotations required to end the loop.  The Port on the Loop Control rotation sensor needs to be set to B or C for the robot to move just 10 rotations.
  9. The robot will move the length of one side of the square, and then make four 90 degree turns with no straight moves in between.  The reason for this is that the rotation sensor is cumulative and once the number of rotations are reached to exit the inner loop the first time, the program will immediately exit the inner loop on each of the subsequent passes.  In order for this program to work as intended, Ziffle must reset the rotation sensor to zero before entering the inner loop.
  10. A) To move faster on a straight line, Ziffle should change the Move “Stop” blocks to Move unlimited with a low power setting (lower than the second Move block, otherwise the robot will not turn in the desired direction)
    B) To negotiate a sharper turn, Ziffle needs to reduce the power setting on the Move blocks, so the robot does not turn all the way across the line.