Unit 4: Robot Chassis Construction

Similar documents
Ultimatum. Robotics Unit Lesson 5. Overview

An Introduction to Programming using the NXT Robot:

Robot Programming Manual

The light sensor, rotation sensor, and motors may all be monitored using the view function on the RCX.

Chapter 14. using data wires

How Do You Make a Program Wait?

Pre-Activity Quiz. 2 feet forward in a straight line? 1. What is a design challenge? 2. How do you program a robot to move

understanding sensors

Deriving Consistency from LEGOs

I.1 Smart Machines. Unit Overview:

Where C= circumference, π = 3.14, and D = diameter EV3 Distance. Developed by Joanna M. Skluzacek Wisconsin 4-H 2016 Page 1

Lab book. Exploring Robotics (CORC3303)

Instructional Technology Center

FLL Coaches Clinic Chassis and Attachments. Patrick R. Michaud

Vision Ques t. Vision Quest. Use the Vision Sensor to drive your robot in Vision Quest!

Your EdVenture into Robotics 10 Lesson plans

LEGO Mindstorms Class: Lesson 1

Line-Follower Challenge

Morse Code Autonomous Challenge. Overview. Challenge. Activity. Difficulty. Materials Needed. Class Time. Grade Level. Learning Focus.

Let There Be Light. Opening Files. Deleting National Technology and Science Press

Activity Template. Subject Area(s): Science and Technology Activity Title: Header. Grade Level: 9-12 Time Required: Group Size:

A - Debris on the Track

A - Debris on the Track

Robotics Workshop. for Parents and Teachers. September 27, 2014 Wichita State University College of Engineering. Karen Reynolds

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

Robotics using Lego Mindstorms EV3 (Intermediate)

1. Creating geometry based on sketches 2. Using sketch lines as reference 3. Using sketches to drive changes in geometry

Studuino Icon Programming Environment Guide

Instructors. Manual GEARED. After-School Robotics Program By Haley Hanson

Worksheet Answer Key: Tree Measurer Projects > Tree Measurer

1. ASSEMBLING THE PCB 2. FLASH THE ZIP LEDs 3. BUILDING THE WHEELS

Getting Started Guide

Scratch Coding And Geometry

Line Detection. Duration Minutes. Di culty Intermediate. Learning Objectives Students will:

Ev3 Robotics Programming 101

Mini Hexapodinno. 18-DOF Robot

Robots in Town Autonomous Challenge. Overview. Challenge. Activity. Difficulty. Materials Needed. Class Time. Grade Level. Objectives.

Medb ot. Medbot. Learn about robot behaviors as you transport medicine in a hospital with Medbot!

EV3 Advanced Topics for FLL

New Sketch Editing/Adding

Students will design, program, and build a robot vehicle to traverse a maze in 30 seconds without touching any sidewalls or going out of bounds.

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

The Nomenclature and Geometry of LEGO

Bipedinno. 12-DOF Waist-high Robot

acknowledgments...xv introduction...xvii 1 LEGO MINDSTORMS NXT 2.0: people, pieces, and potential getting started with the NXT 2.0 set...

Hare and Snail Challenges READY, GO!

2809 CAD TRAINING: Part 1 Sketching and Making 3D Parts. Contents

Blue-Bot TEACHER GUIDE

Overview. The Game Idea

General Description. The TETRIX MAX Servo Motor Expansion Controller features the following:

Welcome to. NXT Basics. Presenter: Wael Hajj Ali With assistance of: Ammar Shehadeh - Souhaib Alzanki - Samer Abuthaher

Mindstorms NXT. mindstorms.lego.com

Innov-ís 4000D/4000 PREMIUM PACKAGE

Exercise 2. Point-to-Point Programs EXERCISE OBJECTIVE

Operation Manual My Custom Design

Congratulations on your decision to purchase the Triquetra Auto Zero Touch Plate for All Three Axis.

Quintic Software Tutorial 3

Erik Von Burg Mesa Public Schools Gifted and Talented Program Johnson Elementary School

Conversational CAM Manual

Lesson 4 Extrusions OBJECTIVES. Extrusions

GAME:IT Junior Bouncing Ball

Unit 6.5 Text Adventures

Vinyl Cutter Instruction Manual

Chapter 1. Robots and Programs

SolidWorks Tutorial 1. Axis

TETRIX Servo Motor Expansion Controller Technical Guide

Chassis & Attachments 101. Chassis Overview

Draw IT 2016 for AutoCAD

FLL Programming Workshop Series

1. Create a 2D sketch 2. Create geometry in a sketch 3. Use constraints to position geometry 4. Use dimensions to set the size of geometry

Roborodentia Robot: Tektronix. Sean Yap Advisor: John Seng California Polytechnic State University, San Luis Obispo June 8th, 2016

My Blogs: To Add New Blog Post: o Click on the My Learn360 link. You will then see eight different tabs (below).

SolidWorks Design & Technology

Chassis & Attachments 101. Part 1: Chassis Overview

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Kinect2Scratch Workbook

Running the PR2. Chapter Getting set up Out of the box Batteries and power

THESE ARE NOT TOYS!! IF YOU CAN NOT FOLLOW THE DIRECTIONS, YOU WILL NOT USE THEM!!

Detrum GAVIN-8C Transmitter


Expanding Your Horizons, 1993 Mechanical Dissection Professor Sheri Sheppard Stanford University SAFETY!!

Measuring in Centimeters

DISCO DICING SAW SOP. April 2014 INTRODUCTION

Create a Simple Game in Scratch

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. LEGO Bowling Workbook

2.4 Sensorized robots

Design Brief: Mousetrap Racer

Line-Follower Challenge

Let s start by making a pencil, that can be used to draw on the stage.

1 Sketching. Introduction

e d u c a t i o n Detect Dark Line Objectives Connect Teacher s Notes

Lesson 6 2D Sketch Panel Tools

A - Debris on the Track

Scratch for Beginners Workbook

The Revolve Feature and Assembly Modeling

A Day in the Life CTE Enrichment Grades 3-5 mblock Robotics - Simple Programs

Introduction to the EXPANSION HUB

Standard Operating Procedure

Positive Promotion: Use the FIRST and FTC logos in a manner that is positive and promotes FIRST.

Introduction to Turtle Art

1 Best Practices Course Week 12 Part 2 copyright 2012 by Eric Bobrow. BEST PRACTICES COURSE WEEK 12 PART 2 Program Planning Areas and Lists of Spaces

Transcription:

Unit 4: Robot Chassis Construction

