Activity Basic Inputs Programming - VEX Clawbot

Similar documents
Activity Basic Inputs Programming VEX

Activity Basic Inputs Programming VEX

2. Within your four student group, form a two student team known as Team A and a two student team known as Team B.

Activity Basic Inputs Programming Answer Key (VEX)

Activity Basic Outputs Programming VEX

Activity Basic Outputs Programming VEX

Activity Variables and Functions VEX

Activity Basic Outputs Programming Answer Key (VEX) Introduction

Activity While Loops and If-Else Structures VEX

Activity Inputs and Outputs VEX

Activity Inputs and Outputs VEX

Activity While Loops and If-Else Structures Answer Key (VEX) Introduction

Troubleshooting ROBOTC with Cortex

Movement using Shaft Encoders

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run

RobotC for VEX. By Willem Scholten Learning Access Institute

Getting Started in RobotC. // Comment task main() motor[] {} wait1msec() ; = Header Code Compile Download Run

Variables and Functions. ROBOTC Software

Testing VEX Cortex Robots using VEXnet

RobotC. Remote Control

TETRIX Getting Started Guide. Harvester and Transporter Programming Guide (ROBOTC )

VEX/RobotC Video Trainer Assignments

Activity Robot Behaviors and Writing Pseudocode

VEX Robot Remote Control Set-Up

K Force The Kristin Robotics Team Introductory Programming Tutorial 2014 For use with the teams squarebot training robots.

16-311: Getting Started with ROBOTC and the. LEGO Mindstorms NXT. Aurora Qian, Billy Zhu

