Billings Senior High

Technology Education

Robotics Unit




Go to the CodeCooker Main page

Introduction

In this unit you will learn how robots can be programmed to accomplish a variety of tasks.


The Task

You will follow the steps shown below to program your robot to move, make use of its various on board sensors, and send and receive messages from other robots.


The Resources

You will have the use of the following:

  • a Lego Mindstorms NXT robot, pre-constructed as a “Taskbot”

  • Lego Mindstorms NXT programming software

  • Robotics Engineering Vol.1 software

  • the Challenge Course set up in the classroom


The Procedure

Using the Programming Software

Begin the tutorials in the Robotics Engineering Vol.1 software

Launch the software.

Select Introduction, then select Using the Programming Software

Watch the tutorial. The narration is in text on the screen. Pause and reread sections until you are familiar with how the software works.

Robotics Engineering Vol.1

Basics – Robot Behaviors

Click on Basics.

This page has standard programming examples for many of our standard robot behaviors and the use of the sensors. Click on Move Forward 720 degrees. Click on each block to become familiar with their behavior. You can play a movie that demonstrates the behavior by clicking in Play Movie in the upper right hand corner.

You do not have to view all the behaviors, but refer back to this page when you have a question as how to program a behavior, especially the Advanced Behaviors.

Robotics Engineering Vol.1

Projects

Click on Projects.

You will now work through each of the first five of the six Research Prototype projects and their Investigations to learn how to program the Taskbot.

Begin with Full Speed Ahead.


Research Prototype Show to Teacher Investigation Show to Teacher Extra Credit
1 Full Speed Ahead Robot moves forward and backwards Wheels and Distance
Do Condition 1
Answer your teacher's questions about wheel circumference and distance
2 Right Face Show the bot making a right turn Measured Turns Have the bot draw the circle on the paper. Do the calculations to come up with a formula that gives a number to insert in your Wait Loop to make the bot turn a desired angle. Show your work on the paper with the circle on it. Demonstrate by having your bot turn the angle assigned by the teacher.
You can test your formula with the online calculator here.
Write a Turn Selector Program

  • User selects the angle to turn by using the arrow keys on the bot
  • The selected angle appears on the bot's display screen
  • The left arrow makes the angle shown count down
  • The right arrow makes the angle shown to count up
  • Pressing the orange button causes the bot to turn the selected number of degrees
Click here for a video sample

Move and Turn Test You will be assigned a map number. It is on the robot assignment sheet on the door.

The map has three lines on it that are connect to form the shape of a "Z." The length of each line and the angles between them are shown on the map. Write a program that makes your bot drive the pattern shown by the Z on the map. Use zero-radius turns when you turn the angles.


Click here for a video sample of writing the program
3 Clap On, Clap Off Show the bot starting and stopping on sound commands.


4 Follow the Guidelines Do the tutorial called "Follow the Guidelines" but keep in mind that our bot has a slightly different design. In fact, our bot is set up like the one in the Investigations you'll do to the right. Show the teacher that your bot can follow the test line provided in class. Faster Line Tracking and End of Line Detection Write a program that will move the robot down a line faster than the tutorial program you just completed. There will be a special line provided for the activity.

For extra credit, write a program that follows a line where the sensor stays in the black, rather that following the edge of the line.
5 Obstacle Detection Complete the tutorial called "Obstacle Detection".. Demonstrate the obstacle detection with the touch sensor. Demonstrate the obstacle detection with the ultra-sonic sensor.


Mindstorms NXT Programming Software

Tutorials

After completing the five Research Prototype projects and the five Investigations, in the Robotics Engineering Vol.1, you will do several of the tutorials built into the Mindstorms NXT Programming Software.


Open the Mindstorms NXT Programming Software and on the right-hand side of the screen you should see the section labeled Common Palette and Complete Palette. If they are not visible, click on the orange Technic Beam.



The tutorials in these sections feature a slightly different robot from ours, but the tutorials work the same.


Also, a couple of the tutorials might be missing slides. Go ahead and figure out on your own what should be done in the missing steps.


In the Complete Palette, complete these tutorials:


  • 29 – Bump Counter



Mindstorms Performance Tests

You will now apply what you have learned in the tutorials to a series of problems. Be sure to review the Basics sections of the Robotics Engineering Vol.1 if you get stuck on any of the challenges.

Performance Test #1

Start on Sound, End on Sound




  • Start on a sound

  • Move forward 12 inches

  • Stop

  • Play a sound

Click here for a video sample



Performance Test #2

Forward and Back with Zero Radius Turn




  • Move forward 8 inches

  • Turn 90 degrees to the right

  • Move backward 12 inches

  • Stop

Click here for a video sample


Performance Test #3

Follow the Line and Turn using the Ultrasonic Sensor




  • Follow the line on the board in the classroom

  • Stop 9 inches from an object at the end of the line

  • Make a 90 degree turn to the right

  • Move forward 12”

  • Stop

Click here for a video sample


Performance Test #4

Push Times 6 Inches
  • Use the touch sensor to count how many times it is pressed

  • Use the sound sensor to start the movement

  • Move forward the number of times the touch sensor was pressed times 6 inches

Click here for a video sample




Performance Test #5

Line Counter/Spinner

Your bot will drive over a piece of paper that has black lines on it that will be perpendicular to your direction of travel. The lines will be about 2-3 inches apart. The paper will be about 18 inches long.

As your bot drives over the line, count them. When you finish counting, your bot will stop and then it will do X number of zero radius 360 degree turns where X is equal to the number of lines you counted.

Additional requirements:
  • start by pressing the touch sensor
  • prior to starting, display a message showing the finger pushing a button and under that the text: "PressTouch Sensor"
  • when it is done spinning, show on the screen "Spins" followed by the number of spins it did (hold on screen for 5 seconds)


Click here for a video sample counting 4 lines
Click here for a video sample counting 2 lines




Performance Test #6

Drag Race


You will have your robot follow a line to its end, turn around, and follow it back to the beginning.

Requirements:
  • the robot will be started by pressing the touch sensor
  • the program will work on any length line
  • after retuning to the starting point, the robot will stop and play a sound


Click here for a video sample

Additional Challenges

Radar Scanner


Write a program that detects, in a 180 degree sweep, the distance to the closest object.

The sequence:

  • When the program is run, your bot will perform a 180 degree, zero-radius, clockwise turn.
  • During the turn, the ultrasonic sensor will be taking distance readings.
  • At the end of the turn, the distance, in inches, to the closest object will be displayed on the bot's screen for 5 seconds.

Click here for an image of the operation.

Click here for a video of the operation.

Search and Destroy

You will mount the supplied launching device on your robot.

You will place your robot in the arena in one of the positions shown.

Both robots will start their programs at the same time.

You are not allowed to launch the projectile for the first 10 seconds.

Use your ultrasonic sensor to sweep the area and locate the opponent.

Turn toward the opponent and launch the projectile.

If you move outside the black border line you will be disqualified.

The Final

Click here for the final assignment






The Conclusion

As a result of successful participation in this assignment you should have a better idea of the robot behaviors and how they are programmed.



Go to the CodeCooker Main page