Unit 4: Teacher s Guide Lesson Overview: Paul s robotic assistant needs to operate in a real environment. The size, scale, and capabilities of the TETRIX materials are better suited to the challenge of helping Paul. Construct a robot chassis (a robot base) that will serve as the platform for the later attachment of sensors and an attachment (an arm) for gripping and delivering items to Paul. Estimated Time: 3 hours (3-4 class periods) Learning Objectives: Engineering Design: Students will be able to discuss how the science concept of center of mass impacts their engineering designs. Students will be able to discuss how they may need to engage in redesign. Classroom Materials: Extra tools for assembling the TETRIX materials Large piece of plywood or other stiff material (for incline test) Yardstick or measuring tape (for determining width of robot chassis) Teacher Pre-activity Preparation: Collect demo materials. Construct sample TETRIX robot chassis. Distribute Student Lesson. Vocabulary: Building: Students will be able to attach TETRIX materials. Students will be able to wire and attach TETRIX DC motor and DC motor controller. Students will be able to integrate the NXT in their TETRIX robot. Unit Resources: Unit 1: Robot Base Student Lesson (Teacher CD) TETRIX Building Resources center of mass: the mean location of all the mass in an object chassis: the body of a vehicle, including the main structure, wheels, motors, and so on DC motor: a motor that runs on direct current electricity torque: the force needed to rotate an object about an axis Programming: None Each student group: LEGO MINDSTORMS kit TETRIX kit Computer with NI LabVIEW Education Edition 7 oz paper/plastic cup Cotton puffs 4.1

Unit 4: Teacher s Guide TETRIX Materials The TETRIX building system has many advantages over the LEGO building system for building larger and stronger robots as well as the ability to control multiple motors of different types. However, the TETRIX system presents new building and wiring techniques that can take some time to learn. Check out http://www.tetrixrobotics.com/building_system/ and http://www.education.rec.ri.cmu.edu/products/getting_started_tetrix/ for building tips and tricks for using TETRIX. Center of Mass The center of mass is the mean location of all the mass in an object. You can balance an object with uniform mass at its geometric center. The balance point changes when the mass is not uniformly distributed in an object. Center of mass is important to consider when designing a robot. If you build a tall robot with the NXT and other heavy pieces on top, the center of mass will be high off the ground and the robot will tip over more easily. Students will need to be continually reflective about how the center of mass of their vehicle affects its performance. 4.2

Engineering Design in Action Unit 4: Teacher s Guide If this is the students first experience with TETRIX, they may resist the instructions to draw (plan) their design ( But, I don t know how to make it. ). Encourage them to use the drawing to help them remember the big ideas they are working toward (a low center of mass, places to attach sensors, and so on) even though they may not know the specific pieces they will use or exactly how they will assemble them. The engineering design process is iterative. While students can use science concepts, such as center of mass; previous experience with LEGO building; and research to assist in the design of their TETRIX chassis, they may need to alter their chassis design in subsequent lessons as they add sensors and the robot arm. Redesign, the revisiting and changing of a design, is an integral part of the engineering design process and highlights the nature of engineering design problems as ill defined (as opposed to a well-defined problem like a basic arithmetic problem) with multiple possible solutions. While it is important to encourage students to be as thoughtful as possible when brainstorming their initial idea, it's equally important to allow students the time to use the feedback from testing their design and other new discoveries to update a design of their chassis. This helps students understand that their design ideas are valued. Incline Test To test that their robot chassis has a reasonably low center of mass and even distribution of mass, students will test their creation by placing it on a large piece of plywood or other stiff material (foamcore board, extra wooden shelf) and lifting it to approximately 30 degrees. A design successfully passes this test if it rolls down the incline or stays on the incline without tipping over. A design that tips over needs to be redesigned. GOOD BAD 30 degrees 30 degrees 4.3

Unit 4: Teacher s Guide Introduction 10-20 minutes 1. Review the unit challenge and the students previous work with LEGO robotics. 2. Introduce students to the TETRIX building system. Look at a LEGO beam and a TETRIX beam as a class. What do you notice about size? Sturdiness? Why would the TETRIX materials be better for a robot functioning in a house? (easier to work in the size needed) Demonstrate how TETRIX pieces attach to each other. Demonstrate how to connect the DC motor controller and batteries. Emphasize that the motor controller and batteries need to be included in the robot. Demonstrate how to attach and wire the TETRIX DC motors. Demonstrate how to combine LEGO and TETRIX parts to attach the NXT. 3. Introduce students to the problem and its requirements as presented on the student worksheet. a. Unit 4: Robot Base Student Lesson (Teacher CD) b. Design Requirements: The robot must be no wider than 18". The robot must use only two DC motors. The robot must use fewer than half of the TETRIX materials. The robot must pass the lift test (be picked up without breaking). The robot must pass the incline test. 3. The goal of this lesson is for students to construct a TETRIX robot chassis. The chassis should be sturdy, have a low center of mass, and be able to have a robotic arm attached as well as sensors for obstacle detection and line following. 4. As a class: Research What is center of mass? Why might we care about center of mass? Where could you look to get ideas for the best design for a robot? Do a Web/image search on mobile robots. Look at the way they are built. What else should we know about Paul s house? Floor-covering type (tile, carpet, hardwood) and color Brainstorm What would a robot with a center of mass close to the floor look like? What obstacles might a robotic assistant encounter in the house? How will adding an attachment to grab and lift things for Paul change the center of mass? 4.4

While the students are working While students are building: 90-120 minutes Unit 4: Teacher s Guide 1. Students will be guided through the design process using the student lesson. Encourage students to think about general ideas for their design while acknowledging that as they gain more experience with the TETRIX materials, they may need to change their ideas. 2. Remind students of the design requirements as they are working. Is it 18" or less in width? Does it use only two DC motors? Does it use fewer than half of the TETRIX materials? Does it pass the lift test (can be picked up without breaking)? Does it pass the incline test? While students are programming: 1. This lesson has no programming so students can focus on building. Class Discussion/Reflections 10-20 minutes 1. When all of the students have completed the challenge, have them present their designs and demonstrate their final solutions. Ask the students: What advice would you give to another group about building with the TETRIX materials? Look at all of the robots in the class. Have the students identify common design themes (position of wheels, materials used to build sides). 2. Discuss with students how this robot compares to their LEGO robot in size and weight. What are the implications of having a heavier robot (sturdier construction, need for stronger motors)? What will change when programming a larger robot? 3. Discuss with students how the concept of center of mass influenced their design decisions. Were there any decisions that were influenced by prior knowledge of center of mass? 4. Discuss with students what they might need to change about their robot when they add sensors and the arm. Emphasize that engineering design is iterative that these changes are expected and students will have time to make them. Optional Extensions 1. Students can begin to incorporate sensors for obstacle detection. 2. Students can optimize their robot to be able to pass a steeper incline test (45 degrees, 60 degrees). 4.5

