- Standards
- Introduction to robotics and website requirements
- AutoCad 2
- Student Movie Files 4
- Rhino 3d student work
- All about gears
- Animations in 3d Rhino
- Your first robot
- Rubrics and Design Challenge page
- Safety Exam
- Advance Robotics
- Podcast
- Remote Control Tutorial
- HTML Code
- Rattlesnake bot
- Line Follower
- Parking Space
- Robotic Cockroach
- Proportional Control
- Follow the leader
- Platform 9 3/4
- Ramp Bot
- camstudio videos (T.E)
- Digital graphic organizer (T.E.)
- Robotics Safety information
- data log activities
- Engineering Design PowerPoint
- SUMO BOT
- Sumo bot PowerPoint
- Under-carriage inspection
- skype-controlled nxt robot
- Engineering with NI labview : High school robotics activities
- labview training CS2N
Ramp Bot
Tank Bot
By Tufts University Center for Engineering Education and Outreach
Introduction
In this lesson you will learn to build a mean, hill‐climbing machine. This lesson introduces key concepts like torque, reduction gearing, and friction.
Reference Resources
Real world applications for tanks
Tanks are armored vehicles use by the military to cross over rough terrain and infiltrate the enemy's defenses. Check out this link to the:
M1 ABRAMS
Understanding Gear Reduction
Useful links about tanks
History
Design
Command, control and communications
Useful links about gears and transmissions
Explanation
Uses
Simple
Multi‐ratio systems
Uncommon types
Experimentation Questions
1. Why does the tank move so slowly?
2. If you change the gear ratio to make the tank faster, will it still be able to climb a steep slope?
3. How could you make a tank that can turn? How would you program it to be able to turn around?
4. What are some weaknesses of this design and what would you do to improve it?
Teaching Standards
We recommend linking your project's content to the nationally recognized Common Core Standards for
literacy in science and math.
Learning Opportunities: In this lab students have the opportunity to understand the following:
1. How to create a system that controls movement to accomplish a goal
2. Torque
3. Friction
4. Gears and gear ratios
5. Simple machines
6. Computer programming
7. Electronics and motors
8. Statics and structures
9. Teamwork and collaboration
10. Sensors
Building and Programming Instructions
Building
Programming
1. Start by creating a while loop ("NXT Programming ‐‐> Structures" palette). Right‐click the left node of the
stop sign VI and select "Create ‐‐> Constant." Be sure this constant is set to "False" ("F"). This creates an
infinite loop—meaning the program will continually repeat everything you add inside this loop.
2. Place a case structure inside the while loop.
3. Next, add a Read Sensor VI ("NXT Robotics ‐‐> NXT I/O" palette) that will read the ultrasonic sensor so that
Tank Bot can "see" where a person or obstacle is in front of it. Add the Read Sensor VI inside the while loop,
but outside the case structure. From the drop‐down menu, choose "Read Ultrasonic." Right‐click the top node
of this VI and choose "Create ‐‐> Constant." Next we need to add a comparison VI. Let’s use the Less Than VI
and set the constant value to 20. This value tells the NXT when to respond to information from the ultrasonic
sensor. The lower the number, the closer Tank Bot will get before he stops, fires red lights, and rotates his
"missile launchers" or touch sensors. Make sure "Port 2" is selected. Finally, wire the Less Than VI into the
"Case Selector" (green question mark) on the case structure.
4. Next create the conditions inside the True case on the case structure. Make sure the top of the case loop
(The inside loop) says "True" at the top. Then insert a Motor Control VI and wire it to the Read Ultrasonic VI
outside of the case structure. Right‐click the motor VI at the top to create a port constant and set the constant
to ports B & C. Then, click the motor on/off tab at the bottom of the VI and set the motor to off/ brake. This
will stop Tank Bot when it "sees" something that is in front of it.
5. Then insert 3 while loops into the True setting on the case structure.
6. We are now going to add the "red laser guns”! Right‐click in the top while loop and insert a Read Sensor VI
and set it to Read Light‐‐>LED On. First we are going to set up the right light sensor or "eye". Right‐click at the
top of the light sensor VI and create a port constant set to port 3. Then wire the brake motor VI to the light
sensor VI inside of the top while loop. To make the lights blink we need to add a wait VI. Right‐click the screen
next to the light VI, go to NXT/IO‐‐> Wait, and insert the wait VI. Wire the wait VI to the light VI. Then rightclick
the Time input on the wait VI, go to Create‐‐>Constant and enter .25. This will cause the light to stay on
for 1/4 of a second. To make it blink we have to turn it off. Next insert another light VI. Then click on the dropdown
menu below the VI and select Read light‐‐>LED off. Insert another wait VI and wire it to the light off VI.
Then create a Time constant for the last light VI and set it to .25. This will make the light turn off for a quarter
of a second. Now to get the lights to turn on and off more than once, we have to set the loop iteration.
7. Select the blue i in the box in the right‐hand corner of top inner while loop and move it to the right side of
the while loop. Then right‐click the screen, go to NXT programming‐‐>comparison‐‐>greater than, and insert
the Greater Than VI into the while loop near the blue i. Right‐click the greater than VI and go to create‐‐
>constant and wire the blue i to the top of the greater than VI. Next right‐click the greater than sign and set
the value to 5. This will make the lights turn on and off 5 times before they stop. Then wire the tip of the
greater than VI to the stop at the bottom right of the while loop. This connects the iteration to the end of the
loop. Finally, select all the VIs in the top while loop with your mouse by clicking and then dragging a box
around them. Then if you are using a PC press Ctrl+C and if you are using a Mac press Cmd+C and move your
curser to the middle while loop. Then press Ctrl+V or Cmd+V to paste the code you just copied from the first
while loop. Next you will need to change the port settings on these light VIs to port 1. Then, wire the first light
VI to the pink NXT wire coming from the brake and going to the top while loop. This will cause the other light
sensors to "fire" too.
8. Now that the "laser guns" (light sensors) are programmed, it’s time to set the False case in the case
structure. Go to the top of the case structure and select False. Then right‐click inside the false case and select a
Motor Control VI. Right‐click the motor VI and create a port constant set to ports B & C. Now wire the motor VI
to the brake VI outside of the case structure. Right‐click the Power input of the motor and set the constant
Power to 75. This will give Tank Bot enough power to move those complicated gear reductions.
9. Now it’s time to create the code that allows touch sensor "missiles" to rotate when the tank encounters an
obstacle. Go to the top of the case structure and change the case back to True. Right‐click in the bottom while
loop and insert a motor VI. Right‐click on the Power input of the motor VI and create a power constant set to
45. Then right‐click on the Port input of the same motor VI and create a port constant set to port A. Wire the
motor VI to the brake motor VI outside of the while loop. Next we will need to set the amount of time the
motor should run so that the mouth can open fully. To do this right‐click next to the motor VI, go to NXT/IO‐‐>
Wait, and add a wait VI. Right‐click the Time input to create a time constant set to .5. Make sure you set the
motor direction to Reverse. Then wire the wait VI to the motor VI. Next insert another motor VI and wire it to
the wait VI and set its speed to 45 and its direction to forward. This will make the mouth close again. Create a
greater than VI. Right‐click again and go to NXT Programming ‐‐>Comparison. Finally wire the bottom terminal
of the greater than VI to the blue i in the bottom while loop. Add a numeric constant by right‐clicking and
going to NXT Programming ‐‐>Numeric‐‐>Numeric Constant. Set the constant to 4 and wire it to the top
terminal of the greater than VI. Then wire the point of the greater than VI to the red loop condition in the
lower right of the while loop.
10. You are almost done. To make Tank Bot back up we will need to add a forward motor VI to the end of the
wire coming out of port A motor break VI. You are all set! Have fun.
By Tufts University Center for Engineering Education and Outreach
Introduction
In this lesson you will learn to build a mean, hill‐climbing machine. This lesson introduces key concepts like torque, reduction gearing, and friction.
Reference Resources
Real world applications for tanks
Tanks are armored vehicles use by the military to cross over rough terrain and infiltrate the enemy's defenses. Check out this link to the:
M1 ABRAMS
Understanding Gear Reduction
Useful links about tanks
History
Design
Command, control and communications
Useful links about gears and transmissions
Explanation
Uses
Simple
Multi‐ratio systems
Uncommon types
Experimentation Questions
1. Why does the tank move so slowly?
2. If you change the gear ratio to make the tank faster, will it still be able to climb a steep slope?
3. How could you make a tank that can turn? How would you program it to be able to turn around?
4. What are some weaknesses of this design and what would you do to improve it?
Teaching Standards
We recommend linking your project's content to the nationally recognized Common Core Standards for
literacy in science and math.
Learning Opportunities: In this lab students have the opportunity to understand the following:
1. How to create a system that controls movement to accomplish a goal
2. Torque
3. Friction
4. Gears and gear ratios
5. Simple machines
6. Computer programming
7. Electronics and motors
8. Statics and structures
9. Teamwork and collaboration
10. Sensors
Building and Programming Instructions
Building
Programming
1. Start by creating a while loop ("NXT Programming ‐‐> Structures" palette). Right‐click the left node of the
stop sign VI and select "Create ‐‐> Constant." Be sure this constant is set to "False" ("F"). This creates an
infinite loop—meaning the program will continually repeat everything you add inside this loop.
2. Place a case structure inside the while loop.
3. Next, add a Read Sensor VI ("NXT Robotics ‐‐> NXT I/O" palette) that will read the ultrasonic sensor so that
Tank Bot can "see" where a person or obstacle is in front of it. Add the Read Sensor VI inside the while loop,
but outside the case structure. From the drop‐down menu, choose "Read Ultrasonic." Right‐click the top node
of this VI and choose "Create ‐‐> Constant." Next we need to add a comparison VI. Let’s use the Less Than VI
and set the constant value to 20. This value tells the NXT when to respond to information from the ultrasonic
sensor. The lower the number, the closer Tank Bot will get before he stops, fires red lights, and rotates his
"missile launchers" or touch sensors. Make sure "Port 2" is selected. Finally, wire the Less Than VI into the
"Case Selector" (green question mark) on the case structure.
4. Next create the conditions inside the True case on the case structure. Make sure the top of the case loop
(The inside loop) says "True" at the top. Then insert a Motor Control VI and wire it to the Read Ultrasonic VI
outside of the case structure. Right‐click the motor VI at the top to create a port constant and set the constant
to ports B & C. Then, click the motor on/off tab at the bottom of the VI and set the motor to off/ brake. This
will stop Tank Bot when it "sees" something that is in front of it.
5. Then insert 3 while loops into the True setting on the case structure.
6. We are now going to add the "red laser guns”! Right‐click in the top while loop and insert a Read Sensor VI
and set it to Read Light‐‐>LED On. First we are going to set up the right light sensor or "eye". Right‐click at the
top of the light sensor VI and create a port constant set to port 3. Then wire the brake motor VI to the light
sensor VI inside of the top while loop. To make the lights blink we need to add a wait VI. Right‐click the screen
next to the light VI, go to NXT/IO‐‐> Wait, and insert the wait VI. Wire the wait VI to the light VI. Then rightclick
the Time input on the wait VI, go to Create‐‐>Constant and enter .25. This will cause the light to stay on
for 1/4 of a second. To make it blink we have to turn it off. Next insert another light VI. Then click on the dropdown
menu below the VI and select Read light‐‐>LED off. Insert another wait VI and wire it to the light off VI.
Then create a Time constant for the last light VI and set it to .25. This will make the light turn off for a quarter
of a second. Now to get the lights to turn on and off more than once, we have to set the loop iteration.
7. Select the blue i in the box in the right‐hand corner of top inner while loop and move it to the right side of
the while loop. Then right‐click the screen, go to NXT programming‐‐>comparison‐‐>greater than, and insert
the Greater Than VI into the while loop near the blue i. Right‐click the greater than VI and go to create‐‐
>constant and wire the blue i to the top of the greater than VI. Next right‐click the greater than sign and set
the value to 5. This will make the lights turn on and off 5 times before they stop. Then wire the tip of the
greater than VI to the stop at the bottom right of the while loop. This connects the iteration to the end of the
loop. Finally, select all the VIs in the top while loop with your mouse by clicking and then dragging a box
around them. Then if you are using a PC press Ctrl+C and if you are using a Mac press Cmd+C and move your
curser to the middle while loop. Then press Ctrl+V or Cmd+V to paste the code you just copied from the first
while loop. Next you will need to change the port settings on these light VIs to port 1. Then, wire the first light
VI to the pink NXT wire coming from the brake and going to the top while loop. This will cause the other light
sensors to "fire" too.
8. Now that the "laser guns" (light sensors) are programmed, it’s time to set the False case in the case
structure. Go to the top of the case structure and select False. Then right‐click inside the false case and select a
Motor Control VI. Right‐click the motor VI and create a port constant set to ports B & C. Now wire the motor VI
to the brake VI outside of the case structure. Right‐click the Power input of the motor and set the constant
Power to 75. This will give Tank Bot enough power to move those complicated gear reductions.
9. Now it’s time to create the code that allows touch sensor "missiles" to rotate when the tank encounters an
obstacle. Go to the top of the case structure and change the case back to True. Right‐click in the bottom while
loop and insert a motor VI. Right‐click on the Power input of the motor VI and create a power constant set to
45. Then right‐click on the Port input of the same motor VI and create a port constant set to port A. Wire the
motor VI to the brake motor VI outside of the while loop. Next we will need to set the amount of time the
motor should run so that the mouth can open fully. To do this right‐click next to the motor VI, go to NXT/IO‐‐>
Wait, and add a wait VI. Right‐click the Time input to create a time constant set to .5. Make sure you set the
motor direction to Reverse. Then wire the wait VI to the motor VI. Next insert another motor VI and wire it to
the wait VI and set its speed to 45 and its direction to forward. This will make the mouth close again. Create a
greater than VI. Right‐click again and go to NXT Programming ‐‐>Comparison. Finally wire the bottom terminal
of the greater than VI to the blue i in the bottom while loop. Add a numeric constant by right‐clicking and
going to NXT Programming ‐‐>Numeric‐‐>Numeric Constant. Set the constant to 4 and wire it to the top
terminal of the greater than VI. Then wire the point of the greater than VI to the red loop condition in the
lower right of the while loop.
10. You are almost done. To make Tank Bot back up we will need to add a forward motor VI to the end of the
wire coming out of port A motor break VI. You are all set! Have fun.