FIRST GAME CHANGERS Powered By Star Wars: Force For Change Tech .

Transcription

FIRST GAME CHANGERSSM powered by Star Wars: Force for Change2020-2021 FIRST Tech ChallengeBlocks ProgrammingAutonomous Mode

2 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualSponsor Thank YouThank you to our generous sponsors for your continued support of the FIRST Tech Challenge!Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode ManualRevision1Date07/21/2020DescriptionInitial Release 3Revision HistoryContentsContents . 3Introduction. 5What is FIRST Tech Challenge? . 5FIRST Core Values . 5Gracious Professionalism . 5Introduction: Basic Guide for Running Tank Drive and Basic Autonomous . 6Set up your hardware names . 6Set up your configuration guidelines . 7Robot Configuration Steps . 8Step 1 . 8Step 2 . 8Step 3 . 8Step 4 . 8Step 5 . 8Step 6 . 8Step 1 . 10Step 2 . 10Step 3 . 10Step 4 . 11Step 5 . 12Step 6 . 12Step 7 . 13Step 8 . 13Run the Op Mode on the Robot . 14Steps to run the Op Mode on the robot . 15Step 9 Modifying the Program . 15Creating A Basic Autonomous Mode. 17Write the PSEUDOCODE . 18Using Encoders. 21Running to position . 23Appendix A – Resources . 25Game Forum Q&A . 25Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

4 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualFIRST Tech Challenge Game Manuals . 25FIRST Headquarters Pre-Event Support . 25FIRST Websites . 25FIRST Tech Challenge Social Media . 25Feedback . 25Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 5IntroductionWhat is FIRST Tech Challenge?FIRST Tech Challenge is a student-centered program that focuses on giving students a unique andstimulating experience. Each year, teams engage in a new game where they design, build, test, and programautonomous and driver operated robots that must perform a series of tasks. To learn more about FIRST TechChallenge and other FIRST Programs, visit www.firstinspires.org.FIRST Core ValuesWe express the FIRST philosophies of Gracious Professionalism and Coopertition through our CoreValues: Discovery: We explore new skills and ideas.Innovation: We use creativity and persistence to solve problems.Impact: We apply what we learn to improve our world.Inclusion: We respect each other and embrace our differences.Teamwork: We are stronger when we work together.Fun: We enjoy and celebrate what we do!Gracious Professionalism FIRST uses this term to describe our programs’ intent.Gracious Professionalism is a way of doing things that encourages high-quality work, emphasizes thevalue of others, and respects individuals and the community.Watch Dr. Woodie Flowers explain Gracious Professionalism in this short video.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

6 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualIntroduction: Basic Guide for Running Tank Drive and Basic AutonomousIn this guide you will perform the following activities: Set up your hardware names.Set up configuration guidelines.Perform Robot Configuration for multiple motors.Use a Tank Drive Op Mode to begin driving.Run the Op Mode on the robot.Modify the Op Mode.Create an Autonomous program without encoders.Create an Autonomous program with encoders.Set up your hardware namesCreate an electrical diagram with the names of the hardware. Using an electrical diagram with consistentnaming will help you have programs that transfer and are easier to troubleshoot.leftrightservoCreate naming guidelines such as: use all lowercase.use names that relate to the function of the hardware.use names that avoid abbreviations and that could be misinterpreted.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 7Set up your configuration guidelinesThe first step in programming the robot is to make sure you have a configuration file that is current.Configuration is the process of setting up the control hub or expansion hub so that it knows which port hasa hardware connection. These names are then transferred as variables into the programming environment.It is important that your program and your configuration file use the same names for the hardware.There are approaches to ensure that your program matches your configuration file:1. Open a template program or other program you have downloaded. Change the configurationfile to the variables used in the program.or2. Change the program to your configuration file.Consistent naming will allow for easier troubleshooting and cross program usage. Students shoulddevelop a process for how they create programs that match the configuration of their robot. For example:o Add motor for manipulatoro Add motor to configuration using agreed on naming guidelines.o Use name variables that are created in the wiring diagram in all programs.The names in the configuration file should not change from one configuration to another. For example, inone configuration the left motor is named left motor but inanother it is left. This will create issues inprograms created where the program will no longer match the configuration file.In this tutorial, we will set up our own configuration file and change templates to fit our configuration file.We will first set up a configuration file for two drive motors on a robot and use the tank drive sampleOpMode to drive the robot. The last step will be to set up a basic autonomous program to drive a specificdistance and stop.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