Unit 4: Teacher s Guide Sample Projects and Photos Hardware Tips Needle-nose pliers are useful for tightening screws in hard-to-reach places. The students will need a small flathead screwdriver to connect wires from the motor to the terminals on the motor controller. Keep the wires clear of rotating components, such as gears and motors. Keep your fingers clear of the gears to avoid injury. The motors in the TETRIX kit are much stronger than the NXT motors and can cause serious injury. When the students are not using the robot, they should turn the power off on the NXT Brick and on the battery pack to avoid draining the batteries. 4.6

Unit 4: Student Lesson Lesson Overview: Paul s robotic assistant needs to operate in a real environment. The size, scale, and capabilities of the TETRIX materials are better suited to the challenge of helping Paul. Construct a robot chassis (a robot base) that will serve as the platform for the later attachment of sensors and an attachment (an arm) for gripping and delivering items to Paul. Estimated Time: 3 hours (3-4 class periods) Learning Objectives: Engineering Design: Students will be able to discuss how the science concept of center of mass impacts their engineering designs. Students will be able to discuss how they may need to engage in redesign. Classroom Materials: Extra tools for assembling the TETRIX materials Large piece of plywood or other stiff material (for incline test) Yardstick or measuring tape (for determining width of robot chassis) Teacher Pre-activity Preparation: Collect demo materials. Construct sample TETRIX robot chassis. Distribute Student Lesson. Vocabulary: Building: Students will be able to attach TETRIX materials. Students will be able to wire and attach TETRIX DC motor and DC motor controller. Students will be able to integrate the NXT in their TETRIX robot. Unit Resources: Unit 1: Robot Base Student Lesson (Teacher CD) TETRIX Building Resources center of mass: the mean location of all the mass in an object chassis: the body of a vehicle, including the main structure, wheels, motors, and so on DC motor: a motor that runs on direct current electricity torque: the force needed to rotate an object about an axis Programming: None Each student group: LEGO MINDSTORMS kit TETRIX kit Computer with NI LabVIEW Education Edition 7 oz paper/plastic cup Cotton puffs 4.7

Unit 4: Student Lesson Name: Date: Building Build a sturdy, two-motor robotic vehicle with a container or holder so that the vehicle can transport a 7 oz paper/plastic cup filled with cotton puffs without spilling. Brainstorm Before starting to build, brainstorm some possible designs. Think about where to put the NXT Brick, sensors, DC motors, motor controller, and battery pack. Sketch two possibilities below. Label the drawings. For each design, list one possible pro and con. Design Idea 1: Design Idea 2: Pro: Con: Pro: Con: Which design did you choose? Why? (Be specific! I think the wider base of my second design will be easier to mount sensors to. ) 4.8

Unit 4: Student Lesson Create Create the TETRIX robot chassis. Test the TETRIX robot chassis. Test The robot must be no wider than 18". The robot must use only two DC motors. The robot must use fewer than half of the TETRIX materials. The robot must pass the lift test (be picked up). Your robot must pass the incline test (stay in place or roll down an incline of 30-45 degrees without tipping). Use the Student Checklist to make sure the robot has addressed all the design requirements. When ready, show the robot to the teacher. Redesign If the robot fails either the lift test or the incline test, the design must be improved and rebuilt and then retested. Did you have to modify the design? If so, what change(s) did you make? Share It is important for engineers to document their work for their own records and future work as well as to share with others. Create a labeled sketch of the robot. Make sure to label the motors, motor controller, NXT, and batteries. Make notes about design or building choices that you made that were important. Notes: 4.9

Unit 4: Student Lesson Reflection Describe one success you had in building the robot. Describe one challenge encountered in building the robot. Engineering design often involves trade-offs between conflicting goals. Describe a trade-off faced in this activity. What did you decide to do? If there was more time, what changes or improvements would be made? Describe one robotic challenge where it would be possible to predict the TETRIX robot would have an advantage over the previous LEGO robot. Describe one robotic challenge where it would be possible to predict that the smaller LEGO robot would have an advantage over the TETRIX robot. Optional Extensions 1. Begin to incorporate a sensor for obstacle detection. 2. Optimize the robot to be able to pass a steeper incline test (45 degrees, 60 degrees). 4.10

Unit 4: Student Lesson Student Checklist Name: Date: Lesson Overview: Paul s robotic assistant needs to operate in a real environment. The size, scale, and capabilities of the TETRIX materials are better suited to the challenge of helping Paul. Construct a robot chassis (a robot base) that will serve as the platform for the later attachment of sensors and an attachment (an arm) for gripping and delivering items to Paul. Identify Problem The chassis for the robotic assistant serves as the base for the rest of the robot. Design Specifications/Requirements: The robot must be no wider than 18". The robot must use only two DC motors. The robot must use fewer than half of the TETRIX materials. The robot must pass the lift test (be picked up). Your robot must pass the incline test (stay in place or roll down an incline of 30-45 degrees without tipping). Rubric for successful completion of the challenge: Robot requirements Completed successfully Teacher comments Robot is 18" or less in width. Robot uses two DC motors. Robot uses fewer than half of the TETRIX materials. Robot can be lifted up (with no pieces falling off). Robot can pass the incline test (robot doesn t tip over when placed on a 30-degree incline). Sketches of robot Handout questions Reflection section Writing requirements Completed successfully Teacher comments Optional extension Completed successfully Teacher comments Attachment of touch or ultrasonic sensor for obstacle detection Attachment of light sensor for line following Robot can be placed on a 45-degree or greater incline. 4.11

Unit 5: Basic Robot Programming

Unit 5: Teacher s Guide Lesson Overview: Program the TETRIX robot to move forward as well as turn to gain experience programming the TETRIX components in NI LabVIEW. In addition, evaluate the robot s performance driving straight and turning to see how well the robot chassis performs and make any necessary design adjustments to the motors or configuration. Estimated Time: 2 hours (2-3 class periods) Learning Objectives: Engineering Design: Students should be able to describe any redesign they did after testing their robot s ability to turn and drive straight. Students should be able to describe the research they did in characterizing how their TETRIX robot performs. Classroom Materials: Multiple yardsticks and/or tape measures Teacher Pre-activity Preparation: Distribute Student Lesson. Create a sample program for a TETRIX robot. Building: Students will be able to redesign parts of their robot (as needed) based on programming testing. Unit Resources: Unit 5: Robot Base Student Lesson (Teacher CD) Video 4: Basic Robot Programming Programming: Students will be able to use the TETRIX DC motor commands. Students will be able to use the Motor Configurator to set up their TETRIX motors. Students will be able to create a Watchdog loop. Students will be able to use NXT flags. Each student group: No additional materials needed. Vocabulary: characterize: to document or describe the properties or characteristics of something (e.g., Characterize how fast the robot moves.) Watchdog: a programmatic safety mechanism within LabVIEW that turns off the HiTechnic DC motors after 2.5 seconds 5.1

