Download presentation
Presentation is loading. Please wait.
Published byAbigail Carroll Modified over 6 years ago
1
ROBOTC for VEX Robotics (VEX IQ) On-Line Session 2016 Tuesday Day 2
Heath Lauster: Instructor Zach Deloe: Tech Assistant
2
Review from Monday Introduction and Tech Check Software introduction:
VEXos Utility Robot C version 4.54 Hardware Overview Download first program (Physical or Virtual) Mini Challenge – 50cm Challenge Program your robot to travel exactly 50 cm! Homework Arm Movement Sensabot Challenge Turning Orchard Challenge
3
Arm Control In order to control the arm of our VEX IQ Clawbot, we will need to use a new Command Block: the moveMotor Command Block Change your setting to 315 degrees. Positive values raise the arm and negative values lower the arm. Try it!
4
Arm Control - Gearing The arm motor needs to turn 315 degrees to move the arm between the up and down positions, but the arm itself does not move 315 degrees. This is because the gears that connect the motor to the arm are not the same size. The gear on the motor is very small compared to the gear that is actually attached to the arm. The smaller gear will need to turn many times in order to turn the larger gear around even once.
5
Arm Control - Gearing However, this configuration also provides the motor with "mechanical advantage", trading more rotations for more strength as it turns. This allows the motor to keep the arm under control even when the robot is holding something that makes the arm heavy.
6
Claw Control The moveMotor command block can also be used to control the claw motor The claw has a very small range of motion, so it’s possible for the program to “get stuck” if you set the motor to move to a position it cannot reach
7
Claw Control To make sure that your claw does not get stuck, set the moveMotor command to move for “seconds” Even if too many seconds are selected the command will “time out”
8
Mini Challenge: Cargo Transport
Program your robot to pick up the object in front of it, then carry it 85 cm, drop the object, and back up to its starting point.
9
Sensabot Challenge View the curriculum video on the Sensabot: Section 1 of the Moving Forward Chapter. Then, review the Sensabot challenge by viewing the challenge tab of the Moving Forward chapter. If you get done early, program the TouchLED sensor to flash a different color every time the robot raises its arm.
10
Turning in Place Use the following Command Block to make your robot turn. What happens? Is it what you expected? Why not?
11
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!
12
Turning in Place Mini Challenge: 90 Degree Turn Challenge
Program your robot to turn exactly 90 degrees to its right! Place two pieces of tape so they form 90 degree angles. Place your robot so it faces along one piece of tape, and program it so that it turns to face directly along the next piece.
13
Orchard Tractor Challenge
14
Math and Robots
15
Math and Robots 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/20cm, then multiply that rate by the total Direct Proportion (Traditional “ratio” equation) 20 cm = 50 cm 360 deg X deg Solved mechanically using cross-multiplication Solved algebraically as a Linear Equation of One Variable
16
Robot Math: Turning Find the corner to corner wheel base
19cm x 3.14 = cm Round up to 60cm To make a right turn the robot has to physically do a ¼ turn. 60cm/4 = 15cm Conversion base on wheels 360°/20cm = 18 degrees/cm 15cm * 18 degrees/cm = 270° Or .75 rotations
17
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? Did it matter? Answer Problem
18
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!
19
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!)
20
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?
21
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/$ 120 cm is 80% of the total. How many cm to go? 80% of 30 questions were correct. How many wrong?
22
Expedition Atlantis
23
Sensors and the VEX IQ
24
Sensors Sensors are part of what makes a robot, a robot. Rather than just blindly running sequences of instructions……robots use sensors to gather information about the world around them, and respond appropriately. You have already used the Rotation Sensors built into the VEX IQ Motors. Robots: Sense, Plan, Act Now, we will investigate several uses for the Bumper Switch, or Touch Sensor.
25
Bumper Switch Simple Mechanical “bumper switch”
Returns a value reporting if pressed or released (not pressed) No firmware updates available for the Bumper Switch sensor Default Port for ROBOTC Graphical: Port #8
26
Move Until Touch Watch Section 3 of Forward Until Touch videos in section 1, 3, and i. Follow along and create a program that has the robot move forward until the Bumper Switch is depressed. Please pay close attention to the information on section 3 pertaining to Boolean Logic. Once complete begin the Vacuum Challenge.
27
Vacuum Challenge
28
Motors Debug Window Displays the status of all of the motors configured on your robot “Readable” and “Writable”
29
VEX IQ Distance Sensor Measures distances of objects by using high frequency sound Has the ability to detect up to three different object distances at the same time Default Port for ROBOTC Graphical: Port #7
30
Forward Until Near Watch Section 3 of Forward Until Touch videos in section 1 and 3. Follow along and create a program that has the robot move forward until near. Please pay close attention to the information on section 3 pertaining to how the distance senor works. Once complete begin the Dynamic Maze Challenge.
31
How does a Distance sensor work?
A distance/sonar sensor sends out an ultrasonic pulse and measures the amount of time the sound wave takes to reflect off of an object and return to the sensor. The VEX IQ Distance Sensor can detect multiple “echos” to try and distinguish between three different objects: Closest Object to Sensor 2nd Closest Object to Sensor Largest Object (relative to sensor/distance) The distance sensor returns all values in millimeters for maximum precision. Wall
32
Measuring Distances Create a program that will move the robot forward until the distance sensor detects and object/wall less than 300mm (30cm) away. Why is the motor speed set to negative 50? Wall
33
Forward Until Near: Threshold Values
The waitUntil (Distance Sensor) command uses a "Threshold" cutoff value to determine when to wait, and when to continue with the program.
34
Dynamic Maze Challenge
In this challenge, you will program your robot to move from the starting area through a maze with tall vertical walls. Use the Ultrasonic Sensor to navigate through the maze without touching any walls and ultimately reaching the goal zone regardless of what the distances were between the walls.
35
Dynamic Maze Challenge
36
Dynamic Maze Challenge
Hints The pattern of turns cannot change, so you don’t need to worry about using a sensor (other than Rotation) during turns Because of the length of the robot, try raising the arm up to shorten the effective length of the robot.
37
VEX IQ Gyro Sensor Measures rotational angle of the robot
Constantly keeps track of angular position and direction. The gyro sensor only tracks rotation in one axis (as denoted by the sensor). Default Port for ROBOTC Graphical: Port #4
38
Turn for Angle Watch Section 3 of Forward Until Touch videos in section 1 and 3. Follow along and create the programs that has turn for angle part 1 and part 2. Please pay close attention to the information on section 3 pertaining to how the gyro sensor works. Once complete begin the Dynamic Maze Challenge.
39
How does a Gyro work? Red Line = Zero Angle A gyro measures angular rotation based off of a “zero” point. With the VEX IQ gyro, counter-clockwise rotation will increase (+) the gyro’s value in degrees Clockwise rotation will decrease (-) the gyro’s value. Z Gyro Value +45 Degrees Z Gyro Value -45 Degrees
40
Golf Course Mower
41
Golf Course Mower Hints
If using virtual world make sure the robot drives over the red or muddy areas. Try using a repeat a preview to the next section program flow.
42
VEX IQ Color Sensor Measures simple colors Measures color hue
Measures independent Red, Green, and Blue in 256 levels each Measure ambient light level (line tracking) Detects objects (proximity) Default Port for ROBOTC Graphical: Port #9
43
Simple Colors (Names) The VEX IQ Color sensor is able to detect 12 different “simple colors” These “simple colors” are the same as the TouchLED’s color names Acceptable Color Names colorRedViolet / colorRed colorDarkOrange / colorOrange colorDarkYellow / colorYellow colorLimeGreen / colorGreen colorBlueGreen / colorBlue colorDarkBlue / colorViolet
44
Color Sensor Values The VEX IQ Color sensor is capable of several different modes: Color Name, Grayscale, Hue, and Proximity. The readings from the color sensor are extremely sensitive to “ambient” light in the robots environment.
45
VEX IQ Color Sensor
46
Color Sensor Values Watch the videos in the “Forward Until Color” section. Then, complete the ‘Try It!’
47
Traffic Light Challenge
48
Troubleshooting and Debugging
49
Troubleshooting Perspectives
How do you direct someone to your house? Tell them where your house is Figure out their own location Find their own route Pick them up and take them there See the sights, but don’t learn the route Guide them Take into account where they are Figure out the best route, given their starting point
50
Troubleshooting Perspectives
Learner-Centered Instruction Don’t just throw out the information without regard for where the student’s understanding is currently (Knowledge-centered instruction) Don’t just focus on results out of context (Assessment-centered instruction) Instead, make sure you practice “learner empathy”: Understand what the student thinks the situation is Plan a path for the student to reach a correct understanding Guide the student down the path
51
STAR Troubleshooting Follow the guiding STAR:
Student’s intent: What does the student THINK should be happening based on his or her current understanding? Trace: Trace through the program to identify where the robot’s behavior diverges from the student’s intent Analyze: What did the student misunderstand? Revise: Correct the student’s misunderstanding, then change the program to reflect the new understanding
52
Solving Problems The Problem The Really Real Problem The Real Problem
53
Troubleshooting Code What’s the intent of this code?
Where did it go wrong?
54
Troubleshooting Code What’s the intent of this code?
Where did it go wrong?
55
Troubleshooting Code What’s the intent of this code?
Where did it go wrong?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.