8 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualRobot Configuration StepsStep 1Step 2Step 3From the driver station selectthethree dots at the top-rightcorner. When the menu opensselect Configure Robot.The screen shows availableconfiguration files. You canclick new to create a new file oredit the one listed. If this is yourfirst setup, you will not have aconfig file. Note: the name ofactive file is at the top right.If the Control Hub is not shownin the USB devices inconfiguration, select the scanbutton . If it is shown, selectthe Expansion Hub.Step 4Step 5Step 6‘’Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode ManualNext select motors from themenu. You will notice that thisis a list of the different types ofports that are located on thehub.Choose the motor type you willbe using from the drop-downmenu. Motor type allows you touse encoders in other stepscorrectly. 9Type in the name of themotors. These are named“left” and “right” to match theelectrical diagram. Click done.This will take you back to thescreen in step 2.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

10 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualStep 1From the driver’s station, select thethree dots at the top-right cornerthen select Program & Manage.Step 2Use the Program & Manage Screento identify the wireless networkname and password. Not the IPaddress you will use in the nextstep.Step 3Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 11On your computer, access thecontrol hub wireless network usingyour wireless option. Open aninternet browser and type in the IPaddress listed in the Program &Manage screen. This can beopened with anything with a webbrowser.Step 4Select Blocks from the topmenu. Then choose CreateNew Op Mode.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

12 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualStep 5Select “Basic Tank Drive”from the Sample drop-downmenu.Step 6Create a name for theprogram and click the OKbutton.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode ManualStep 7 13Explore the program andconsider how it is receivinginput from the joystick andwhere it is sending the data.Note: that the right motorpower is inversed in theprogram. This is becausethe motor is mounted in theopposite direction so thepower must be reversed sothat it runs in the samedirection as the left motor inthe program.Set Power of the left motorto - LeftStickY.Set Power of the right motorto - RightStickY.Save the Op Mode once youhave explored the program.Step 8Make sure that your driver’sstation phone is connectedto the gamepad.Open the FTC Driver StationAppGracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

14 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualClick Start A on thegamepad. This signals theapp to recognize thegamepad. You should seean icon light up with User 1when it is connected.Run the Op Mode on the RobotRevision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 15Steps to run the Op Mode on the robot.1. Select the right downward facing triangle for TeleOpmode on the driver station.2. Select the Op Mode that you just created and saved.3. Check to make sure that the gamepad is recognized,which is indicated by User 1 joystick becomes white.4. Select the INIT button to initialize.5. Select the center triangle to Play6. Drive, test, and record how inputs are affecting robotactions.7. Select the center square to stop the program.8. Make changes, as necessary, to the program. Saveand repeat the processes above until the robot actionsare achieved.Step 9 Modifying the ProgramYou may find that thetemplate does notspecifically fit the way youwould like to control yourrobot.You can make changes to fityour needs, such asremoving the negativevalues on the joysticks toinvert the values and howthe data is processed.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

16 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualYou can also change themotors that are beingcontrolled by the LeftStickyor Rightstick Y to fit yourdesired driving style.Save the OpMode andfollow the steps above forrunning the Op Mode.Note: that if you useprograms that have beensaved with a differentconfiguration file, then youwill get an error.You can fix the error bychoosing the correct motorfrom above that matches theconfiguration file.You either have to use asingle configuration file orchange the program to meetthe current configuration.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode ManualCreating A Basic Autonomous Mode 17Configure your robotCreate a New Op Mode andname it “Autonomous Mode”Select OK.Learn about encodersSelect Autonomous from thedrop-down menu.NOTE: Selecting theAutonomous option will requirethe program to be 30 seconds orless.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