Unit 5: Teacher s Guide NI LabVIEW Programming for TETRIX Robots Programming a TETRIX -based robot with an NXT is very similar to programming the entirely LEGO -based robot. The main difference is the VIs used for programming the motors and the need to use the Motor Configurator. The motor icons located in the TETRIX palette will be used. The Motor Configurator will be used to create a configuration for your motor controller, which allows the motor to be named, specifies the port the controller is connected to, and specifies the way the motors are connected. Characterize While engineers can use science and math to model and predict how their design will work, oftentimes the complex systems they create can t be completely understood or predicted with existing math and science models. Hence, engineers need to study the performance of their design under different conditions to be able to describe and predict how it will work. This documenting of how their design performs is sometimes referred to as characterizing their design. Drive Test The drive test checks to see if the robot is built in such a way as to drive in a straight line (as well as turn). The test checks that the materials are all aligned well and attached properly and that no wires are dragging or interfering with the operation of the motors. While the robot will be primarily turning to follow a line, if materials are not attached correctly, the robot s performance may be erratic and unpredictable, which will make all tasks difficult to perform. Choose a center point on the robot (mark with tape if necessary) to align with the line and then measure where that point is after the car has driven 24". Center point is no more than 3" on either side of the line. 24" 5.2

Introduction 10-20 minutes Unit 5: Teacher s Guide 1. Review the unit challenge and the students previous work with building a TETRIX chassis. 2. Introduce the students to the idea that they will be programming their robot today in order to test their design and research how it performs. The tests they do may lead them to discover that they need to redesign their robot. Research is needed because it is an original design that hasn t been previously studied (unless students used building instructions). While the students are working While the students are building: 45-60 minutes Students will engage in building only as redesign in response to their robot s performance on tests they conduct after programming their robot. Note: Encourage students who are having difficulty to examine the successful designs of other students to get ideas. Students who have difficulty with tests may think they need to scrap their entire design and start over. Talk with students to see what smaller changes they can make to address the problem(s). When possible, have the students save total redesigning of the robot until after the attachment of the arm in later units. While the students are programming: 1. Students will watch Video 4: Basic Robot Programming. 2. Review the Motor Configurator and the TETRIX Motor VIs with students. Class Discussion/Reflection 20 minutes 1. Discuss with students whether the spin and drive-straight tests necessitated any design changes. What did they need to change and why? 2. Discuss with students how their robot performed on the speed tests. Did everyone s robot go the same speed at 100% power? At 50% power? Why or why not? What factors influenced the speed? 3. Discuss with students how their TETRIX robot compares in speed to their LEGO robot. Given the speed of the TETRIX robot, what advantages might it have over a LEGO robot? (able to travel greater distances, reach a destination faster) 4. Discuss with students what disadvantages the TETRIX robot might have in comparison to the LEGO robot. (need for additional power/batteries, heavier, harder to maneuver in small spaces) 5. Review with students the idea that there is not a single right solution to a design problem. While the TETRIX robot is better suited for the challenge with Paul, a smaller robot (such as the LEGO one) might be better suited for a different challenge. Optional Extensions 1. Begin to incorporate a sensor for obstacle detection. 2. Program your robot to drive forward for three seconds and then back up to its exact starting point. 5.3

Unit 5: Teacher s Guide Programming Tips The Watchdog timer is a safety feature that stops the motors after 2.5 seconds. To keep the motors on for more than 2.5 seconds, the Watchdog timer needs to be fed or reset before the timer reaches 2.5 seconds. NXT Flag VIs are located on the Advanced palette. Troubleshooting Tip If the student s robot is driving in circles instead of straight, he/she probably didn t check reverse for one of the motors in the Motor Configurator. Have the student correct the problem in the Motor Configurator and update the program. 5.4

Unit 5: Quiz Multiple Choice Directions: Read each question carefully and write the best answer on the line provided. 1. True or false: The TETRIX robot can run a program off the brick (not linked to the computer). A. true B. false 2. The TETRIX Motor Configurator can be found in which drop-down menu? A. Window B. View C. Tools D. Project 3. True or false: It is possible to control a DC Motor connected to the NXT Port 1 and Motor Controller 1 with a Motor Configuration set to NXT Port 1 and Motor Controller 2. A. true B. false 4. True or false: Each DC Motor created in the same Motor Configuration must have a unique name and location. A. true B. false 5. What happens if the Reverse box is checked in the Motor Configurator? A. The DC Motor s direction is reversed. B. The DC Motor will only go in the reverse direction. C. The DC Motor s name will appear reversed on the Block Diagram. D. The DC Motor s maximum speed is lowered. 6. A DC Motor Configuration constant can output a total of how many DC Motor Configurations? A. 1 B. 2 C. 5 D. 100 E. as many as you want 7. A DC Motor Configuration array can output a total of how many DC Motor Configurations? A. 1 B. 2 C. 5 D. 100 E. as many as you want 8. Which function should you use to read the light value of a table and a piece of tape? A. NXT Input B. NXT Output C. DC Motor D. Control Mode E. Power/Speed 9. True or false: A DC Motor can only run at a constant speed if an encoder is attached to it. A. true B. false 5.5

Unit 5: Quiz 10. If a value of 100 is wired into the Power/Speed terminal of the TETRIX Move DC Motors function, the DC Motor will. A. move backward at half power. B. move forward at full power. C. not move. D. move forward at quarter power. E. move backward at full power. 11. True or false: In the Move DC Motors (group) mode, a constant must be wired into the Power/Speed terminal, and an array must be wired into the DC Motors terminal. A. true B. false 12. In this program, at what power will the Right motor be traveling? A. 50 B. 55 C. 5 D. 0 13. By not feeding the Watchdog, approximately how many seconds can a DC motor run before it is turned off? A. 2 B. 2.5 C. 25 D. 30 E. 60 14. True or false: A separate Watchdog must be fed for each DC Motor controller and servo controller connected to the NXT. A. true B. false 15. How many different NXT Flags can there be in a single program? A. 1 B. 5 C. 10 D. 16 Short Answer 1. Explain the purpose of the TETRIX Motor Configurator. 2. Why is it important to save the DC Motor Configuration file into the default directory? 3. Why is it necessary to stop feeding the Watchdog after the rest of the program has finished running? 4. What is the fundamental reason for the Watchdog? 5. How is it possible to have multiple DC Motors run at different speeds using a single function? 5.6