Download Program. Setup ROBOTC. task main() { motor[motorc] = 100; wait1msec(3000);

TETRIX Getting Started Guide. Launcher Programming Guide (ROBOTC )

MS4SSA Robotics Module:

Step 1: Connect the Cortex to your PC

VEX Robotics A Primer

2

Programming in ROBOTC ROBOTC Rules

G. Tardiani RoboCup Rescue. EV3 Workshop Part 1 Introduction to RobotC

VEX ARM Cortex -based Microcontroller and VEXnet Joystick User Guide

RobotC primer. Alexander Kirillov

Autonomous Parking. LEGOeducation.com/MINDSTORMS. Duration Minutes. Learning Objectives Students will: Di culty Beginner

Getting Started with FTC Using RobotC

VEX Startup and Configuration Procedures

MS4SSA Robotics Module:

EV3 Programming Workshop for FLL Coaches

USB. Bluetooth. Display. IO connectors. Sound. Main CPU Atmel ARM7 JTAG. IO Processor Atmel AVR JTAG. Introduction to the Lego NXT

RCX Tutorial. Commands Sensor Watchers Stack Controllers My Commands

Introduction to Robotics using Lego Mindstorms EV3

ROBOTC Basic Programming

Programming with the NXT using the touch and ultrasonic sensors. To be used with the activity of the How do Human Sensors Work?

Autonomy/Encoders Forward for Distance

Colin Harman and Jonathan Kim

Programming Techniques Workshop for Mindstorms EV3. Opening doors to the worlds of science and technology for Oregon s youth

Tutorial: Making Legobot Move Steering Command Brighton H.S Engineering By: Matthew Jourden

Unit 03 Tutorial 3: Sensors: Touch Sensor Brighton H.S Engineering By: Matthew Jourden

TETRIX Getting Started Guide FTC Extension. Programming Guide (ROBOTC ) Autonomous Programming

LEGO Mindstorm EV3 Robots

Robotics Study Material School Level 1 Semester 2

Programming Preset Heights in ROBOTC for VEX Robotics By George Gillard

Part A: Monitoring the Rotational Sensors of the Motor

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

LME Software Block Quick Reference 1. Common Palette

Robotics Jumpstart Training II. EasyC: Software & Firmware Updates

The Arduino IDE. & ArduBlock

Experiment 4.A. Speed and Position Control. ECEN 2270 Electronics Design Laboratory 1

ROBOLAB Tutorial MAE 1170, Fall 2009

Intro to Programming the Lego Robots

Creating a robot project

Don t Bump into Me! Pre-Quiz

PROGRAMMING ROBOTS AN ABSTRACT VIEW

LEGO mindstorm robots

Brought to you by WIRED Les Quiocho September 30, 2017

contents in detail introduction...xxi 1 LEGO and robots: a great combination the EV3 programming environment... 5

RobotC Basics. FTC Team 2843 SSI Robotics October 6, 2012 Capitol College FTC Workshop

CORTEX Microcontroller and Joystick User Guide

Robotics II. Module 2: Application of Data Programming Blocks

INDEX. Tasks 1-9. Tasks Tasks Tasks Tasks Tasks Tasks Tasks Tasks Tasks Tasks

Robotics II. Module 1: Introduction to Data & Advanced Programming Blocks

INTRODUCTION LEGO MINDSTORMS NXT AND LABVIEW 8.6

CORTEX Microcontroller and Joystick Quick Start Guide

TETRIX Getting Started Guide FTC Extension

Sensor Melody Light Robot

Advanced RobotC. Sensors and Autonomous Coding Teams 5233 Vector and 5293 Rexbotics

B - Broken Track Page 1 of 8

Competitive VEX Robot Designer. Terminal Objective 5.2: program functions to accept values

US Version USER GUIDE COMPUTER SCIENCE SCIENCE TECHNOLOGY ENGINEERING MATH. LEGOeducation.com/MINDSTORMS

OBSTACLE AVOIDANCE ROBOT

The Beginners Guide to ROBOTC. Volume 2, 3 rd Edition Written by George Gillard Published: 18-July-2016

Tech Tips. BeeBots. WeDo

Adaptive Cruise Control

NXT Programming for Beginners Project 9: Automatic Sensor Calibration

Robotic Systems ECE 401RB Fall 2006

Today. Robotics and Autonomous Systems. The scenario (again) Basic control loop

Part I. "Hello, world"

Programming With easyc Kevin Barrett September 12, 2015

Hands-on Lab. Lego Programming BricxCC Basics

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

TETRIX Getting Started Guide FTC Extension

Wall-Follower. Xiaodong Fang. EEL5666 Intelligent Machines Design Laboratory University of Florida School of Electrical and Computer Engineering

Computer science Science Technology Engineering Math. LEGOeducation.com/MINDSTORMS

The Maze Runner. Alexander Kirillov

Sonar range sensor WiFi n

INTRODUCTION TO ARTIFICIAL INTELLIGENCE

Clawbotics Control Center:

Transcription:

Activity 3.1.3 Basic Inputs Programming - VEX Clawbot Introduction Inputs are devices which provide a processor with environmental information to make decisions. These devices have the capacity to sense the environment in a variety of ways such as physical touch, rotation, and light. An engineer can design a system to respond to its environment through the use of input sensors. In this activity you will use ROBOTC and VEX robotics platform components to sense the environment. Equipment Procedure Computer with ROBOTC software POE Clawbot POE Clawbot ROBOTC template Part 1 - Bump Switch 1. Connect the POE Clawbot Cortex to the PC with the USB cable. Open your POE Clawbot ROBOTC template. Click File, Save As, select the folder that your teacher designated for you to save your ROBOTC programs in, then name the file A3.1.3_Part1. 2. In this activity you will use and program many of the Clawbot's inputs and outputs. For the next part, support your Clawbot on a box so that the wheels are not in contact with the table top. 3. Copy and paste or create the program below in the task main() section of the program between the curly braces. untilbump(bumpswitch); startmotor(rightmotor, 67); wait(5); 4. Power on the Cortex. 5. Compile and download the program. If you have any errors, check with your instructor to troubleshoot your program. 6. Press Start to run the program and observe the behaviors. 7. Document what this program would look like as pseudocode simple behaviors in the psuedocode section of the program. 8. Save the program to your saved files location. Bump Switch

Part 2 - Bump Switch II 9. Create a copy of your program file from above, then rename the it A3.1.3_Part2. 10. The wiring configuration, motors &sensors tabs should remain the same as before. 11. Write a program that performs the following simple behaviors. Use the natural language functions where appropriate as shown below. Add comments at the end of each command line to explain the purpose of each step. a. Wait for the bumper switch to be bumped. Note that bump means that a switch is pressed and released and not simply pressed and held. b. Both motors turn on at half power until the sensor is bumped again. c. Both motors should then move in reverse at half power for 3.5 seconds. d. Both motors will stop. Natural LanguageMovement Natural Language Special Natural LanguageUntil Natural LanguageWait 12. Test the program and troubleshoot if needed until the expected behavior has occurred.

Part 3 - Quadrature Encoders 13. Open the POE Clawbot ROBOTC template. Click File, Save As, select the folder that your teacher designated, then name the file A3.1.3_Part3. 14. The wiring configuration and motors and sensors tabs should be the same as in previous activities. 15. Copy and paste or create the program below in the task main() section of the program between the curly braces. startmotor(leftmotor, 63); startmotor(rightmotor, 63); untilencodercounts(480,leftencoder); untilencodercounts(480,rightencoder); stopmotor(leftmotor); 16. Download and run the program. Observe the behaviors and document what this program would look like as pseudocode simple behaviors in the pseudocode section of the programming file. 17. Modify your program to perform the pseudocode below. a. Turn on both motors 1/2 speed forward until the encoder has counted 480 degrees b. Stop both motors c. Wait 2 seconds d. Turn on both motors in reverse at 1/2 speed until another 3.5 rotations of the encoder have passed e. Turn off both motors Quad/Optical Encoder 18. Test the program and troubleshoot until the expected behavior has occurred. Save the program file. Part 4 - Line Followers 1. Open the POE Clawbot ROBOTC template. Click File, Save As, select the folder that your teacher designated, then name the file A3.1.3_Part4. 2. The wiring configuration and motors and sensors tabs should be the same as above. 3. Set the line follower threshold. Thresholds allow your robot to make decisions via Boolean Comparisons a. Calculate an appropriate Threshold with the aid of the Sensor Debug Window (see next page). Line Followers

b. Open the Sensor Debugger Window c. Verify that the Program Debug Window s Refresh Rate reads "Continuous". d. Place a white object (e.g., paper) within ¼ and 1/8 in. in front of the line follower sensors. Record the value for the sensors displayed in the Sensors Debug Window. Make sure that there is enough light to illuminate the white object or the sensors will register darkness. e. Place a dark object within ¼ and 1/8 in. in front of the line follower sensors. Record the value for the sensors displayed in the Sensors Debug Window. f. Add the two values and divide by 2. The result is the threshold for the sensors. 4. Copy and paste or create the program below in the task main() section of the program between the curly braces. Substitute your threshold number for "1000". wait1msec(2000); // The program waits for 2000 milliseconds before continuing. int threshold = 1000; /* found by taking a reading on both DARK and LIGHT */ /* surfaces, adding them together, then dividing by 2. */ while(true) // RIGHT sensor sees dark: if(sensorvalue(rightlinefollower) > threshold) // counter-steer right: motor[leftmotor] = 63; motor[rightmotor] = 0; // CENTER sensor sees dark: if(sensorvalue(centerlinefollower) > threshold) // go straight motor[leftmotor] = 63; motor[rightmotor] = 63; // LEFT sensor sees dark: if(sensorvalue(leftlinefollower) > threshold) // counter-steer left: motor[leftmotor] = 0; motor[rightmotor] = 63; 5. Test the program and troubleshoot until the expected behavior has occurred. Save the program file to your folder.

Part 5 - Ultrasonic (Sonar) Sensor 6. Open the POE Clawbot ROBOTC template. Click File, Save As, select the folder that your teacher designated, then name the file A3.1.3_Part5. 7. The wiring configuration and motors and sensors tabs should be the same as above. Ultrasonic (Sonar) Sensor 8. Copy and paste or create the program below in the task main() section of the program between the curly braces. startmotor(leftmotor, 63); startmotor(rightmotor, 63); untilsonarlessthan(20, sonar); stopmotor(leftmotor); turnledon(green); wait(6.25); turnledoff(green); 9. Download and run the program. Observe the behaviors and document what this program would look like as pseudocode simple behaviors in the pseudocode section of your program file. 10. Modify your program to perform the pseudocode below. a. Wait until an object is detected within 20 cm to turn both motors on. b. Wait for the object to move more than 25 cm away before turning the motors off. 11. Test the program and troubleshoot until the expected behavior has occurred. Save the program file. Conclusion 1. Describe any challenges that you encountered while developing the programs. 2. Describe three applications for the use of sensors below that you worked with in this activity. Bump Switch: Quad Encoder: Sonar: