Instruction Guide: Move until Touch

In this lesson students explore the use of the touch sensor.

Have students work through the "Move Until Touch" lesson on the "Behaviors" page of  "NXT Video Trainer 2.0".

Students should be able to answer all the review questions at the end of each step and end up with a solid command of each parameter in the Wait-until-Touch block configuration panel and an understanding of how the touch sensor works.

As students progress through, have them document their milestones in the Move Until Touch Task Assignment Sheet.

This Task Assignment has two teacher sign-offs, here's what to look for in each:

Vacuum Challenge

This page contains a copy of this challenge from "NXT Video Trainer 2.0."

  • This is great opportunity to reinforce the idea that the solution to most robotics challenges are a trade-off between hardware and software
    • Some students will invest the time to build the prescribed "Touch+Light Attachment"
      • This investment of time will pay off by allowing the tribot to detect the walls even when approached at very acute angles, thus allowing their software to be less precise and faster to develop/debug.
    • At the other extreme, some students will make a minimal investment in hardware design and simply attached a touch sensor protruding from the front of the tribot
      • This approach will work well when the tribot approaches a wall at, or near, a right angle
      • This requires the software to be much more precise in its turns and makes it very sensitive to its initial starting position
      • If students succeed with this approach by eventually tweaking their software to work with a predetermined starting position, have them run their program with the touch sensor pointed directly toward a corner
        • The tribot will collide with the corner, but the touch sensor will not depress, so the tribot will sit there literally "spinning its wheels"
      • Ask these students to come up with a hardware solution to this problem.
      • A robust design is all was better than a sensitive one.
    • Ideally, some students (either on their own or prompted in the above scenario) will realize the axle fitting on the end of the touch sensor can be used to fashion a simple bumper which will improve the range of angles over which the touch sensor will respond as desired
      • This approach is much simpler, quicker and uses fare fewer parts than the prescribed "Touch+Light Attachment"
        • This attachment provides both a light sensor capability and a bump/release capability - neither of which is required for this challenge
      • Over designing hardware solutions (to add capabilities not useful in the task at hand) can be costly in both time and resources.
  • Have the students explain their tribot hardware, and explore the different approaches to bumper design they considered
  • Have the students explain their program to ensure both team members understand the operation of the touch sensor block
    • Start with their flow chart/pseudocode to get an overall view of the program
    • Use the NXT-G program to show how each block in the flow chart was implemented

Forward Until Release

  • Student actually complete this activity before the Vacuum Challenge during the Video Trainer 2 lesson. We revisit it here to ensure students fully understand the difference between the "Release" and "Bump" options inside the Touch Sensor Block..
  • Have students show their "Wait for Release" demonstration from Step 6 in NXT Video Trainer 2.0. This involves having the tribot initially in contact with a relatively heavy object, and having the tribot push forward until the object falls off a ledge - at which point the tribot stops before also falling off.
    • Replace the object with a very light object.
    • When initially positioned in contact with the tribot, the tiny spring in the touch sensor (see the spring in the animation of Step 7) will push the very light object forward so the touch sensor switch is open. Although the tribot is touching the object, it will not depress the touch sensor.
    • Have the student run their program again - nothing will appear to happen (motors actually turn on, but then immediately turn off since the wait-for-release block is satisfied instantly and the motors then stop immediately).
    • Have the students explain this behavior - the touch sensor needs to initially be depressed in order for the wait-for-release to work as intended (just as the wait-for-press needed to be initially released for the Vacuum Challenge to work as intended).
    • If necessary, use the animation in Step 7 to help
  • Go back to the heavy object and place it in front of, but not touching, the tribot. Tell the students you want the tribot to push this object off the ledge and stop.
    • Have them run their program - similar to the above example, the tribot will appear to do nothing since the touch sensor is already in the released position as the program is started
    • Ask the students how they could modifying their program, without adding any blocks, to achieve the desired behavior
    • The goal here is to have students realize that a wait-until-bump action will perform this function
  • Ensure the students can now explain the difference between the "pressed", "released" and "bumped" actions with the touch sensor