Unit 5: Quiz Answer Key Multiple Choice Answers: 1. A 2. C 3. B 4. A 5. A 6. A 7. E 8. C 9. A 10. B 11. A 12. B 13. B 14. A 15. D Short Answer Answers: 1. The TETRIX Motor Configurator is used to give a unique identity to each motor that you will be controlling in your program. 2. It is important to save the DC Motor Configuration file into the default directory to be able to find it in the Motor Configurations sub-palette in the Functions palette. This enables you to create programs more efficiently because the configuration function is in an easy-to-access location. 3. The Feed Watchdog function is inside of a While loop, and as long as that While loop is not exited, the program will continue running even if all of the other code in the program has finished running. You must stop feeding the Watchdog in order to end the program completely. 4. The Watchdog is meant to be an emergency shutoff for the DC Motors and servos in case something goes wrong in the program. 5. By choosing Move DC Motors (multi) from the polymorphic selector of the TETRIX Move DC Motors function, you can run an array of different DC Motors with an array of different constants. Each motor configuration in the array corresponds to one of the constants in the Power/Speed array. 5.7

Overview Unit 5: Programming Guide The purpose of this lesson is to introduce students to the TETRIX Motor Configurator tool, the TETRIX Move DC Motors function, the Watchdog, and the NXT Flag functions. At the end of this lesson, students should be able to: Use the TETRIX Motor Configurator to set up the TETRIX DC Motors. Move the TETRIX DC Motors using the TETRIX Move DC Motors function. Feed the Watchdog so that the motors can run. Use the NXT Flag functions to send information between parallel loops. Basics of LabVIEW You can use the NXT Brick to control TETRIX DC Motors. However, first you must give each motor a unique name and specify how it is connected to the NXT. To do this, you will have to first configure them using a tool in NI LabVIEW called the TETRIX Motor Configurator. Open the Motor Configurator by clicking Tools, selecting NXT Tools, and clicking TETRIX Motor Configurator. This will bring up a window with two tabs DC Motors and Servos, as shown in Figure 1. Figure 1. TETRIX Motor Configurator 5.9

Unit 5: Programming Guide In this lesson you will only be learning how to configure the DC Motors. The name of the control file and its location can be seen in the top of this window. To change either of these, click the folder icon. A new window will appear where a new file name can be typed in, and the location of the file can be specified. It is important to note that if the control file is not placed in this default directory, it will not appear in the Motor Configuration subpalette. To add another motor, click Add Motor. A message indicates that each motor must have a unique name and configuration. A unique name enables the program to determine which motor it should connect to. Change the name of the motor by tripleclicking the text box and writing in a new name. Specify the NXT Port, Motor Controller, and Motor drop-down boxes, depending on how your TETRIX motors are set up. The Reverse box is useful if two motors that are wired into the controller face opposite directions but must still travel in the same direction. Check this box for one of the motors to make them go in the same direction when the same motor power is wired into both of them. Once this is all done, click OK, and you will be prompted to save your new control file. Click Save, and then a new window will come up stating the new functions that have been created. If you saved the control file into the default directory, you can access these configuration functions by right-clicking the Block Diagram, clicking the TETRIX sub-palette, and then clicking the Motor Configurations sub-palette, as shown in Figure 2. Figure 2. Motor Configurations sub-palette There will be two new files in this sub-palette. One of these files will be a single control constant. Placing this onto the Block Diagram will create a constant with a drop-down menu, as shown in Figure 3. Figure 3. Motor Configuration Constant Clicking the arrow will show all of the motors that you configured in the control; clicking any one of them will set this constant to that motor. The other file will be an array of control constants. Place this onto the Block Diagram, and you will notice that it only has one output terminal, as shown in Figure 4. Figure 4. Motor configuration array 5.10

Unit 5: Programming Guide This means that every single constant in this array will be going through a single wire. Resize the array to add or remove constants by hovering over it, clicking either the top or bottom peg, and dragging it up or down until the desired number of constants is reached. Click any of the array s boxes and select the motor name, just like you did for the single control constant. The difference between these two controls will become evident when you learn about the TETRIX Move DC Motors function. TETRIX DC Motor You can use the TETRIX Move DC Motors function to instruct the program to move a DC Motor. To insert the function, rightclick the Block Diagram, select TETRIX, click TETRIX Move DC Motors, and click the Block Diagram. Open up the Context Help to analyze this function, as shown in Figure 5. Figure 5. Context Help for TETRIX Move DC Motors function It has the usual NXT input and output terminals, a DC Motor terminal, a Control Mode terminal, and a Power/Speed terminal. Use the DC Motor terminal to specify which motor the function will control. This is where you will be wiring the Motor Configuration constants that you created earlier. The Control Mode terminal requires a constant that specifies whether the motors will run with a constant power or at a constant speed. The default is constant power, but if you want the motor to run at a constant speed, you will need to attach an encoder to the DC Motor. Use the Power/Speed terminal to indicate the power or speed of the motor. The range of values is -100 to 100. A value of zero indicates no motion. The TETRIX Move DC Motors function is polymorphic and allows you to choose from three settings, as shown in Figure 6. Figure 6. Polymorphic Selector of TETRIX Move DC Motors function 5.11

Unit 5: Programming Guide You can also set the function to automatically choose one of the three settings, depending on the type of constants that are connected to the DC Motors and the Power/Speed terminals. The first setting is Move DC Motor. It moves one motor at one power level. This setting requires a single motor to be connected to the DC Motor terminal and a single numeric constant to be connected to the Power/Speed terminal. The second setting is the Move DC Motors (group). It moves multiple motors at one power level. This setting requires an array of motors to be connected to the DC Motor terminal and a single numeric constant to be connected to the Power/ Speed terminal. The third setting is the Move DC Motors (Multi). It moves multiple motors at different power levels. This setting requires an array of motors to be connected to the DC Motor terminal. To specify the different power levels, you can use a numeric array. Right-click the Power/Speed terminal and click Create Constant. To resize the array, place the cursor over the icon, click and hold the top or bottom peg, and drag it to the desired size. Input numbers by double-clicking any of the numeric boxes and typing in a number. Each number in this array will be the power for its corresponding motor in the array wired up to the DC Motor terminal. This means that the first number will be the power for the first motor, the second number will be the power for the second motor, and so on. Clear up some space by deleting the numeric array and the DC Motor Configuration array. Wire the DC Motor Configuration constant into the DC Motor port of the TETRIX Move DC Motors function. Create a constant for its Power/Speed terminal and set it to 50. Put this function into a While loop and set the Conditional terminal to False. The program should look similar to the program in Figure 7. Figure 7. While loop around TETRIX Move DC Motors function Run the program and notice that the motor will run forever, as expected. Now remove the While loop by right-clicking it and clicking Remove While Loop. Also, delete the Boolean constant. Create a Wait For function and set its Time terminal to 10. Create another TETRIX Move DC Motors function, wire in the DC Motor Configuration constant into its DC Motor Port, and set its Power/Speed terminal to 0. Wire up the NXT terminals of the functions, starting at the TETRIX Move DC Motors function on the left and ending on the TETRIX Move DC Motors function on the right. Recall that the role of these NXT wires is to ensure that the functions run in the order you set them to. The program should look similar to the program in Figure 8. Figure 8. TETRIX Move DC Motors functions and Wait For function Run the program, and you will notice that the DC Motor will stop running after about 2.5 seconds even though the Wait function should wait for 10 seconds before stopping the motor. This problem can no longer be solved by placing the code into the While loop, and a new solution must be applied. 5.12

Watchdog Unit 5: Programming Guide The reason for the motors mysteriously stopping is called the Watchdog. Each Motor Controller hooked up to the NXT has a Watchdog. If the Watchdog is not fed for 2.5 seconds, all the motors in that controller will shut off and prevent any damage or injury from occurring. In order to keep the Watchdog from stopping the motors after 2.5 seconds, you must feed it. Right-click the Block Diagram, go into the TETRIX sub-palette, click the TETRIX Feed Watchdog function, and place it on the Block Diagram, as shown in Figure 9. Figure 9. Feed Watchdog function This function will feed the Watchdog and reset the timer that turns off the motors. Specify which motor controller s Watchdog you want to feed by creating constants for the Port and Motor Controller terminals and specifying them according to how your motor controller is wired up to your NXT. In order for the motors to run forever, the Watchdog must be fed over and over again, so place it in a While loop and wire a False into its Conditional terminal. The motors will keep running as long as the Watchdog is fed every 2.5 seconds, but just to be on the safe side, feed it every second. Do this by placing a Wait For function in the While loop, creating a constant for its Time terminal, typing 1 into it, and wiring the NXT output terminal of the TETRIX Feed Watchdog function to the NXT input terminal of the Wait For function, as shown in Figure 10. Figure 10. Feed Watchdog loop Now the DC Motor will run for 10 seconds and then turn off. The program will not actually end because the While loop is still running, and this is where the NXT Flags are useful. 5.13

Unit 5: Programming Guide NXT Flags The NXT Flag function can be found by right-clicking the Block Diagram, going into the NXT I/O sub-palette, and then going into the Advanced sub-palette. There are three NXT Flag functions in this sub-palette: Check NXT Flag, Set NXT Flag True, and Set NXT Flag False, as shown in Figure 11. Figure 11. NXT Flag functions These functions act as messengers between parallel sections of code. The Check NXT Flag function has an NXT Flag terminal that can be set from zero to 15. This number corresponds to the set that the flag belongs to. This means that there can be a total of 16 different flags all communicating within their own groups. The status terminal outputs the flag s value, which can be either true or false. The Set NXT Flag True function sets the flag s value to true, and the Set NXT Flag False function sets the flag s value to false. In this case you want to stop feeding the Watchdog when the motor is turned off. The only way to stop feeding the Watchdog is to exit the While loop, so the While loop must be exited when the motor is turned off. Place a Check NXT Flag function into the While loop and wire up its status terminal to the Conditional terminal. When the value of the flag is true, the While loop will exit and the Watchdog will no longer be fed. This must occur right after the motor has been turned off, so place a Set NXT Flag True function onto the Block Diagram and wire the NXT output terminal of the TETRIX Move DC Motors function into its NXT input terminal. In order to be sure that the value of the flag is false to begin with, place a Set NXT Flag False function to the left of the While loop and wire its NXT output terminal directly into the left side of the While loop. This will set the flag s value to false before the While loop begins running. The program should now be similar to Figure 12. Figure 12. Fully functional program The NXT Flag Number terminal of each of the NXT Flag functions has been left unwired, so it is defaulted to 0 on each of them. Now, as soon as the motor is turned off, the flag s value will become true, and the While loop will stop running. The Watchdog will no longer be fed, so if for some reason the motor did not turn off, it will turn off after 2.5 seconds of the Watchdog not being fed. 5.14

Unit 5: Programming Solution Overview Drive Forward: This sequence of functions moves two TETRIX DC Motors in the same direction for five seconds and then stops both motors. These two DC Motors are named Left and Right. They are connected to Motor Controller 1, which is connected to Port 1 of the NXT Brick. File name: Unit5a.vi Turn: This sequence of functions moves two TETRIX DC Motors to the left and to the right for five seconds and then stops both motors. These two DC Motors are named Left and Right, respectively. They are connected to Motor Controller 1, which is connected to Port 1 of the NXT Brick. File name: Unit5a.vi LabVIEW library files Each lesson contains a LabVIEW library file. The library file contains all of the solution VIs. To open the library file: 1. In the Lesson Interface menu, click Programming Solution VI. This will open up the LLB Manager menu. 2. Double-click the appropriate programming solution VI file for the lesson. Motor Configuration Files To run the Programming Solution VI without the motor configuration files: 1. Click Cancel when you launch the program and LabVIEW prompts you for the motor configuration files. 2. The motor configuration files on the Block Diagram will be gray. 3. Create motor configuration files for the DC Motors and servos attached to your NXT Brick. 4. Replace each gray motor configuration on the Block Diagram with the same kind (DC Motor or servo) and same type (constant or array) of configuration. Drive Forward Place a TETRIX Move DC Motors (A) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Move DC Motors function. 4. Click Block Diagram. Place a Wait (time) (A) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Click Wait For function. 4. Click Block Diagram. Place a TETRIX Move DC Motors (B) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Move DC Motors function. 4. Click Block Diagram. 5.15

