Download presentation
Presentation is loading. Please wait.
Published byHilary Gibson Modified over 8 years ago
1
ROBOTC for VEX CORTEX Professional Development Jesse Flot
2
Welcome Tech Check Tools VEX CORTEX Hardware Robot Virtual Worlds Basic Movement Program Planning
3
Tech Check
4
Voice communication –Introduce yourself –Checkmark yourself Screen sharing –DEMO: Starting ROBOTC
5
Tools
6
CS2NLearn - The Learning Management System (LMS) –Logging in, and where to post homework Three Main Pieces of Software –1. WebEX –2. ROBOTC Application / Robot Virtual Worlds –3. ROBOTC Curriculum / Tutorial Videos
7
Tools The Forums –Class Forum for announcements and asking questions can be found under the Announcements and Information section: –http://www.robotc.net/forums/ Active ROBOTC Community
8
Hardware Overview
9
VEX 2.0 Cortex Overview Coordinates the flow of information and power on the robot All electronic components interface with the Cortex 10x Faster than the PIC 10 Motor Ports 8 Analog Ports 12 Digital VEXnet Wireless I2C and UART Ports
10
Clawbot with Sensors 2 Driving Motors 1 Arm Motor 1 Claw Motor 3 Integrated Motor Encoders 1 Quadrature Encoder 3 Line Followers 1 Touch Sensor 1 Ultrasonic Rangefinder 1 Gyroscope
11
Squarebot and Swervebot These robot models will work, too, with some small adaptations:
12
ROBOTC Overview & Features
13
ROBOTC this Week There may be several versions of ROBOTC on your desktops This class we will primarily use ROBOTC for VEX Robotics (and ROBOTC Graphical)
14
Background Information ROBOTC is developed specifically with teachers, classrooms, and competitions in mind Complete programming solution for the VEX PIC, VEX Cortex, VEX IQ and several other popular robot platforms Only programming language for the VEX PIC, VEX Cortex, and VEX IQ with a real-time debugger –You’ll learn more about this feature later on Very similar to industry-standard C programming –Students get real-world programming experience
15
Function Library Lists commands that can be drag-and-dropped into the program. List of available functions will expand or shrink depending on the “Menu Level”
16
Sample Programs ROBOTC includes over 300 Sample Programs Code is fully explained via commenting
17
ROBOTC Help In-depth explanations about the ROBOTC interface, commands, debugger, etc.
18
Introduction to Programming VEX Cortex
19
Student-Paced Instruction Everyone learns different things at different paces Everyone MUST move at a different pace –Going too fast results in failure and frustration –Going too slow results in loss of attention (i.e. future failure) VEX Cortex Video Trainer can be used as a teaching aid –One instructor can’t teach at 20 different paces simultaneously –One instructor plus 20 computers can
21
Overview
22
What are ? RVWs are simulation environments that run virtual LEGO and VEX robots programmed in the same languages as physical robots (ROBOTC). Check out the video on the front page of http://robotvirtualworlds.com/ http://robotvirtualworlds.com/
23
Why RVW (Initially)? 1.Many classrooms don’t have enough robots for students 2.Very few students have robots at home to do homework or make up missed classwork The Robot Virtual Worlds Project tackles both of these problems by allowing students to program virtual robots using the same programming software
24
Why RVW (Now)? Research between the CMU Robotics Academy and the LRDC at the University of Pittsburgh shows that learning to program in a simulated environment is actually more efficient than with physical robots! http://cs2n.org/teachers/research Liu, A., Newsom, J., Schunn, C., Shoop, R. Learn to program in half the time!. Robot Magazine, 49-51. [ Author Proof (PDF) ] http://cs2n.org/teachers/researchAuthor Proof (PDF)
25
RVW Solutions Curriculum Environments –Challenge Pack –Curriculum Companion Tables –Level Builder Competition Environments –VEX Nothing But Net –VEX IQ Bank Shot –Beltway Themed / Game Environments –Ruins of Atlantis –Operation Reset –Palm Island –Mobile Games
26
RVW Curriculum Companion All of the programming tables found in the ROBOTC Curriculum in a virtual environment Students follow along with the tutorials and go through the practice challenges, with physical virtual robots Every student in a classroom can learn to program, even at home!
27
Virtual Robots Virtual robots emulate their real- world counterparts Several robots available, based off of models used in curriculum Have working color sensors, touch sensors, distance sensors, gyro sensors, and motors with encoders Still communicate with the ROBOTC Debugger!
28
Measurement Tools In-game measurement tools eliminate the need to “guess-and- check” for programming solutions Create waypoints in the world to find key distances and angles Go to http://robotvirtualworlds.com/ and choose Tools > Measurement Toolkit for more informationhttp://robotvirtualworlds.com/
29
Achievements / Badges As students complete challenges, they earn badges similar to modern games Designed to motivate them, engage them in CS activities long-term Badges are also displayed on CS2N.org, allowing teachers and parents to track progress
30
Tracking Progress CS2N.org also allows teachers to create “Groups” with their students RVW Challenge Completion and Quiz scores are all presented in convenient, easy-to- understand format
31
Getting Started with RVW
32
Using Robot Virtual Wolds 1.Switch Robot > Compiler Target to Virtual Worlds 2.Choose Window > Menu Level > Select Virtual World to Use > Curriculum Companion 3.Compile and Download a Program to Launch the Virtual World
33
First Program – Moving Forward
34
VEX Motors 3 Main Types: –Original 3-wire motor –Newer 2-wire motor 269 –Newer 2-wire motor 393 All motors are programmed the same way in ROBOTC –Accept values between 127 (full forward) and -127 (full reverse)
35
Before You Begin Make sure you have done the following: –Updated the VEX Cortex Brain, Motors and Sensors –Installed ROBOTC Firmware –Chose the correct compiler target
36
Platform Type Make sure to configure ROBOTC to work with the Cortex!
37
Compiler Target Make sure your Compiler Target is set to “Physical Robot”.
38
VEX Cortex Communication Mode Allows you to specify: 1.How programs are downloaded 2.Whether the Cortex looks for a VEXnet connection when it starts up With “VEXnet or USB” the Cortex will look for a VEXnet connection before running code
39
VEX Cortex Microcontroller The Cortex has two processors that are responsible for different tasks –Master Processor: VEXnet communication, low-level motor control –User Processor: Interpret ROBOTC Programs Each processor has software called “firmware” that allows it to perform its tasks
40
Renaming and Reversing Robot > Motors and Sensors Setup –Optional but a good practice –Give Motors and Sensors custom names –Reverse motor polarity
41
Naming Rules The Motors and Sensor Setup window allows you to give your motors and sensors custom names. The names, however: –Should be descriptive of the sensor or motor they refer to (rightMotor, frontBumper, ect.) –Must be all one word made up of letters, numbers, and underscores –Must contain no special characters (&, $, /, ect.) –Cannot already be a ROBOTC reserved word (task, motor, true)
42
Basic Programming: Motor and Wait Commands
43
rightMotor On for 5 Seconds
44
Turns the port2 rightMotor on at half power forward
45
rightMotor On for 5 Seconds Causes the robot to wait here in the program for 5.0 seconds
46
rightMotor On for 5 Seconds Stops the port2 rightMotor. End Result: rightMotor spins for 5.0 seconds.
47
Basic Commands: Program Flow
48
Moving Forward The basics of programming with the ROBOTC Graphical is to take a command from the left and drag it to the right. Start with the Forward command block
49
Moving Forward What happens if you choose "Seconds" as the unit in a Forward movement command? Try it!
50
Backward Command What happens when you use a Backward command in your program instead of a Forward command? Write a program using a Backward command. Try it!
51
Arm Control In order to control the arm of our robot, we will need to use a new Command Block: moveMotor Change your setting to 315 degrees. Positive values lower the arm and negative values raise the arm. Try it!
52
Moving Forward Mini Challenge: 50 cm Challenge –Program your robot to travel exactly 50 cm!
53
Motors Debug Window Displays the status of all of the motors configured on your robot “Readable” and “Writable”
54
Turning
55
Turning in Place Use the following Command Block to make your robot turn. What happens? Is it what you expected? Why not?
56
Turning in Place Units of Turn What happens if you switch the second box of the turnLeft or turnRight command from Rotations to Degrees? Try it!
57
Turning in Place Mini Challenge: 90 Degree Turn Challenge Program your robot to turn exactly 90 degrees to the right!
58
Movement Exercises 1.Move the robot forward at full speed for 3.5 seconds, and stop 2.Point Turn to the left at half power for 5 seconds, then Point Turn to the right at full power for 2 seconds 3.Move Backward for 3.25 seconds at half power, then Swing Turn to the right for 2.35 seconds
59
Program Planning
60
Behavior Based Programming A behavior is anything your robot does: –turning on a single motor, moving forward, tracking a line, navigating a maze Three main types of behaviors: –basic behaviors – single commands to the robot (turn on a motor) –simple behaviors – simple task performed by the robot (move forward, track a line) –and complex behaviors – robot performs a complex task (solve the maze) Complex behaviors can always be broken down into simple behaviors, which are then broken down into basic behaviors
61
Labyrinth Challenge
62
The Labyrinth Challenge
63
Programming Discussion The Challenge: Labyrinth The Solution: ??? The Programmer’s (your) Role –Plan out the robot’s path / actions - Pseudocoding –Understanding Program Flow and Behavior Based Programming –Translate the Pseudocode into real code The Robot’s role –To carry out your instructions! The Solution: Programmer and Robot working together, fulfilling their roles –True for all robotic challenges!
64
Pseudocode Pseudocode is a shorthand notation for programming which uses –informal programming structures (if touch1 is pressed…) –verbal descriptions of code (move forward, stop) Emphasis is placed on expressing the behavior or outcome of each portion of code rather than on correct syntax Your lines of Pseudocode should also be listed in the same order as they will appear in the ROBOTC Program
65
Pseudocode Sample Pseudocode:
66
Putting it all Together Effective Program Planning is essential to writing correct code. Carrying out that plan is equally important! Once you have your plan, don’t try to implement it all at once! Systematically add sections of code, testing at every step!
67
Code Commenting “Comments” allow the programmer to make notes in the program that the robot will ignore –Begin with “//” –You can also click on a line number to “comment out” a line of code. This is useful during troubleshooting.
68
Labyrinth Challenge
69
The Labyrinth Challenge
70
Homework! Homework assignments can always be found and turned-in on CS2NLearn You’ll also be expected to watch a series of videos for review Optional practice quizzes will prepare you for the certification exam at the end
71
Appendix
72
Big Ideas and Teaching
73
Big Ideas What can you teach with a robot? How do you teach with a robot? What do I need to know about programming?
74
Preconceptions & Pedagogy Preconceptions –You have preconceptions Students have preconceptions –New information has to be reconciled with existing beliefs –Something has to give! –Contradictory statements can coexist in the mind …this is called CONFUSION We want to get rid of this. Effective instruction requires teachers to address preconceptions effectively
75
Preconceptions Do we expect you to believe this yet? –NO! –You can’t change preconceptions by simply making claims and justifications –Preconceptions are too closely linked to the rest of our world view –2 ways to change belief: Repeated experience Trauma We prefer this one, but hey…
76
Teaching with Robotics Often, you will encounter a problem
77
Teaching with Robotics Solve the problem
78
Teaching with Robotics Problem solved…
79
Teaching with Robotics Problem not solved??
80
Teaching with Robotics
86
The Problem The Real Problem The Really Real Problem
87
The Robotics Teacher Build an understanding that leads to a solution Understand the underlying problem and solution Make it work Instruction vs. Unstruction –What happens if you just solve the problem for the student? Remove the tip of the iceberg Don’t actually solve the problem At a loss to explain why the same problem re-emerges soon after –Result: Confuses students Teaches dependence as a solution
88
The Robotics Teacher Level 1: Answer Level –“Explode” the iceberg (tip) –Short term solutions –Shallow understandings –“Solving the problem” often doesn’t solve the problem! –Be aware of, but do NOT stop or let your students stop here Understand the underlying problem and solution Make it work
89
The Robotics Teacher Level 2: Student Level –Realize the underlying nature and scope of the problem (whole iceberg) –Find a way to solve the real problem –Students need to achieve this level of understanding Understand the underlying problem and solution Make it work
90
The Robotics Teacher Level 3: Teacher Level –“Remove” the water –Expose the problem –Build an understanding –Lead the student toward a working solution to the “whole” problem –You must reach this level Build an understanding that leads to a solution Understand the underlying problem and solution Make it work
91
The Robotics Teacher Build an understanding that leads to a solution Understand the underlying problem and solution Make it work Instruction vs. Unstruction –Teachers must operate fluently at the highest level This includes understanding a student’s level and perspective –You must: Be aware of and eschew Level 1 understandings Construct a Level 2 understanding Expand into a Level 3 understanding
92
Preconceptions Do we expect you to believe this yet? –Have you had repeated experience or trauma yet?
93
Robot Math
94
How did you solve the 50 cm problem? How did you solve the math problem behind it? Some common methods: –Scale Factor (“Scaling” multiples of a known quantity) –Rate: Unit Ratio (# of X in a single Y, times the number of Y’s) “Rate” relationship Find #degrees/1cm, then multiply that rate by the total What about #degrees per floor-line? –Rate: Raw Ratio (# of X per # of Y, times the number of Y’s) Find 360degrees/20.4cm, then multiply that rate by the total –Direct Proportion (Traditional “ratio” equation) 20.4 cm = 50 cm 360 deg X deg Solved mechanically using cross-multiplication Solved algebraically as a Linear Equation of One Variable
95
The M in STEM Did you all solve the same problem? Did you all get the same answer? Did you all use the same method? Answer Problem Did it matter?
96
The M in STEM To measure distance, we have many tools… –Why should robotics be any different? –Why should mathematics be any different? Give students more tools and more experience in choosing and using them!
97
The M in STEM steM Many STEM teachers will not be teaching in “Math class”, yet when Math is the correct tool… –Make the math explicit; don’t waste the opportunity! Embrace multiple methods of solving the same problem; students need more tools at their disposal, not conflicting information about which ones are “better” than others (none are, use what works!)
98
Abstraction Bridges Criticism: What good is Robot Math? –Is the SAT going to ask you about encoder counts and wheel rotations? Refining the math skills –Generalize understanding (apply to other numbers and contexts) –Practice Compare these problems: –A robot moves 3 meters in 2 turns of its wheel. How far does it go in 6 turns of the wheel? –You can get 3 T-shirts for 2 dollars at the mall. How many can you get for 6 dollars?
99
Underlying Math Structure Abstraction Bridge –Problem-pair is one type of Abstraction Bridge –Same question, different context Are these the same question? –20 cm in 412 degrees, find deg/cm –200 mi in 41.2 dollars, find mi/$ Are these the same question? –120 cm is 80% of the total. How many cm to go? –80% of 30 questions were correct. How many wrong?
100
Expedition Atlantis
101
“Program” robots to move based on solving proportional math problems Students learn to solve “forward” problems, then “turning”, then combine to “turn and move forward” Students can customize robots 4 different difficulty levels Available in iTunes, Mac, PC
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.