18 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualWrite the PSEUDOCODE1.2.3.4.5.6.Repeat until the stop button is pressed.Set left motor power to 1.Set right motor power to 1.Wait 1 second.Set left motor power to 0.Set right motor power to 0.Write out the pseudocode or listof actions for the autonomousmode.For example:Drive forward 1 foot and stop.Explore the DC motor tools inthe Blocks programmingenvironment. Refer to the TankDrive OpMode you created.You will need to start theprogram by setting the directionof the right motor to reverse.Select and drag the“set left. Direction to DirectionReverse” block.Drag the block into the loop,before the blue “if do”statement.Then change the drop-downmotor from “left” to “right”.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 19Notice that the green“repeat”loop can be adjustedfrom “while” to “until.”Go to the Linear OpMode Attach the“callAutonomous.isStopRequested” to the “repeat until” loop.This will ensure that the loopruns until the Stop button ispushed. This will prevent therobot from damaging itself byrepeating the loop continually.Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

20 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualNext, set your motor power bychoosing:Actuators, DCMotor, and thenDual.Then select “SetPower” blockwith the variable of 1.Change the power level to 0.5for each motor.Now if you refer to yourpseudocode the next step is toAdd a “wait” block.Select the LinearOpMode fromthe left menu. Find and �� block.Use the previous steps to add“set the motor power to 0” fromthe DC Motor menu and 00” block fromthe LinearOpMode.Place the blocks according tothe image.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode ManualUsing Encoders 21Encoders are a sensor built intothe motor that measures therotation of a motor shaft withpulses. Using encoders canallow your robot to be morereliable and consistent.In Blocks, they are found in thedrop-down menu for motorcontrols under Actuators, DCMotor.Select the “Set Modeleft to RunModeRUN WITHOUT ENCODERright to RunModeRUN WITHOUT ENCODER”Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

22 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualDrag the block under the“Setright.Direction toDirection.REVERSE”Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 23Then choose the option to“RUN USING ENCODER”from the drop-down menu.Choose it for both left and rightmotors in the block.Running to positionGracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

24 FIRST Tech Challenge Blocks Programming Autonomous Mode ManualYou can further use encodersto run to a specific position.This will allow you tospecifically adjust.To do this you will need firstneed to change the first modefor both motors to“STOP AND RESET ENCODER.”This will reset the encoder to0. Then duplicate the blockand change both motors toRUN TO POSITIONThen go to the DC Motors,Dual drop- down menu andselect the “setTargetPosition”block.In this example, it will move to4880 at 50 percent power.Then it will sleep 1000milliseconds.If you want the program tostop here for the remainder ofthe autonomous, change thesleep to 300000 which isaround 30 seconds.Save the Op Mode, the run onthe Driver Station.Revision 1: 07/21/2020

FIRST Tech Challenge Blocks Programming Autonomous Mode Manual 25Appendix A – ResourcesGame Forum Q&Ahttps://ftcforum.firstinspires.org/Anyone may view questions and answers within the FIRST Tech Challenge game Q&A forum without apassword. To submit a new question, you must have a unique Q&A system username and password for yourteam.FIRST Tech Challenge Game ManualsPart 1 and 2 - /game-and-season-infoFIRST Headquarters Pre-Event SupportPhone: 603-666-3906Mon – Fri8:30am – 5:00pmEmail: Firsttechchallenge@firstinspires.orgFIRST WebsitesFIRST homepage – www.firstinspires.orgFIRST Tech Challenge Page – For everything FIRST Tech Challenge.FIRST Tech Challenge Event Schedule – Find FIRST Tech Challenge events in your area.FIRST Tech Challenge Social MediaFIRST Tech Challenge Twitter Feed - If you are on Twitter, follow the FIRST Tech Challenge Twitter feed fornews updates.FIRST Tech Challenge Facebook page - If you are on Facebook, follow the FIRST Tech Challenge page for newsupdates.FIRST Tech Challenge YouTube Channel – Contains training videos, game animations, news clips, and more.FIRST Tech Challenge Blog – Weekly articles for the FIRST Tech Challenge community, including outstandingvolunteer recognition!FIRST Tech Challenge Team Email Blasts – contain the most recent FIRST Tech Challenge news for teams.FeedbackWe strive to create support materials that are the best they can be. If you have feedback about this manual, please emailfirsttechchallenge@firstinspires.org. Thank you!Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

Use a Tank Drive Op Mode to begin driving. Run the Op Mode on the robot. Modify the Op Mode. Create an Autonomous program without encoders. Create an Autonomous program with encoders. Set up your hardware names