Unit 5: Programming Solution Create an array for the DC Motor terminals on the TETRIX Move DC Motors (A and B) functions: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Go to Motor Configurations sub-palette. 4. Click the DC Motor Configuration array you made using the TETRIX Motor Configurator. 5. Click Block Diagram. 6. Resize array to include two constants. 7. Click top constant and set it to Left. 8. Click bottom constant and set it to Right. 9. Click output terminal of the DC Motor Configuration array. 10. Click DC Motors terminal of the TETRIX Move DC Motors (A) function. 11. Click any point of the wire that connects the DC Motor Configuration array with the TETRIX Move DC Motors (A) function. 12. Click DC Motors terminal of the TETRIX Move DC Motors (B) function. Create a constant for the Power/Speed terminal of the TETRIX Move DC Motors (A) function: 1. Right-click Power/Speed terminal of the TETRIX Move DC Motors (A) function. 2. Go to Create tab. 3. Click Constant. 4. Type 75. 5. Press Enter. Create a constant for the Power/Speed terminal of the TETRIX Move DC Motors (B) function: 1. Right-click Power/Speed terminal of the TETRIX Move DC Motors (B) function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Create a constant for the Time terminal of the Wait (time) (A) function: 1. Right-click Time terminal of the Wait (time) (A) function. 2. Go to Create tab. 3. Click Constant. 4. Type 5. 5. Press Enter. Connect the NXT terminals of both TETRIX Move DC Motors (A and B) functions and the Wait (time) (A) function: 1. Click NXT output terminal of the TETRIX Move DC Motors (A) function. 2. Click NXT input terminal of the Wait (time) (A) function. 3. Click NXT output terminal of the Wait (time) (A) function. 4. Click NXT input terminal of the TETRIX Move DC Motors (B) function. Place a TETRIX Feed Watchdog function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Feed Watchdog function. 4. Click Block Diagram. Place a Wait (time) (B) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Click Wait For function. 4. Click Block Diagram. 5.16

Unit 5: Programming Solution Create a constant for the Port terminal of the TETRIX Feed Watchdog function: 1. Right-click Port terminal of the TETRIX Feed Watchdog function. 2. Go to Create tab. 3. Click Constant. 4. Click the created constant to open the drop-down menu. 5. Click Port 1. Create a constant for the Motor Controller terminal of the TETRIX Feed Watchdog function: 1. Right-click Motor Controller terminal of the TETRIX Feed Watchdog function. 2. Go to Create tab. 3. Click Constant. 4. Type 1. 5. Press Enter. Create a constant for the Time terminal of the Wait (time) (B) function: 1. Right-click Time terminal of the Wait (time) (B) function. 2. Go to Create tab. 3. Click Constant. 4. Type 1. 5. Press Enter. Connect the NXT terminals of the TETRIX Feed Watchdog function and the Wait (time) (B) function: 1. Click NXT output terminal of the TETRIX Feed Watchdog function. 2. Click NXT input terminal of the Wait (time) (B) function. Create a While loop around the TETRIX Feed Watchdog function and the Wait (time) (B) function: 1. Right-click Block Diagram. 2. Go to Structures sub-palette. 3. Click While loop structure. 4. Click Block Diagram. 5. Move the mouse so that the TETRIX Feed Watchdog function and the Wait (time) (B) function are inside of the outlined box. 6. Click Block Diagram again. Place a Check NXT Flag function into the While loop: 1. Right-click Block Diagram. 2. Go to the NXT I/O sub-palette. 3. Go to the Advanced sub-palette. 4. Click Check NXT Flag function. 5. Click inside While loop. Connect the status terminal of the Check NXT Flag function into the Conditional terminal of the While loop: 1. Click status terminal of the Check NXT Flag function. 2. Click Loop Condition terminal of the Conditional terminal in the While loop. Create a constant for the NXT Flag Number terminal of the Check NXT Flag function: 1. Right-click NXT Flag Number terminal of the Check NXT Flag function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. 5.17

Unit 5: Programming Solution Place a Set NXT Flag True function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Go to Advanced sub-palette. 4. Click Set NXT Flag True function. 5. Click Block Diagram. Create a constant for the NXT Flag Number terminal of the Set NXT Flag True function: 1. Right-click NXT Flag Number terminal of the Set NXT Flag True function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Connect the NXT terminals of the Set NXT Flag True function and the TETRIX Move DC Motors (B): 1. Click NXT output terminal of the TETRIX Move DC Motors (B) function. 2. Click NXT input terminal of the Set NXT Flag True function. Place a Set NXT Flag False function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Go to Advanced sub-palette. 4. Click Set NXT Flag False function. 5. Click Block Diagram. Create a constant for the NXT Flag Number terminal of the Set NXT Flag False function: 1. Right-click NXT Flag Number terminal of the Set NXT Flag False function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Connect the NXT terminals of the Set NXT Flag False function and the NXT Feed Watchdog function: 1. Click NXT output terminal of the Set NXT Flag True function. 2. Click NXT input terminal of the TETRIX Feed Watchdog function. Final Program This program will run two TETRIX DC Motors in the same direction for five seconds and then stop both of them. 5.18

Unit 5: Programming Solution Turn Place a TETRIX Move DC Motors (A) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Move DC Motors function. 4. Click Block Diagram. Place a TETRIX Move DC Motors (B) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Move DC Motors function. 4. Click Block Diagram. Place a Wait (time) (A) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Click Wait For function. 4. Click Block Diagram. Place a TETRIX Move DC Motors (C) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Move DC Motors function. 4. Click Block Diagram. Create a constant for the DC Motors terminal on the TETRIX Move DC Motors (A) function: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Go to Motor Configurations sub-palette. 4. Click DC Motor Configuration constant you made in the TETRIX Motor Configurator. 5. Click Block Diagram. 6. Click the created constant. 7. Click Left. 8. Click the output terminal of the DC Motor Configuration constant. 9. Click DC Motors terminal of the TETRIX Move DC Motors (A) function. Create a constant for the DC Motors terminal on the TETRIX Move DC Motors (B) function: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Go to Motor Configurations sub-palette. 4. Click DC Motor Configuration constant you made in the TETRIX Motor Configurator. 5. Click Block Diagram. 6. Click the created constant. 7. Click Right. 8. Click output terminal of the DC Motor Configuration constant. 9. Click DC Motors terminal of the TETRIX Move DC Motors (B) function. 5.19

