Home

Vex CORTEX Programming instructions

image

Contents

1. ROBOTICS DESIGN SYSTEM 276 2178 E 0610 Go to Reference Links Concepts to Understand continued Robust Fabrication continued EXAMPLE 1 continued Arm Extension continued By using two screws this design removes the possibility of rotation ak Two Screws around either one of NO o g Eliminate them Additionally the Cee Rotation design is more resilient WON 276 2178 E 0610 ROBOTICS DESIGN SYSTEM Inventor s Guide Concepts to Understand continued Robust Fabrication continued Go to Reference Links EXAMPLE 2 Bracing The extended bars are now attached firmly to each other and the long arm is mounted on your robot However the long arm is going to generate huge stresses at its mounting point because it is so long especially when the arm is used to lift a load Long Lever Arm Causes Great Strain on Mounting Point Single Screw Mounting Point Inventor s Guide Large Stress on Weak Mounting Point Causes Structural Failure i ROBOTICS DESIGN SYSTEM 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Concepts to Understand continued Robust Fabrication continued EXAMPLE 2 Bracing the Bars Shorter Lever Arm continued AIN CON Causes Less Strain In order to keep the arm SASIAN On Mounting Screw from falling down you will need to brace it You could use a second screw to hold it like you did with
2. 4 Move both joysticks through their full ranges of motion When the remote control detects that the joysticks have been fully rotated the JOYSTICK LED stops blinking red and green and switches to a solid green L JOYSTICK ROBOT oa 4a Move the Joysticks Move the joysticks through their full ranges of motion Up Down Left Right and in a circle 4b JOYSTICK LED Once the remote control detects that the joysticks have been fully rotated the JOYSTICK LED switches to solid green indicating that you can stop moving the joysticks Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 10 Go to Reference Links m AO asseris meam ROBOTC Reference Se BEW VEXnet Joystick Configuration in ROBOTC cont 5 Press the 8U button to save the new calibration 5 Save Press the 8U button to save the joystick calibration on your remote control The JOYSTICK LED will blink green for a few seconds Additional Information If the calibration is not saved the process will timeout after 10 seconds and the VEXnet LED will blink red To cancel a calibration press the 7U button The calibration process will be discontinued and the VEXnet LED will blink red Once the calibration is discontinued or saved all of the remote control LEDs will resume their normal function The joysticks must be calibrated any time the firmware
3. Power Subsystem A class of battery chemistries commonly used in disposable batteries This type of battery is not suited for use in robotics applications Allen Wrench An L shaped tool used to work with hex screws Analog Sensor Sensor Subsystem Analog sensors communicate with the Microcontroller by sending an electrical voltage that varies between 0 and the maximum voltage Analog Digital Port Bank Logic Subsystem A group of ports on the Microcontroller used for analog and digital communication with other parts of the robot system Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR Arcade style Controls Control Subsystem A driving mode in which the robot is controlled with one joystick on the controller like an arcade game Also called 12 mode because axes 1 and 2 are being used to drive the robot Attachment Structure Subsystem Generally any piece that is attached and not fundamentally part of the basic robot design Usually refers to such pieces as arms or sensor modules especially if they are removable Autonomous Logic Subsystem Technically a robot must be able to function entirely without human supervision to be considered fully autonomous Almost all real world robot systems are designed instead to work with partial autonomy under varying degrees of human supervision Autonomous Mode Logic Subsystem The VEX robot has a simple pre programmed autonomous mode tha
4. When designing a robot s structure it is important to think about making it strong and robust while still trying to keep it as lightweight as possible Sometimes overbuilding can be just as detrimental as underbuilding The frame is the skeleton of the robot and should be designed to be integrated cleanly with the robot s other components The overall robot design should dictate the chassis frame and structural design not vice versa Design is an iterative process experiment to find out what works best for a given robot a Inventor s Guide bles IGN SYSTE 276 2178 E 0610 Concepts to Understand continued Go to Reference Links Robust Fabrication Fasteners The most common problem with robots that fall apart or lose pieces easily is that groups of parts are not joined securely enough and separate from each other and move around EXAMPLE 1 Arm Extension A robot needs to be able to reach a goal that is high off the ground The goal is so high that a single long piece will not reach it Two pieces must be joined together to reach the desired height This attachment uses a single screw to join the two bars As you can see it has a problem when weight is applied to it the extension bar rotates around the screw Also if this screw were to come loose or fall out for any reason the entire arm would come crashing down Arm Rotates Too Easily Around This Point Inventor s Guide
5. match 2nd commands break command Marks the end of each case s command statements break default default case default commands If the switch value does not match any of the given case values the default case will run Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Switch Case 1 Go to Reference Links A proveer ueno me my ROBOTC Reference 5 PLTW Switch Case The touch sensors are used to set the value of turnVar in the program below The switch case statement is then used to determine what to do based on its value No sensors pressed will leave turnVar with a value of 0 and the robot will run the default case and go straight Pressing touch1 will give turnVar a value of 1 and make case 1 run left turn Pressing touch2 makes turnVar 2 which makes case 2 right turn run Both turns reset turnVar to 0 before ending to allow fresh input on the next pass of the loop task main i bMotorReflected port2 1 ine cur Vvac O while true Switch statement An The switch line designates the value that will 1f SensorValue touch 1 be evaluated to see if it matches any of the case turnVaral if SensokValue touch2 1 turnVar L Case statement The first line of a case includes the word case and a value If the value of the switch variable turnVar matches this case value 1 the code f
6. z keps nut x 2 Limited 90 day Warranty This product is warranted by Innovation One against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation One dealers For complete warranty details and exclusions check with your dealer Innovation One Inc 350 North Henderson Street Fort Worth TX 76102 11 04 Printed in China 0405 vex Inventor s Guide insert light sensor kit 1 2005 Innovation One All Rights Reserved Vex and Vex Robotics Design System are trademarks of Innovation One Go to Reference Links sensor accessories Technical overview The light sensor uses a Cadmium Sulfoselenide photoconductive photocell or CdS cell for short A CdS cell is a photoresistor meaning that its resistance value changes based on the amount of incident light This is an analog sensor so its output covers a range of values in this case from zero to five volts rather than being only high five volts or low zero volts as is the case for a digital sensor This range of outputs from zero to five volts is sent to the microcontroller which reads it as a range of integer values from 0 to 255 For more detail refer to the Sensors chapter in your Vex Inventor s Guide For this particular sensor a low value around 0 corresponds to very bright light and a high value around 255 corresponds to darkness Maximum Mini
7. Program control structures in ROBOTC enable a program to control its flow outside of the typical top to bottom fashion task main Creates a task called main needed in every program Task main is responsible for holding the code to be executed within a program while condition Used to repeat a section of code while a certain condition remains true An infinite while loop can be created by ensuring that the condition is always true e g 1 1 or true cdl es eae Ie SOOO 7 ama stele eae sie See ST iclaicina a SiS Motor ports 21 a Moror ports en tor WO if cond rion else With this command the program will check the condition within the if statement s parentheses and then execute one of two sets of code If the condition is true the code inside the if state ment s curly braces will be run If the condition is false the code inside the else statement s curly braces will be run instead The else condition is not required when using an if statement if SensorValue bumper 1 the bumper is used as ene ee omer carom Meron Petes 20 gt aiT Ss Ores SoG pores eShops else Kece e Pores le a ti li Canoe eo resceo pOreoe tums Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 5 Go to Reference Links a e U I J PROJECT LEAD THE WAY RSh 4 U ROBOTC Reference
8. Robotics Reference Guide Version 2 0 This guide undergoes continuous revision including the addition of more reference guides Be sure to visit the engineering section of the Igniting imagination and innovation through learning Virtual Academy to ensure that you ROBOTC have the most recent version To determine whether you have the tht Carnegie Mellon ss Robotics Academy PROJECT LEAD THE WAY most up to date version reference the date in the filename ROBOTICS DESIGN SYSTEM Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ER Refe rence Li nks Each Reference below is a link to that file Building with VEX Introduction to the Structure Subsystem VEX Inventor s Guide Robust Fabrication VEX Inventor s Guide Introduction to the Motion Subsystem VEX Inventor s Guide Cortex Pin Guide ROBOTC Reference Getting Started VEX Cortex Configuration Over USB ROBOTC Reference Using the PLTW Template ROBOTC Reference Sample Programs ROBOTC Reference Running a Program ROBOTC Reference VEXnet Joystick Configuration ROBOTC Reference Programming Sense Plan Act ROBOTC Reference Behaviors ROBOTC Reference Pseudocode amp Flow Charts ROBOTC Reference Program Design ROBOTC Reference ROBOTC Natural Language Cortex Quick Reference ROBOTC Reference The ROBOTC Debugger ROBOTC Reference White Space ROBOTC Reference Co
9. SPDT switch Sensor Subsystem Short for Single Pole Double Throw A switch that is activated by a single contact single pole but changes the state of two outputs at once double throw The Limit Switch Sensor is an SPDT switch but one of the two outputs is hidden making it function effectively as an SPST switch Speed Motion Subsystem Technically speed is the magnitude of velocity i e velocity but without indicating direction It is most commonly used to mean the rate of movement of a vehicle By extension it can also mean the rate of rotation of a gear or wheel It is also sometimes used to refer to a vehicle s potential maximum speed as opposed to its acceleration capability SPST switch Sensor Subsystem Short for Single Pole Single Throw A switch that is activated by a single contact single pole and changes the state of a single output single throw The Bumper Switch Sensor is an SPST switch Stability Structure Subsystem The ability of a robot to remain upright and steady while moving over terrain and traversing obstacles Stall Motor Motion Subsystem A condition where a motor encounters so much resistance that it cannot turn It is damaging for the motor to be in this condition The motor can get hot and can stop functioning Stick Mode Control Subsystem An advanced feature of the Transmitter that allows control channels 2 and 3 to trade places on the joysticks
10. around the circumference is positioned between an LED and a light MATITE Ug a A detector as the disc rotates the light from the LED is blocked ina WALUT UDIN A regular pattern This pattern is processed to determine how far the Hagemiky i l KERA disc has rotated If the disc is then attached to a wheel on a robot it is possible to determine the distance that wheel traveled based on the circumference of the wheel and the number of revolutions it made With the Quadrature Encoder there are 2 output channels Only one output can be used as a basic Optical Shaft Encoder The term quadrature refers to the situation where there are two output channels that is two square waves 90 degrees out of phase with each other being outputted by the unit The two output channels of the Quadrature Encoder can be used to indicate both position and direction of rotation Optical Shaft Encoder x 2 Screw x 4 8 32 3 8 Keps Nut x 4 Limited 90 day Warranty This product is warranted by Innovation First against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation First dealers For complete warranty details and exclusions check with your dealer Innovation First Inc 1519 IR 30 W Greenville TX 75402 For More Information and additional Parts amp Pieces refer to 08 07 www Vex Robotics com vEXx Optical Shaft Encoder Kit 1
11. 1000 Hz is a frequently used unit also Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 4 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt es ROBOTC Reference Glossary continued Horticulture Culture or growing of garden plants Hypothesis An educated explanation describing the possible relationship between two or more factors A good hypothesis is very specific providing detailed useful information A good hypothesis is also testable meaning that experimentation can help to show whether the hypothesis is correct or incorrect though it cannot ever conclusively prove correctness Independent Variable In an experimental setup the variable that is set and changed in different experimental conditions by the experimenter in order to see whether these changes cause a change in the dependent responding variable Also called the manipulated variable Innovate Introduce something new usually to make an improvement Input See Sensor Something which is sent to the controller which is used in its program An input is typically a sensor value sent by a sensor An input may also refer to the sensor itself Integration The process of combining or accumulating usually in a well ordered and useful way To integrate sensor data for example would be to combine data from two or more sensors in a useful way To integrate two parts of a robot would
12. Functions offer a number of distinct advantages over basic step by step coding e They save time and space by allowing common behaviors to be written as functions and then run together as a single statement rather than re typing all the individual commands e Separating behaviors into different functions allows your code to follow your planning more easily one function per behavior or even sub behavior e Through the use of parameters multiple related but not identical tasks can be handled with a single intuitive function Using Functions Functions must be created and then run separately A function is created by declaring it and run by calling it 1 Declare Your Function Declare the function by using the word void followed by the name you wish to give to the function It s helpful to give the function a StartMotor armMotor 63 name that reflects the behavior it will perform Mee e475 See low om caine On Vold rotat Arm Within the function s curly braces write the commands exactly as you would normally When the function is called it will run the lines between its braces in order just like task main does with the code between its own braces task main rotateArm 2 Call Your Function Once your declare your function it acts like a new command in the language of ROBOTC To run the function simply call it by name remember that its name includes the par
13. Hz which is one wave per second v 5 N n L a Gantt Chart A bar chart that illustrates a project schedule broken into subschedules for each of the tasks needed to complete the project Distance Gear Ratio The number of times the driving axle in a system must spin to make the driven axle turn once With gears the gear ratio can be found by counting the number of teeth on the driven gear and dividing by the number of teeth on the driving gear Gear Train A series of gears that transmit power between axles Gimbal A mechanical device that allows the rotation of an object in multiple dimensions GPS An acronym which stands for Global Positioning System A GPS receiver can accurately determine its location latitude longitude and altitude by processing signals sent by more than two dozen GPS satellites Graph A line or curve representing the variation of one quantity with another Graphing Representing data on a graph Hertz Unit of measurement for the frequency of repeating events defined as one repetition per second With sound for instance frequency is the number of pressure waves that travel past a certain point in a certain amount of time each time the peak of a wave travels by that point you can count one cycle of the wave Thus if ten peaks travel by in one second the wave has a frequency of 10 hertz Many waves travel so quickly that thousands of peaks will go by ina second thus the kilohertz kHz
14. If the Potentiometer has reached Jf LES mimmin IOLE se Mocorleorctol 0 turm che motor Ori Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Potentiometers 3 pF l Go to Reference Links sensor accessories Potentiometer Kit The Vex Potentiometer will keep things on the level Use this sensor to get an analog measurement of angular position This measurement can help to understand the position of robot arms or other mechanisms To effectively utilize this sensor users are required to use the Vex Programming Kit YOU MUST HAVE A PROGRAMMING KIT TO USE THIS SENSOR 4x 1 2 Long Threaded Beam 2x Potentiometer 4x 8 32 x 1 4 Long 4x 8 32 x 1 2 Long Assembly Mounting Screws Mounting Screws The Potentiometer is designed with a D hole in the center This hole should slide easily over the Vex square shafts The Potentiometer also includes 2 arcs which are 1 2 from the center hole these arcs are used for mounting the Potentiometer to the robot structure The mounting arcs allow for 90 degrees of adjustment to the Potentiometer position Since the Potentiometer has limited travel it is important to ensure that the shaft that is being measured by the Potentiometer does not travel more than 260 degrees the Potentiometer can only move mechanically about 265 degrees 5 and can only measure electrically 250 degrees
15. Once the cable is attached move the POWER switch to the ON position Connect the Cortex to your PC Use the USB A to A cable to connect your Cortex to your PC Note The order detailed in this step is crucial When the Cortex is powered on it immediately tries to determine how it is connected over VEXnet USB or no connection Some power is provided to the Cortex over USB which will allow it to determine that it is connected to your computer Turn the Cortex ON Make sure a 7 2V Robot battery is connected and move the POWER switch on the Cortex to the ON position Note If your Cortex is connected to a mobile robot it s recommended that you prop the robot up to prevent its wheels from making contact with a surface The motors may turn on and off during the firmware download process Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 1 ROBOTC Reference Go to Reference Links PROJECT LEAD THE WAY VEX Cortex Configuration over USB cont 2 Specify that you are using the Cortex and how it is connected to your computer in ROBOTC File Edit View Robot Window Help m Function Explorer View En nection bra Solution Explorer View E Compile Errors View amp Debugger Output View Ctri L Ctri E Find In Files View Ctri Editor Font Increase Editor Font Decrease Ctri Function Explorer Font Increase Function
16. ROBOTC Reference 4s PLTW TPOUEORDGORNI ROBOTC with Cortex Restart your computer e Open ROBOTC e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the Master CPU Firmware 8 Additional Steps e Try downloading the Master CPU Firmware using another computer with the same Cortex Try downloading the Master CPU Firmware using the same computer with a different Cortex Try using a different USB A to A cable co Slow down the firmware download by inserting delays Go to Window gt Menu level gt and select Super User Go to View gt Preferences gt Detailed Preferences Go to the VEX Cortex Tab The box next to Delay Between HID Write allows you to specify a number of milliseconds to insert as delays Add a 5 millisecond delay Retry downloading the ROBOTC Firmware Continue to add short delays up until 100 milliseconds Retry downloading the Master CPU firmware until Success 10 Try the download using the VEXnet Firmware Upgrade Utility supplied by VEX Robotics e Download the VEXnet Firmware Upgrade Ultility available here e http www vexforum com wiki index php Software_ Downloads e Unzip the utility and instructions e Follow the instructions included with the utility to update the firmware Problem Program will not Compile 1 If you re using Natural Language functions make sure you re in the Natural Language platform type e Go to Robot
17. Reserved Words Data Types Different types of information require different types of variables to hold them IOL This data type is used to store integer values ranging from 32768 to 32768 Ineo Declares the integer variable x et ESO a a a Your 95 The code above can also be written int x 765 Declares the integer variable x and ee ede ie kevin ico el sulla eons 1 ai bool This data type is used to store boolean values of either 1 also true or O also false Cool if WSC lanca kena Jeo Nee eE ae E Ee ea eck 0 char This data type is used to store a single ASCII character specified between a set of single quotes Ghari x Declares the char variable x eg Oa j Suores Ene Character Inside vor x Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 6 Go to Reference Links E oe A proseer eao mue way ROBOTC Reference 2 PLTW While Loops with Natural Language A while loop is a structure within ROBOTC which allows a section of code to be repeated as long as a certain condition remains true There are three main parts to every while loop Part 1 The keyword while while condition repeated commands while Every while loop begins with the keyword while Part 2 The condition while condition condition The condition controls how long or how many times a while loop repeats While the condition
18. The act of examining sequentially part by part Scanning may be part of an automated process which searches for either a single object or a type of object It may also be part of the process whereby mapping is accomplished In either case the robot scans part of the area to be examined gathering sensor input allowing a part of a map to be constructed or for the presence or absence of the desired object s to be determined Then it proceeds to the next part of the area continuing in a systematic fashion until all parts of the area have been scanned and a map of the entire area can be constructed or the presence or absence of the desired object s in the area can be determined Schedule In project management a schedule consists of a list of a project s terminal elements or deadlines with intended start and finish dates Gantt and PERT Charts are important project management scheduling tools Scientific Inquiry The process by which scientists seek to ask and answer questions about the world Evidence models and logical explanation are all key parts of the process Inquiry is NOT a rigid series of steps but rather a fluid cycle of proposing examining and revising explanations to find the best answer to a question Sender Remote Used to sense something at a distance Remote communication may be used to transfer the remote sensor s data Sense Plan Act The three characteristic capabilties that define a robot The robot must be able to
19. aren or 07 starcMotor armMotor O Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems White Space 1 Go to Reference Links Lad PROJECT LEAD THE WAY gt ROBOTC Reference s PLTW Comments with Natural Language Commenting a program means using descriptive text to explain portions of code The compiler and robot both ignore comments when running the program allowing a programmer to leave important notes in non code format right alongside the program code itself This is considered very good programming style because it cuts down on potential confusion later on when someone else or even you may need to read the code There are two ways to mark a section of text as a comment rather than normal code Start Notation End Notation Single line Multiple line Below is an example of a program with single and multi line comments Commented text turns green pragma connig Sensor dgtl bumper SengorTouch EEG Cong Moco oae a aa Moor Eemo o Normal ope nO Code automatically generated by ROBOTC IES Par oTo espace Onmmrs m S e erent eigie This program uses commenting to describe each process a task main stari Motor armMot or Oo 3 7 Turna arno or Omar l2 power Unei TOUCA CUMEE C Wait for bumper switch to be touched StopMeror aumMoton 5 otop ehe auilloror Commenting out Code Commenting is also sometimes
20. else allows for specific code to be run only when the condition is false Pseudocode of an if else Statment ILE ona aL ILS an condition Either true or false txrue commands true commands Commands placed here will run if the condition is true else false commands false commands Commands placed here will run if the condition is false Example program containing an if else Statement task main while true i condition condition 1f SensorValue sonarsensor gt 25 true if the sensor reads over 25 false otherwise Sear Ole mi o Ao o true commands Commands here run if the condition is true else SEODMOE OTPORE Sy false commands Commands here run if the condition is false This if else Statement tells the robot to run port3 at half power if the nearest object the Ultrasonic Rangefinder detects is more than 25 centimeters away If the Ultrasonic Rangefinder detects an object closer than 25 centimeters then the else portion of the code will be run and the motor on port3 will stop moving The outer while true loop makes the if else statement repeat forever Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems If Statements Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Embedded if if else Statements with Natural Language Sometimes especially with mo
21. gt Platform Type e Select the Natural Language option e Go to Robot gt Compile Program to recompile your code 2 Is the correct Platform Type Selected e Verify that the correct platform type is selected under Robot gt Platform Type e Retry downloading the program 3 Check your code for mistakes e Are you missing any curly braces e Are you missing any semicolons e Are any of your commands or variables improperly capitalized e Do any of your commands or variables contain typos e Go to Robot gt Compile Program to recompile your code Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 6 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Troubleshooting ROBOTC with Cortex 4 Check the ROBOTC Errors window for hints e The ROBOTC Errors window usually located at the bottom of the screen will display e alist of Known errors what line they re on and some information about the error e Double click errors in the ROBOTC Errors window to highlight the affected line in your e program e Correct errors keep in mind yellow x s are only warnings and white x s are only information e not errors e Go to Robot gt Compile Program to recompile your code 5 Compare your code to programs you know work and compile e Compare your code t similar ROBOTC Sample Programs File gt Open Sam
22. 2 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference Error Messages in ROBOTC Code Common Error Messages The example below contains two syntax errors a missing curly brace on line 2 and a missing semicolon on line 6 Once again you should try to correct the first error in the program before moving on task main int speed 63 forward speed wait 2 0 stop ij File Forward c compiled on May 23 2011 14 05 47 Frror Exzpected gt Found int EFrror Executable statements not valid in main declaration block Frror Exzpected gt Found wait Frror Executable statements not valid in main declaration block Frror Executable statements not valid in main declaration block Frror Unexpected scanner token gt The first error message comes up on line 4 saying Error Expected gt Found int When the word Expected gt appears in the Errors display screen it usually indicates that a piece of syntax is missing In this case it expected to find the missing curly brace immediately after task main but found the reserved word int instead To correct this error you should add the opening curly brace on line 2 and then recompile your code i task main int speed 63 in of Oo Ro forward speed wait 2 0 stop x Ow mo ay om Errors of File Forward c compiled
23. 2 becomes the right stick s vertical axis and 3 becomes the left stick s vertical axis The default mode is 2 and should not be changed under most circumstances Stress Structural Structure Subsystem Physical forces acting on an object constitute mechanical stress Too much stress concentrated on a small area can cause parts to bend or break Glossary 129 Glossary Structure Subsystem The subsystem responsible for holding the rest of the subsystems together and in place and for protecting them from physical harm Subsystem A subdivision of a system that helps to organize the system into convenient compartmentalized functions The lines between subsystems are not always perfectly clear for example a wheel s axle is both a motion transferring device and a physical support but they work to give a general idea of purpose for the components in a system Support Structure Subsystem The degree of physical stability a piece has owing to the strength of the foundation provided by the other pieces which are holding it in place A piece which provides a physical brace or foundation for another piece is also called a support Support Polygon Structure Subsystem The imaginary polygon formed by connecting all the points at which the robot touches the ground In cases where the arrangement of ground contact points is complex the support polygon is the largest convex polygon that can be formed by those point
24. 20 The adjustment arcs allow the Potentiometer s range of motion to be repositioned to match the shaft s range of motion To measure the motion of something which moves more than 230 degrees try gearing down the shaft s motion to a secondary shaft this secondary shaft will move less distance and then measure this secondary shaft Limited 90 day Warranty This product is warranted by Innovation First against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation First dealers For complete warranty details and exclusions check with your dealer Innovation First Inc 1519 IH 30 W Greenville TX 75402 For More Information and additional Parts amp Pieces refer to 10 07 www VexRobotics com A Potentiometer Kit 1 Potentiometer Kit 2 V Go to Reference Links sensor accessories Slide the Potentiometer down the shaft being measured and ensure that it sticks out of the Potentiometer a little bit on the far side Mount the Potentiometer using the provided hardware Ensure the Potentiometer is centered on the shaft and that there is no mechanical bind BEFORE tightening the mounting screws Robot Structure not included Shaft being measured not included 1 4 Mounting 1 1 2 Mounting Screw 2x gt Screw 2x Mar NG K Y 1 2 Threaded Beam 2x Potentiometer Assembly The Potentio
25. Bumper Switch 4 Lig F s y nes Ff 6 6 7 7 7 x Nt 8 SEE fs Nd l 9 Kl i 10 a RE a tees EO f L n AJ 12 Note The last page of this document contains a clean image of the Cortex that you can label then cutout and attach in your engineering notebook for your own projects Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 2 ROBOTC Reference Go to Reference Links gt a LP I J PROJECT LEAD THE WAY Fp 4 J Program Design PLTW ROBOTC Program Template Note Be sure the Cortex you are using has been updated with the Master CPU and ROBOTC Firmware Refer to the reference Firmware Over USB to acquire detailed instruction for this procedure 5 Open ROBOTC and open the Sample Program PLTWTemplate 6 Use your initial description Complex Behaviors of your overall goal for the program for the Task Description 7 Copy your final pseudocode Basic Behaviors for the Pseudocode section of the PLTW ROBOTC program template 8 It is recommended that you include your pseudocode mostly in tact as comments beside programming commands Example 5 S 6 Project Title T Team Members 8 Date g Section 10 11 12 Task Description 13 14 A fan will run until someone needs it to stop There will be a warning light 15 as a safety device before the fan turns on and another light to indicate that the 16 fan has stopped 1
26. Call Stack System Parameters Debug Stream For additional information on these debug windows along with the ones covered in this document view the ROBOTC Debugger section of the built in ROBOTC Help documentation E ROBOTC for IFI Cortex File Edit View Go Help Contents Index Search E Introduction H installation Help H A Getting Started ROBOTC Interface F G ROBOTC Debugger Program Debugging Debugger Vs Traditional Methods Ei Docking Debugger Windows E u Debug Windows B Program Debug Global Variables Timers lt j ROBOTC File Edit XT ROBOTC for VEX Cortex and PIC Docking Debugg Many of the ROBOTC debugger windows can be docked into the interface View Robot Window Help ou dh Bo oh e ction Libr 1 bra ary H _C Constructs Sensors H User Defined Competition Control Task Status B System Parameters E O Natural Language Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems LETTET EE StartPage What s New MazeSolver c typeRight Straight typeLeftRight type cross typeDeadEnd typeGoalReached TintersectiontT yps PROJECT LEAD THE WAY ROBOTC Debugger 8 Go to Reference Links CBS prosten cro me war ROBOTC Reference PLTW White Space with Natural Language White Space is the use of spaces tabs and blank lines to visually organize code Programmers use White Space since it can gro
27. Debugger IFI Remote Co l Math Platform Type gt F Motors i Sensors Sound Task Control Timing User Defined Sensor Configuration Select A D Sensors 1 8 Type rightEncoder next to in2 set its type as a Quadrature Encoder and its second port as ind Download Firmware Type leftEncoder next to in3 set its type as a Quadrature Encoder and set its second port as in6 Press OK to complete the configuration Opens the motor and sensor configuration property sheet Ln 1 Col 1 RobotClFl Note The Quadrature Encoders can be plugged into any of the Analog Digital Analog sensor at port in4 must be assigned to port lower i i ambe fen be daare moer aT oa AT pote D none een ae Ports int3 through int6 However if your Use Motor and Sensors Setup command on the Robot menu to robot is being configured with analog modify configuration sensors Potentiometer Reflection Light as well the Encoders must be plugged into higher port numbers for them to VEX CPU hardware limits placement of quadrature motor encoders Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Shaft Encoders 3 l Go to Reference Links sensor accessories tical Shaft En r KI Basic Optical Shaft Encoders are commonly used for position and motion sensing Basically a disc with a pattern of cutouts
28. Download Method Select Download using USB Only to have the program start automatically Download the program Turn Cortex OFF Disconnect the Cortex from the computer Turn the Cortex On Program should start automatically e e e e e e e Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 9 l l Go to Reference Links Motion Accessories 2 Wire Motor 269 The 2 Wire Motor 269 replaces the 3 Wire Motor as the standard INSERT THIS PAGE VEX motor All of the internal gears are made from a steel alloy at the back of the which means the clutches and replacement gears are no longer Motion Chapter in your required The 2 wire motor can be directly connected to the Cortex UEA verios MUM and ARM9 microcontrollers internal motor controllers An external motor control module is required to connect the 2 wire motor to the PIC Microcontroller V0 5 External motor control modules can also be used with the Cortex and ARM 9 microcontrollers Motor Coupler The 2 Wire Motor 269 kit includes the new shaft coupler which can be used in place of the clutch to connect the motor to VEX shafts The coupler can also be used to connect VEX Shafts together Motor Specifications All motor specifications are at 7 2 volts Actual motor specifications are within 20 of the values below P o Motor Coupler Motor Post x 1 2 Wire Motor x 1 x1 Limit
29. Encoder you will use both outputs Channel 1 and Channel 2 to determine of the direction of rotation The channels are separated in phase by 90 degrees as shown below Channel 1 Channel 2 For example if channel 1 leads channel 2 the wheel is rotating clockwise Likewise if channel 2 leads channel 1 the wheel is rotating counter clockwise By monitoring the relative phase and number of pulses of channel 1 and 2 you can determine how fast how far and what direction your robot is traveling Reprogramming your microcontroller to read the sensor You ll need to plug your shaft encoder into any port in the Interrupt bank on the Vex Microcontroller Depending on your specific application you may be able to use any port in the Analog Digital bank Note that the connector is keyed to fit into the microcontroller port in a specific orientation plugging it in backwards could damage or even destroy your sensor aq In order for your robot to be able to read the sensor you will have to reprogram the microcontroller Sample code to help you get started is available on the Vex website For More Information and additional Parts amp Pieces refer to www Vex Robotics com Optical Shaft Encoder Kit 4 wE gt lt ROBOTICS DESIGN SYSTEM ROBOTC Reference Potentiometers overview Go to Ref
30. Explorer Font Decrease Code Completion v Status Bar Toolbars ROBOTC Preferences Platform Environment Platform Type Natural Language Library VEX C gt use Wired Cable 1 gt Automatic Selection USE Wired Cable 1 COM i ommunications Port Show Splash Screen on Startup Auto Save Before Compile Open Last Project on Startup Highlight Program Execution Compiler Code Optimization 2a Detailed Preferences Go to View gt Preferences and select Detailed Preferences Detailed Preferences 2b Platform Settings Make sure that the Platform tab is selected on the ROBOTC Preferences window Next specify the Natural Language VEX Cortex as your Platform Type Finally to program directly over the USB A to A cable select the option that specifys the USB Wired Cable Press OK to finalize your settings Note The Automatic Selection option should be used if you will be switching between VEXnet using the USB to Serial Programming Cable and the USB A to A Cable Note The Platform Type can also be modified by going to the Robot menu in ROBOTC selecting Platform Type and choosing one of the available options Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection Debugger Debug Windows Remote Control Troubleshooter Motors and Sensors Setup Download Firmware Project Lead The Way and Carnegie Mellon Robotics Acade
31. File Save As then navigate to the folder to save your robotics projects in appropriately name your program and click Save Exit 3 Libraries a Documents ad Music Pictures F Videos jt Computer amp Local Disk C o c TERRELLBOOK E ny Name ab Advanced d Basic Movement d Bumper amp Limit Switch d Control Structures LCD m Light Sensor a Line Follower Multitasking i Natural Language d PLTW do Pneumatics d Radio Control Transmitter ae Remote Control as gzz v Date modified 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM 5 9 2011 12 20 PM MsINn11 17 90 NAA Filename Type File folde File folde File folde File folde File folde File folde File folde File folde File folde File folde File folde File folde File folde Cile falda C Files c cpp h X All Robotics Projects should be completed using the PLTW template Open the PLTW folder in Sample Programs to get the PLTWtemplate file Testbed c PLTWtemplate c 3 Project Title 4 Team Members 5 Date amp Seetion 7 8 5 Task Description 12 Pseudocode ia 16 task main i Li Program begins r Before typing in the template you M
32. If the RF receiver is plugged into Rx 1 the following values apply Control Port Joystick Channel Possible Values Right Joystick X axis 127 to 127 Right Joystick Y axis 127 to 127 If the RF receiver is plugged into Rx 2 the following values apply Control Port Joystick Channel Possible Values Right Joystick X axis Ch1Xmtr2 127 to 127 Right Joystick Y axis Ch2Xmtr2 127 to 127 bVexAutonomousMode false enable radio control while true mocro rL Ss y err lens bow crOhejoyvor hee a xs eons tr OleSs ee MnO Ole wOl PO eat mocar POE vyexRl ae s o ite Ove elo ne aos COnLre ls ene MmOror Ol pore 2 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 4 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Reserved Words Miscellaneous Miscellaneous useful commands that are not part of the standard C language srand seed Defines the integer value of the seed used in the random command to generate a random number This command is optional when using the random command and will cause the same sequence of numbers to be generated each time that the program is run srand lo Assign 16 as the value of the seed random value Generates random number between 0 and the number specified in its parenthesis E O s Generates a number between 0 and 100 Control Structures
33. ROBOTICS DESIGN SYSTEM l Go to Reference Links sensor accessories Technical overview The Optical Shaft Encoder uses an infrared light sensor to detect illumination from an infrared LED passing through slots cut in the circumference of a rotating wheel From basic geometry we know that the circumference of a circle is equal to pi times the diameter of the circle circumference diameter of wheel The distance travelled by a wheel then is simply the circumference of the wheel times the number of revolutions the wheel has made nA a i TAa hh mi e oe hl 4n j T Ti J Hi Peay ee we ae yi iE HH A big iy amp lL distance circumference x number of revolutions For a standard wheel in the Vex Inventor s kit the diameter is 2 75 So the distance the wheel travelled would be distance 8 64 x number of revolutions For More Information and additional Parts amp Pieces refer to www Vex Robotics com Optical Shaft Encoder Kit 2 wE gt lt ROBOTICS DESIGN SYSTEM l Go to Reference Links sensor accessories Dtical Shaft Encoder Kit can Technical overview continued By knowing how many slots are cut into the encoder wheel we can determine how many revolutions the robot wheel has made based on the number of times the light sensor has picked up illumination from the LED The encoder wheel included in this kit has 90 slots 9
34. Type Motors and Sensors Setup VEX Remote Screen Li PORTE Download Firmware ici sash Contral Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 4 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference The ROBOTC Debugger Motors The Motors debug window provides access to the current values of the motors servos and flashlights on your microcontroller Motor servo and flashlight power levels can be viewed and changed using this window Motors port port ports porta port pot port portd portS potit D D G Global Variables Timers Sensors Index The index of where the current device is located port1 port10 Motor Current name of the motor These names can be customized through the Motors and Sensor Setup window Value Displays the current power level of the motor The Motors window can be opened by going to the Robot menu Debug Windows and selecting Motors ROBOTC File Edit View Robot Window Help i S i il i Compile and Download Program Function Library Compile Program VEX Cortex Download Method confi g Sensor i E Software Inspection 1 confi g Motor P E Natural Language Debugger confi 1g Motor F Debug Windows H Global Variables Global Variables Variables Timers Remote Control Troubleshooter Platform Type Motors and Sensors Setup VEX Remote Soreen Download Firmware Com i
35. a program that correctly configures the sensors on the robot e Run the program e Stop the program e Observe the sensor data 3 Is the Program Debug window set to provide Continuous updates e Download the program to the robot e Under the Refresh Rate section verify that a button is not labeled Continuous e Ifa button is labeled Continuous press it to receive continuous updates e Observe the sensor data Have the Master CPU and ROBOTC Firmware been downloaded successfully to the Cortex Do they need to be re downloaded Download the Master CPU Firmware 6008 Download the ROBOTC Firmware Power Cycle the Cortex Re download the program Observe the sensor data O0O000 amp O1 Does the Cortex need to be power cycled Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Re download the program e Observe the sensor data 6 Restart ROBOTC e Close ROBOTC e Open ROBOTC e Re download the program e Observe the sensor data Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 8 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh ROBOTC Reference ef PLTW Troubleshooting ROBOTC with Cortex Problem Program does not immediately run when Cortex is turned on Check the VEX Cortex Download Method Go to Robot gt VEX Cortex
36. and ability to hold that position They can be set to values ranging from 127 to 127 with 127 being fully rotated one way and 127 fully rotated the other Mounted Servo Module Here the Servo Module is mounted on Squarebot 3 0 It allows the arm to be rotated and held at specific positions Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Servo Motors 1 ROBOTC Reference Go to Reference Links Servo Motors Sample Code Rotating the Servo Modules Shaft to Different Positions This code rotates a Servo Module on MOTOR Port 6 to a different position every second starting at 127 fully backward and ending at 127 fully forward moc or Pores 127 waitlMsec 1000 motor porto 95 waitlMsec 1000 mOEor Pores e waitlMsec 1000 motoriporte 3l waitlMsec 1000 motor port6 0 waitlMsec 1000 metor pore 6 31 waitlMsec 1000 motor port6 63 waitlMsec 1000 mOLtor Ppores 95 waitlMsec 1000 motor porr6 127 waitlMsec 1000 Set position fully backward ji Nale Cor lL seeond See position 3 4 backward 7 Wait tor L second Set position 1 2 backward Wait tor L second M Sert position 1 4 backward Wait tor L second Set position to middle Wait tor L second see postion 1 4 forward J Wane ror l second Bert posicion 1 2 forward j Wait ror second Set posit
37. and important information the compiler finds are displayed in the Errors display screen of the ROBOTC interface File Edit View Robot Window Help Sah Ble cs HS wh Es j Forward c B i E _C Constructs Natural Language l Robot Motion E Setup E Movement task main int speed Forward 63 wait 2 0 G Special Stan t Until g Wait Mm i om oom tf ob w Bo Fe File Forward c compiled on May 23 2011 10 30 42 Intot speed if written but has no read references Warning Substituting Similar variable forward for Forward weError Ezpected gt Found stoap es Solution Exp 2 Function Lib For Help press Fl ait The Errors display screen reports the number of errors in your code as well as their types Double clicking a compiler message in the Error display screen will highlight the relevant line of code in your program Depending on the type of error ROBOTC will only be able to highlight the approximate location For instance in the example above the missing semicolon is on line 7 but ROBOTC will highlight line 8 ROBOTC generates three types of compiler messages Errors Warnings and Information Errors There was an issue your program that prevented it from compiling These are usually misspelled words missing semicolons and improper syntax Errors are denoted with a Red X Warnings There was a minor issue with your
38. cD fa Worm Gear A special type of gear that uses a screw like shaft and a wheel with slanted teeth to reduce speed or transmit torque between nonparallel axles Also has the special properties of being a one way gear and having effectively only one tooth for gear ratio calculations Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Wavelength Distance Glossary 11 276 2178 E 0610 ROBOTICS DESIGN SYSTEM Glossary JE 12 mode Control Subsystem A Transmitter driving mode where axes 1 and 2 are used to control the primary navigation of the robot Also called Arcade style controls 23 mode Control Subsystem A Transmitter driving mode where axes 2 and 3 are used to control the primary navigation of the robot Also called Tank style controls 4WD Short for Four Wheel Drive A four wheel drive robot typically has four wheels all of which are powered independently This usage is analogous but not identical to the meaning of the term with respect to automobiles A Acceleration Motion Subsystem In physics acceleration is the change in velocity of an object over time In robotics acceleration usually refers to the ability of a robot to speed up or slow down quickly on demand Actuator Motion Subsystem A term commonly used in industry to describe a mechanical device used for moving or triggering a mechanism Alkaline Battery
39. component using the standard VEX 1 2 pitch In the center of each piece there is a square hole which matches the VEX square Shaft As such any VEX component can be locked to a shaft using the Lock Bar so that it will spin with the shaft Note that Lock Bar the insert in each Lock Bar is removable a and can be reinserted at any 15 increment Intake Rollers can be used in a variety of applications These components were originally designed to be rollers in an intake or accumulator mechanism The fins or fingers of the roller will flex when they contact an object this will provide a gripping force which should pull on the object HINT Try cutting off some of the fins of an Intake Roller for better performance on some objects 3 32 Inventor s Guide vEx ROBOTICS DESIGN SYSTEM 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Introduction to the Motion Subsystem continued The VEX Motion Subsystem contains a variety of components designed to help make robots mobile This includes a variety of wheel sizes tank treads and other options Robots using these in different configurations will have greatly varying performance characteristics Tank Tread components and wheels can also be used to construct intake mechanisms and conveyor belts These are frequently used on competition robots When designing the Motion Subsystem of a robot it is important to think about several factors e
40. for data type that the VEX can understand Obstacle Detection The ability of a robot to detect obstacles in its environment LEGO robots usually detect obstacles using a Touch Sensor an Ultrasonic Sensor or both One way Communication See Communication One way Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 6 Go to Reference Links k oh A proveer ueno me my ROBOTC Reference 2 PLTW Glossary continued Output Something which the controller sends An output is typically power sent to a motor An output may also refer to the motor itself or to sensor values that are displayed or collected in a file Peak The top of a wave on a graph The point of greatest disturbance Peak from the rest state in one direction See also trough Peak Percent Error The percentage that the measured value differs from the Trough calculated value which can be determined by the formula calculated poles value measured value calculated value x 100 co a wn n v a Perpendicular Intersecting at a 90 degree angle PERT Chart An acronym standing for Program Evaluation and Review Technique it is a method for analyzing the tasks involved in completing a given project in order to identify the minimum time needed to complete Distance the total project Point Turn A turn where one wheel rotates forward and the other rotates backward causing the
41. keep AF E a a gg J Es structural members aligned Q D amp E gir correctly and for maximum N p pU h o a strength J old gx N i 9 ll ri When using screws to attach things together there are three types of nuts which can be used e Nylock nuts have a plastic insert in them which will prevent them from unscrewing These are harder to install as you need to use an open ended wrench to tighten them up These nuts will not come off due to vibration or movement e KEPS nuts have a ring of teeth on one side of them These teeth will grip the piece they are being installed on This means you do not NEED to use an open ended wrench to tighten them but it is still recommended These nuts are installed with the teeth facing the structure These nuts can loosen up over time if not properly tightened however they will work great in most applications e Regular nuts have no locking feature These basic hex nuts require a wrench to install and may loosen up over time especially when under vibration or movement They are very thin and can be used in some locations where it is not practical to use a Nylock or KEPS nut SZ Y DI G O S Nylock Nut KEPS Nut Regular Hex Nut WARNING It is important to be careful when tightening screws The allen wrenches may round or strip out the socket on the head of the screw if they are not fully inserted into the socket Use care when tightening screws to prevent s
42. left motor mapped to the left joystick Default right and left and joystick Ch2 Ch3 Arcade Control The robot is remote controlled with both motors mapped to a single joystick Default vertical and horizontal joysticks Ch2 Ch1 2010 Carnegie Mellon Robotics Academy For use with VEX Robotics Systems forward wait stop backward wait stop POLne Turn 3 wait stop Sewildigl urn gt wait stop forward wait stop lineTrackForTime Stop lineTrackForRotations Stop moveStraightForTime Stop moveStraightForRotations stop while true tankControl while true arcadeControl forward 63 wait 2 0 stopi backward 63 wait 2 0 StOD Polnt rug tlerc 62 walt 0 4 Stop SwingTurn left 63 wait 0 75 Stop forward 63 wait 2 0 stop lineTrackForTime 3 99 1n6 107 inc stop lineTrackPorRotations 4 75 39 176 107 ino stop movesStraightForTime 7 5 dgtl5 dogtls stop movestraightForRotations 4 75 dogtls5 dogt1l3 stop while true tankControl Chl Ch4 while true arcadeControl Chl Ch4 ROBOTC Natural Language Cortex Quick Guide 3 Go to Reference Links A proseer teap mue wav ROBOTC Reference PLTW ROBOTC Debugger Overview A debugger is a programming too
43. multiplier generated by a group of 2 or more gears turning together For simple non compound gear trains this can be calculated as the number of teeth on the driven gear divided by the number of teeth on the driving gear Gear Train Motion Subsystem In general a group of gears that turn together to transmit motion from one point to another on the robot often providing mechanical advantage along the way Gripper An attachment designed to pick up or hold an object often by gripping it with claw like appendages Gusset Structure Subsystem A piece used to strengthen an angled joint H HIGH Digital value Sensor Subsystem One of two possible values in a digital system the other is LOW The voltage used to indicate HIGH usually corresponds to the maximum voltage of the system Hub Motion Subsystem With wheels the hub is the center portion of the wheel that joins to the axle I Idler Gear Motion Subsystem A gear in a gear train that is neither the driven nor the driving gear and does not share an axle with another gear in the train i e does not form a compound gear Each idler gear in the train reverses the direction of spin once but never affects the gear ratio Glossary 125 Glossary Interrupt Port Bank Logic Subsystem A port bank on the Microcontroller used primarily for advanced programming functions J Jumper Control Subsystem Logic Subsystem A metal wi
44. near 75MHz which is part of the VHF Very High Frequency band of the electromagnetic spectrum This carrier wave is then modulated by the signal wave to produce a third wave which is transmitted through the air and received by the RF Receiver Module on the robot Friction Motion Subsystem The force between two touching surfaces moving at different speeds that acts to slow their movement relative to each other In robotics this usually has one of three contexts friction between wheels and ground that results in rolling wheels slowing down friction between wheels and ground that allows wheels to push off and start moving to begin with rather than spinning in place and friction between any two components rubbing together in the robot that result in loss of energy G Gear Motion Subsystem Essentially gears are spinning discs with teeth that prevent them from slipping past each other Gears are frequently used to transfer rotational motion from one piece to another and to provide mechanical advantage while doing so The number of teeth on a gear assuming the same spacing between teeth on both gears so their teeth mesh properly is directly proportional to the gear disc s circumference thus the number of teeth can easily be used to calculate the gear ratios of gear trains Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR Gear Ratio Motion Subsystem The mechanical advantage or force
45. of a robot including the motors gears axles and wheels Driven Gear Motion Subsystem In a gear train the last gear being turned Usually this gear shares an axle with a wheel Driving Gear Motion Subsystem In a gear train the gear that provides the energy to turn all the other gears and their connected components This gear usually shares an axle with a motor Glossary 124 Inventor s Guide Go to Reference Links APPENDIX B GLOSSARY Driving Mode Transmitter Control Subsystem The driving mode selected on the Transmitter through the DRIVE menu either 23 mode or 12 mode This setting together with Jumper 14 on the Microcontroller determines which combination of joystick axes on the Transmitter will control the robot s movement E Electromagnetic Waves Control Subsystem Technically a time varying electric field that propagates through space at the speed of light caused by the acceleration of a charged particle More simply an electronically controllable wave that travels at the speed of light and can carry information between two points through a variety of encoding techniques End Points Joystick Control Subsystem End points control the percentage of the full power command that will be sent by the Transmitter when the joystick is pushed to the edge of its movement area Exponential Scaling Control Subsystem A control scaling method that allows for stiffening
46. on May 23 2011 14 15 50 T gt 4 Error Expected gt Found wait After recompiling your code any remaining errors will be displayed Missing semicolons also display an Expected gt style error message but notice that the error for the missing semicolon on line 6 appears on line 7 This is because the compiler ignores whitespace blank lines spaces and tabs but expected a semicolon before it encountered the wait command To correct this error you should add a semicolon after the forward command Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 3 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference Error Messages in ROBOTC Code Common Error Messages The example below the ROBOTC compiler does not recognize the forward wait or stop commands Error messages that begin with Error Undefined procedure indicate that ROBOTC does not recognize the command this is also indicated by the commands failing to turn blue like other ROBOTC reserved words Forward c i task main int speed 63 forward speed Wait 2 0 Stop ij in Jom tn b to ha D Wo File Forward c compiled on May 23 2011 14 Error Undefined procedure forward Error Undefined procedure wait e Info Undefined procedure qT OL There are two main causes for this error 1 The command
47. on a graph Note that amplitude is NOT Zero Line the difference between the highest point and the lowest point on the wave amplitude is measured from the top to the middle or the bottom to the middle but not top to bottom o 3 po A Autonomus Something that can work by itself Often used as a synonym for robotic For example an autonomous harvester is one that can harvest without a human operator Autonomous Navigation See Navigation Autonomus Distance Behaviors Anything a robot does including both observable actions e g move forward for 10 cm and internal actions e g add 1 to a variable in the program Complex behaviors are often made of numerous simpler behaviors put together moving through a maze is a behavior composed of smaller moving and turning behaviors Best fit Line A straight line that best represents all the data on a graph It is also known as a trendline A line of best fit is usually written in a form called slope intercept containing two variables x and y Brainstorming The process of coming up with ideas Good brainstorming in teams requires team members to encourage different unexpected and unusual approaches to a problem and to build on each others ideas Budget See Resources In projects the amount of money which is available to spend on completing the project and by extension the amount of other resources available Budgeting money time and human res
48. on the remote control is downloaded End of Section Calibrating the VEXnet Joystick Values The joysticks on your VEXnet Joystick are now properly calibrated and ready to be used to remote control your robot If you had any issues during the process troubleshooting tips can be found on the following page Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration e 11 Go to Reference Links ROBOTC Reference PLTW VEXnet Joystick Configuration in ROBOTC cont P Troubleshooting Issue Slow blinking green ROBOT light on the Cortex Solution Download the Cortex Master Firmware using ROBOTC Issue Slow blinking ROBOT green light on the VEXnet Joystick Solution Push and hold CONFIG button for about 5 seconds until the status LEDs starts blinking green Release it wait for another 5 seconds and then turn the VEXnet Joystick OFF and then back ON If that fails download the VEXnet Joystick Firmware using ROBOTC Issue Yellow or red ROBOT light on the Cortex Solution Make sure you are using fully charged Robot battery Issue Yellow or red ROBOT light on the VEXnet Joystick even though they are both green on the Cortex Solution Power cycle both the VEXnet Joystick and CORTEX Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 12 ROBOTC Reference Sense P
49. or softening of the feel of the joystick controls by causing the output command value to increase faster or slower than it normally would as the joystick is moved away from the center of its movement area F Fastener Structure Subsystem A general term for pieces such as screws whose primary purpose is to hold two or more other components together Floating Structure Subsystem As opposed to locked Moving freely not held in one specific place A collar floats freely on a square bar when the screw is not tightened it slides easily up or down the bar Flush Structure Subsystem As in flush against another part Pushed up against something leaving no space between them A collar is flush against a bearing when it is pushed up against the bearing as far as it can go ROBOTICS DESIGN SYSTEM 276 2178 E 0610 276 2178 E 0610 o 3 m 0 Z v lt 0 m lt Glossary Four Wheel Drive Control Subsystem A four wheel drive robot typically has four wheels all of which are powered independently This usage is analogous but not identical to the meaning of the term with respect to automobiles Frequency Modulated Signals Control Subsystem Frequency Modulated FM signals are used in the VEX system to encode data in radio transmissions Radio waves are a form of electromagnetic wave with a very high frequency The frequencies used by the VEX system all have a carrier frequency
50. program but the compiler was able to fix or ignore it These are usually incorrect capitalizations or empty infinite loops Warnings are denoted with a Yellow X Information ROBOTC will generate information messages when it thinks you have declared functions or variables that are not used in your program These messages inform you about inefficient programming Information messages are denoted with a White X Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 1 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh D ROBOTC Reference PLT W Error Messages in ROBOTC Code Common Error Messages Error messages will prevent your program from compiling and downloading to your robot You must correct any and all error messages in your program before you will be able to download it to your robot Also error messages can have a ripple effect errors at the beginning of your program can cause subsequent errors in the code Because of this it s recommended that you correct errors at the beginning of your program first recompile your code and then correct any remaining errors Most error messages are caused by misspelled reserved words and improper syntax Many of these mistakes can be avoided by dragging commands from the Function Library into your ROBOTC programs In the example below the T in task main is capitalized causing mu
51. robot to sit and spin in place Also called a skid turn in general robotics Ports The designated areas for connecting sensors and or motors to the controller A wire of appropriate length should be used to connect the controller with each sensor or motor device Problem Context The overall dimensions of the problem which include exactly what the problem consists of what person or group wants the problem solved what places situations or people the solution has to function in or with what commercial markets if any the solution will be marketed in and what previous efforts have been made to solve the problem Project A project is a temporary endeavor undertaken to create a unique product or service A project is typically worked on by a project team for a particular customer client or sponsor who funds it and has certain goals a schedule and a budget Project Management The process of managing a project Good project management includes breaking down the project work into tasks assigning responsibilities for them to team members ensuring that adequate communication takes place both within the team and between the team and any other groups or people involved scheduling the tasks to ensure the project meets its deadline s and budgeting resources in such a way that all necessary work can occur before any of the resources run out Project Manager The member of the project team who manages the project especially the schedule an
52. spins giving ita resolution of 90 counts per revolution Only one output channel wire is needed to transmit the sensor data to the Vex Microcontroller The upgraded Quadrature Shaft Encoder includes a second optical sensor which allows the sensor to detect if the internal disk is spinning clockwise or counterclockwise and increases the resolution to 360 counts per revolution 2 count intervals Two output channels wires are needed to transmit its sensor data to the Vex Original Shaft Encoder Quadrature Shaft Encoder Only has one output wire Has two output wires Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Shaft Encoders 1 Go to Reference Links ba PROJECT LEAD THE WAY ROBOTC Reference EK PLTW Shaft Encoders Wiring Configuration The Quadrature Shaft Encoder is fully compatible with the existing Squarebot 2 0 and 3 0 models Use the following wiring configuration to ensure that the Encoders count up when the robot drives forward and down when the robot moves in reverse Reversing the placement of the wires will cause the Encoders to count in the wrong direction 2 4 6 instead of 2 4 6 failing to place the wires in the correct ports will result the Quadrature Encoder behaving as an original Encoder or not at all Right Encoder Detects rotation from Motor on Motor Port 2 Top wire Left Encoder Bottom wire Bottom w
53. the square hole the shaft goes through If either of these situations exists an easy way to fix it is to use multiple gears in parallel Try using two gear trains next to each other to decrease the load on each individual gear There are several ways to transfer motion in the VEX Robotics Design System A number of Motion Subsystem accessory kits are available with a variety of advanced options The primary way to transfer motion is through the use of sour gears Spur gears transfer motion between parallel shafts and can also be used to increase or decrease torque through the use of gear ratios These gears can also be combined with sprocket amp chain reductions and also with advanced gear types to create even more complex mechanisms vex Inventor s Guide 3 31 Go to Reference Links It is easy to drive components of the VEX Structure Subsystem using motion components in several different ways Most of the VEX Gears have mounting holes in them on the standard VEX 1 2 hole spacing it is simple to attach metal pieces to these mounting holes One benefit of using this method is that in some configurations the final gear train will transfer torque directly into the structural piece via a gear this decreases the torque running through the shaft itself Another option to drive structural pieces using the Motion Subsystem is through a Lock Bar These pieces are designed such that they can bolt onto any VEX structural
54. used to temporarily disable code in a program without actually deleting it In the program below the programmer has code to move an arm up and then move the arm down However in order to test only the second half of the program the programmer made the first behavior into a comment so the robot will ignore it When the programmer is done testing the second behavior he she can remove the comment marks to re enable the first behavior in the program task Main je Stave Motor CarmMowe rm 165 7 Pien ormMoron vom at il 2 power obi IO rela bumper Wait for bumper switch to be touched 77 SeOPMOLOr acmMorern Ww Seoe Ene armMotor wait 2 0 Vo Wee a T E ea Start Motor armMotor So a aa Turna aeMmMoronr on aS S power untilRelease bumper Wait for bumper switch to be released stopMotor armMotor Sr Opera a OE Or Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Comments 1 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Error Messages in ROBOTC Code ROBOTC has a built in compiler that analyzes your programs to identify syntax errors capitalization and spelling mistakes and code inefficiency Such as unused variables The compiler runs every time you download code to the robot and when you choose to compile your program from the Robot menu in ROBOTC Notifications regarding any errors warnings
55. value of the specified sensor port Values will correspond to the type of sensor set for that port The VEX has 16 analog digital inputs inl in2 to inl6 if SensorValue inl 1 If inl bumper is pressed ienwena renews e whey Motor Port 3 full speed forward Type of Sensor Digital Analog Range of Values Digital Reflection Ambient 0 to 1023 Rotation Older Digital O to 32676 Encoder Sounds The VEX can play sounds and tones using an external piezoelectric speaker attached to a motor port PlayTone frequency duration This plays a sound from the VEX internal speaker at a specific frequency 1 1 hertz for a specific length 1 1 100th of a second Playtone 2207 500 2 7 Plavys a 220nz tone tor 1 2 second Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 3 Go to Reference Links Kn A proveer ueno me wa ROBOTC Reference 2 PLTW Reserved Words Radio Control ROBOTC allows you to control your robot using input from the Radio Control Transmitter bVexAutonomousMode Set the value to either 0 for radio enabled or 1 for radio disabled autonomous mode You can also use true for 1 and false for O bVexAutonomousMode OF enable radio control bVexAutonomousMode 1 Jy Cis abilet tadiose con a vexRT joystick channel This command retrieves the value of the specified channel being transmitted
56. waitiMsec random 5000 This program runs the robot forward for a random amount of time up to 5 seconds Wait for a random time The number of milliseconds that the wait1Msec command will wait for will be a random number between 0 and 5000 Using Other Numbers If you need something other than whole numbers between zero and something you may need to be a little creative ADCO a random LOO Minimum value as shown 4000 5000 Adding the random value on top of a base number lets you get random numbers between a minimum the base number and a maximum base maximum random value fandom 100 7 U0 Percent as shown 0 100 in 1 increments Dividing your random value by its own maximum value normalizes the value so that it always falls between 0 and 1 Seeds Computers can t be truly random Instead they try to use a hard to predict series of numbers based off a seed value Under certain circumstances you may want to set the seed Sica il 3 Set random seed V 2 The srand command sets the random le EE A number seed for this robot Run with the same seed random numbers will always be generated in the same sequence Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Random Numbers 1 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Pseudocode amp Flow Charts Pseudocode is a shorthand not
57. when SB pe A mounting a VEX Bearing Flat 2 _ 1 amp ZB ay ee there are small tabs which will tm SA OS Ss stick through the square hole and am e N hold it perfectly in alignment i om Zy NA This allows for good placement of at ea AN Tiea components with key alignment PR a I ay requirements It would be bad if oe T I a bearing slipped out of place gt lt Note that hardware is still required to hold the Bearing Flat onto a structural piece Hardware is an important part of the Structure Subsystem Metal components can be directly attached together using the 8 32 screws and nuts which are standard in the VEX kit The 8 32 screws fit through the standard VEX square holes These screws come in a variety of lengths and can be used to attach multiple thicknesses of metal together or to mount other components onto the VEX structural pieces Allen wrenches and other tools are used to tighten or loosen the hardware Note There are two types of screws that are part of the VEX Robotics Design System e Size 8 32 screws are the primary screws used to build robot structure e Size 6 32 screws are smaller screws which are used for specialty applications like mounting the VEX Motors and Servos Inventor s Guide 2 11 Go to Reference Links Introduction to the Structure Subsystem continued Attach components together 2A eo R a aan with multiple screws from e ER fe OS J es different directions to
58. will detect using the Bumper Switch If the Bumper Switch is unpressed the motors will be run forward if the Bumper Switch is pressed the robot will turn away from the obstacle This is all captured in the program which runs on the robot reading the sensor s data and issuing the appropriate motor commands The robot acts by moving its motors in response to the given motor commands which are given in combinations that produce forward movement and turns as appropriate Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems SPA 1 Go to Reference Links Ke A proveer ueno me my ROBOTC Reference 2 PLTW Boolean Logic Truth Values Robots don t like ambiguity when making decisions They need to know very clearly which choice to make under what circumstances As a consequence their decisions are always based on the answers to questions which have only two possible answers yes or no true or false Statements that can be only true or false are called Boolean statements and their true or false value is called a truth value Fortunately many kinds of questions can be phrased so that their answers are Boolean true false Technically they must be phrased as statements not questions So rather than asking whether the sky is blue and getting an answer yes or no you would state that the sky is blue and then find out the truth value of that statement true it is blue or fa
59. with VEX Robotics Systems Potentiometers 1 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference 48s PLTW Potentiometers ROBOTC Setup The Potentiometer is fully supported by ROBOTC for IFI v 1 4 and up Use the following instructions and to correctly configure one within ROBOTC F s3 ROBOTC Potentiometer c File Edit View itceeim Window Help C E mE 1 Compile and Download Program F5 Robot gt Motors and Sensors Setup Open the Motors and Sensors Setup E Constructs Compile Protan F7 Z window IFI Remote Co Math Platform Type Miscellaneous Motors and Sensors Setup HI Motors H Sensors Motors and Sensors Setup H Sound Gk Taek Contul Device Mgmt IFI Motors VEX A D Sensors 1 8 VEX A D Sensors 9 16 Timing a Ne Sensor Configuration Select A D Sensors 1 8 af insu i a e es oO Wiiweee Ga U nn Type a Name for your sensor next to one of the ports and set it as Type Potentiometer Press OK to complete the configuration RobotCIFI Note The Potentiometer can be plugged into any of the Analog Digital Analog sensor at port in4 must be assigned to port lower in i i igi number than the quadrature motor encoder at port in2 ports int th rough id 6 ay digital sensors Limit Switches Bumper Use Motor and Sensors Setup command on t
60. your microcontroller to read the sensor Start by plugging your light sensor into any port in the Analog Digital bank on the Vex Microcontroller Note that the connector is keyed to fit into the microcontroller port in a specific orientation plugging it in backwards could damage or even destroy your sensor In order for your robot to be able to read the sensor you will have to reprogram the microcontroller Sample code to help you get started is available on the Vex website Refer to the Programming chapter in your Vex Inventor s Guide for information on how to add or change code vex Inventor s Guide insert light sensor kit 3 ROBOTICS DESIGN SYSTEM Go to Reference Links A proveer ueno me my ROBOTC Reference x PLTW Glossary Actual measurements Data that is found by making measurements as opposed to predictions All Purpose Usable for a number of different tasks Algorithm A systematic method for solving a certain kind of problem that is guaranteed to always give a correct answer Sometimes used more generally to mean any well defined systematic method of doing something Amplitude The difference between the highest or lowest Amplitude point of a wave and the rest or zero level For a sound wave the difference in air pressure between the most compressed E Amplitude peak areas of the wave and undisturbed air which is represented Wave as the middle zero line
61. your robot It also provides the wireless communication link between your computer and the VEX Cortex enabling you to wirelessly download firmware programs and run the ROBOTC debugger In this document you will learn how to configure VEXnet Joystick using ROBOTC This document is broken into 3 sections 1 Downloading Firmware to the VEXnet Joystick 2 Creating a Wireless Link Between the VEXnet Joystick and VEX Cortex 3 Calibrating the VEXnet Joystick Values You will need e 1 VEXnet Joystick with 6 AAA Batteries e 1 Small Phillips Screwdriver e Acomputer with ROBOTC for Cortex and PIC installed e 1 USB A to A Cable e 1USB to Serial Programming Cable Section 1 Downloading Firmware to the VEXnet Joystick 1 Begin by installing 6 AAA batteries in the VEXnet Joystick You will need a small Phillips screwdriver to remove the battery cover 1a Install 6 AAA Batteries Remove the battery cover using a small Phillips screwdriver and install 6 AAA batteries being careful to align them as indicated 1b Verify Correct Installation Turn the VEXnet Joystick ON to verify that you correctly installed the batteries If any of the LED s on the front turn on you installed the batteries correctly Turn the controller OFF and secure the battery cover using the Philips screwdriver Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 1 Go to
62. 0 tick marks pulses 1 complete revolution By mounting a shaft encoder on the axle of one of your robot s wheels you ll be able to determine how many times that wheel has rotated That in turn can be used to calculate the distance the robot has travelled based on the diameter of the wheel The Optical Shaft Encoder can detect up to 1700 pulses per second which corresponds to 18 9 revolutions per second and 1133 rpm revolutions per minute Faster revolutions will not be interpreted correctly resulting in erroneous positional data being passed to the microcontroller This is a digital sensor which means that the signal it will pass to the Vex microcontroller will either be high 1 or low 0 The sensor output is low 0 when the light from the IR LED passes through a cutout segment of the encoder wheel and falls on the detector and high 1 when the light is blocked by an opaque segment of the encoder wheel This a means that the Vex microcontroller will be receiving a string of 1 s and 0 s as your robot moves The string of l s and 0 s will then be interpreted by your program and used to determine the robot s actions 2222222 23 22 For More Information and additional Parts amp Pieces refer to www Vex Robotics com vEX Optical Shaft Encoder Kit 3 ROBOTICS DESIGN SYSTEM l Go to Reference Links sensor accessories Dptical Shaft Encoder Kit cani With the Quadrature
63. 1 and 10 and accelerometers 3 wire motors and servos can be Digital ports are available for digital input directly connected and controlled signals Examples include bumper switches in ports 2 through 9 limit switches ultrasonic range finders and optical shaft encoders 2 wire motors and flashlights can be connected to ports 2 through 9 The digital ports can also be used as digital using a Motor Controller 29 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Cortex Pin Guide 1 Go to Reference Links SE 7 PROJECT LEAD THE WAY ROBOTC Reference 2 PLTW VEX Cortex Configuration over USB The VEX Cortex is a fully programmable device and is what enables you to incorporate motors sensors an LCD screen and remote control signals all in one robot Inside of the Cortex there are two separate processors a user processor handles all of the ROBOTC programming instructions and a master processor controls lower level operations like motor control and VEXnet communication This document is a guide for downloading the Master CPU firmware and ROBOTC firmware to the VEX Cortex using the USB A to A cable You will need e 1 VEX Cortex Microcontroller with one 7 2V Robot Battery e A computer with ROBOTC for Cortex and PIC installed e 1 USB A to A Cable 1 Leaving the POWER switch in the OFF position connect your Cortex to the computer using the USB A to A cable
64. 7 18 Pseudocode 19 20 Program begins 21 Light 1 LED 1 turns on 22 for three seconds 23 Fan Motor 1 turns on 24 Until a button bumper switch is pressed 25 Light 2 LED 2 turns on 26 for 3 seconds 27 Program ends 28 29 f 30 31 task main 32 33 Program begins 34 fLight 1 LED 1 turns on 35 Eor three seconds 36 Fan Motor 1 turns on 37 f Until a button bumper switch is pressed 38 ffLight 2 LED 27 turns on 39 for 3 seconds 40 Program ends 41 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 3 Go to Reference Links gt es LP I j PROJECT LEAD THE WAY Gp 4 J ROBOTC Reference Program Design PLTW ROBOTC Program Template Cont 9 Identify all inputs and outputs in the Motors and Sensors Setup window Motors VEX 2 0 Analog Sensors 1 8 VEX 2 0 Digital Sensors 1 12 Port Name Type Reversed w P port Fanmotor Motor equipped E l z 10 Use the Debugger to confirm that all inputs and outputs are working as expected Refer to the reference Debugger to learn more about these functions Motors VEX 2 0 Analog Sensors 1 6 VEX 2 0 Digital Sensors 1 12 Port Name Type dot j Doat ae O iiam Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 4 ROBOTC Reference Go to Reference Links a LP Y PROJECT LEAD TH
65. 7 2V power loss e LED scheme displays the status of the Robot VEXnet link and Game Competition Mode 1 Begin by verifying that both the Cortex and VEXnet Joystick are connected to charged batteries 1a Connect a Battery to the Cortex Connect a 7 2V robot battery to the Cortex but do not power it ON 1b Install Batteries in the VEXnet Remote Control Remove the battery cover plate on the remote control Install 6 AAA batteries and replace the battery cover plate Do not power the remote control ON Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 4 Go to Reference Links m CBO src ens me am ROBOTC Reference Se Bw VEXnet Joystick Configuration in ROBOTC cont 2 Tether the USB port on the VEXnet Joystick to the USB port on the Cortex using a USB A to A cable 2a VEXnet Joystick USB Port Plug one end of the USB A to A cable into the USB port on the VEXnet Joystick 2b VEX Cortex USB Port Plug the other end of the USB A to A cable into the USB port on the VEX Cortex 3 Power the Cortex ON After a few seconds ROBOT and VEXnet LEDs will blink green indicating that the Cortex and VEXnet Joystick have successfully paired 3a Turn the Cortex ON 3b Status LEDs The ROBOT and VEXnet LEDs will blink green once the Cortex and VEXnet Joystick have successfully paired The GAME LED will also blink green if a program
66. Analysis Perhaps the most important idea in behaviors is that they can be built up or broken down into other behaviors Complex behaviors like going through a maze can always be broken down into smaller simpler behaviors These in turn can be broken down further and further until you reach simple or basic behaviors that you recognize and can program By looking back at the path of behaviors you broke down you can also see how the smaller behaviors should be programmed so that they combine back together and produce the larger behavior In this way analyzing a complex behavior maps out the pieces that need to be programmed then allows you to program them and put them together to build the final product Large behavior Smaller behaviors ROBOTC ready behaviors Go forward for Turn on left motor Follow the path to Esty Conds reach the goal Turn on right motor gt gt Go forward 3 secon Turn on left Turn left 90 ds Turn on right a i Wait 3 seconds Go forward 5 seconds Wait 3 seconds furn right 90 Turn off left motor Turn off left motor Go forward 2 seconds Turn off right I Turn right 90 otor Turn off right motor Go forw ard 2 Seconds Turn left 90 E Reverse left motor Tan ie left motor Turn on right mot on rig t ur O ri O or Step by step Wait 0 8 aoa g Turn off left motor Wait 0 8 seconds 1 Start with a large scale beha
67. E WAY RS D S Prog ram Design PLTW ROBOTC Program Template Cont Basic Behavior Basic Behavior Basic Behavior Complex Behavior Remember many basic behaviors generally come together to create a complex behavior You can solve simple and basic behaviors one at a time and troubleshoot them as they come together to form a complex behavior Test and debug the combined program Make sure your behavior functions as intended within the program Many times you will need to make adjustments to compensate for orientation momentum or other unforeseen factors as they begin to work together 11 Code and test small behaviors or sets of behaviors individually and edit add comments as you build your code 33 34 35 36 37 38 39 40 41 task main turnLEDOn LED1 Wait 3 turnLEDOTEt LED1 FanMotor turns on Until Bumper is pressed Program begins f LEDI turns on ffor three seconds fLED1 turns off 12 Continue programming and testing one behavior at a time To test individual behaviors as you go temporarily turn sections of code into comments using followed by 33 34 ao 36 af 36 39 40 41 42 43 44 45 46 task main i turnLEDOn LED1 wait 3 turnLEDOfTt LED1 i startMotor FanMotor 127 untilBump Bumper stopMotor FanMotor ffLight 2 LED 27 turns on Program begins f LED1 turns on for three seconds fLEDI turns off fFanMotor tur
68. EMO om mem Ao wair r0 SEaArEMOCOr POr E a uo Ny vaden Count oSCo Adds 1 to count every time the loop runs Result The loop repeats 4 times caus ing the port2 motor to turn back and forth four times Below is an example of a program using a sensor controlled While Loop pragma eonig sensor doe A ESEO sensorTouch pragma cong Sensory dgtl Contr olBEN m Sensor Touch pragma cong Sensor dgtl TED sensorDigitalOut Eacsk main whilel SensorValue Eec p 0 Checks if the Estop touch sensor is equal to 0 unpressed Lit SensorValue cont rolbrn l If the controlBtn is pressed turn the LED on if it s not turn the LED off CUrCALEDON LCED l Result The loop repeats continuously allowing the LED to be turned on while alse the controlBtn is pressed and off while controlBtn is released The loop will stop as soon as the Estop touch sensor 1S bead Ponce IG is pressed Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 2 Go to Reference Links A proveer ueno me wa ROBOTC Reference Se CTW If Statements with Natural Language An if Statement allows your robot to make a decision When your robot reaches an if Statment in the program it evaluates the condition contained between the parenthesis If the condition is true any commands between the braces are run If the co
69. ENDIX B GLOSSARY Limit Switch Sensor Sensor Subsystem A small contact sensitive sensor that is most often used for internal regulation of movement and should not be exposed to high impact conditions This is a digital sensor Linear Scaling Control Subsystem A control scaling method that allows for control of the overall range of motion and sensitivity of the joysticks on the Transmitter Logic Subsystem The subsystem responsible for onboard robot operation allocation of power processing sensor feedback and interpretation of human operator control LOW Digital value Sensor Subsystem One of two possible values in a digital system the other is HIGH The voltage used to indicate LOW usually corresponds to the zero ground voltage of the system M Master Channel Control Subsystem In a Programmable Mix the Master Channel is the control channel that when manipulated by the operator will also affect the value on the designated slave channel Mechanical Advantage Structure Subsystem Motion Subsystem The ratio of the force a machine can exert to the amount of force that is put in Mechanical advantage can also be thought of as the force multiplier factor that a mechanical system provides 276 2178 E 0610 276 2178 E 0610 o m o Zz 10 oO Fi z Glossary Memory Effect Power Subsystem Technically the phenomenon where a rechargeable battery that is repeatedly discharg
70. First it needs to be able to perform all the moving functions of the robot e Second it needs to be robust enough to survive normal robot operation it also needs to be robust enough to survive some abnormal shock loads e Third it needs to be well integrated into the overall robot system The Motion Subsystem combines with the Structure Subsystem to form the primary physical parts of the robot The motion components will be used throughout a robot s construction and will likely be part of every major robot function As such this Subsystem needs to be well thought out in advance vex Inventor s Guide 3 33 Go to Reference Links oh I srosecruenp me we ROBOTC Reference 2 PLTW Cortex Pin Guide The VEX Cortex Microcontroller coordinates the flow of all information and power on the robot It has built in bidirectional communication for wireless driving debugging and downloading using the state of the art VEXnet 802 11 wireless link The Microcontroller is the brain of every VEX robot ON OFF SWITCH 7 2V MAIN BATTERY ANALOG INPUTS PWM VOLTATGE GROUND DIGITAL INPUTS OUTPUITS YyOLONW SPEAKER OUP UJ Analog Outputs amp Digital Inputs Outputs Motor Outputs e Analog Outputs are used by any sensors that e 2 wire motors and flashlights provide a range of values Examples include can be directly connected and potentiometers light sensors line followers controlled in ports
71. In an experimental setup the variable whose value is measured to see whether it was affected by a change in the independent variable Also called the responding variable Design Both the process of originating and developing a plan for a new object like a project prototype and the plan itself Design Canidate An idea selected for evaluation with a group of other ideas the most applicable of which will become a prototype Design Review A process in which a design or designs are evaluated usually by the team or experts Design Review External A process by which outside parties particularly those who are funding the project review the concept that has been chosen as the prototype and offer feedback and suggestions Design Review Internal A process designed to facilitate a fair and efficient comparison of all available design ideas so that the best one can be chosen for continued development Design Specification A document created to help fully understand the problem before beginning a solution Diameter The distance across the center of a circle from edge to edge Equal to two times the radius of the circle Document A real or virtual written item which provides information To document means to provide supporting information usually so as to make something easier to reference or modify For example a well documented program will have all successful versions saved named and commented descriptively so that future modificatio
72. M Go to Reference Links line follower kit continued Reading data from the line follower Reprogramming your microcontroller to read the sensor Start by plugging your line follower into any port in the Analog Digital bank on the Vex Microcontroller Note that the connector is mechanically keyed to fit into the microcontroller ports in a specific orientation Plugging it in backwards could result in damage to your sensor In order for your robot to be able to read the sensor you will have to reprogram the microcontroller Sample code to help you get started is available on the Vex website Refer to the Programming chapter in your Vex Inventor s Guide for information on how to add or change code te4 Inventor s Guide insert vex Go to Reference Links sensor accessories light sensor kit Light Sensor Kit INSERT THESE PAGES With a light sensor you can add a whole new range of at the back of the capabilities to your robot Design a simple tracker that Sensor Chapter in your follows the beam of a flashlight or use a light sensor to help eit ered your robot to avoid getting stuck under furniture by making it steer away from shadows Conserve battery power by programming your robot to shut down in the absence of YOU MUST HAVE A light You can even give your robot color vision by putting PROGRAMMING KIT TO USE THIS SENSOR colored filters on different light sensors f light sensor x 1 screw x 2 i 8 32 3 8
73. Mining Longwall Longwall mining is a form of underground coal mining where a long wall about 250 400 m long typically of coal is mined in a single slice typically 1 2 m thick The longwall panel the block of coal that is being mined is typically 3 4 km long and 250 400 m wide The longwall equipment consists of a number of hydraulic jacks called chocks roof supports or shields which are placed in a long line up to 400 m in length in order to support the roof An individual chock can extend to a maximum cutting height of up to 5 m The coal is cut by a rotating drum with bits called a shearer that moves along the length of the face in front of the chocks disintegrating the coal Continuous miners are used in longwall mining primarily to open the spaces needed for the longwall machine and chocks Monitor See Receiver Sender To watch or to receive information Moition Detector A sensor that detects motion It may be quite simple or very complex and may use a wide variety of sensors separately or together Multitask To do more than one thing at once In the VEX programming software multitasking is accomplished by creating a program with more than one task Navigation Directing a vehicle from one place to another Navigation Autonomous The ability of a robot to get to a pre determined place without human intervention sometimes despite the presence of unknown obstacles or from an unknown starting point Number Another word
74. Power 75 a N motorPower Stores the current sensor reading sonarVariable SensorValue sonarSensor of the sensor sonarSensor in the variable sonarVariable Adds the value in variable1 to the value in variable2 and stores the result in the variable 14 sum variablel variable2 Adds the value in variable1 and the value in variable2 average variablel variable2 2 then divides the result by 2 and stores the final resulting value in average Adds 1 to the current value of count and places the result back into count effectively increases the value in count by 1 count count 1 Creates the variable x with an initial value of O combination declaration and assignment statement int zero 0 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 3 Go to Reference Links A prosten ueno me we ROBOTC Reference 2 PLTW Thresholds with Natural Language Thresholds are values that set a cutoff in a range of values so that even if there are many possibilities the value eventually falls above the threshold or below the threshold Using thresholds allows you to perform certain behaviors depending on where a certain value usually a sensor value falls in relation to the threshold Threshold 25 cm If you look at this image it shows an VEX using an Ultrasonic Range
75. Reference Links A S7 PROJECT LEAD THE Way ROBOTC Reference 5 PLT VW Ge A VEXnet Joystick Configuration in ROBOTC cont 2 Connect the VEXnet Joystick to your computer using the USB A to A cable and turn it ON 2a Connect the VEXnet Joystick Use the USB A to A cable to connect your VEXnet Joystick to your computer Note The VEXnet light should turn green 2b Turn the VEXnet Joystick ON Switch the VEXnet Joystick to the ON postion Note The Joystick light should turn green Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 2 Go to Reference Links PROJECT LEAS THE NAY ROBOTC Reference VEXnet Joystick Configuration in ROBOTC cont 3 Go to Robot gt Download Firmware gt VEXnet Joystick Firmware and select Standard File to download the latest VEXnet Joystick Firmware to the controller Window Help Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection Debugger Debug Windows Remote Control Troubleshooter Platform Type Motors and Sensors Setup ROBOTC Firmware Master CPU Firmware pO_V2_31 bin Download Progress 3 Download Progress A Download Progress window will appear and begin the download process When the window closes the firmware download is complete Note You only need to download the VEXnet Joystick Firmware onc
76. Sense things about its environment it must be able to Plan an appropriate response to those factors and it must be able to Act accordingly Sensor A device that detects some important physical quality or quantity about the surrounding environment and conveys the information to the robot in electronic form Slope Intercept See Best fit Line A slope intercept equation contains two variables x and y usually in the form y mx b The quantity m describes the slope of a line on a graph and b describes the y intercept Sound Sensor A sensor that detects sound waves and reports the amount of sound back Sound wave A moving pattern of high and low pressure in air or other medium perceived as sound SPA See Sense Plan Act Specifications A specification is a set of requirements Normally a specification is the specific set of high level requirements listed by the sponsor which a project must meet A project specification may be that a robot can be no bigger than 2 feet long or that it must be able to travel at over 30 km an hour for example Speed The rate at which an object is moving The rate of change an object s position over time Calculated by dividing the distance an object moves by the amount of time it took to move STEM Acronym for the closely related fields of Science Technology Engineering and Mathematics Stimulus Anything that may have an impact on a system an input to the system A program
77. TC e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the program Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 3 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Troubleshooting ROBOTC with Cortex 10 Additional Steps e Try using the same program on another computer with the same Cortex e Try using the same program on the same computer with a different Cortex e Try using a different USB A to A cable Problem Not able to Download ROBOTC Firmware over USB 1 Was the correct startup sequence followed when connecting the Cortex to the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the ROBOTC Firmware 2 Has the Master CPU Firmware been successfully downloaded e Download the Master CPU Firmware 000 e Retry downloading the ROBOTC Firmware 3 Is the correct Platform Type Selected e Verify that the correct platform type is selected under Robot gt Platform Type e Retry downloading the ROBOTC Firmware 4 Is the connected battery sufficiently charged e Swap in a fully charged battery e Retry downloading the ROBOTC Firmware 5 Does the Cortex need to be power cycled e Start with the Cortex Turned OFF e Conne
78. UST go to File Save As then navigate to the folder to save your robotics projects in appropriately name your program and click Save Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Using the PLTW Template 1 Go to Reference Links ROBOTC Reference Using the PLTW Template PROJECT LEAD THE WAY The commented section above task main provides an are to coplete your identification information date a nar rative of what the program will and a place for pseudocode i 2 f 3 Project Title Shes AR eee Fill in personal information 5 Darte 6 Section i E 3 Task Description Describe project requirements in your 20 own words 11 lz Pseudocode me 13 Program planning 14 j 15 l task main 17 Program begins 18 19 E Section between curly braces is 20 designated for the actual program 21 22 23 ROBOTC uses different colors to help identify code and text This makes it easy to navigate through the pro gram in addition to providing clues about mistakes when items are a different color than expected 6 7 Project Title Robot Drag Race 8 Team Members PLTW 9 Date 2 1 11 10 Section 4th Period 11 12 Task Description Program a robot dragster to travel as fast 13 as possible after started with a switch 14 Notice the color changes in your document 15 Pseudocode 16 Green Comments single and multiple l
79. Unit but I get no video Solutions 1 Check that the RCA Video Cable is correctly attached to your television and to the Camera Receiver 2 Check that your television is on the correct input channel refer to your TV manual 3 Check that the Channel Selector Switch on the Camera Unit and Receiver are set to the same number Problem The video quality is poor Solutions 1 Check that the Camera is not too far away from the Receiver The Camera will only work within a certain distance from the Receiver 2 There may be interference from outside sources Try changing the channel on the Camera and the Receiver to a different number and see if the video quality improves Note the Camera and Receiver must both be set to the same channel 3 The RCA Video Cable may be slightly disconnected try disconnecting and reinstalling the cable for a better connection 4 The RCA Cable may be damaged or broken Try an alternate RCA cable 5 The battery level on your robot or Camera Receiver is low replace the batteries Color Camera Kit 4 Inventor s Guide insert v7 E gt lt Go to Reference Links sensor accessories ultrasonic sensor kit Ultrasonic Sensor Kit INSERT THESE PAGES Ultrasonic refers to very high frequency sound sound at the back of the that is higher than the range of human hearing Sonar or Sensor Chapter in your Sound Navigation And Ranging is an application of eG eels ultrasonic sound that
80. X Robotics Systems Boolean Logic 2 Go to Reference Links A proveer ueno me my ROBOTC Reference Se BTW Boolean Logic Use in Control Structures Under the hood of all the major decision making control structures is a simple check for the Boolean value of the condition The line if SensorValue bumper 1 may read easily as if the bumper switch is pressed do but the robot is really looking for if true or if false Whether the robot runs the if true part of the if else structure or the else part depends solely on whether the condition boils down to true or false if 50 gt 45 4 if true Logical Operators Some conditions need to take more than one thing into account Maybe you only want the robot to run if the traffic light is green AND there s no truck stopped in front of it waiting to turn Unlike the comparison operators which produce a truth value by comparing other types of values is one number equal to another the logical operators are used to combine multiple truth values into one single truth value The combined result can then be used as the condition Example Suppose the value of a Light Sensor named sonarSensor is 50 and at the same time the value of a Bumper Switch named bumper is 1 pressed The Boolean statement sonarSensor gt 45 amp amp bumper 1 would be evaluated v 50 gt 45 amp amp 1 1 a true amp amp t
81. a Kit 1 ROBOTICS DESIGN SYSTEM Go to Reference Links Auxiliary Accessories C olor Camera Kit continued Connect the Camera Receiver to a Television not included using the RCA Cable provided in the kit Make sure the yellow connector is connected to the Video port on the Receiver and the television and the white connector is connected to the Audio port on the Receiver and the television White Audio Battery Case underneath unit Yellow Video Channel Selector Port Switch Switch Once the Receiver has batteries installed and is connected to the TV it is time to mount the Camera to your robot The Camera has a row of 5x threaded mounting holes on its bottom These holes can be used to attach to Camera unit to any VEX structural component The image below shows an example of camera mounting using the 2 Mounting Screws provided in this kit Mounting Robot Structure Mounting Screws Color Camera Kit 2 Inventor s Guide insert vex ROBOTICS DESIGN SYSTEM l Go to Reference Links Auxiliary Accessories Color Camera Kit continued The Camera draws power from a motor port on a VEX Microcontroller plug the 2 prong connector into a 3 pin socket so that the connector is against the flat edge not the keyed edge as shown The key on the connector should NOT be inserted into the key of the socket Note The robot must be turned on for the Camera to receive power You cannot h
82. able See Dependent Variable Revise See Iterative Development Test Revise Repeat To remake or improve based on testing and or feedback Test revise repeat is the typical project pattern Testing reveals both what works and what doesn t Revision maintains what works while trying to fix what doesn t work Revision is done after feedback from people as well as testing Right Angle A 90 degree angle Robot A machine that is able to interact with and respond to its environment in an autonomous fashion A robot is characterized by three central capabilties the ability to Sense the ability to Plan and the ability to Act See Sense Plan Act Rotation Sensor A device that measures the amount of rotation of a certain piece or object Rubric A method and tool for evaluation consisting of a chart of criteria for evaluation of work It allows for standardized evaluation according to specified criteria making evaluation more transparent Scatterplot Used to illustrate the relationship between two aspects of the same set of data One aspect is represented by the X coordinate horizontal location and the other is represented by the Y coordinate vertical location of the data point Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 8 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued Scanning See Mapping
83. ame Here are some specifics about the rules governing each Rules for Variable Types e You must choose a data type that is appropriate for the value you want to store The following is a list of data types most commonly used in ROBOTC Data Type infeger Positive and negative whole numbers as 35 1 0 T J well as zero 33 100 345 Floating Point Numeric values with decimal points 123 0 56 3 0 float Decimal even if the decimal part is zero 1000 07 Boolean True or False Useful for expressing the fitie false baal outcomes of comparisons Rules for Variable Names Proper Variable Improper Variable e A variable name can not have spaces in it Names Names e A variable name can not have symbols in it e A variable name can not start with a number WERE nee e Avariable name can not be the same as an existing reserved word time1 T 1 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 2 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Variables Assignment and Usage Rules Assignment of values to variables is pretty straightforward as is the use of a variable in a command where you wish its value to be used Rules for Assignment e Values are assigned using the assignment operator not e Assigning a value to a variable that already has a value in it will overwrite the old value with the new one e M
84. any point on its circumference Equal to half the diamater of the circle Receiver See Monitor Sender A receiver gets messages sent by the transmitter Request for Proposals RFP See Proposal Clients sometimes issue a Request for Proposal commonly referred to as an RFP on a particular subject These RFPs are issued to find a provider for a new product or service one that typically addresses a particular problem or set of problems Research The process of gathering information pertaining to a subject In a project thorough research investigates the nature limits and complicating factors involved in the problem the project seeks to solve and all previous attempts to address it Lack of adequate research is often a cause for a project failing to meet its goals Resource Any limited good that can be drawn upon to complete a project Projects typically are limited in money time and human resources and need a plan to allocate them carefully in order to meet project goals Responsibility Matrix After the project work has been divided into tasks a responsibility matrix may be created which assigns responsibility for these tasks to project members A well constructed responsibility matrix will ensure both that no tasks necessary for successful completion of the project are left undone and also that there is no duplication of effort more than one member or team of members working on the same task in an uncoordinated way Responding Vari
85. apter The Motion Subsystem also contains parts designed to keep pieces positioned on a Spacers _ VEX shaft These pieces include washers spacers and shaft collars VEX Shaft Collars slide onto a shaft and can be fastened in place using a setscrew Before tightening the setscrew it is important to slide the Shaft Collars along the square shafts until they are next to a fixed part of the robot The collar prevents the shaft Collars from sliding back and forth Il a MT HINT The setscrews used in VEX Shaft Collars are 8 32 size threaded screws this is the same thread size used in the rest of the kit There are many applications where it might be beneficial to remove the setscrew from the Shaft Collar and use a normal VEX screw If a setscrew is lost any other VEX 8 32 screw can be substituted although the additional height of the screw head must be considered 3 30 Inventor s Guide 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Introduction to the Motion Subsystem continued In some applications excessive loads can damage the components of the VEX Motion Subsystem In these cases there are often ways to reinforce the system to reduce the load each individual component will experience or so that the load is no longer concentrated at a single location on any given component EXAMPLE Gear Train 1 One example of a component failure is fracturing gear teeth Another example is rounding out
86. ary A collection of programs or parts of programs stored to help optimize the programming process Without a library of programs everything a programmer does must be done from scratch A well ordered library on the other hand enables a programmer for example to track a line by calling a line tracking program from a library instead of having to place and configure each icon needed to track a line LIDAR An acronym standing for Light Detection and Ranging or Laser Imaging Detection and Ranging An optical remote sensing technology which measures properties of light to find range and or other information of a distant target The most common method is to send laser pulses into the environment and determine the distance to various objects by measuring the amount of time they take to reflect back Other methods like measuring the frequency of the reflected light are also used LIDAR is an important and widely used remote sensing and obstacle detection technology for mobile robots Limit Switch A Touch Sensor used to limit the motion of a moving device like a mechanical arm Limit switches may be used to provide a precise beginning and end point to mechanical motion Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 5 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued Linear Regression See Best fit Line The lin
87. ath operators can be used with assignment statements to perform calculations on the values before storing them e Avariable can appear in both the left and right hand sides of an assignment statement this simply means that its current value will be used in calculating the new value e Assignment can be done in the same line that a variable is declared e g int x 0 will both create the variable x and put an initial value of O in it Rules for Variable Usage e Use a variable simply by putting its name where you want its value to be used e The current value of the variable will be used every time the variable appears Examples Stores the value 75 in the variable motorPower 75 a N motorPower Stores the current sensor reading sonarVariable SensorValue sonarSensor of the sensor sonarSensor in the variable sonarVariable Adds the value in variable1 to the value in variable2 and stores the result in the variable 14 sum Adds the value in variable1 variablel variable2 and the value in variable2 average variablel variable2 2 then divides the result by 2 and stores the final resulting value in average Adds 1 to the current value of count and places the result back into count effectively increases the value in count by 1 count count 1 Creates the variable x with an initial value of O combination declaration and as
88. ation for programming which uses a combination of informal programming structures and verbal descriptions of code Emphasis is placed on expressing the behavior or outcome of each portion of code rather than on strictly correct syntax it does still need to be reasonable though In general pseudocode is used to outline a program before translating it into proper syntax This helps in the initial planning of a program by creating the logical framework and sequence of the code An additional benefit is that because pseudocode does not need to use a specific syntax it can be translated into different programming languages and is therefore somewhat universal It captures the logic and flow of a solution without the bulk of strict syntax rules Below is some pseudocode written for a program which controls a motor and an LED as long as a touch sensor is not pressed A motor turns on and an LED turns off if no object is deteced within 20cm of a sonar sensor the motor turns off and an LED turns on if an object is detected within 20 cm task maim while touch sensor is not pressed Some intact syntax The use of a while loop in the pseudocode is fitting Ir onar Ceweers Ob jece gt 2 Venvaway because the way we read a i while loop is very similar to the manner in which it able Moe Oie E ONS Oa is used in the program Red CED EUr orr else Rabel Moni oie 2 oo Descriptions Ree Pir Devas son There are no actual motor c
89. ave the robot turned off and still operate the camera Connector sits 77 EEES against this fat edge Camera 2 prong connector NS VEX Microcontroller Motor Parts Once the Camera is mounted and connected to power it is time to turn the system on Ensure that both the Camera unit and the Receiver are set to the same channel Each of these units has a Channel Selector Switch set these to the same number Turn both units on and set the TV to the correct video input channel this will vary depending on the TV On Off Switch Channel Selector Switch Inventor s Guide insert Color Camera Kit 3 i l Go to Reference Links Auxiliary Accessories Color Camera Kit continued Camera Troubleshooting Guide Problem The LED light on the Camera Receiver is not on Solutions 1 Check your batteries to see if they have been installed correctly 2 Check that batteries are charged 3 Check that the power switch is in the on position Problem The LED light on the Camera Unit is not on Solutions 1 Check that the power switch on the Camera is in the on position 2 Check that the Camera 2 prong connector is correctly connected 3 Check that the robot is turned on and has fresh batteries Problem The LED light is activated on both the Camera Receiver and the Camera
90. be to combine them into one machine Internal Design Review See Design Review Internal Inventory An inventory is the total stock available at a given place and time To inventory means to list systematically the items that are available in a particular place or situation or for a particular purpose Irrigation Bringing water to crops by human effort in place of or in addition to water coming from rainfall or by natural waterways An irrigation ditch for example is something people dig to channel water onto cropland Iterative Development See Test Revise Repeat The process of repeatedly testing and making improvements to a product before it is finalized In this process multiple iterations of the product are developed each iteration being closer to the final product than the last LCD Liquid Crystal Display A transparent screen containing a light polarizing liquid that is controlled by electric fields to create visible readouts on some controllers Light Sensor A sensor that detects the presence of certain wavelengths of light and reports the intensity of light back to the controller Light Sensors have two modes Reflected Light and Ambient Light In Reflected Light mode the Light Sensor will shine a red light and look for the amount of that light that bounces back to it off objects in the environment In Ambient Light mode the sensor will not shine the light instead looking for light that reaches it from other sources Libr
91. but under terrestrial gravity conditions they are the same It is critical that the center of gravity be kept directly over the support polygon or the robot will fall over Challenge VEX System VEX Challenges are designed to give you a specific task to accomplish by building a robot and to open possibilities for collaboration and competition with other robot designers Chassis Structure Subsystem Motion Subsystem A vehicle s basic structural frame plus its locomotion systems In the VEX system this is generally the Structure Subsystem plus the Motion Subsystem minus any attachments Circumference The distance around the edge of a circle This quantity is equal to pi times the circle s diameter or 2 times pi times the radius Clockwise A rotational direction that prescribes turning in the same direction as the hands on a clock normally turn Clutch Motion Subsystem A detachable piece normally mounted to the VEX motors that protects them from shock loads These should not be removed under most circumstances Collar Structure Subsystem A type of spacer that can be set to remain stationary at any given point along an axle These are often used to keep other components on the axle or sometimes the axle itself from sliding out of position Compound Gear Motion Subsystem A system of gears involving several pairs of gears some of which share axles with each other When calculating gear rat
92. calculations using stored values The same basic rules are followed but the possibilities go far beyond just what you ve seen so far Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 1 Go to Reference Links Re A proveer ueno me my ROBOTC Reference 2 PLTW Variables with Natural Language Declaration Rules In order to declare a variable you must declare its type followed by its name Here are some specifics about the rules governing each Rules for Variable Types e You must choose a data type that is appropriate for the value you want to store The following is a list of data types most commonly used in ROBOTC Data Type Example Values infeger Positive and negative whole numbers as 35 1 0 T J well as zero 33 100 345 Floating Point Numeric values with decimal points 123 0 56 3 0 float Decimal even if the decimal part is zero 1000 07 Boolean True or False Useful for expressing the taetae Best outcomes of comparisons Individual characters such as letters and ps es ees Character neat n o Z char numbers placed in single quotes Multiple characters in a row can Hello World String optionally form sentences and words asdf Zebra string placed in double quotes Number 50 Rules for Variable Names Proper Variable Improper Variable e Avariable name can not have spaces in it Names Names e Avariable name can not have s
93. coming from the Microcontroller When an external force like a collision or being pressed up against a wall pushes the switch in it changes its signal to a digital Electrical Ground LOW until the limit switch is 0V LOW PUSH released An unpressed switch is indistinguishable from an SO open port N O Terminal Signal pin on wire Note You can connect multiple switches to the same port using a y cable Pushing switch brings the signal pin voltage to LOW PIC Microcontroller Default Code Behavior Info Usable Ports Analog Digital 1 8 Limit Switch Behavior 9 10 not recommended 11 12 Autonomous Behavior For more info see ANALOG DIGITAL Programmed Behaviors later in this section Ep EY ihe El vet sos eb OA vet oe Ea eb vb He els deb Ea EE ES Ee ED TE FEE En CEB Cel E EL GE CEP Gk CE ble E 5 64 Inventor s Guide vex ROBOTICS DESIGN SYSTEM 276 2178 E 0610 Go to Reference Links A prose ena me war ROBOTC Reference 2 PLTW Shaft Encoders Overview The Quadrature Shaft Encoder detects the rotation of an axle that passes through it It has a resolution of 360 counts per revolution 2 count intervals and can distinguish between clockwise and counterclockwise rotation The Quadrature Shaft Encoder is an upgrade from the original Shaft Encoder The original version contains only one internal sensor which detects the slits in an internal disc as it
94. complete AROBOTC Message will appear and remind you to also download the ROBOTC Firmware ROBOTC Message Firmware for master CPU has been successfully downloaded Firmware for user CPU should now be downloaded as well Note You only need to download the Master CPU Firmware once when you first start using a VEX Cortex with ROBOTC or when you upgrade to a newer version of ROBOTC Switching programs or download methods does not require a re download Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 4 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference VEX Cortex Configuration over USB cont 5 The ROBOTC Firmware enables you to download ROBOTC programs to your robot and utilize the various debug windows Go to Robot gt Download Firmware gt ROBOTC Firmware and select Standard File to download the ROBOTC Firmware to your robot Window Help Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection Debugger Debug Windows Remote Control Troubleshooter Platform Type Motors and Sensors Setup jee Salt Master CPU Firmware VEXnet Joystick Firmware Download Progress 5 Download Progress A Download Progress window will appear and begin the download process When the window closes the firmware download is complete Note You only need to download the ROBOTC Firm
95. cond The maximum amount of time that can be referenced is 32 768 seconds 1 2 minute The VEX has 4 internal timers T1 T2 T3 and T4 INCS Integer variable x E Pil Assigns x value of Timer 1 1 1000 sec timelO timer This code returns the current value of the referenced timer as an integer The resolution for time10 is in hundredths of a second 1 1 100th of a second The maximum amount of time that can be referenced is 327 68 seconds 5 5 minutes The VEX has 4 internal timers T1 T2 T3 and T4 de Gua a4 Integer variable x x timelO T1 Assigns x value of Timer 1 1 100 sec timelOO timer This code returns the current value of the referenced timer as an integer The resolution for time100 is in tenths of a second 1 1 10th of a second The maximum amount of time that can be referenced is 3276 8 seconds 54 minutes The VEX has 4 internal timers T1 T2 T3 and T4 LN ER Integer variable x e OO a a a a a a cee Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 2 Go to Reference Links a e U I J PROJECT LEAD THE WAY RSh 4 U ROBOTC Reference Reserved Words ClearTimer timer This resets the referenced timer back to zero seconds The VEX has 4 internal timers T1 T2 T3 and T4 ClearTimer T1l Clear Timer 1 SensorValue Sensor input SensorValue is used to reference the integer
96. ct the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the ROBOTC Firmware 6 Try another USB port on the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the ROBOTC Firmware 7 Restart ROBOTC e Close ROBOTC e Open ROBOTC e Retry downloading the ROBOTC Firmware 8 Restart the computer e Restart your computer e Open ROBOTC e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the ROBOTC Firmware Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 4 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Troubleshooting ROBOTC with Cortex 9 Additional Steps e Try downloading the ROBOTC Firmware using another computer with the same Cortex e Try downloading the ROBOTC Firmware using the same computer with a different Cortex e Try using a different USB A to A cable 10 Slow down the firmware download by inserting delays e Go to Window gt Menu level gt and select Super User e Go to View gt Preferences gt Detailed Preferences e Go to the VEX Cortex Tab e The box next to Delay Between HID Write allows you to specify a number of milliseconds to insert as delays e Adda 5 millisecond delay e R
97. ction Motion Subsystem An overall measure of how well a tire is able to grip the ground Many factors texture size material etc must be taken into account when evaluating a tire s traction on different surfaces Transmitter Control Subsystem The primary user interface device for the human operator of the robot The Transmitter gathers input from its two joysticks and four buttons and transmits them via FM radio wave to the RF Receiver mounted on the robot Transmitter Battery Holder Power Subsystem The battery container for the Transmitter The battery holder contains the 8 NiCd AA batteries in place required to operate the Transmitter If you wish to use the 9 6V battery pack the Battery Box can be easily removed to make room for the 9 6V pack 276 2178 E 0610 276 2178 E 0610 Glossary Transmitter Frequency Crystal Control Subsystem The swappable module in back of the Transmitter that designates the radio frequency that the Transmitter will use to communicate with the RF Receiver Module The frequency of the Transmitter Frequency Module must match the frequency of the crystal installed in the RF Receiver Module on the robot in order for them to communicate All VEX Systems come with the same Transmitter Frequency Module Additional modules on different frequencies are available for purchase separately Trickle Charge Power Subsystem A very low power charge that is applied to full batteries in
98. cx Technical overview This is an analog sensor meaning that its output covers a range of values in this case from zero to five volts rather than being only high five volts or low zero volts as is the case for a digital sensor This range of output from zero to five volts is sent to the microcontroller which reads it as a range of integer values from 0 to 255 For more detail refer to the Sensors chapter in your Vex Inventor s Guide For this particular sensor sensor output will be low around 0 when the infrared light bounces back to the detector in other words when the surface is pale or highly reflective and high around 255 when the light is absorbed and does not bounce back Maximum Minimum Illumination Illumination Integer Value Q _ gt 255 Analog Value OV We can then set a threshold value in our code to act as a trigger for behaviors From this basic premise we can build more complicated behaviors For example if you have three line sensors on the front of your robot hint use the mounting bar included in your kit then you can program your robot to follow a white line on a black surface LineFollower_ Middle should always see white and the other two LineFollower_ Left and LineFollower_ Right should always see black If LineFollower_Left starts seeing white then your robot needs to steer back to the left If LineFollower Right starts seeing white the
99. d hole that replaces the part s original square hole A VEX square shaft can then spin freely in the newly created round Drilled Center Hole hole This is useful for some specialty applications VEX Square Shaft Hole vex inventors Guide 3 29 Go to Reference Links The key component of any motion system is an actuator an actuator is something which causes a mechanical system to move In the VEX Robotics Design System there are several different actuator options The most common types of actuators used are the VEX Continuous Rotation Motors the 3 Wire Motor and the high strength 2 Wire Motor 393 and the VEX Servos For more information on Motors amp Servos refer to the Concepts to Understand section of this chapter Each VEX Robotics Motor amp Servo comes with a square socket in its face designed to connect it to the VEX square shafts By simply inserting a shaft into this socket it is easy to transfer torque directly from a motor into the rest of the Motion Subsystem The most common types of actuators used are the VEX Continuous Rotation Motors the 3 Wire Motor the 2 Wire Motor 269 and the high strength 2 Wire Motor 393 and the VEX Servos WARNING Some VEX Motors include a clutch assembly which is designed to prevent damage to the internals of the VEX Motor in the event of a shock load For more information on VEX Clutches refer to the Concepts to Understand section of this ch
100. d budget Proposal See Request for Proposals A properly accomplished proposal educates the prospective client about the full nature of his or her need and argues as well as possible that the proposal writer s group can meet it Sponsors sometimes issue a Request for Proposals commonly referred to as an RFP in orderProtractor to invite proposals on a particular subject Protoype Literally first of its kind Creating a working prototype that is creating a first of its kind robot that accomplishes the task s it is meant to is the typical goal of a robotic project Protractor A device used for measuring angles Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 7 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued Pseudocode is a compact and informal description of a computer programming code Itis a hybrid language which combines the features of the programming language with the native language of the person writing the program RADAR See LIDAR An acronym standing for Radio Detection And Ranging it is a system that uses radio waves to detect determine the distance and or speed of objects It functions by bouncing radio waves off of objects and timing how long it takes the reflected wave to come back to a receiver Radius The length of the line segment that joins the center of a circle with
101. d etitian Control Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 5 Go to Reference Links CBSO eraser noe ROBOTC Reference PTW Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems The ROBOTC Debugger Sensors The Sensors debug window provides access to the current values of all sensors digital inputs and digital outputs configured on your microcontroller Sensor values can be viewed and changed using this window but you must first use the Motors and Sensors Setup menu to tell ROBOTC what types of sensors are connected to which ports Different sensors are interpreted differently by ROBOTC and and the microcontroller and appropriate values will not be displayed if they are not properly configured Line am Line Follower Line Follower No Sensor No Sensor Potentiometer No Sensor No Sensor Quadrature Enc Quad Encoder Quadrature Enc Quad Encoder No Sensor Touch Touch SONAR cm SONAR 2nd Port No Sensor dtl 11 No Sensor dgtli No Sensor Global Variables Timers Wlotors Sensors Index The index of where the current device is located in1 in8 for ANALOG Ports 1 8 and dgtl1 dgtl12 for DIGITAL Ports 1 12 Device Current name of the sensor These names can be customized through the Motors and Sensor Setup window Type Displays the type of the curr
102. draining them to OV by external means and then recharging them to full capacity Repeating the drain charge cycle a few times should restore the batteries to full performance W Washer Structure Subsystem A round metal or plastic disc placed between a screw head or nut and the surface to which it is mounted The washer gives the screw a secure surface to brace against and prevents the screw head from bending the metal surrounding the hole and popping all the way through Steel washers should be used with screws that are not meant to move at all Delrin white plastic washers should be used when the entire screw nut assembly is meant to turn together e g the screw at the pivot of a movable arm attachment Glossary 131
103. e H Desktop Ji Advanced 10 20 2010 4 09PM_ File folder J Downloads Ji Basic Movement 10 20 2010 4 09PM_ File folder i Recent Places J Bumper amp Limit Switch 10 20 2010 4 09 PM File folder J Dropbox Control Structures 10 20 2010 4 09 PM File folder jb Default Code 10 20 2010 4 09PM_ File folder Ca Libraries LCD 10 20 2010 4 09PM_ File folder Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Sample Programs 1 Go to Reference Links ROBOTC Reference PLT Running a Program Once a program has been successfully written it needs to be given to the robot to run The following steps will guide you through the process of downloading your program to the robot and then running it remotely or connected to your computer 1 Make sure your VEX is turned on Move the switch from the OFF position to the ON position 2 Make sure your robot is plugged in to the computer via the Programming Module The program will be loaded onto the robot through this connection 3 Click Robot on the top menu bar of the ROBOTC PEE Window Help window and select Download Program or Compile ee and Download Program they re effectively the same Recompile Program which one you see depends on whether you have made fo Debugger Debug Windows changes since the last time you compiled Platform Type Motors and Sensors Setup 4 You may be prompted t
104. e when you first start using a VEX Cortex with ROBOTC or when you upgrade to a newer version of ROBOTC End of Section Downloading Firmware to the VEXnet Joystick Once the Download Progress window closes the VEXnet Joystick Firmware download is complete Move on to the next section to learn how to create a wireless link between the VEXnet Joystick and VEX Cortex Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 3 Go to Reference Links VEXnet Joystick Configuration in ROBOTC cont Section 2 Creating a wireless link betwen the VEXnet Joystick and VEX Cortex In this section you will learn how to pair a VEX Cortex Microcontroller to a VEXnet Joystick allowing them to communicate over VEXnet This section assumes that you have already updated the master firmware on the VEX Cortex and VEXnet Remote Control VEXnet is an 802 11 WiFi communication system between the VEX Cortex and VEXnet Remote Control VEXnet features include e Easy to connect No IP addresses MAC addresses passwords or special security modes e Multiple layers of security built in and always on e No wireless access point needed each VEXnet pair makes its own private network e Hundreds of robots can operate at once every VEXnet robot has a hidden unique ID e Optional tether for wired communication e Optional 9V battery backup to maintain wireless link during a main
105. e integer variable speed is created and initialized but never actually used in the program This is indicated in the Errors display screen with the message speed is written but has no read references Forward c task main oS int speed 63 forward 63 wait 2 0 stop 1 2 3 4 5 amp T 5 H m of File Forward c compiled on May 23 2011 11 44 25 4 pg Info You do not need to correct this message but you can in two ways 1 Eliminate the code on line number 4 deleting the variable 2 Call the speed variable in the forward command on line 6 in place of the integer 63 Handling other Error Messages Learning how to program robots isn t easy it s no different than learning a foreign language This document covers how to handle some of the more common mistakes and error messages that you may encounter but you may run into others That said here are some general rules for dealing with all error messages e Determine if the message is an error a warning or just information The message may not even require additional work on your part e Read the error message for clues Error messages aren t always the most intuitive but they always contain some information about what the compiler found e When your program contains multiple errors fix them one at a time recompiling your code after each fix The ripple effect can make it seem like there are errors even if the r
106. ear function referred to in the phrase linear regression may also be a best fit line or trendline Regression in general is the problem of estimating a conditional expected value Logic A data type that the controller can understand Logic data has only two possible values which can be represented in multiple ways The value True is often also represented by a 1 or a checkmark and False is also represented by a 0 or an X Manipulated Variable See Independent Variable Mapping Making a map In robotics mapping usually refers to the ability of an autonomous robot to enter an area and navigate sense and record information in such a way as to allow an accurate map of the area to be constructed Marketing Refers to the process of advertising and selling a product or service Marketing also refers to bringing the product or service to the market where it can be bought or sold Marketing Presentation A marketing presentation is one concerned with marketing a product or service usually to potential buyers Miner Continuous In the mining industry a large tracked machine that uses moving claws to tear coal loose from its natural formation and pull it into a large scoop The continuous miner then transfers the coal to other coal moving machines Mining The extraction of valuable minerals from the earth The area where minerals are extracted is called a mine There are for example coal mines iron mines gold mines and uranium mines
107. eceiver operate The crystal used in the Transmitter Frequency Module must match the crystal used in the Receiver for controls to be sent and received properly CW Short for Clockwise Glossary 123 Glossary Deep Cycling Power Subsystem Draining a battery down to very low power below the normal cutoff levels before recharging it This will wear a rechargeable battery out very quickly and should be avoided if possible Diameter The distance from one point on a circle to the point directly across from it This quantity is equal to two times the radius or it can be multiplied by pi to find the circumference of the circle Digital Sensor Sensor Subsystem Digital sensors communicate with the Microcontroller by setting an electrical voltage in the system to one of two values either a digital LOW equal to OV or a digital HIGH equal to the maximum voltage on that port Discharge Cycle Power Subsystem Technically any period during which power is drawn from the battery and then recharged Usually used in one of two contexts either when referring to the usage pattern of a battery using a battery fora short time then recharging it constitutes a pattern of short discharge cycles or when battery chargers automatically drain the battery before recharging it the charger performs a discharge cycle on the battery Drive Train Motion Subsystem All the parts involved in the primary locomotion system
108. ed 90 day Warranty This product is warranted by Innovation First against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation First dealers For complete warranty details and exclusions check with your dealer Innovation First Inc 1519 IH 30 W Greenville TX 75402 For More Information and additional Parts amp Pieces refer to 03 10 www VE Xrobotics com Inventor s Guide insert 2 Wire Motor 269 1 ROBOTICS DESIGN SYSTEM l l Go to Reference Links Motion Accessories 2 Wire Motor 393 The 2 Wire Motor 393 provides up to 60 more torque than the INSERT THIS PAGE standard motor which will allow more powerful mechanisms and drive imaa rem a bases All of the internal gears are made from a steel alloy which Motion Chapter in your means that clutches and replacement gears are no longer required BES TNUELWON S uac The 2 wire motor can be directly connected to the Cortex and ARM 9 microcontrollers internal motor controllers An external motor control module is required to connect the 2 wire motor to the PIC Microcontroller V0 5 External motor control modules can also be used with the Cortex and ARM 9 microcontrollers High Speed Option Want to go faster than the standard motor but still have the same output torque as the Standard motor No problem The 2 Wire Motor 393 kit can be configured into a high speed version Simply
109. ed to the exact same level and then recharged will develop a permanently diminished capacity True memory effect is observed only under laboratory conditions and on board solar powered satellites in space The more common usage of the term is incorrect and is frequently used mistakenly to refer to voltage drop Microcontroller Logic Subsystem The brain of the robot The Microcontroller contains the robot s program and processes all signals received from both human operators and onboard sensor systems It also manages power allocation on board the robot and directly controls the motors Miscalibrated Control Subsystem A condition where two values which should be the same do not in fact match each other This occurs frequently with the joysticks on the Transmitter which should produce a neutral motor state when centered but will often cause motors to turn slowly instead when the sticks are released Sensors that indicate things like distances can also become miscalibrated and report values that do not reflect the actual physical situation Mix Transmitter Control Subsystem A control setup where inputting commands on one control channel influences the commands being sent on other control channels Motion Subsystem The subsystem responsible for the generation and transmission of physical motion on the robot This includes motors gears wheels and many others Motor Electric Motion Subsystem An e
110. eering Journal A notebook which serves as a personal organizer for a project It should maintain and order all items related to the project including research brainstorming ideas schedules daily activities design reviews presentations etc Environmental Of or pertaining to the environment sometimes the natural world around us and sometimes the area in which the robot will be operating External Design Review See Design Review External Feedback See Input Input such as what a sensor gives to the VEX For example a robot uses Light Sensor feedback to follow a line By extension feedback can also mean human response both positive and negative Efficiently gathering and making use of available human feedback both internal and external will tend to help the success of any project Follow up Proposal A second proposal made to continue work begun in the first A follow up proposal typically takes into account both the successes and the failures of the original project and is based on new perspectives gained from it Funding Money made available for a specific purpose like a project Frequency Mi High Frequency Frequency The number of waves that pass by a point in space in a certain Low Frequency amount of time For counting purposes one wave is usually considered an entire cycle from peak to peak i e two tops of waves pass by or trough to trough two bottoms pass by Frequency is usually expressed in hertz
111. ent sensor The type must be set using the Motors and Sensor Setup window Value Displays the current value of the sensor Debugger The Sensors window can be opened eee Y PY going to the Robot menu Debug Remote Control Troubleshooter Platform Type Motors and Sensors Setup ROBOTC Debugger 6 Go to Reference Links gt e PB T J PROJECT LEAD THE WAY RSh A e U ROBOTC Reference The ROBOTC Debugger Sensors F ROBOTC To configure the sensors connected to your microcontroller open the Motors and Sensors Setup from the Robot menu in ROBOTC File Edit View Robot Window Help Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection E _C Constructs H Natural Language Debugger Debug Windows Remote Control Troubleshooter Platform Type Digital sensors Bumper Limit Encoder Ultrasonic can be configured on the VEX 2 0 Digital Sensors 1 12 tab and analog sensors Light Line Follower Potentiometer Accelerometer can be configured on the VEX 2 0 Analog Sensors 1 8 tab To configure a sensor first locate the row that aligns with where the sensor is plugged in on the Cortex For example dgtl2 is short for DIGITAL Port 2 on the Cortex Next give the sensor a custom name and define its sensor type in the dropdown menu After applying your chages redownload your program to the microcontroller to have the changes take effect in the Se
112. entheses followed by a semicolon Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Functions 1 Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW Advanced Functions Parameters Parameters are a way of passing information into a function allowing the function to run its commands differently depending on the values it is given It may help to think of the parameters as placeholders all parameters must be filled in with real values when the function is called so in the places where a parameter appears it will simply be replaced by its given value 1 Declare parameter A parameter is declared in the same way that a variable is type then name inside the parentheses following the function name float time starcMotor armMotcor o3 SC COPMOCPr able em void rotateArm 2 Use parameter The parameter value behaves like a placeholder Whatever value is provided for the parameter when the function is called Ca REN will appear here POCECE AK 3 Call function with parameter When the function is called a value must be provided within the parentheses to take the place of the parameter inside the function Substitution ELO oE E E A Gilles ce ES The arrows in the illustration to the right show f the general path of the value from the place where it is provided in the function call to where
113. eoeeeo 2 The ultrasonic sensor generates a 250 microsecond ultrasonic pulse YY gt 1 The Vex microcontroller sends a start signal to the ultrasonic sensor im a a m m e ew ee ee eee TU MML hi e ui Tii Er 2 Tite Ao 3 The ultrasonic sensor sets its output signal to 5V thus sending a 1 high signal to the microcontroller In digital terms this isa I o m m a 8 a a O 4 A timing loop on the microcontroller begins Le counting the seconds This bo fumed d fi will be the round trip delay in the distance equation 5 The ultrasonic sensor picks up the echo from the 250 microsecond pulse rm E 0 0 8 0 8 8 B 2 E e a je 7 The Vex microcontroller exits the timing loop and _ uses the round trip delay to calculate the distance to the object ea 6 The ultrasonic sensor sets its output signal to OV thus sending a low signal to the microcon troller In digital terms this is a 0 vex Inventor s Guide insert ultrasonic sensor kit 3 Go to Reference Links sensor accessories Connecting the ultrasonic sensor to the microcontroller The ultrasonic module has two three pin connectors that will each plug into an interrupt port on the Vex Microcontroller These can be adjacent ports but do not have to be The connector labelled INPUT is the trigger output of the Vex
114. erence Links S Pb E PROJECT LEAD THE WAY ALED gt lt 9 G The Potentiometer is used to measure the angular position of the axle or shaft passed through its center The center of the sensor can rotate roughly 265 degrees and outputs values ranging from 0 1023 to the Vex Microcontroller The Potentiometer can be attached to the robot using the mounting arcs surrounding the center of the sensor The arcs provide flexibility for the orientation of the Potentiometer allowing the full range of motion to be utilized more easily When mounted on the rotating shaft of a moving portion of the robot such as an arm or gripper the Potentiometer provides precise feedback regarding its angular position This sensor data can then be used for accurate control of the robot Gear it Up If the range of motion is too large for the Potentiometer try developing a gear train that would allow you to measure the rotation of the shaft Note Your sensor feedback will lose some resolution Mounted Potentiometer Here the Potentiometer is mounted on Squarebot 3 0 It provides feedback regarding the position of the movable arm CAUTION When mounting the Potentiometer on your robot ensure that the range of motion of the rotating shaft does not exceed that of the sensor Failure to do so may result in damage to your robot and the Potentiometer Project Lead The Way and Carnegie Mellon Robotics Academy For use
115. es not correct the capitalization in your code only what it sends to the robot Again the actual warning message inform you about the substitution Warning Substituting similar variable forward for Forward Check spelling and letter case Forward c BlankFile c task main int speed 63 Forward speed wait z2 0 Stopi 1 2 3 4 a 6 T7 3 g g 1 gf File Forward c compiled on May 23 2011 15 05 54 6 Warning Substituting similar variable forward for Forward Check spelling and letta a Warning Substituting similar variable stop for S5top Check spelling and letter casg You do not need to correct this message If it was not intentional you can 1 Include code within the curly braces of the while loop for it to repeat 2 Change the condition of the while loop so that it does not repeat forever Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 6 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Error Messages in ROBOTC Code Common Intionmation Messages Information messages will not prevent your program from compiling or downloading to your robot They only notify you regarding possible inefficiencies in your code The most common occurrence of information messages are unused variables in your code In the example below th
116. est of your program is perfect e Pseudocode pseudocode pseudocode Make sure you have a plan in place before you try to write a complex program That way you can work out the logic first without having to worry about it and the syntax spelling and capitalization at the same time Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 7 Go to Reference Links Ke A proveer ueno me wa ROBOTC Reference 2 PLTW Troubleshooting ROBOTC with Cortex This guide is to designed to be used by a student or teacher as a reference for help troubleshooting ROBOTC software issues Troubleshooting Topics e Computer will not Recognize the VEX Cortex e Not able to Download my ROBOTC program over USB e Not able to Download ROBOTC Firmware over USB e Not able to Download Master CPU Firmware over USB e Program will not Compile e Program compiles but does not behave as desired e Not able to open the ROBOTC Debugger e Motors and or Sensors Debug windows not functioning correctly e Program does not immediately run when Cortex is turned on Problem Computer will not Recognize the VEX Cortex 1 Was the correct startup sequence followed when connecting the Cortex to the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On 2 Is the connected battery sufficiently charged Swap in a fully charged batter
117. etry downloading the ROBOTC Firmware e Continue to add short delays up until 100 milliseconds e Retry downloading the Master CPU firmware until success Problem Not able to Download Master CPU Firmware over USB 1 Was the correct startup sequence followed when connecting the Cortex to the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the Master CPU Firmware 2 Is the correct Platform Type Selected e Verify that the correct platform type is selected under Robot gt Platform Type e Retry downloading the Master CPU Firmware 3 Is the connected battery sufficiently charged e Swap in a fully charged battery e Retry downloading the Master CPU Firmware 4 Does the Cortex need to be power cycled e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the Master CPU Firmware 5 Try another USB port on the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the Master CPU Firmware 6 Restart ROBOTC e Close ROBOTC e Open ROBOTC e Retry downloading the Master CPU Firmware 7 Restart the computer Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 5 Go to Reference Links gt I J PROJECT LEAD THE WAY
118. finder The threshold in this case is 25 centimeters We can create behaviors that tell the robot to go forward until the Ultrasonic Rangefinder detects something closer than 25 centimeters StoLellouow letrhoroem 16 gt untilSonarLessThan 25 The threshold is just used to determine at which point the robot should be peforming a different behavior Calculated Thresholds Some sensors like the Ultrasonic Rangefinder and Potentiometer provide the same set of values no matter what environment the robot is in for the most part their thresholds can simply be chosen based on their application Other sensors like the Light Sensor and Line Tracking Sensor will provide very different values based on the environment they re in due to factors such as the amount of ambient light or the type of surface the robot is tracking Sensors that provide a different range of values based on their environment need to have their thresholds calculated For example to find a dark line on a light surface you must first calculate a threshold to distinguish light from dark One recommended method is 1 Meausre the Line Follower Sensor value of the light surface For more information on finding sensor values reference the ROBOTC Debugger document 2 Measure the Line Follower Sensor value of the dark surface 3 Add the two light sensor readings together 4 Divide by two to find the average and use it as your threshold light value dark val
119. follow the Gear Change Procedure step by step instructions to increase the output speed by 60 Motor Coupler The 2 Wire Motor 393 Kit includes the new shaft coupler which can be used in place of the clutch to connect the motor to VEX shafts The coupler can also be used to connect VEX Shafts together Motor Specifications All motor specifications are at 7 2 volts Actual motor specifications are within 20 of the values below As Shipped High Speed Option Stall Torque 13 5 in lb 1 68 N m 8 4 in lb 1 05 N m Free Speed 100 RPM 160 RPM Stall Current 3 6 Amps 0 15 Amps Limited 90 day Warranty This product is warranted by Innovation First against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation First dealers For ee Motor Coup er G complete warranty details and ears x 1 E ates 2 Wire Motor x 1 xl H Motor Post x 1 exclusions check with your dealer Innovation First Inc 1519 IH 30 W Greenville TX 75402 For More Information and additional Parts amp Pieces refer to 12 10 www VE Xrobotics com Inventor s Guide insert 2 Wire Motor 393 1 ROBOTICS DESIGN SYSTEM l l Go to Reference Links Motion Accessories 2 Wire Motor Kit continued C Gear Change Procedure To configure the high speed option follow these instructions 1 Remove the four screws in the corners 2 Lift off the top cove
120. g ROBOTC with Cortex Problem Not able to Download my ROBOTC program over USB 1 Was the correct startup sequence followed when connecting the Cortex to the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the program 2 Does the program compile e Fix any errors red x s e Retry downloading the program 3 Is the correct Platform Type Selected e Verify that the correct platform type is selected under Robot gt Platform Type e Retry downloading the program 4 Is the connected battery sufficiently charged e Swap in a fully charged battery e Retry downloading the program 5 Does the Cortex need to be power cycled e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the program Have the Master CPU and ROBOTC Firmware been downloaded successfully to the Cortex Do they need to be re downloaded Download the Master CPU Firmware c 10008 Download the ROBOTC Firmware Power Cycle the Cortex Retry downloading the program O OOO N Try another USB port on the computer Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On e Retry downloading the program 8 Restart ROBOTC e Close ROBOTC e Open ROBOTC e Retry downloading the program 9 Restart the computer e Restart your computer e Open ROBO
121. ghtness port4 63 Flashlight OFF Turn a VEX Flashlight in a specified motor port OFF Default motor port port4 Robot Type Choose which robot you are using Recbot or Swervebot Default bot none 2010 Carnegie Mellon Robotics Academy For use with VEX Robotics Systems StarcMocor ports 63 untilPotentiometerGreaterThan Stop startMotor porte 63 4 untilPotentiometerLessThan Stop SstartMotor UntilDerk stop SstartMotor untilLignit stop startMotor UntilReotations SCOP StartMotor untilEncoderCounts Scop 3 CurnbLEDOn j wait turnLEDOff turnLEDOn wait EUrnLEDOLE lt 4 turnrlasnlighton wait CuIMrlashlightOrt turnFlashlightOn wait Eurny een lisneore j robotType startMotor porto 63 untilSonarGreaterThan 4000 Stop 7 ind T untilSonarLessThan 40 SstartMotor ports ind stop 63 in StartMotor ports untilDark 1005 Stop 6377 in4j startMotor ports untilLight 1005 stop 623 dgtl startMotor ports u ntilRotations 2 75 stop SlLarcMocor porto 03 u untilEncodercCounts 990 stop dgt13 turnLeDOn dqgtly wait 0 5 turnLEDOff dgt17 LUrnLEDOn detly wait 0 5 turnLEDOCE dgtl CurnrlashliohtOn porclo wait 0 5 cCurnk lashlightOtt porctio gt Lar t rn Flashnli
122. gnton portiy wait 0 5 turn lashiliohtOrt portu 127 robotType swervebot ROBOTC Natural Language Cortex Quick Guide 2 ROBOTC Natural Language Cortex QUR Ree Heace Links Forward The robot drives straight forward Default speed 95 Backward The robot drives straight backward Default speed 95 Point Turn The robot makes a sharp turn in place Default direction and speed right 95 Swing Turn The robot makes a wide turn activating only one drive motor Default direction and speed right 95 Stop The robot halts both driving motors coming to a stop Line Track for Time The robot tracks a dark line on a light surface for a specified time in seconds Default time threshold sensors 5 0 505 in1 in2 in3 Left Center Line Track for Rotations The robot tracks a dark line on a light surface for a specified distance in rotations Default time threshold sensors 3 0 505 in1 in2 in3 Left Center Move Straight for Time The robot will use encoders to maintain a straight path for a specified time in seconds Default time rightEncoder leftEncoder 5 0 dgtl1 2 dgtl3 4 Move Straight for Rotations The robot will use encoders to maintain a straight path for a specified distance in encoder rotations Default rotations rightEncoder leftEncoder 1 0 dgtl1 2 dgtl3 4 Tank Control The robot is remote controlled with the right motor mapped to the right joystick and the
123. h this option selected ROBOTC will download firmware and programs to your Cortex using only the USB connection In this mode when the Cortex is powered ON it will immediately run your program This option is NOT recommended if you are using the VEXnet Joysticks to download to the Cortex or remotely control it Option 1 Download for Competition VEXnet This option disables the ROBOTC debugger and is not recommended for classroom use Important Note Restarting the Cortex The VEX Cortex Download Method setting is stored in ROBOTC and on the Cortex If you change the setting the Cortex must be power cycled turned fully off and then back on before the change will take effect Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 3 Go to Reference Links ROBOTC Reference PROJECT LEAD THE WAY VEX Cortex Configuration over USB cont 4 Go to Robot gt Download Firmware gt Master CPU Firmware and select Standard File to download the latest Master CPU Firmware to your robot Window Help Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection Debugger Debug Windows Remote Control Troubleshooter Platform Type Motors and Sensors Setup PA FLRC_2p0 Download Progress 4 Download Progress A Download Progress window will appear and begin the download process When the window closes the firmware download is
124. hapter in your infrared light the sensor then picks up the reflected e a S Gries infrared radiation and based on its intensity determines the reflectivity of the surface in question Light colored YOU MUST HAVE A PROGRAMMING KIT surfaces will reflect more light than dark surfaces resulting TO USE THIS SENSOR in their appearing brighter to the sensor This allows the sensor to detect a dark line on a pale surface or a pale line on a dark surface You can use a line follower to help your robot navigate along a marked path or in any other application involving discerning the boundary between two high contrast surfaces A typical application uses three line follower sensors such that the middle sensor is over the line your robot is following line follower x 3 Limited 90 day Warranty This product is warranted by Innovation One against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation One dealers For complete warranty details and exclusions check with your dealer Innovation One Inc screw x 5 8 32 3 8 350 North Henderson Street Fort Worth TX 76102 g 11 04 Printed in China 0405 vex Inventor s Guide insert line follower kit 1 2005 Innovation One All Rights Reserved Vex and Vex Robotics Design System are trademarks of Innovation One Go to Reference Links sensor accessories ine follower Kit
125. hat calls it Here it is acting as an integer value for the wait command Substitution Lie Sela reOm ime ie The arrows in the illustration to the right show the general path of the value as it is returned int sq d goes back into the main function and g Sones ie The parameter 100 is used as t in the return sq function to calculate the value but is not shown in the arrows task main The function will run as if the code read as it does in the bottom box e a a a 1 walt Square or T00 EO E Gie este E E Woa COOCONE Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Functions 3 Go to Reference Links o oe A proseer uean mue way ROBOTC Reference 2 PLTW Switch Case The switch case command is a decision making statement which chooses commands to run from a list of separate cases A single switch value is selected and evaluated and different sets of code are run based on which case the value matches Below is the pseudocode outline of a switch case Statement Sswitch switch value switch value The value which be checked for a match with any cases case matoeh lst commands case value A possible match for the switch value If this value matches the switch value the code immediately following it runs case commands The commands that run if this case successfully matched Case nd value
126. hat refer to different frequency sensitivity settings When used this way the terms dB and dBA are not units dB mode produces readings that are simply based on how much sound is picked up by the Sound Sensor dBA mode also gives readings based on the amount of sound detected but adjusts those readings so that the displayed values more closely match the pattern of human hearing which is less sensitive to very high and very low frequencies Just as a human would perceive these sounds to be quieter dBA mode will give lower readings for those frequencies even if the actual amount of sound is the same Decibel A relative unit of measure commonly used with reference to the amplitude loudness of sound In sound O dB is the quietest sound a person can hear measured in micropascals a very small unit of pressure since sound is based on pressure waves Every 10 dB increase then means that the sound gets ten times louder 10 dB is ten times louder than the quietest sound you can hear 20 dB is ten times louder than that 30 dB is ten times louder than 20 dB and is about the level of noise in a quiet room Note that the Sound Sensor does not measure in decibels even when its mode is set to dB Instead it measures a value of the loudest sound it can detect Demonstration demo An event in which a project prototype demonstrates some or all of its capabilities for an audience which usually includes the project sponsors Dependent Variable
127. he Robot menu to Switches Encoders Ultrasonic di s ration eit Paice Rangefinders must be used in higher Port numbers for them to be configured correctly VEX CPU hardware limits placement of quadrature motor encoders Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Potentiometers 2 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference Potentiometers Sample Code Limiting Arm Movement with the Potentiometer This code allows the rotating arm of a robot to be remote controlled using the Ch5 rear buttons on the Radio Control Transmitter The Potentiometer is used to prevent the motor from spinning once the arm has reached its minimum and maximum points bIfiAutonomousMode false Enable Radio Control mode while true Loop forever if vexRT Ch5 127 VLE rhe roo Chs meibia Wolgm is Pressed s LE Sensor vyalue larm orcentcLomecsrc lt 900 LE cne POCentionaecat Maas nor reached ies mMascimum JOLE 2 Moron loort6 31 tirn che motor on forward else T the Potentiometer has reached rires maximo Pointsi moLorlports 0 turm Ene motor ont LE vee teh Se 7 fn TE ene botton Chs buccon 15 Pressed o Li Sensor values larm orcsnceLometcer gt 550 LE the Potentiometer mhas NOE reached Tes MMMM Porn e mower eoOre 6 le 31 turn the motor on in reverse else
128. i a Control Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 3 Go to Reference Links A proseer eao me wav ROBOTC Reference PLT W The ROBOTC Debugger Timers The Timers debug window provides access to current values of the timers built in to your microcontroller On the VEX Cortex there are 4 user accessible timers T1 T2 T3 and T4 and two system timers nSysTime and nPgrmTime The 4 user accessible timers can be modified in real time using the Timers debug window but the two system timers cannot 728 690 sec nPgm Time 5 000 sec Timer 6 26 811 sec Timer 6 26 811 sec Timers 6 26 811 sec Timer4 6 76 811 sec Global Variables Motors Sensors Index The index of the timer T1 T4 Timer Name of the timer nSysTime is the amount of time the controller has been powered on nPgmTime is the amount of time the current program has run Timer1 through Timer4 can be reset and monitored in your programs Time Displays the elapsed time The Timers window can be opened by going to the Robot menu Debug Windows and selecting Timers gt ROBOTC File Edit View Robot i S i il i Compile and Download Program Function Library Compile Program VEX Cortex Download Method confi g Sensor i E Software Inspection confi g Motor P H Natural Language Debugger confi a Motor F Remote Control Troubleshooter Flatform
129. ice in the two different places that it is used once for each of the motor commands This way both motors are set to the same value but more interestingly you would only need to change one line of code to change both motor powers task main int speed speed 50 One line changed The value assigned to speed is now 50 instead of 75 motor ports Ean i anged without being change motor port2 No change was made to the program here but waitlMsec 2000 because these lines use the value contained in the variable both lines now tell their motors to run at a power level of 50 instead of 75 This example shows just one way in which variables can be used as a convenience for the programmer With a robot however the ability to store sensor values values that are measured by the robot rather than set by the programmer adds invaluable new capabilities It gives the robot the ability to take measurements in one place and deliver them in another or even do its own calculations using stored values The same basic rules are followed but the possibilities go far beyond just what you ve seen so far Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 1 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Variables Declaration Rules In order to declare a variable you must declare its type followed by its n
130. ill act as if its stored value were in its place Here both startMotor commands expect integers for power settings so the int variable speed can stand in The commands set their respective motor powers to the value stored in speed 75 In the example above the variable speed is used to store a number and then retrieve and use that value when it is called for later on Specifically it stores a number given by the programmer and retrieves it twice in the two different places that it is used once for each of the startMotor commands This way both motors are set to the same value but more interestingly you would only need to change one line of code to change both motor powers task main int speed speed 0 One line changed The value assigned to speed is now 50 instead of 75 SiO eliewe Meowmie POE Changed without being changed startMotor port2 speed No change was made to the program here but e O because these lines use the value contained in the variable both lines now tell their motors to run at a power level of 50 instead of 75 This example shows just one way in which variables can be used as a convenience for the programmer With a robot however the ability to store sensor values values that are measured by the robot rather than set by the programmer adds invaluable new capabilities It gives the robot the ability to take measurements in one place and deliver them in another or even do its own
131. imer T1 you would type ClearTimer T1 Then you can retrieve the value of the timer by using time1 T1 time10 T1 or time100 T1 depending on whether you want the output to be in 1 10 or 100 millisecond values In the example above you should see in the condition that we used time1 T1 The robot will track a line until the value of the timer is less than 3 seconds The program ends after 3 seconds Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Timers e 1 Go to Reference Links E oe A proveer ueno me wa ROBOTC Reference 2 PLTW Behaviors A behavior is anything your robot does turning on a single motor is a behavior moving forward is a behavior tracking a line is a behavior navigating a maze is a behavior There are three main types of behaviors that we are concerned with basic behaviors simple behaviors and complex behaviors Basic Behaviors Example Turn on Motor Port 3 at half power At the most basic level everything in a program must be broken down into tiny behaviors that your robot can understand and perform directly In ROBOTC these are behaviors the size of single statements like turning on a single motor or resetting a timer Simple Behaviors Example Move forward for 2 seconds Simple behaviors are small bite size behaviors that allow your robot to perform a simple yet significant task like moving forward for a certain amou
132. ine 17 When pushbutton pressed 18 Blue RobotC reserved words 19 Turn both motors on full power 20 Bright Red syntax i e and operators 21 i e 22 23 S Black Normal Text 24 2 task main Dark Red numbers 26 27 28 untilButtonPress StartButton When button is pressed 29 30 startMotor Motorl1 127 Motors 1 and 10 will start 31 startMotor Motor10 127 32 33 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Using the PLTW Template 2 Go to Reference Links A rosterueno me w ROBOTC Reference 2 PLTW Sample Programs One of the easiest ways to begin programming is to start with existing code try it out and then modify it ROBOTC includes over 70 sample programs to help you get started with learning how to program To open a sample program go to the File menu and select Open Sample Program All of the ROBOTC sample programs have comments that tell how the robot should be configured and To access Sample Programs go File gt Open Sample Programs kemet oo wr pz j Mee P File Edit View Robot Window Help New gt fa Open and Compile Ctri O T opensa bed Save Cerin Save As save ai 4 ee ey amp Robotics Academy ROBOTC forIFl Sample Programs VEX2 gt 4 Print Organize v New folder gt Favorites Name Date modified Typ
133. ing a Wireless Link between the VEXnet Joystick and VEX Cortex Your VEXnet Joystick and VEX Cortex can now communicate over the VEXnet USB Keys Move on to the next section to calibrate the values your VEXnet Joystick sends out Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 7 Go to Reference Links Ch AD passeren ea ROBOTC Reference 5 PLT W VEXnet Joystick Configuration in ROBOTC cont Section 3 Calibrating the VEXnet Joystick Values This section contains the procedure for calibrating the VEXnet Remote Control joysticks Some steps are time sensitive so it s recommended that you read through the instructions once before following along The VEXnet Remote Control includes two joysticks each having an X and Y axis 8 buttons on the front and 4 additional trigger buttons on the top Inside there is also 3 Axis accelerometer capable of providing X Y Z acceleration values Values from the joysticks buttons and accelerometer are sent as a constant stream of information over VEXnet to the robot enabling a user to control the robot in real time To ensure that the VEXnet Joystick sends out accurate joystick values the joysticks must be calibrated before their first use and after any firmware updates are applied You will need e AVEXnet Joystick with batteries e AVEX Cortex with robot battery e Asmall Allen wrench 1 16 or
134. io this whole system of gears behaves as if it were a Single gear pair with a gear ratio that might not otherwise be achievable Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR Compound Gear Ratio Motion Subsystem The overall equivalent gear ratio produced by a group of gears in a compound gear configuration This can often be quite high or quite low due to the multiplicative nature of gear ratios in a compound gear system Configuration Transmitter Control Subsystem One of the 6 different control setups stored on the RF Transmitter Each configuration saves the Transmitter menu settings that were set while using that configuration number Control Subsystem The subsystem responsible for collecting human operator input and communicating it to the Microcontroller Control Channel Control Subsystem One of the 6 pathways for control information traveling from the Controller to the Microcontroller The X axis of the right joystick for instance sends its data over control channel 1 that axis of the Stick itself is sometimes referred to as Channel 1 as a result Note that control channels are not the same as radio channels Counterclockwise A rotational direction that prescribes turning in the opposite direction from the way the hands on a clock normally turn Crystal Radio Frequency Control Subsystem One of the crystals that determine the frequency on which the Transmitter and R
135. ion 3 4 forward J Wait ror l second Set posicion fully forward aigc tor L saccone Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems PROJECT LEAD THE WAY Servo Motors 2 Go to Reference Links motion accessories servomotor kit Servomotor l INSERT THIS PAGE As explained in the Motion Subsystem section of the at the back of the Inventor s Guide servomotors are a type of motor that can Motion Chapter in your be directed to turn to face a specific direction rather than CODER Te just spin forward or backward servomotor x 1 screw 6 32 x 12 x 2 ae ae screw 6 32 x 14 x 2 TE E clutch post x 1 Limited 90 day Warranty v This product is warranted by Innovation One against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation One dealers For complete warranty details and exclusions check with your dealer 350 North Henderson Street wii Wn Innovation One Inc Fort Worth TX 76102 11 04 Ti Printed in China Trea 0105 vex Inventor s Guide insert servomotor kit 1 2005 Innovation One All Rights Reserved Vex and Vex Robotics Design System are trademarks of Innovation One i Go to Reference Links Auxiliary Accessories Flashlight The Flashlight will help your robots see in the dark The included Flashlight will turn nigh
136. ire Right Encoder Top wire Poecococcocoaaqgoecs eoeocaeeanbeeaeasaeasnscse Left Encoder Left Encoder Detects rotation from L ANALOG DIGITAL if 5 Top wire Motor on Motor Port 3 Right Encoder Top wire Bottom wire p Bottom wire hairna debisi ae Two Quadrature Shaft Encoders mounted on Squarebot 2 0 Right Encoder Left Encoder Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Shaft Encoders 2 Go to Reference Links PROJECT LEAD THE WAY ROBOTC Reference Shaft Encoders ROBOTC Setup The Quadrature Shaft Encoder is also fully supported by ROBOTC for IFI v 1 40 and up Use the following instructions and the wiring configuration on the previous page to correctly configure them within ROBOTC ci ROBOTC Quadrature Encoders c File Edit View BeG iiia Window Help Robot gt Motors and Sensors Setup D eH Compleand Dorina Program Open the Motors and Sensors Setup ea aa Compile Program F7 WAGON Fl _C Constructs EEA IFI Competition Debugger IFI Remote Ca l Math Platform Type Miscellaneous Motors and Sensors Setup Motors z l Sensors lt ROBOTC Potentiometer c SEE EN d File Edit View Robot Window Help iH soun bo Te Compile and Download Program F5 Task Contro Compile Program F7 _C Constructs IFI Competitiot
137. is misspelled 2 The correct ROBOTC Platform Type is not selected To correct this error 1 Verify that your spelling and capitalization is correct 2 Verify that you have the appropriate Platform Type selected If you are using Natural Language commands you must have the Natural Language Platform Type selected File Edit View Robot Window Help 48 i Gil Compile and Download Program Compile Program VEX Cortex Download Method T _C Constructs Software Inspection H IF Competition Debugger H IFI Remote Cont H STOPER Debug Windows e Math 4 Motors Remote Control Troubleshooter Sensors Seiad Platform Type H VEX 2 0 Cortex ij Timing Motors and Sensors Setup Natural Language Library VEX Cortex 4 Undefined Entrie User Defined Download Firmware Innovation First IFT Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 4 Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW Error Messages in ROBOTC Code Common Warming Messages Warning messages are used to notify you about possible programming and logic errors in your program With warning messages the compiler is able to fix or ignore the issues so they will not prevent your program from compiling or downloading to your robot A common occurrence of warning messages are empty infinite loops in your code In the example below the a
138. is stored on your Cortex Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 5 Go to Reference Links ch A prosze zas THE ta ROBOTC Reference Se BCTWw VEXnet Joystick Configuration in ROBOTC cont 4 Turn the Cortex OFF 5 Remove the USB A to A cable from the VEXnet Joystick and Cortex 6 Insert VEXnet USB Keys into both the VEXnet Joystick and Cortex 6 VEXnet USB Keys Insert VEXnet USB Keys into the VEXnet Joystick and Cortex Note It does not matter which VEXnet USB Key you insert into the Cortex versus the VEXnet Joystick Pairing the Cortex and VEXnet Joystick establishes the link the VEXnet USB Keys simply act as antennas for the Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 6 Go to Reference Links VEXnet Joystick Configuration in ROBOTC cont 7 Power the Cortex and Joystick ON After roughly 15 seconds the ROBOT and VEXnet LED s will blink green indicating that the VEXnet communication link has been established 7a Turn the Cortex ON 7b Turn the VEXnet Joystick ON 7c Status LEDs After roughly 15 seconds the ROBOT and VEXnet status LEDs will start quickly blinking green With the VEXnet link established you should power OFF your Cortex and VEXnet Joystick to preserve battery End of Section Creat
139. is true the while loop repeats when the condition is false the while loop ends and the robot moves on in the program The condition is checked every time the loop repeats before the commands between the curly braces are run cepeated commands Part 3 The commands to be repeated or looped while condition cepeated commands Repeated commands Commands placed between the curly braces will repeat while the condition is true when the program checks at the beginning of each pass through the loop Below is an example of a program using an infinite While Loop Cac koman The condition is true as long as 1 is equal to 1 which is always Siawellot Gis POrt a 265 Walt 5 0 gt While the condition is true the port2 motor will turn forward S16 lie GMO Ope POr 47 16 a1 warc Ao 0 for 5 seconds then in reverse for 5 seconds Result The port2 motor will turn back and forth forever Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 1 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh ROBOTC Reference a While Loops with Natural Language Below is an example of a program using a counter controlled While Loop eck marn int ere Liane 0 Creates an integer variable named count and gives it an initial value of 0 whilel count lt 4 Checks if count is less than 4 SCAT
140. its value is substituted into the function StarceMouce acmMot ory oo wait time SEOpl loner arumMorenr The function will run as if the code read as it does in the bottom box task main rotateArm 3 25 StareMorvor armMotor 63 ware oro SCOPO On ar OMOTO Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Functions 2 Go to Reference Links Ke A proveer ueno me my ROBOTC Reference 2 PLTW Advanced Functions Return Values Not all functions are declared void Sometimes you may wish to capture a mathematical computation in a function for instance or perform some other task that requires you to get information back out of the function at the end The function will return a value causing it to behave as if the function call itself were a value in the line that called it 1 Declare return type Because the function will give a value back pea eae at the end it must be declared with a type other than void indicating what type of value it will give En woe e Teao 2 Return value The function must return a value In this case it is returning the result of a ca emia computation the square of the parameter Sour Moronr eae htMotom 46 wait squareOf 100 SIE CHOOT Ee reaL sone Merc ee 3 Function call becomes a value The function call itself becomes a value to the part of the program t
141. l that enables you to quickly write and correct code and allows you to interact with all of the inputs sensors timers ect and ouputs motors LED s ect connected to your VEX microcontroller ROBOTC has a debugging capability that enables unparalleled interactive access to the robot as your program is running Using the debugger will significantly reduce the time it takes to write programs and find erros in your code With ROBOTC s real time debugger you can Start and stop your program from the computer Single step through your program running one line of code at a time and examine the results the values of variables sensors ect and the flow of execution Read and write the values of all the variables defined in your program Read the write the values of all the motors and sensors configured on your microcontroller PEEEALTAA AAA AAA ALAA AA AAA AA LAA AA AAA AAA AAA AA AAA 119 2K On FI Debug Status Refresh Rate if Intersectii start suspend Once if Step Into step Ove Step m Pause Refresh The maze follower program traverses a Maze cons f f are right angle turns the maze does not contai Clear All ff f f BR eight element array of line detection sensors if nSaveNumb Lett nSave Numb Right nSaveFiterNone nSaveFitterlenter nNumbCenterHits bMotors Disabled nErorValue nLast Error nTumSpeed nlangetSpeed nT argetClassicalSpeed nMaxAllowedSpeed epErrors Global Variables Timers Motors Sens
142. lan Act SPA Sense Plan Act was an early robot control procedure commonly abbreviated SPA Today we use its fundamental concepts to remind us of the three critical capabilities that every robot must have in order to operate effectively Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U SENSE The robot needs the ability to sense important things about its environment like the presence of obstacles or navigation aids What information does your robot need about its surroundings and how will it gather that information PLAN ACT The robot needs to take the sensed data and figure out how to respond appropriately to it based on a pre existing strategy Do you have a strategy Does your program determine the appropriate response based on that strategy and the sensed data Finally the robot must actually act to carry out the actions that the plan calls for Have you built your robot so that it can do what it needs to physically Does it actually do it when told Where are S P and A in this program task main bMotorReflected port2 1 while true 1f SensorValue bumper 0 INOW ls OO ws dey MOE ie COE i i else MOmen OOmt Eo Merton leonrA O waitlMsec 1500 SENSE The robot uses a Bumper Switch to sense whether it has collided with an object PLAN ACT The overall strategy for this robot is to run forward unless something is in its way which it
143. lectromechanical device that converts electrical energy into kinetic physical energy on demand The motion generated by a motor is almost always rotational in nature and may need to be mechanically redirected before it can be used to produce the desired effect Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR Motor Port Bank Logic Subsystem The port bank on the Microcontroller where the motors or servos are plugged in The motors servos receive both commands and power through these ports Motor Shaft Structure Subsystem Motion Subsystem A carried over term from automotive engineering this usually refers to the axle square bar that is directly driven by the motor Mounting Point Structure Subsystem Any place where a component can be conveniently attached An open spot on the front bumper for instance may serve as a good mounting point for a forward facing sensor N NiCd Nickel Cadmium Power Subsystem The preferred battery chemistry for the VEX Robotics Design System for performance reasons A NiCd pronounced Nai kad battery is an electrochemical cell which uses Nickel metal as its cathode material and Cadmium metal as its anode material Cadmium is highly toxic and should not be disposed of in the trash call 1 800 8 BATTERY Nut Structure Subsystem Nuts are used to allow a screw to function as a fastener when the actual component being fastened does not include its
144. ll never end because the condition to make them end can never be reached Ask yourself Truth value 0 Is O equal to 1 False always Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Boolean Logic 1 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Boolean Logic Comparison Operators Comparisons such as the comparison of the Ultrasonic sensor s value against the number 45 are at the core of the decision making process A well formed comparison typically uses one of a very specific set of operators the comparison operations which generate a true or false result Here are some of the most common ones recognized by ROBOTC is equal to is not equal aqua to lt is less than 50 lt 100 100 lt 50 50 lt 50 lt e a 50 lt 100 or equal to 50 gt 50 gt oe 50 gt 100 than 100 gt 50 50 gt 50 i oe 50 gt 100 or equal to 100 gt 50 Evaluating Values The result of a comparison is either true or false but the robot takes it one step further The program will actually substitute the true or false value in where the comparison used to be Once a comparison is made it not only is true or false it literally becomes true or false in the program if 50 gt 45 if true Project Lead The Way and Carnegie Mellon Robotics Academy For use with VE
145. ller and the text on button will change to Stop Pressing the Stop button will stop the program execution Suspend Pressing the Suspend button will suspend pause the program execution on your robot controller Step Into Pressing the Step Into button will execute the next command in your program Clear All The Clear All button will reset all of the values being displayed by the other debug windows Once Pressing the Once button will update the values in the other debugger windows once Pause Refresh Continuous Pressing the Pause Refresh button will cause the values in the debugger windows to stop updating Pressing it will also cause the text to change to Continuous Pressing the Continuous button will cause the values in the debugger windows to update continuously Pressing it will also cause the text to change to Pause Refresh Note For continuous value updates on the other debug windows make sure the button says Pause Refresh and not Continuous ROBOTC The recommended method of 3 opening the Program Debug window and establishing a connection with the robot is by downloading a program to the robot However the debugger can also be launched by e SPELT A selecting Debugger from the Robot seamed ain Debug Windows File Edit View Robot Window Help Compile and Download Program Function Library Compile Program VEX Cortex Download Method Project Lead The Way and Carnegie Mello
146. lse it is not blue Note that the truth value of a statement is only applicable at the time it is checked The sky could be blue one minute and grey the next But regardless of which it is the statement the sky is blue is either true or false at any specific time The truth value of a statement does not depend on when it is true or false only whether it is true or false right now Conditions ROBOTC control structures that make decisions about which pieces of code to run such as while loops and if else conditional statements always depend on a condition to make their decisions ROBOTC conditions are always Boolean statements They are always either true or false at any given moment Try asking yourself the same question the robot does for example whether the value of the Ultrasonic Sensor is greater than 45 or not Pick any number you want for the Ultrasonic Sensor value The statement the Ultrasonic Sensor s value is greater than 45 will still either be true or be false Ask yourself Truth value True if the current value is more than 45 for example if it is 50 JensortalusisonarSensor amp ae Is the value of the Ultrasonic Sensor greater than 45 False if the current value is not more than 45 for example if it is 40 Some conditions have the additional benefit of ALWAYS being true or ALWAYS being false These are used to implement some special things like infinite loops that wi
147. ltiple subsequent errors and warnings to appear in the Errors display screen Forward j 4 Task main i int speed 63 forward speed wait 2 0 Stop 2 3 4 5 6 7 B Errors f File Forward c compiled on May 23 2 Error Undefined variable Task Error Expected gt Found main Error Executable statements not valid in main declaration block Tnto Undefined procedure main slobal subroutine ass ai Warning Meaningless statement no code generated Error task keyword missing before main S ETror iMissing Bbetare ja j Bo Pi j In situations like these its recommended that you try to correct the first error in your program before moving on The first error message reads Error Undefined variable Task short assumed When the words Undefined variable appear in the Errors display screen it indicates that ROBOTC does not recognize the specified word the fact that Task is colored black instead of blue like other ROBOTC reserved words also indicates that ROBOTC does not recognize it To correct this error you should replace the uppercase T with a lowercase t in task and recompile your code The compiler will reevaluate your code and generate a new set of notifications Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code
148. may wait for a given stimulus like the Touch Sensor being pressed to execute a specific behavior like stopping Stimulus Response Action made in response to a stimulus The stimulus response cycle enables robots to interact effectively with their environment Strategy Strategize A master plan for accomplishing certain goals To strategize means to come up with a plan to meet a goal Support Polygon The imaginary polygon formed by connecting all the points where an object touches the ground This polygon marks the boundaries of where the object s Center of Mass can be while remaining stable If the Center of Mass is not directly over the interior of the Support Polygon the object will fall over Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 9 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued Swing Turn A turn where one wheel rotates and the other stays in place causing the robot s body to swing around the stationary wheel Task A discrete unit of work A task may refer to a human activity like designing a drivetrain or a robotic one like mapping a coal mine Effectively breaking down tasks is a key to success both for a human project and for a robotic program Teamwork The process of working together in team Effective and cooperative teamwork is an essential quality of a successful pr
149. meter or Pot for short describes an electrical device in which the user can adjust the resistance As the resistance of the sensor changes a varying voltage is created and thus the sensor acts as a variable voltage divider This varying analog voltage can be measured by the Vex Controller and is proportional to the position of the shaft connected to the center of the Pot This is how you obtain an analog measurement of an angular position Before you can use the Potentiometer you must reprogram your Vex Controller to read the varying voltage of the sensor on the corresponding port you are planning on connecting to How to write change your code to read the varying voltage is not covered in these instructions We suggest searching our Forum for help at www vexforum com To connect the Potentiometer Sensor to the Vex Controller you plug the Sensor Connector into any port in the Analog Digital Bank on the Vex Controller typically you start with the 1st position Note that the Connector is keyed to fit into the Vex Controller Port in a specific orientation plugging it in backwards could damage your Sensor For More Information and additional Parts amp Pieces refer to www Vex Robotics com M Go to Reference Links sensor accessories line follower kit Line Follower Kit INSERT THESE PAGES A line follower consists of an infrared light sensor and an at the back of the infrared LED It works by illuminating a surface with Sensor C
150. microcontroller the ultrasonic module receives a start signal from the Vex microcontroller on this line The connector labelled OUTPUT is the echo response from the ultrasonic detector this is the line through which the Vex microcontroller receives output from the detector indicating that it has picked up an echo Reprogramming the microcontroller to enable the ultrasonic sensor to generate a ping Start by plugging the INPUT and OUTPUT connectors into any two ports in the Interrupts bank on the Vex Microcontroller m Oo SLAGNYYSALNI 4 3 2 4 In order for your robot to be able to read the sensor you will have to reprogram the microcontroller Sample code to help you get started is available on the VexLABS com website Refer to the Programming chapter in your Vex Inventor s Guide for information on how to add or change code ultrasonic sensor kit 4 Inventor s Guide insert wEx R B TICS DESIGN SYSTEM 276 2178 E 0610 Go to Reference Links Bumper Switch Sensor Bumper Switch Sensor Signal Digital Description The bumper sensor is a physical switch It tells the robot whether the bumper on the front of the sensor is being pushed in or not Technical Info Type SPST switch Single Pole Single Throw configured for Normally Open behavior Signal Behavior When the switch is not being pushed in the sensor maintains a digital HIGH signal on its sensor
151. mments ROBOTC Reference Boolean Logic ROBOTC Reference Variables ROBOTC Reference Reserved Words ROBOTC Reference While Loops ROBOTC Reference If Statements ROBOTC Reference Variables ROBOTC Reference Thresholds ROBOTC Reference Timers ROBOTC Reference Functions ROBOTC Reference Switch Cases ROBOTC Reference Random Numbers ROBOTC Reference Troubleshooting Error Messages in ROBOTC Code ROBOTC Reference Troubleshooting ROBOTC with Cortex ROBOTC Reference Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Go to Reference Links Refe rence Li nks Each Reference below is a link to that file Motor Outputs 2 Wire Motor 269 VEX Inventor s Guide 2 Wire Motor 393 VEX Inventor s Guide Servo Modules ROBOTC Reference Servo Motor VEX Inventor s Guide Flashlight VEX Inventor s Guide Color Camera VEX Inventor s Guide Digital Inputs Outputs Ultrasonic Sensor VEX Inventor s Guide Bumper Switch VEX Inventor s Guide Limit Switch VEX Inventor s Guide Optical Shaft Encoder ROBOTC Reference Optical Shaft Encoder VEX Inventor s Guide Analog Inputs Potentiometers ROBOTC Reference Potentiometers VEX Inventor s Guide Line Following VEX Inventor s Guide Light Sensor VEX Inventor s Guide ROBOTC Reference Glossary VEX Inventors Guide Glossary Project Lead The Way and Carnegie Mellon Robotics Academy For use
152. mum Illumination Illumination Integer Value Q W_ __ gt 255 Analog Value OV 5V We can then set a threshold value in our code to act as a trigger for behaviors From this basic premise we can build more complicated behaviors For example if you have two light sensors on the front of your robot one on the left and one on the right then you can program your robot to follow a bright light by telling it to steer toward bright light in the direction of the sensor that is receiving low values and away from darkness away from the direction of the sensor that is receiving high values light sensor kit 2 Inventor s Guide insert vex ROBOTICS DESIGN SYSTEM Go to Reference Links sensor accessories igh kits Technical overview continued The light sensor has a usable range of O to 6 feet so it can distinguish a light source from ambient light up to six feet away a light source more than 6 feet away will blend into the ambient light and be lost The range is dependent on the intensity of the light source as well as the intensity of the ambient light in the environment The range will be greater for a very bright point source in a very dark room but dramatically reduced for a flashlight outdoors on a sunny day This light sensor is sensitive to visible light only it will not provide useful data for infrared or ultraviolet sources Detecting light level Reprogramming
153. my Platform Type b gt Natural Language Library VEX Cortex VEX 0 5 Microchip Innovation First IFI gt VEX 0 5 Microchip VEX 2 0 Cortex For use with VEX Robotics Systems Main Title 2 Go to Reference Links gt L e g a PROJECT LEAD THE WAY lt Ee3 ROBOTC Reference VEX Cortex Configuration over USB cont 3 The VEX Cortex Download Method controls how ROBOTC downloads firmware and programs to your Cortex as well as what types of connections your Cortex checks for when it is powered on Confirm that your VEX Cortex Download Method is set to Download Using VEXnet or USB or Download Using USB Only Window Help Compile and Download Program Compile Program Download Using VEXnet or USB Download Using USB Only Download for Competition VWEXnet Debugger v Debug Windows Remote Control Troubleshooter Platform Type Motors and Sensors Setup Download Firmware Option 1 Download Using VEXnet or USB With this option selected ROBOTC will download ROBOTC firmware and programs to your Cortex using a VEXnet or USB connection In this mode when the Cortex is powered ON it will look for a VEXnet or USB connection for up to 10 seconds before running your program The Automatic Selection option in the ROBOTC Preferences should be selected if you plan on switching between VEXnet and USB as your download method Option 2 Download Using USB Only Wit
154. n Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 2 Go to Reference Links e UE I J PROJECT LEAD THE WAY 033 ROBOTC Reference EK The ROBOTC Debugger Global Variables The Global Variables window displays the current values of every variable declared in your program Using the ROBOTC debugger not only can you view the variable s names and values you can also change their values in real time To change the value of one of the variables select the Value box of the variable you d like to change type in the new value and press Enter on your keyboard Global Variables time threshold Global Variables Timers Motors Sensors Index The index of the variable in memory Variable The name of the variable defined in the program Value The value of the variable during program execution Values will update automatically if the Program Debug window is set to update continuously The Global Variables window can be opened by going to the Robot menu Debug Windows and selecting Global Variables ROBOTC File Edit View Robot Window Help El ze Gil i Compile and Download Program FS hai p B Function Library Compile Program i VEX Cortex Download Method confi g Sensor i _C Constructs E 1 config Motor E Natural Language Detna conf oe Moto Remote Control Troubleshooter Platform Type Motors and Sensors Setup VEX Remote Soren Download Firmware a
155. n infinite loop is created with no code embedded within the loop to stop it from repeating forever This is considered a warning rather than an error because it is valid code and can be intentionally used by a programmer The warning message will inform you that there was a possible programming error caused by an infinite loop Warning Possible programming error Infinite loop unconditional branch to itself detected task main int speed 67 forward speed while 1 1 H of File Forward c compiled on May 23 2011 14 45 32 T a Warning Possible programming error Infinite loop unconditional branch to itself If creating an infinite loop was your intention you do not need to correct this message If it was not intentional you can 1 Include code within the curly braces of the while loop for it to repeat 2 Change the condition of the while loop so that it does not repeat forever Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Error Messages in ROBOTC Code 5 Go to Reference Links i aw A proseer uean mue way ROBOTC Reference 2 PLTW Error Messages in ROBOTC Code Common Warning Messages In the example below the forward and stop commands are improperly capitalized The ROBOTC compiler is able to substitute in the correct forms of the commands but uses warning messages to notify you of the substitution Note that it do
156. n your robot needs to steer back to the right Line followers top down view Course correction 0 255 255 255 0 255 255 255 7 based on sensor reading line on left line in middle line on right steer left steer straight steer right line follower kit 2 Inventor s Guide insert vex ROBOTICS DESIGN SYSTEM Go to Reference Links sensor accessories Technical overview continued The optimal range for the line follower is approximately 0 02 to 0 25 inch The minimum line width it can detect is 0 25 Minimum 1 4 Pa the detector in other words when the surface is pale or highly reflective and high 5V when the light is absorbed and does not bounce back HELPFUL HINT Because the line follower uses an infrared LED to illuminate its target and an infrared sensor to detect the reflected light it will actually work in low light conditions or even in the dark However this also means that it can easily become saturated in other words everything will look white to it like an over exposed photograph in environments where there is a lot of infrared radiation You ll find environments like this in competition settings where tungsten lights are used for illumination To avoid saturating the infrared sensor consider mounting it underneath the robot or adding a cardboard shield to block ambient radiation wEx Inventor s Guide insert line follower kit 3 ROBOTICS DESIGN SYSTE
157. nal Statement programming A programming block that chooses to run different pieces of code depending on some user defined factor for example it may choose to run straight ahead if the robot does not detect an obstacle but turn to the left if there is a nearby object Cross Multiplication A mathematical procedure used to solve an equation Cross Multiplication of the form X A Y B one fraction equals another fraction with no other terms outside the fractions The result of cross multiplication in the example to the right is BX AY Crystal Crystals are the channels used to send signals from the transmitter to the reciever The transmitter s frequency module and the matching receiver crystal determine the control frequency for a robot Each robot operating at the same time should be on a different control frequency Data Factual information like the weight of a robot or the value of a sensor Note that the word data is plural A single piece of factual information is a datum Data Analysis The process of manipulating data to increase understanding of a certain topic or issue Data Flow The process of moving data around inside of a program Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 2 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued dB and dBA dB and dBA are modes of the Sound Sensor t
158. ncation Two way e U I J PROJECT LEAD THE WAY Sh gt lt es Ultrasonic Sensor A sensor that measures distance by emitting ultrasonic sound waves then measuring how long it takes them to echo back off of objects or surfaces in the environment The Ultrasonic Sensor then reports the calculated distance back to the controller Uploading Transferring data usually gathered data from the robot controller to the computer See also Downloading Variable mathematics A stand in for a not yet known value in a mathematical equation Once a variable s value has been found the value can be substituted anywhere in place of the variable Variable experimental A factor that is either manipulated or measured during the course of an experiment See also Independent Variable Dependent Variable Variable programming A container for a value The programmer may choose to store a value perhaps a sensor reading in the variable and use it in a later operation display it to the screen at the end of the program for instance The programmer may also choose to perform mathematical operations on the stored value such as adding 1 to it Wavelength The distance between successive equivalent points Wavelength on a wave For example the distance between two neighboring peaks on the wave While Loop is a control flow statement that allows code to be executed repeatedly based on a given boolean condition cD gt N N
159. ncluded in an FM transmission Skid Motion Subsystem A non wheel piece which rests on the ground and provides support for the robot but is intended to slide when the robot moves Skids provide support and stability without fundamentally altering the way the robot maneuvers but they can cause significant friction and often wear out quickly Caster wheels are the preferred alternative in most cases Slave Channel Control Subsystem In a Programmable Mix the Slave Channel is the control channel that is partly or completely controlled by the Master Channel Software 12 Mix Control Subsystem Logic Subsystem A version of the 12 mix arcade style controls where the control mixing takes place in software on the Microcontroller rather than in hardware on the Transmitter The software implementation of the controls also performs a few of the calculation differently resulting in a somewhat different feel for the driver This mode is activated by placing a jumper clip on top of Analog Digital Port 14 on the Microcontroller Spacer Structure Subsystem Motion Subsystem There are several plastic spacers which are designed to slide onto square bar axles between other parts or between parts and rails to keep them from moving too close together They can also be used like collars if enough spacers are added to keep the other parts from moving at all Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR
160. nd one Slave channel to be used in a configurable control mix R Radio Channel Control Subsystem A shortened name for a radio frequency Radio frequencies often have long names so they are given channel designations to be used as shorthand 75 410MHz for instance is referred to as Channel 6l Radio Frequency Control Subsystem A designated carrier frequency for radio transmission Each transmitter receiver pair should operate on its own radio frequency and hence transmit data that will not interfere with other signals in the air The radio frequency for a transmitter receiver pair is determined by the frequency crystals installed in both devices Glossary 128 Inventor s Guide Go to Reference Links APPENDIX B GLOSSARY Radius The distance from the center of a circle to the edge This quantity is equal to half the diameter or it can be multiplied by two times pi to find the circumference of the circle RBRC Power Subsystem Rechargeable Battery Recycling Corporation A non profit organization that facilitates the collection of rechargeable batteries for recycling because rechargeable battery chemicals such as the cadmium in NiCd batteries tend to be very harmful to the environment when thrown in the trash http www rbrc or RF Receiver Module Control Subsystem The Control Subsystem component that receives and decodes FM radio signals that are sent by the Transmitter After decoding
161. ndition is false those same commands are Pseudocode of an if Statment lee true or false txrue commands true commands Commands placed here will run if the condition is true Example program containing two if Statements task main ia oeneomy alle DUm pEr condition true if the sensor is unpressed false otherwise Starti Met Pei oy true commands Commands here run if the condition is true oe ee condition true if the sensor is pressed false otherwise o POr true commands Commands here run if the condition is true This program uses a Bumper Switch and two if Statements to control when the port3 motor moves The first if Statement sets the motor to half power forward if the Bumper Switch has not been pressed while the second turns the motor off if it has been pressed Continually repeating these two behaviors within the while loop causes the motor to spin forward while the Bumper Switch is released and to remain stopped for as long as it is pressed Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems If Statements Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW if else Statements with Natural Language The if else Statement is an expansion of the basic if Statement The if section still checks the condition and runs the appropriate commands when it evaluates to true but using the
162. nds with a product which is mass produced and sold on the commercial market Communication The process of sending and or receiving information by two or more parties Communication One way One way communication occurs when one of the two or more communicating parties functions only as the sender of information and the other s only as the receiver s of information Communication Remote Remote communication is communication occurring over some distance and typically by a specialized technology like Bluetooth Communication Two way Two way communication occurs when all of the communicating parties function as both sender s and receiver s of information Compiler The compiler is a part of the VEX Programming Software that takes the code in a program and converts them into machine language that the VEX brick can understand and run The compiled code is not exactly the same as the code written on your computer this is why you cannot load the program back onto the computer once it is compiled and downloaded to the VEX Condition experimental A portion of an experiment corresponding to one specific setting of the independent variable If your experiment involves large wheels and small wheels for instance the part of the experiment where you use the large wheels is the large wheel condition Condition can also refer to the setting of the variable itself large wheels See also Conditional Statement programming Conditio
163. ne in the order that each should happen Try to describe actions and what prompts each action to continue start stop etc Example A warning light comes on before the fan starts for three seconds The fan turns on and runs until a button is pressed A different light turns for three seconds before the program stops 3 For each simple behavior break it down further to Basic Behaviors Try to think in terms of what each input and output component will be on your device Example Program begins Light 1 LED 1 turns on for three seconds Fan Motor 1 turns on Until a button bumper switch is pressed Light 2 LED 2 turns on for 3 seconds Program ends Note This text will be used for the Pseudocode in the PLTW ROBOTC program template Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 1 Go to Reference Links A srozereo me way ROBOTC Reference 2 PLTW Program Design identify Inputs and Outputs 4 Now that you know what inputs and ouputs you will need identify which ports each will be plugged into on the Cortex Pay attention which sensors are analog and which are digital Below is a sketch of a possible configuration for the example on the previous page Example ANALOG INPUTS 1 2 YY 3 5 Y i 6 T i 7 T bs 4 MOTOR OUTPUTS DIGITAL INPUTS OUTPUTS L p Motor fan Sh D a e i LED 2 as rE e 3 3
164. ns on Until Bumper is pressed FanMotor turns off Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 5 Go to Reference Links A erosten ueno me wa ROBOTC Reference 2 PLTW ANALOG INPUTS 2 Pe oe oe oP oe DIGITAL INPUTS OUTPUTS p MOTOR OUTPUTS Fo f f i eo 7 o n b wp 7 a M Su oo mL om io M ir i iF J if IO DRROBGRBDHBRBaBTWeB eae aaeaaca O BBORBBRBEAaBRBERBRBEBABRTBARBEBHEA ZH A i ROBOT VEXnet GAME aan S J Do p x em kb Ww NM gt os D Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Program Design 6 ROBOTC Natural Language Cortex QUR ReReHeace Links Set Servo Set a servo to a desired position Default servo and position port6 0 Start Motor Set a specific motor to a speed Default motor and speed port6 95 Stop Motor Stop a specific motor Default motor port6 Wait Wait an amount of time measured in seconds Default time 1 0 Wait in Milliseconds Wait an amount of time measured in milliseconds Default time 1000 Until Touch The robot waits for the Touch Sensor to be pressed Default sensor port dgtl6 Until Release The robot waits for the Touch Sensor to be released Default sensor port dgtl6 Until Bump The robot waits for the Touch Sensor to be pressed in and then released out Default se
165. ns to the program can be done as efficiently and accurately as possible Downloading Transferring data usually a compiled program from the computer to the VEX See also Uploading Driven Axle When considering a pair of axles connected by gears pulleys or other means the driven axle is the one whose movement is an effect of the other s rather than the cause See also Driven Gear Driving Axle Driven Gear When considering a pair of connected gears the driven gear is the one whose movement is an effect of the other s If axles are being considered the driven gear is the gear on the driven axle See also Driven Axle Driving Gear Driving Axle When considering a pair of axles connected by gears pulleys or other means the driving axle is the one whose movement is the cause of the other s See also Driving Gear Driven Axle Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 3 Go to Reference Links e U I J PROJECT LEAD THE WAY Sh gt lt ROBOTC Reference Glossary continued Driving Gear When considering a pair of connected gears the driving gear is the one whose movement is the cause of the other s If axles are being considered the driving gear is the gear on the driving axle See also Driving Axle Driven Gear Engineering The study and application of science mathematics and technology to find solutions to real world problems Engin
166. nsor debug window Motors and Sensors Setup X Motors VEX 2 0 Analog Sensors 1 8 VEX 2 0 Digital Sensors 1 12 Port Name Type dati cata fouroes Frou dgil3 No Sensor hd doz SO i no Sensor ati i id agis P ifios o Yd dgtl amp No Sensor im aiz ff S no Sensor i ati i s C Yd dgila no Sensor bi do fs no Sensor o a cm 2 mm Ines Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 7 ROBOTC Reference Go to Reference Links The ROBOTC Debugger miscellaneous There are several additional debug windows available in the Expert and Super User modes of ROBOTC To unlock these windows change your Menu Level by going to Window gt Menu Level and selecting one of the other modes The additional debug windows are very powerful and can be very helpful in advanced applications gt ROBOTC File Edit View eahigl Function Library E _C Constructs H Natural Language Compile and Download Program Compile Program VEX Cortex Download Method Software Inspection Debugger Debug Windows d Hexadecimal File Management Remote Control Troubleshooter Platform Type Motors and Sensors Setup Download Firmware Test Message Link VEX Cortex USB Cable Text Global Variables Timers Motors Sensors VEX Remote Screen Competition Control Task Status
167. nsor port dgtl6 Until Button Press The robot waits for a button on the VEX LCD to be pressed Until Sonar Less Than The robot waits for the Sonar Sensor to read a value in cm less than the threshold setServo startMotor wait SCOPMOCOr J SstartMotor wait sto opMotor startMotor wait stop StartMotor waitInMilliseconds Scop SstartMotor UNtCLLTcuch gt stop StartMotor untilRelease stop StartMotor Unita Bump Stop StartMotor untilButtonPress Stop 3 startMotor untilSonarLessThan SLOp Ssectservo port 7 95 startMotor porto 34 wait U 5 4 stopMotor porte startMotor porto 32 7 wait 0 5 sCopMotor ports startMotor porto 63 wait 2 7 SCOP startMotor porto 63 waitInMilliseconds 2700 Stop j startMotor Porto 63 7 un ilIrouch adgtliUji stop startMotor porto 63 untilRelease dgt110 Stop startMotor porto 63 7 untbialBbump agt lio StOD startMotor porto 63 untilButtonPress rigqghtBtnVEX Stop StartMotor ports 63 untilSonarLessThan 45 dgt1l2 SCOP Default threshold and sensor port 30 dgtl8 9 Until Sonar Greater Than StaLrcMovor SstartEMotor porte 63 The robot waits for the Sonar Sensor to read a untilSonarGreaterThan untilSonarGreaterThan 45 dgt1l2 value in cm g
168. nt of time These are perhaps the most useful behaviors to think about because they are big enough that you can describe useful actions with them but small enough that you can program them easily from basic ROBOTC commands Complex Behaviors Example Follow a defined path through an entire maze These are behaviors at the highest levels such as navigating an entire maze Though they may seem complicated one nice property of complex behaviors is that they are always composed of smaller behaviors If you observe a complex behavior you can always break it down into smaller and smaller behaviors until you eventually reach something you recognize task main 1 MOtCorIport sI n Poo Basic Simple Complex 7 behavior behavior behavior ooo port2 63 This code This code This code 1 wal tlMsec 2000 turns the left makes the makes the robot arise e speek ere Atle ers yagi Se arte Sees ca egy N motor on at robot go move around a half power forward for MOCO Pods oe O57 N 1 2 seconds at Motor Iporre Fo half power waitlMsec 400 Mowers oleic 3 63 moco cone G 6 6 waitlMsec 2000 Se Qe e e e e e e e e e e e SS SS lc CU Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Behaviors 1 Go to Reference Links e LP I J PROJECT LEAD THE WAY Sh ROBOTC Reference RE Behaviors Composition and
169. o save your program If so save gi i E EE EE T in the same directory EE as your other programs 5 If there are errors in your code the compiler will identify them for you and you will need to correct them before a successful download can be completed Downloading places your program on the robot to be run on command You can run the program in two different ways Program Debug x e Run attached jE E 115 2 On If your robot is still connected to your computer you mme Em nenna can run the program which was just downloaded by i ati clicking Start in the Program Debug window which automatically appears upon download This will run your program and because the robot is still connected to the computer via its cable you can obtain live variable and sensor feedback by using such debug windows as Global Variables and Devices e Run Independently If you want to run the program while the robot is not connected just remove the cable once the program has been downloaded On the back of the VEX toggle the power switch in the Off position and then back to On The program will run immediately Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Running a Program 1 Go to Reference Links m CBO tresena me am ROBOTC Reference 5 PLT W VEXnet Joystick Configuration in ROBOTC The VEXnet Joystick enables more than just the remote control of
170. oject Test Revise Repeat See Iterative Development Revision Test revise repeat is the typical project pattern Testing reveals both what works and what doesn t Revision maintains what works while trying to fix what doesn t Repeat means that testing and revision are done continuously Text Text includes words letters numbers punctuation spaces or a combination of all This data type is often also called a string Theoretical Measurement A predicted value for a measurement Usually these predictions are made by taking a real measurement then using a hypothesis or theory hence the name theoretical to predict what the value should be under slightly different conditions After this prediction is made the real measurement is usually taken and compared against the theoretical one to see how well the prediction matched the real outcome Threshold A cutoff or dividing line between two regions One common use for thresholds is to divide the hundreds of possible sensor readings from a sensor a Light Sensor can give a value anywhere from 0 100 for example into two manageable Uric i categories For the Light Sensor this would mean setting a threshold value somewhere between 0 and 100 then declaring that all values above the threshold are now light while all values below Read as Dark Read as Light the threshold are now dark A light sensor reading can then be easily categorized and handled appr
171. ollowing the case line will run Swie cl ee isin aa MOEOr Peres 127 Mow ot POE 127 turnVar 0 Commands These commands belong to the case 1 and will run if the value of the switch variable turnVar is equal to 1 case 2 moto ports l 1127 Break statement _ Each case ends with the command break MmOkeonr Pome L7 turnVar 0 break default Default case statement Mo Cor lport o If the switch value above did not match any of the cases presented by the time it reaches this point Mencia jeronee SE the default case will run Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Switch Case 2 Go to Reference Links _ oe CBS prosten cso war ROBOTC Reference 2 PLTW Random Numbers Sometimes a behavior will call for a robot to use a random number in one of its measurements This may seem strange but randomness can actually be helpful to a robot in avoiding patterns of movement that would otherwise get it stuck Using Random Numbers Random numbers is pretty straightforward Wherever you want the random number to appear simply add the code random maxNumber Each time the line is run a random whole number between 0 and the number you entered will fill in the spot where the random command is Gasket nn bMotorReflected port2 Mmowow Loriol Fl motori port l
172. ommands in this section of the code but the pseudocode suggests where the commands belong and what they need to accomplish This pseudocode example includes elements of both programming language and the English language Curly braces are used as a visual aid for where portions of code need to be placed when they are finally written out in full and proper syntax Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Pseudo Code amp Flow Charts 1 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Pseudocode amp Flow Charts Flow Charts are a visual representation of program flow A flow chart normally uses a combination of blocks and arrows to represent actions and sequence Blocks typically represent actions The order in which actions occur is shown using arrows that point from statement to statement Sometimes a block will have multiple arrows coming out of it representing a step where a decision must be made about which path to follow Start and End symbols are represented as rounded rectangles Start Sto usually containing the word Start or End but can be more specific such as Power Robot Off or Stop All Motors Actions are represented as rectangles and act as basic Action commands Examples wait 1 second increment LineCount by 1 or motors full ahead Decision blocks are repre
173. opriately The threshold value can be chosen in any way desired but it is conventional to choose a value exactly halfway between two known extremes e g halfway between a very dark surface and a very light one Time Management The process of managing time a limited resource in any project Project time management tools are schedules timelines Gantt Charts and PERT Charts Timeline A visual representation of a process or series of events It helps chart the progress of the project Torque Roughly speaking torque is the rotational equivalent of force Whereas force causes an object to speed up or slow down its linear motion torque causes an object to speed up or slow down its rotation A motor that generates more torque will let the robot speed up or slow down more rapidly as well as handle larger tires heavier loads and steeper inclines Touch Sensor A sensor that detects physical contact touch and reports back to the controller whether its contact area is being pushed in or not Trendline See Best fit Line Trough The bottom of a wave on a graph The point of greatest disturbance from the rest state in one direction the one that corresponds to downward on the graph See also peak Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 10 Go to Reference Links ROBOTC Reference Glossary continued Two way Communcation See Commu
174. order to keep them full A trickle charge counteracts a battery s natural loss of charge over time so that the battery can be left on the charger and still always maintain a full charge Trim Control Subsystem The calibration setting for the joysticks on the Transmitter Also the name of the menu on the Transmitter that allows for fine tuning of these settings V Voltage Battery Power Subsystem The electrical voltage difference between the and terminals on a battery Different batteries and battery packs have different starting voltages Voltage falls though not all the way to 0 as the battery s power is used up and can be used as a rough indicator of the amount of capacity remaining on a battery Inventor s Guide Go to Reference Links APPENDIX B GLOSSAR Voltage Electrical Power Subsystem The difference in electrical potential between two points in a circuit or electrical field An electron or other charged particle has more energy at one of the two points and will tend to move toward the other point Voltage Drop Power Subsystem A phenomenon exhibited by rechargeable batteries where a battery that is frequently shallow discharged discharged only a little between recharges will begin to experience reduced performance This can be reversed by discharging the batteries to a nearly empty safe level when the robot automatically turns off for example NOT by shorting them or
175. ors Note Traditional Debugging Techniques Debugging a program finding the errors and correcting them can be a slow process without a real time debugger Without a debugger you may have to resort to other techniques Adding code to turn on different LED s as the microcontroller executes different sections of code You then try to determine from the LED s what is being executed within your program Adding print statements to your code at various points in the program if your microcontroller has a display device By examining the display you can hopefully determine what is happening in your program Both of the above techniques are available in ROBOTC but a real time debugger eliminates the need to resort to them There s no need to add code to debug your program Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Debugger 1 Go to Reference Links A proseer teap mue wav ROBOTC Reference PLT W ROBOTC Debugger Debug Window The Program Debug window appears every time you download a program to your VEX microcontroller and is in control of the connection between your computer and robot controller Closing it will terminate the connection between your computer and the robot controller along with any other open debug windows Debug Status J Suspend Step Into Start Stop Pressing the Start button will start the program execution on your robot contro
176. otorA Full speed forward Timing The VEX allows you to use Wait commands to insert delays into your program It also supports Timers which work like stopwatches they count time and can be reset when you want to start or restart tracking time elapsed waitlMsec wait_time This code will cause the robot to wait a specified number of milliseconds before executing the next instruction in a program wait_time is an integer value where 1 1 1000th of a second Maximum wait_time is 32768 or 32 768 seconds mocar por 6 jell 2 75 ge Seneies 228 1c LS a waltilMsec 2000 Walt 2 seconds moLlor pores 0 Gone G54 ao OLE Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Reserved Words 1 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Reserved Words waitlOMsec wait_time This code will cause the robot to wait a specified number of hundredths of seconds before executing the next instruction in a program wait_time is an integer value where 1 1 100th of a second Maximum wait_time is 32768 or 327 68 seconds qvonsoue po Sle We A Soscie 6 pan Mle pee aicle cena chal waitl0OMsec 200 Wait 2 seconds MOuGr pore o 0 A a nen ts timel timer This code returns the current value of the referenced timer as an integer The resolution for time1 is in milliseconds 1 1 1000th of a se
177. ources adequately is essential to the successful completion of a project Bumper Sensor A Touch Sensor used as a bumper activated when a robot bumps into another object A bumper sensor can be used for obstacle detection Calibrate To set the correct position value or capacity of something Calibrating the Sound or Light Sensor will set minimum and maximum values for it Caliper An instrument using converging or diverging arms to determine the external or internal width of an object Center of Mass The average location of all the mass in an object In many cases you can make predictions about the entire objects behavior based on the location of its center of mass alone Circumference The distance around the edge of a circle Equal to diameter times T Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Glossary 1 Go to Reference Links A proveer ueno me wa ROBOTC Reference PLTW Glossary continued Code General term for any command or group of commands in a program Comment A written note in the program that explains something about that portion of the program Comments do not actually change the way the robot behaves but are very important to the programmer s ability to remember what the code does Commercialize To bring into the commercial market In a robotics project commercialization if it occurs begins with the completed robotic prototype and e
178. own threading A screw anda nut sandwich the parts that are being fastened and hold them together The nut provides threading for the screw to lock into when none is present otherwise 0 Overcharging Power Subsystem Continuing to apply a charging voltage to the battery after it has reached full capacity This is very likely to damage your battery and can be dangerous as the battery will heat up rapidly while being overcharged and may even explode if it gets too hot Be sure your charger has the appropriate safeguards so that it will not attempt to overcharge your batteries Glossary 127 Glossary P Parallel Batteries Power Subsystem A battery arrangement where multiple battery cells are hooked up so that they provide the same voltage as a single cell but drain power evenly across all the cells thus behaving similarly to a single cell with a very large capacity Pivot Structure Subsystem A structural component that provides a mounting point for another component but rather than locking it in place the pivot allows the attached component to swivel or turn along a specific arc Potentiometer Sensor Subsystem An analog sensor which measures angular position Power Subsystem The subsystem responsible for storing and delivering electrical energy to the robot systems Programmable Mix Control Subsystem A feature of the Transmitter that allows the operator to designate one master channel a
179. ple Program Problem Program compiles but does not behave as desired 1 Compare your code to programs you know work and compile e Compare your code t similar ROBOTC Sample Programs File gt Open Sample Program 2 Think like the robot The robot does exactly what you tell it to do Nothing more and nothing less e Is there an important step you re forgetting to tell the robot e Go back to your pseudocode plan Does the sequence of steps make sense for the robot 3 Use the ROBOTC Program Debug window to Step through your code line by line e Download the program to the robot e When the Program Debug window appears repeatedly press the Step button to run the program line by line e Observe the robot s behavior How does it compare to the desired behavior e Try to identify where the robot s behavior differs from the desired behavior 4 Insert visual flags in your program e Insert optional wait statements or turn on different LED s at different parts of the program e When the robot reaches one of the wait statements or LED s and behaved correctly you know that the program was correct up until that point e Continue to insert and observe these optional flags until you identify the problem Problem Not able to open the ROBOTC Debugger 1 Was the correct startup sequence followed when connecting the Cortex to the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer ove
180. port This High signal is coming from the Microcontroller When an external force like a collision or being pressed up against a wall pushes the switch in it changes its signal to a Electrical Ground digital LOW until the switch is 0V LOW oo _ S released An unpressed switch IG Terminal is indistinguishable from an Signal pin on wire open port Note You can connect multiple switches to the Signal pin is HIGH when switch is open same port using a y cable Pushing switch brings the signal pin voltage to LOW PIC Microcontroller Default Code Behavior Info Usable Ports Analog Digital 1 8 Limit Switch Behavior 9 10 Tag Behavior 11 12 Autonomous Behavior f ANALOG DIGITAL For more info see Programmed Behaviors later in this section sed Me E gt ED ee LD EE E ch Co Oy OF em amp te By RA ele El Ep ER Ely ORA RAFE DJ E Et et ile EE A EL E CEP ER CE vey CES thE th Coe Gl CE fh CS ti ea vex Inventor s Guide 5 e 63 Go to Reference Links Limit Switch Sensor Limit Switch Sensor Signal Digital Description The limit switch sensor is a physical switch It can tell the robot whether the sensor s metal arm is being pushed down or not Technical Info Type SPDT microswitch configured for SPST Normally Open behavior Behavior When the limit switch is not being pushed in the sensor maintains a digital HIGH signal on its sensor port This High signal is
181. r Do not disturb the of the front of the motor case gears inside F 3 Lift off the output bushing and place 4 Remove the middle gear and the output to the side This will be used later shaft gear 7 Install the output bushing removed in step 3 8 Replace the cover and four screws Make sure the bushing orientation is as shown removed in steps 1 and 2 2 Wire Motor 393 2 Inventor s Guide insert ROBOTICS DESIGN SYSTEM Go to Reference Links m A prostor veno mae wav ROBOTC Reference 2 PLTW Servo Motors Overview A Servo Module or Servo Motor rotates its shaft to a set angular position between 0 and 120 degrees Once its position has been set ina ROBOTC program the Servo Module will continually draw power to maintain that position until another is specified Servo Modules can be plugged into any of the MOTORS ports in ROBOTC The only differences in appearance between the VEX Servo and Motor Modules are their labels on the back but the two should not be confused When a Motor Module is set equal to a value it uses that value as a power setting and starts spinning its shaft in continuous rotations When a Servo Module is set equal to a _ value however it uses that value to rotate its shaft to a position and hold it there Servo Modules are typically and appropriately found in robotic grippers and arms because of their small range of motion ability to be set to a specific position
182. r USB e Turn the Cortex On e Retry downloading the program to open the debugger 2 Has the program been downloaded to the Cortex e Download the program to open the debugger 3 Have the Master CPU and ROBOTC Firmware been downloaded successfully to the Cortex e Do they need to be re downloaded e Download the Master CPU Firmware e Download the ROBOTC Firmware e Power Cycle the Cortex e Retry downloading the program to open the debugger Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 7 Go to Reference Links Ke A proveer ueno me my ROBOTC Reference 2 PLTW Troubleshooting ROBOTC with Cortex 4 Check the VEX Cortex Download Method e Verify that the Robot gt VEX Cortex Download Method is set to Download using VEXnet or USB or Download using USB Only If it was set for Competition Download the program Turn Cortex OFF Disconnect the Cortex from the computer Reconnect the Cortex to the computer over USB Turn the Cortex On Retry downloading the program to open the debugger O O 0 Problem Motors and or Sensors Debug windows not functioning correctly 1 Is the Cortex turned on and connected to a charged battery e Swap in a fully charged battery e Turn the Cortex on e Observe the debug window data 2 Has a program that correctly configures the sensors been downloaded to the robot e Download
183. re complex tasks your robot will have to make multiple consecutive decisions before performing a behavior This can be accomplished by embedding or placing if Statments within other if Statements Pseudocode of an embedded if Statment condition Either true or false true commands true commands Commands placed here will run if the condition is true else false commands false commands Commands placed here will run if the condition is false Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems If Statements Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW Variables with Natural Language Variables are places to store values such as sensor readings for later use or for use in calculations There are three main steps involved in using a variable 1 Introduce create or declare the variable 2 Give assign the variable a value 3 Use the variable to access the stored value task main Declaration The variable is created by announcing its type followed by its name Here it is a variable named speed that will store an integer speed 75 Assignment The variable is assigned a value The variable speed now contains the integer value 75 SEAaLLMOLOr PpOres 7 Use startMotor port2 speed The variable can now stand in for any value of the appropriate warte EO type and w
184. re contained in a plastic housing that can be placed and removed by hand to complete make an electrical connection These are most often used to set options on the Microcontroller by placing them in ports in the Analog Digital Port Bank Placing a jumper in one of these ports closes a circuit setting the voltage for that port s input value just like closing a limit switch sensor would K Keps Nut Structure Subsystem A variant of the standard nut that includes a toothed crown designed to bite into a mounting surface and prevent the nut from slipping Nuts are used to allow a screw to function as a fastener when the actual component being fastened does not include its own threading Keying connectors Logic Subsystem An intentionally asymmetrical construction of a connector to prevent backwards insertion The power port on the VEX Microcontroller is keyed the two plastic shapes in the middle are not the same for instance so that the power plug cannot be inserted upside down Keyed connectors are sometimes called polarized connectors L Lever Structure Subsystem One of the six simple machines that provides a mechanical advantage There are three main classes of levers with subtle differences but in general long pieces that rotate around any point on their length will function as levers and can provide mechanical advantage Glossary 126 Inventor s Guide Go to Reference Links APP
185. reater than the threshold stop Stop Default threshold and sensor port 30 dgtl8 9 2010 Carnegie Mellon Robotics Academy For use with VEX Robotics Systems ROBOTC Natural Language Cortex Quick Guide 1 ROBOTC Natural Language Cortex QUR Ree Heace Links Until Potentiometer Greater Than The robot waits for the Potentiometer Sensor to read a value greater than a set position Default threshold and sensor port 2048 in6 Until Potentiometer Less Than The robot waits for the Potentiometer Sensor to read a value less than a set position Default threshold and sensor port 2048 in6 Until Dark The robot waits for the Light Sensor to read a value less than the threshold Default threshold and sensor port 505 in2 Until Light The robot waits for the Light Sensor to read a value greater than the threshold Default threshold and sensor port 505 in2 Until Rotations The robot waits for an encoder to reach a specified number of rotations Default rotations encoder 1 0 dgtl1 2 Until Encoder Counts The robot waits for an encoder to reach a specified number of encoder counts Default counts encoder 360 dgtl1 2 LED ON Turn an LED in a specified digital port ON Default sensor port dgtl2 LED OFF Turn an LED in a specified digital port OFF Default sensor port dgtl2 Flashlight ON Turn a VEX Flashlight in a specified motor port ON at a specified brightness Default motor port and bri
186. remely locked down computers may prohibit new hardware such as the VEX Cortex from being connected e Contact your Tech Support for additional priviledges 7 Some SmartBoard software causes a conflict with the Cortex The SMART Virtual TabletPC device can be disabled to resolve the conflict File Action View Help esm OH mle a churd HP h ur Acronis Devices p pe Batteries b gt D Bluetooth Radios PND JE Computer b ga Disk drives p My Display adapters gt if DVD CD ROM drives Ja Human Interface Devices es Bluetooth Remote Control fe te HID compliant consumer control device fe ts HID compliant consumer control device Re HID compliant device es HID compliant device AS HID compliant device leg HID compliant device ee HID compliant device es HID compliant device is is HID compliant device es Microsoft Hardware USB Mouse ee Microsoft Input Configuration Device Q5 SMART HID Device Og SMART Vint abi ee USB Input Update Driver Software gt ag IDEATAYATAR Disa ed Imaninn device Disables the selected devi Uninstall Scan for hardware changes ace Information and Properties Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 2 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Troubleshootin
187. rence Links a Or I J PROJECT LEAD THE WAY ALED 4 as 2 ROBOTC Reference ef PLTW Program Design Planning your program may occur after you have sketched or built your physical device It may also occur before or at the same time depending on the your challenge Regardless it is good practice to do some planning for your program before writing code This document outlines a strategy for a simple example to show the process Please review the reference Behaviors to familiarize yourself with basic simple and complex behaviors The steps below should be documented in your engineering notebook Some of the information will then be transferred to the PLTW ROBOTC program template 1 Describe the task or overall goal that your program will accomplish This may be described as one or more complex behaviors Example A fan will run until someone needs it to stop There will be a warning light as a safety device before the fan turns on and another light to indicate that the fan has stopped Note This text will be used for the Task Description in the PLTW ROBOTC program template Creating Pseudocode As you begin to break down your behaviors into individual actions do not worry about syntax or which commands will be used with ROBOTC Simply describe them in short phrases such turn a motor on for three seconds or follow a line until running into a wall 2 For each complex behavior break it down into Simple Behaviors line by li
188. rred to as batteries in common usage Battery Holder Power Subsystem The Battery Holder creates a 7 2V battery out of 6 1 2V AA cells by connecting them in series or 9 6V out of 8 1 2V AA cells The Battery Holder also holds the AA cells in place on board the robot Bearing Structure Subsystem A piece that is used to hold a moving piece such as an axle in place relative to the rest of the system Bearing Flat Motion Subsystem A commonly used type of bearing in the VEX system This bearing has three holes in a row The bearing is secured to the chassis through two of the holes and an axle is passed through the third which allows it to spin freely but not move out of place relative to the chassis Behavior Sensor Subsystem Logic Subsystem In the context of robotics a behavior is the pattern of actions a robot will enact when given certain inputs or commands Bumper Switch Sensor Sensor Subsystem A high durability sensor designed to detect physical contact This is a digital sensor Glossary 122 Inventor s Guide Go to Reference Links APPENDIX B GLOSSARY C Calibrate Sensor Sensor Subsystem Calibrating a sensor is the process of matching sensor readings against known values to ensure that the sensor input is being interpreted correctly in the program Simple sensors like the Bumper and Limit Switches typically do not need to be calibrated Calibrate Joysticks Control Subsys
189. rue see true ROBOTC amp amp AND Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Boolean Logic 3 Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW Variables Variables are places to store values such as sensor readings for later use or for use in calculations There are three main steps involved in using a variable 1 Introduce create or declare the variable 2 Give assign the variable a value 3 Use the variable to access the stored value task main Declaration The variable is created by announcing its type followed by its name Here it is a variable named speed that will store an integer speed 75 Assignment The variable is assigned a value The variable speed now contains the integer value 75 Moker pomEsS lt motor port2 Eee E The variable can now stand in for any value of the appropriate waitlMsec 2000 type and will act as if its stored value were in its place Here both motor commands expect integers for power settings so the int variable speed can stand in The commands set their respective motor powers to the value stored in speed 75 In the example above the variable speed is used to store a number and then retrieve and use that value when it is called for later on Specifically it stores a number given by the programmer and retrieves it tw
190. s If the center of mass of the robot is not directly over the support polygon i e projecting a line straight down from the center of gravity would not intersect the support polygon at all times the robot will fall over T Tank style Controls Control Subsystem A Transmitter driving mode in which the robot is controlled with only the vertical axes of the joysticks Each joystick controls the motion of one side of the robot like an old tank Also called 23 mode because axes 2 and 3 are being used to drive the robot Glossary 130 Inventor s Guide Go to Reference Links APPENDIX B GLOSSARY Tether Control Subsystem A cable used to connect the Transmitter directly to the Microcontroller Using a tether allows you to control the robot by sending signals through the cable rather than through the air eliminating the possibility of radio interference You can use any telephone handset cable the one that goes from the base to the handset of a corded phone as a tether Threaded Structure Subsystem A threaded piece has threading on or in it which allows a screw to be fastened into it Threading is the tiny spiraling texture on the outside of a screw or the inside of a nut for example that allows a screw to be locked into place Torque Motion Subsystem Angular spinning force Torque can be converted into linear pushing force where a wheel comes in contact with the ground Tra
191. sented as diamonds These typically contain Yes No questions Decision blocks have two or more arrows coming out of them representing the different paths that can be followed depending on the outcome of the decision The arrows should always be labeled accordingly To the right is the flow chart of a program which instructs a robot to run the right motor Start forward as long as its touch sensor is not pressed When the touch sensor is pressed J the motor stops and the program ends e olen Ne Run the Right Sensor pressed To read the flow chart e Start at the Start block and follow its arrow down to the Decision block Motor e The decision block checks the status of the touch sensor against two possible outcomes the touch sensor is either pressed or not pressed e Ifthe touch sensor is not pressed the program follows the No arrow to the action block on the right which tells the right motor to run forward The arrow leading out of that block points back up and around and ends back at the Decision block This forms a loop e The loop may end up repeating many End times as long as the Touch Sensor remains unpressed e Ifthe touch sensor is pressed the program follows the Yes arrow and stops the motors then ends the program Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Pseudo Code amp Flow Chartse 2 Go to Refe
192. signment statement int zero 0 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 3 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Reserved Words Motors Motor control and some fine tuning commands motor output power This turns the referenced VEX motor output either on or off and simultaneously sets its power level The VEX has 8 motor outputs portl port2 upto ports8 The VEX supports power levels from 127 full reverse to 127 full forward A power level of 0 will cause the motors to motori rore 127 j Cores Pull o pee forward Mowom Iporre T 2 port2 Full speed reverse bMotorReflected output 1 or 0 When set equal to one this code reverses the rotation of the referenced motor Once set the referenced motor will be reversed for the entire program or until bMotorReflected is set equal to zero This is useful when working with motors that are mounted in opposite directions allowing the programmer to use the same power level for each motor There are two settings 0 is normal and 1 is reverse You can use true for 1 and false for O Before moco e e l 12 7s PEro bu ea oa oeer khoon e Ae 7 port2 Full speed reverse After bMotorReflected port2 1 Flip port2 s direction MOtr Ot pore o 227 A POrsSs FPulilesbeeo torwe rd MOtet peri sua m
193. smaller or paper clip 1 Power on the VEXnet Joystick and VEX Cortex Allow them to sync over VEXnet Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 8 Go to Reference Links s aiaia ROBOTC Reference 2 PLTW e si VEXnet Joystick Configuration in ROBOTC cont 2 Press and hold the 6U trigger button 2 Press and hold the 6U trigger button PARTNER PROGRAM ON COMPETITION 3 While keeping the 6U trigger button pressed in use your Allen wrench or paper clip to press in the internal CONFIG button until the JOYSTICK LED blinks red and green 3a Press and the CONFIG button While still pressing in the 6U trigger button use an Allen wrench or paper clip to press in the CONFIG button 3b JOYSTICK LED JOYSTICK Once the JOYSTICK LED begins to blink a red and green release both the 6U and CONFIG buttons POE Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems VEXnet Joystick Configuration 9 Go to Reference Links ch AO pauzen zna mae am ROBOTC Reference SS Btw VEXnet Joystick Configuration in ROBOTC cont Important Time Sensitive Instructions There is a 10 second time limit to complete steps 4 and 5 If they are not completed in time the calibration process will timeout and the VEXnet LED will blink red briefly
194. square hole square shaft system transmits torque without using cumbersome collars or clamps to grip a round shaft The square shaft has rounded corners which allow it to spin easily in a round hole This allows the use of simple bearings made from Delrin a slippery plastic The Delrin bearing will provide a low friction piece for the shafts to turn in These VEX Delrin bearings come in two types the most common of which is a Bearing Flat The Bearing Flat mounts directly on a piece of VEX structure and supports a shaft which runs perpendicular and directly through the structure 3 28 Inventor s Guide vEx ROBOTICS DESIGN SYSTEM 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Another type of bearing used in the VEX Motion Subsystem is a Bearing Block these are similar to the pillow blocks used in industry The Bearing Block mounts on a piece of structure and supports a shaft which is offset either above below or to the side of the structure Some bearings can be mounted to VEX structural components with Bearing Pop Rivets These rivets are pressed into place for quick mounting These Rivets are removable pull out the center piece by pulling up on the head of the Rivet to get it to release HINT It is also possible to to convert the square hole s in some Motion Subsystem Components to a round hole by using a S drill approximately 0 175 diameter to create a roun
195. t into day with its four powerful LEDs allowing for robot operation in low light conditions Instructions for use 1 Simply mount the Flashlight either using the included standoffs and screws or other VEX hardware a The mounting tab at the bottom of the Flashlight will allow it to mount easily onto the side of any VEX component Your Robot N l 8 32 x 1 4 Long Structure gt LED Flashlight Screw 4x Module 1x 3 Threaded Standoff 2x 2 Plug the 2 prong cable into a power source This accessory will draw power from a 3 wire PWM motor port on a VEX Microcontroller When connecting to a VEX Microcontroller plug the 2 prong connector into a 3 pin socket of a Motor Port such that the connector is against the flat edge not the keyed edge as shown The key on the 2 prong Flashlight connector should NOT be inserted into the key of the socket Connecting to a flat edge J VEX Microcontroller 3 wire PWM Motor Ports Limited 90 day Warranty t ETI This product is warranted by 3 Switch the Flashlight switch to on VEX Robotics Inc against a Ensure the Microcontroller is turned on and has power ee es and workmanship under normal use for ninety 90 days from the date of purchase from authorized VEX Robotics dealers For complete warranty details and exclusions check wi
196. t uses two bumper or limit switch sensors to detect obstacles as the robot wanders around a room or course Axis Joystick Control Subsystem One of two axes X and Y along which a joystick can move Each axis on the joystick is associated with an onboard potentiometer that measures the joystick s position along that axis Axis of Rotation Motion Subsystem The imaginary line around which a spinning object rotates This usually coincides with the axle for a wheel or gear Axle Motion Subsystem A long rigid piece through the rotational center of an object like a gear or wheel Axles serve two main purposes to hold spinning bodies in place relative to the rest of the structure and to transfer rotational motion from one spinning piece to another as in the case of a motor axle turning a gear Square bars are usually used as axles in the VEX system Glossary 121 Glossary Back driving Motion Subsystem A condition where torque is transferred backwards through a mechanical system causing the driving element typically a motor to be driven instead This can often be damaging to the mechanical system and or the motor A clutch can be used to disengage the motor if the back driven force is strong enough to cause damage Battery Power Subsystem Normally any portable power source such as the VEX battery packs Technically a battery is a collection of multiple cells but single cells are often refe
197. tem Calibrating the transmitter joysticks also called trimming the sticks is the process of adjusting trim values on the Transmitter to ensure that the Sticks produce no motor movement when they are centered A more thorough calibration process also includes setting the scaling and end points to ensure a full range of motion Carrier Wave Control Subsystem The carrier wave for FM communication is a simple sine wave with a set frequency It is then modified modulated by the desired signal wave to produce the final output wave that is sent to the receiver Caster Wheel Motion Subsystem A free swiveling wheel mounted on a robot to provide stability while producing a minimum of friction The front wheels on a shopping cart are caster wheels they support weight and stabilize the cart but do not add significant amounts of friction like a skid would nor do they change the maneuvering characteristics of the cart like an additional locked wheel would CCW Short for Counterclockwise Cell Power Subsystem A single electrochemical unit producing a known voltage differential such as a single NiCd AA battery which has a voltage of 1 2V between the and terminals 276 2178 E 0610 276 2178 E 0610 T r o 9 i lt o m lt Glossary Center of Gravity Structure Subsystem The robot s center of gravity is the average position of all the mass on the robot technically this is the center of mass
198. th your dealer VEX Robotics inc 1519 IH 350 W KAO OAU ECO A O Greenville TX 75402 www VEX Robotics com 4 10 A as Flashlight Kit 1 i l Go to Reference Links Auxiliary Accessories Color Camera Kit The Color Camera Kit can give you a new perspective Use this wireless color camera to see through your robot s eyes Connect the Camera Receiver to any television to see and hear from your robot s point of view via the 2 4 GHz camera link 1x RCA Cable 2x 8 32 X 1 4 Mounting Screws 1x Camera Unit The first step is to insert the batteries into the Camera Receiver Using a Phillips head screw driver remove the screw and open the battery door on the bottom of the Camera Receiver Install 4x AA batteries not included Insert the batteries in the correct orientation by following the polarity diagram inside the battery compartment Reinstall battery door and screw Battery Compartment Limited 90 day Warranty This product is warranted by VEX Robotics Inc against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized VEX Robotics dealers For Compartment complete warranty details Door and exclusions check with your dealer VEX Robotics Inc 1519 IH 30 W For More Information and additional Parts amp Pieces refer to Greenville TX 75402 www VEXRobotics com 0710 vEx Inventor s Guide insert Color Camer
199. the arm itself but er sk There are Now because the arm is such CIIAN Two Supports a long lever arm that EAA screw would actually be Bracing Arm in danger of deforming Provides Support And Shortens or breaking A better Lever Arm solution would be to give the structure support at a point closer to the end thus reducing the mechanical advantage that the arm has relative to the supports The arm is now more stable and better able to withstand stresses placed on it from both its own weight and any external forces acting on it The bracing arm has both decreased the mechanical advantage from the long lever arm and spread the load over two supports instead of just one vex Inventor s Guide 2 23 Go to Reference Links Introduction to the Motion Subsystem The Motion Subsystem comprises all the components in the VEX Robotics Design System which make a robot move These components are critical to every robot The Motion Subsystem is tightly integrated with the components of the Structure Subsystem in almost all robot designs In the VEX Robotics Design System the motion components are all easily integrated together This makes it simple to create very complex systems using the basic motion building blocks The most fundamental concept of the Motion Subsystem is the use of a square shaft Most of the VEX motion components use a square hole in their hub which fits tightly on the square VEX shafts This
200. the signals they are passed on to the Microcontroller RF Control Subsystem Short for Radio Frequency but often used to refer to any system or component that deals with radio transmission in any way e g RF Receiver S Screw Hex Structure Subsystem A screw with a hexagon shaped hole in the head allowing the screw to be tightened or loosened with a hex L wrench Sensor Subsystem The eyes and ears of the robot Electromechanical devices that can detect specific things about the robot and its environment and communicate that information to the Microcontroller through an electrical signal Series Batteries Power Subsystem A battery arrangement where multiple battery cells are hooked up so that their voltages are added together thus behaving similarly to a single battery with a much higher voltage 276 2178 E 0610 276 2178 E 0610 ROBOTICS DESIGN SYSTEM Glossary Servomotor Motion Subsystem An electromechanical device that converts electrical energy into kinetic physical energy on demand The difference between a standard motor anda servomotor is the way they respond to joystick commands A motor will spin continuously in one direction or the other whereas a servomotor will turn to face a specific direction within a limited arc Signal Wave Control Subsystem In radio transmission the signal wave represents the data that is being sent converted into a wave form in order to be i
201. tripping out the head of the screw 2 12 Inventor s Guide bae Ai 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Introduction to the Structure Subsystem continued Components can also be offset from each other using 8 32 Dami threaded standoffs these standoffs come in a variety of lengths and lt add great versatility to the VEX kit These standoffs work great for mounting components in the VEX system as well as for creating structural beams of great strength 9 One of the key features of many VEX structural parts is their bend able and cut able nature Users can easily modify many of these structural parts into new configurations better suited for their current needs Flat plates can be bent into brackets Many metal components can be cut to custom lengths These parts were DESIGNED to be modified Note It is almost impossible to fully flatten a piece once it has been bent vEX Inventor s Guide 2 13 Go to Reference Links The VEX structural components come in a variety of shapes and sizes Each of these structural shapes may be strong in some ways but weak in others It is very easy to bend a piece of VEX Bar in one orientation but it is almost impossible to bend it when it is in another orientation Applying this type of knowledge is the basis of structural engineering One can experiment with each piece and see how it can be used to create an extremely strong robot frame
202. ue 2 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Thresholds e 1 In equation form threshold Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 U ROBOTC Reference Timers Timers are very useful for performing a more complex behavior for a certain period of time Wait States from wait1Msec don t let the robot execute commands during the waiting period which is fine for simple behaviors like moving forward If calculations or other actions need to occur during the timed period as with the line tracking behavior below a Timer must be used task main Clear the Timer Clearing the timer resets bMotorReflected port2 1 and starts the timer You can choose to reset any Ce ane L of the timers from T1 wotke time Lillis lt 7000 to T4 if SensorValue lineFollower lt 45 Timer in the condition This loop will run while the MOE OI lport o l o timer s value is less than 3 A seconds i e less than 3 motor port2 0 seconds have passed since the reset The line tracking behavior inside the body else will continue for 3 seconds motor pori o 0 MOCor Pore Coe First you must reset and start a timer by using the ClearTimer command Here s how the command is set up ClearTimer Timer_number The VEX has 4 built in timers T1 T2 T3 and T4 So if you wanted to reset and start T
203. up code into sensible readable chunks without affecting how the code is read by a machine For example a program that moves an arm up until a touch sensor is pressed stops waits for 2 seconds and then moves down until the touch sensor is released could look like either of these Program Without White Space Program With White Space eee ein aS les ineial el 10 startMotor arnMower eros gt unei l ToU ON lerbliuerena SCOPO Or a M EO warte 0 Searc Mo orar mMmMoOtCor e e E Lecise a n E stopMotor armMotor SC ele miMOmere alee oie eS untilRelease bumper See levee ar OEO StaOvrEMOoLor aruhMoOrom O Ct tM Ote ma lovin ec SECA E Orar OE a ware 0 Both programs will perform the same however the second uses white space to organize the code to separate the program s two main behaviors moving the arm up and moving the arm down In this case line breaks returns were used to vertically segment the tasks Horizontal white space characters like spaces and tabs are also important Below white space is used in the form of indentations to indicate which lines are within which control structures task main while loop if else statement Program Without White Space Program With White Space task main task main while true while true if SensorValue touch 0 if SensorValue touch 0 SboOrEeMObOr armMotor Oo staricMotor armMotor O else else SstarcMotor
204. uses propagation of these high frequency sound waves to navigate and detect obstacles Sonar has a wide variety of applications and a wide variety YOU MUST HAVE A of users from submarines avoiding underwater obstacles to PROGRAMMING KIT hungry bats looking for their dinner TO USE THIS SENSOR d ultrasonic module x 1 screw x 2 8 32 3 8 Limited 90 day Warranty This product is warranted by Innovation One against manufacturing defects in material and workmanship under normal use for ninety 90 days from the date of purchase from authorized Innovation One dealers For complete warranty details and exclusions check with your dealer Innovation One Inc 350 North Henderson Street Fort Worth TX 76102 11 04 Printed in China 0405 vex Inventor s Guide insert ultrasonic sensor kit 1 2005 Innovation One All Rights Reserved Vex and Vex Robotics Design System are trademarks of Innovation One Go to Reference Links sensor accessories Technical overview The ultrasonic sensor determines the distance to a reflective surface by emitting high frequency sound waves and measuring the time it takes for the echo to be picked up by the detector The ultrasonic sensor can determine the distance to an object between 3cm and 3m away closer Emit sound wave than 3cm will result in the sound waves 2 T echoing back to the gt oa sensor before the detector is ready to ee Detect sound
205. vior that solves the problem Turn off ri ght motor Turn off left motor 10 Turn off right motor Go forward fop I seconds 2 Break it down into smaller pieces Then break the smaller gt y pices rowan Tan on left motor 11 Turn on left motor 1 On right motor 3 Repeat until you Wait 5 seconds have behaviors that Poy 12 Turn on right motor are small enough Os for ROBOTC i 13 Wait 5 seconds understand Sometimes it can be hard to tell whether a behavior is simple or complex Some programs are so complex they need multiple layers of simple behaviors before they reach the basic ones Basic Simple and Complex are categories of behaviors which are meant to help you think about the structure of programs They are points of reference in the world of behaviors Use these distinctions to help you but don t worry if your complex behavior suddenly becomes a simple part of your next program just pick the point of reference Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Behaviors 2 Go to Reference Links A proveer ueno me my ROBOTC Reference 2 PLTW Functions with Natural Language A function is a group of statements that are run as a single unit when the function is called from another location such as task main Commonly each function will represent a specific behavior in the program
206. ware once when you first start using a VEX Cortex with ROBOTC or when you upgrade to a newer version of ROBOTC End of Lesson Once the Download Progress window closes the ROBOTC Firmware download is complete Your VEX Cortex is now ready to be programmed in ROBOTC If you are also using the VEXnet Joysticks you can follow the provided instructions in the VEXnet Joysticks Setup document Otherwise move on to the Downloading Sample Programs over USB guide to learn how to download sample code and verify that your setup is fully functional Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Main Title 5 Go to Reference Links ROBOTC Reference Using the PLTW Template GROBOTC SourceCode Fie Edit View Robot Window Help New Ctrl N Open and Compile Open Sample Program Revert to Last Saved Revert to Original File Save Ctrl S Save As The PLTW template is the starting point for all your programs The template is located in the Open PROJECT LEAD THE WAY p ere d sample programs VEX2 gt 4 Search VEX2 Print Ctrl P Sample Programs in the ien IN PLTW folder Page Setup Print Setup Organize New folder B f t th 1 Quad Encoder Test ra a erTore Ing IN e 2 SourceCode Favorites YP g 3 Robot code m Desktop template you MUST go 4 test encoder B Downloads di Dropbox Recent Places to
207. wave The number of seconds for the sound wave to be detected round trip delay The ultrasonic sensor actually consists of two parts an emitter which produces a 40kHz sound wave and a detector which detects 40kHz sound waves and sends an electrical signal back to the microcontroller In order to determine the distance to an object it is necessary to implement a timing loop in your microcontroller code to measure the length of time required for the sound wave generated by the emitter to traverse the distance to the object The distance to the object can then be calculated with the following formulas Distance to object 12 speed of sound X round trip delay Note speed of sound varies with altitude and temperature At sea level and room temperature it s approximately 344 2 m s or 1135 ft s It will increase with temperature and decrease with altitude Therefore Distance in feet 567 5 ft s X round trip delay or Distance in meters 172 1 m s X round trip delay ultrasonic sensor kit 2 Inventor s Guide insert trasoni kit aan ROBOTICS DESIGN SYSTEM Go to Reference Links peeeoog e e e e e e e e e e e e e e e E e e e F e e a e 1 E 2 e eecneeeoeomeoceeeoeeeoeeeesneeoeeog eeeeveeeseeoeoneeceeaeeoeogeevneaevneaenaeeoeaeeoaceneeaegeeeeeeoeaeoeeeeoeeeeegeeaeeeeeeeeeeeoeeeegeeeseeneeeeeeeeeeee Y a J E CQ Nw EE E E E S EEEE E EE EEE m IIE E EEEE eeeeed
208. with VEX Robotics Systems Go to Reference Links Introduction to the Structure Subsystem The parts in the VEX Structure Subsystem form the base of every robot These parts are the skeleton of the robot to which all other parts are attached This subsystem consists of all the main structural components in the VEX Design System including all the metal components and hardware pieces These pieces connect together to form the skeleton or frame of the robot In the VEX Robotics Design System the majority of the components in the Structure Subsystem are made from bent sheet metal These pieces either aluminum or steel come in a variety of shapes and sizes and are suited to different functions on a robot Different types of parts are designed for different applications The VEX structural pieces all contain square holes 0 182 sq on a standardized 1 2 grid This standardized hole spacing allows for VEX parts to be connected in almost any configuration The smaller diamond holes are there to help users cut pieces using tin snips or fine toothed hacksaws without leaving sharp corners 2 10 Inventor s Guide V 276 2178 E 0610 276 2178 E 0610 Go to Reference Links Introduction to the Structure Subsystem continued VEX square holes are also used as alignment features on it some components These pieces Si Ee ee will snap in place into these a Sas square holes For example
209. y 3 Does the Cortex need to be power cycled e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On 4 Try another USB port on the computer e Start with the Cortex Turned OFF e Connect the Cortex to the computer over USB e Turn the Cortex On 5 Try putting the Cortex into Bootload mode e Start with the Cortex turned OFF but with a battery connected e Push and hold Config button in on the Cortex e Attach the USB cable between the PC and Cortex e Wait for the Robot VEXnet and Game lights to blink green e Release Config button e Turn the Cortex ON e Then in ROBOTC click Robot Download Firmware Master CPU Firmware Standard File e After the Master CPU Firmware finishes downloading click Robot Download Firmware ROBOTC Firmware Standard File Additional Note This step may be necessary if the Master CPU Firmware was corrupted and or only partially downloaded to the Cortex Also possible if the wrong firmware VEXnet Joystick was downloaded to the Cortex this step may be necessary Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Troubleshooting ROBOTC with Cortex 1 ROBOTC Reference Go to Reference Links PROJECT LEAD THE WAY Troubleshooting ROBOTC with Cortex 6 Make sure that your computer allows for new hardware to be connected Ext
210. ymbols in it e Avariable name can not start with a number Se need e Avariable name can not be the same as an existing reserved word time1 T 1 Project Lead The Way and Carnegie Mellon Robotics Academy For use with VEX Robotics Systems Variables 2 Go to Reference Links a e U I J PROJECT LEAD THE WAY Sh 4 a ROBOTC Reference Variables with Natural Language Assignment and Usage Rules Assignment of values to variables is pretty straightforward as is the use of a variable ina command where you wish its value to be used Rules for Assignment e Values are assigned using the assignment operator not e Assigning a value to a variable that already has a value in it will overwrite the old value with the new one e Math operators can be used with assignment statements to perform calculations on the values before storing them e Avariable can appear in both the left and right hand sides of an assignment statement this simply means that its current value will be used in calculating the new value e Assignment can be done in the same line that a variable is declared e g int x 0 will both create the variable x and put an initial value of O in it Rules for Variable Usage e Use a variable simply by putting its name where you want its value to be used e The current value of the variable will be used every time the variable appears Examples Stores the value 75 in the variable motor

Download Pdf Manuals

image

Related Search

Related Contents

Nulling Voids: Filling Cracks and Holes in Wood  Electra Elite IPK II Multiline Terminal User Guide  Samsung SHR-5162 User's Manual  OWNER`S MANUAL  Unified Brands Kitchen Ventilation Systems User's Manual  イージーイリゲーションタワー 取扱説明書  125m Basic Trainer  MICROCOR® TOOLS Reference Manual    Sur l\`utilisation du sulfate de cuivre en thérapeutique piscicole  

Copyright © All rights reserved.
Failed to retrieve file