Unit 5: Programming Solution Create an array for the DC Motors terminal on the TETRIX Move DC Motors (C) function: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Go to Motor Configurations sub-palette. 4. Click DC Motor Configuration array you made in the TETRIX Motor Configurator. 5. Click Block Diagram. 6. Resize array to include two constants. 7. Click top constant and set it to Left. 8. Click bottom constant and set it to Right. 9. Click output terminal of the array. 10. Click DC Motors terminal of the TETRIX Move DC Motors (C) function. Create a constant for the Power/Speed terminal of the TETRIX Move DC Motors (A) function: 1. Right-click Power/Speed terminal of the TETRIX Move DC Motors (A) function. 2. Go to Create tab. 3. Click Constant. 4. Type -75. 5. Press Enter. Create a constant for the Power/Speed terminal of the TETRIX Move DC Motors (B) function: 1. Right-click Power/Speed terminal of the TETRIX Move DC Motors (B) function. 2. Go to Create tab. 3. Click Constant. 4. Type 75. 5. Press Enter. Create a constant for the Time terminal of the Wait (time) (A) function: 1. Right-click Time terminal of the Wait (time) (A) function. 2. Go to Create tab. 3. Click Constant. 4. Type 5. 5. Press Enter. Create a constant for the Power/Speed terminal of the TETRIX Move DC Motors (C) function: 1. Right-click Power/Speed terminal of the TETRIX Move DC Motors (C) function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Connect the NXT terminals of the three TETRIX Move DC Motors (A, B, and C) function and the Wait (time) (A) function: 1. Click NXT output terminal of the TETRIX Move DC Motors (A) function. 2. Click NXT input terminal of the TETRIX Move DC Motors (B) function. 3. Click NXT output terminal of the TETRIX Move DC Motors (B) function. 4. Click NXT input terminal of the Wait (time) (A) function. 5. Click NXT output terminal of the Wait (time) (A) function. 6. Click NXT input terminal of the TETRIX Move DC Motors (C) function. Place a TETRIX Feed Watchdog function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to TETRIX sub-palette. 3. Click TETRIX Feed Watchdog function. 4. Click Block Diagram. 5.20

Unit 5: Programming Solution Place a Wait (time) (B) function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Click Wait For function. 4. Click Block Diagram. Create a constant for the Port terminal of the TETRIX Feed Watchdog function: 1. Right-click Port terminal of the TETRIX Feed Watchdog function. 2. Go to Create tab. 3. Click Constant. 4. Click Constant to open the drop-down menu. 5. Click Port 1. Create a constant for the Motor Controller terminal of the TETRIX Feed Watchdog function: 1. Right-click Motor Controller terminal of the TETRIX Feed Watchdog function. 2. Go to Create tab. 3. Click Constant. 4. Type 1. 5. Press Enter. Create a constant for the Time terminal of the Wait (time) (B) function: 1. Right-click Time terminal of the Wait (time) (B) function. 2. Go to Create tab. 3. Click Constant. 4. Type 1. 5. Press Enter. Connect the NXT terminals of the TETRIX Feed Watchdog function and the Wait (time) (B) function: 1. Click NXT output terminal of the TETRIX Feed Watchdog function. 2. Click NXT input terminal of the Wait (time) (B) function. Create a While loop around the TETRIX Feed Watchdog function and the Wait (time) (B) function: 1. Right-click Block Diagram. 2. Go to Structures sub-palette. 3. Click While loop structure. 4. Click Block Diagram. 5. Move the mouse so that the TETRIX Feed Watchdog function and the Wait (time) (B) function are inside of the outlined box. 6. Click Block Diagram again. Place a Check NXT Flag function into the While loop: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Go to Advanced sub-palette. 4. Click Check NXT Flag function. 5. Click inside While loop. Connect the status terminal of the Check NXT Flag function into the Conditional terminal of the While loop: 1. Click status terminal of the Check NXT Flag function. 2. Click Loop Condition terminal of the Conditional terminal in the While loop. 5.21

Unit 5: Programming Solution Create a constant for the NXT Flag Number terminal of the Check NXT Flag function: 1. Right-click NXT Flag Number terminal of the Check NXT Flag function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Place a Set NXT Flag True function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Go to Advanced sub-palette. 4. Click Set NXT Flag True function. 5. Click Block Diagram. Create a constant for the NXT Flag Number terminal of the Set NXT Flag True function: 1. Right-click NXT Flag Number terminal of the Set NXT Flag True function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Connect the NXT terminals of the Set NXT Flag True function and the TETRIX Move DC Motors (C): 1. Click NXT output terminal of the TETRIX Move DC Motors (C) function. 2. Click NXT input terminal of the Set NXT Flag True function. Place a Set NXT Flag False function onto the Block Diagram: 1. Right-click Block Diagram. 2. Go to NXT I/O sub-palette. 3. Go to Advanced sub-palette. 4. Click Set NXT Flag False function. 5. Click Block Diagram. Create a constant for the NXT Flag Number terminal of the Set NXT Flag False function: 1. Right-click NXT Flag Number terminal of the Set NXT Flag False function. 2. Go to Create tab. 3. Click Constant. 4. Type 0. 5. Press Enter. Connect the NXT terminals of the Set NXT Flag False function and the NXT Feed Watchdog function: 1. Click NXT output terminal of the Set NXT Flag True function. 2. Click NXT input terminal of the TETRIX Feed Watchdog function. Final Program This program will run two TETRIX DC Motors in opposite directions for five seconds and then stop both of them. 5.22

Unit 5: Student Lesson Lesson Overview: Program the TETRIX robot to move forward as well as turn to gain experience programming the TETRIX components in NI LabVIEW. In addition, evaluate the robot s performance driving straight and turning to see how well the robot chassis performs and make any necessary design adjustments to the motors or configuration. Estimated Time: 2 hours (2-3 class periods) Learning Objectives: Engineering Design: Students should be able to describe any redesign they did after testing their robot s ability to turn and drive straight. Students should be able to describe the research they did in characterizing how their TETRIX robot performs. Classroom Materials: Multiple yardsticks and/or tape measures Teacher Pre-activity Preparation: Distribute Student Lesson. Create a sample program for a TETRIX robot. Building: Students will be able to redesign parts of their robot (as needed) based on programming testing. Unit Resources: Unit 5: Robot Base Student Lesson (Teacher CD) Video 4: Basic Robot Programming Programming: Students will be able to use the TETRIX DC motor commands. Students will be able to use the Motor Configurator to set up their TETRIX motors. Students will be able to create a Watchdog loop. Students will be able to use NXT flags. Each student group: No additional materials needed. Vocabulary: characterize: to document or describe the properties or characteristics of something (e.g., Characterize how fast the robot moves.) Watchdog: a programmatic safety mechanism within LabVIEW that turns off the HiTechnic DC motors after 2.5 seconds 5.23

Unit 5: Student Lesson Name: Date: Building Use the robot chassis you constructed in the previous lesson. Check all of the connections and wires. Programming Watch Video 4: Basic Robot Programming. Use the TETRIX building system Motor Configurator to create a configuration for the motors on the robot. Write a program to move the robot forward for one second at power level 50. Deploy and run the program. Test the robot on the floor with plenty of empty space surrounding the robot. If the robot doesn t drive forward, adjust the configuration to set one of the motors to reverse. To reset the Watchdog timer, a Watchdog loop is needed for programs that move the motors forward for more than 2.5 seconds. Add a Watchdog loop to the program. 5.24