An Introduction to VEX IQ Programming with Modkit

Slides:



Advertisements
Similar presentations
How Do You Make a Program Wait?. 1. What is an algorithm? 2. Can you think of a reason why it might be inconvenient to program your robot to always go.
Advertisements

Automation and Robotics
Autonomy using Encoders Intro to Robotics. Goal Our new task is to navigate a labyrinth. But this time we will NOT use motor commands in conjunction with.
Testbed: Exercises.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
BEGINNER PROGRAMMING Lesson
Program ultrasonic range sensor in autonomous mode
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
ROBOTC Software EV3 Robot Workshop
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
LESSON 05 Using the Touch LED The Touch LED The purpose of this lesson is to introduce students to the Touch LED Sensor and how they can be used on a.
INTRODUCTION Robots have been part of our fantasy and science fiction for many years. In the last few decades robots have also become a reality of everyday.
Advanced issues in Robotics and Programming Dr. Katerina G. Hadjifotinou Experimental Junior High School of the University of Macedonia.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
LESSON 05 Using the Touch LED. LESSON 05 Using the Touch LED.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
With. Project Overview  Introduction to Factory Automation Numerical Control  Build an autonomous robotic solution  Testing an autonomous robot build.
Scratch Programming Cards
How Do You Make a Program Wait?
VEX IQ Gyro Sensor Measures rotational angle of the robot
Introduction to Programming in RobotC
VEX IQ Curriculum It’s Your Future Lesson 11 Lesson Materials:
Development Environment
VEX IQ Curriculum Smart Machines Lesson 09 Lesson Materials:
An Introduction to VEX IQ Programming with Modkit
Line-Follower Challenge
Ozoblockly Lesson 03 Beginner Programs
Exploring Computer Science Lesson 6-11
BEGINNER EV3 PROGRAMMING Lesson
FLOWCHARTS Part 1.
Understanding Communication with a Robot? Activity (60 minutes)
An Introduction to VEX IQ Programming with Modkit
While multiplying larger numbers involves more steps, it’s not necessarily more challenging. If you know the steps to organize the process. So, what strategies.
By Sanjay and Arvind Seshan
Exploring Computer Science Lesson 6-11
CS1371 Introduction to Computing for Engineers
By Sanjay and Arvind Seshan
Programming Part 2 Mod Kit
Using Algebra Tiles to Solve Equations, Combine Like Terms, and use the Distributive Property Objective: To understand the different parts of an equation,
Autonomy using Encoders
Loops and Switches Pre-Quiz
Print slides for students reference
Automation and Robotics
Beginner Programming Lesson
Sasha Popov November 16, 2018 iRobot Create.
BEGINNER PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
Beginner Programming Lesson
Using the Gyro Sensor and Dealing with Drift
Recap the basics Lesson 1.
File I/O in C Lecture 7 Narrator: Lecture 7: File I/O in C.
Beginner Programming Lesson
Introduction to TouchDevelop
An Introduction to VEX IQ Programming with Modkit
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING Lesson
Arduino Part 4 Let there be more light.
Flow Diagrams Start End
Robotics Programming Using Shaft Encoders
An Introduction to VEX IQ Programming with Modkit
Recap the basics Lesson 1.
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
An Introduction to VEX IQ Programming with Modkit
creating a ecosystems model in net logo
Exploring Computer Science Lesson 6-11
Getting started with LEGO EV3 Mindstorms software
Presentation transcript:

An Introduction to VEX IQ Programming with Modkit Robotics Lesson Materials: VEX IQ sensor car (per 2 students) Computer running Modkit (per 2 students) An Introduction to VEX IQ Programming with Modkit Lesson 06

Programming task: Count to 10 Remind the students of the variable blocks: we can give a variable any name we like and store a value in there (such as white=30). So far we haven’t changed this value during our program, but we can. So let’s create a simple counter program. We also want to display this changing value, so we’ll use the VEX IQ brain LCD screen to show the user of our program the changing value of our counter. This slide shows most of the blocks we’ll use. Have the students identify and explain the blocks they know, can they guess the function of the new blocks? (Guide and correct where needed).

Programming task: Count to 10 Show the students where they can find the new ‘brain’ blocks in the Modkit interface.

Programming task: Count to 10 Challenge You need to program the robot to…. Clear the LCD display on the brain Count up from 1 to 10, waiting 2 seconds between each step. Show the continuous count on the LCD of the brain. As there are no sensors used in this programming exercise, nothing needs adding or configuring in the robot view of Modkit. The whole program will be in the brain section of the blocks view. The students should be able to piece the skeleton (see next slide) of the program together.

Programming task: Count to 10 Guide the students with pseudo code on how the program would count: check what the current value of our variable is, add one and put it in the same variable. Try to let them put the pieces together while providing them with the needed blocks. Notice how we can drop the ‘MyCounter’ block in the print block. Just like the Black and White blocks represented values in our previous programs, this MyCounter block will be whatever number our counter will be at that time. Guide or let students complete the program. (Next slide shows full program)

Programming task: Count to 10 Please note there are various equally correct ways to program this.

Automated vehicles Remember how it all started with our Google car? Slightly easier but very similar automated vehicles are already in use in airports throughout the world. Terminal 5 at Heathrow airport has a ‘Pod Parking’. If you park your car there, you can take a fully automated vehicle from the parking to the terminal and back again. Have a look at the clip (01:10)

Programming task: Robot car Final Challenge You need to program the robot car to…. Warn your passengers with an orange LED light that the car is about to move (3 seconds warning). Your car will move forward until it is 25 cm away from a wall, while driving the LED should be white. Once the car reaches the wall, it should stop, change its light to green and allow the passengers 5 seconds to (dis)embark. After a 3 second warning, by changing the light to orange, the car will turn around (how many degrees would that be?) while a red light is shown and go back to the start position (with a white LED light). Repeat the same instructions when reaching this wall. The car should show how many trips it makes on the LCD display of the brain. We will try to recreate a program that mimics these Heathrow ‘Pods’. In the first challenge the students will program their car to drive forward until the car is 25 cm away from a wall. Once there, the car will give the passengers some time to get in and out, warn them that the car is ready to turn around, turn around and go back to the start point. Apart from visual feedback clues to the passenger (green light when boarding, orange when the car is about to move again, white while driving forward and red when turning around), we will also use a variable to keep track of the number of trips the car has made. Please note there is one new block in this exercise (the ‘break’ block to exit a forever loop), all the other blocks and programing principles have been used before. Students should be allowed to refer back to previous programs while programming this task.

Programming task: Robot car Although it might seem a bit daunting at first, the students already have the needed knowledge to complete this task. Let’s guide them though creating the program, making sure you allow them the needed time to figure it out before showing the next step. We start in the robot view and will need the following parts: Drivetrain, Touch LED, Distance Sensor. In the extension we will use the ‘color’ sensor to follow a track (as in Lesson 5) instead of the easier straight lines of this exercise. Make sure you double check the ports of the sensors and make sure your drivetrain settings are correct (Connected wheels etc.)

Programming task: Robot car We start with a simple ‘getting ready’ broadcast: we need the Touch LED to glow orange, we can set the speed and turning speed for our drive train (more important in the line tracking version of the program) and don’t forget our distance sensor needs a maximum distance (see lesson 3).

Programming task: Robot car The next part of the program will be the driving (after a 3 second wait). The brain will broadcast this command (called ‘followline’ in the example program) . What needs happen now? Which parts of the robot car need to respond and what do they need to do? Answers: DriveTrain (needs to start moving our car) and Touch LED (needs to change colour), once the destination is reached (25cm away from wall), the robot car needs to stop (drivetrain) and the light needs to go to green (Touch LED) for 5 seconds. The program is revealed in the next slide, try to gently guide the students to the right code instead of revealing the solution. Please note that in the example program the colour change is called from the drivetrain blocks instead of the brain (both are correct), the reason is to keep the subroutine names easy to follow (MakeGreen, MakeOrange, MakeWhite,… to change the colour of the LED). We will add the needed counter after the next slide.

Programming task: Robot car Note how a forever loop is used, once we are too close to a wall (see lesson 3), we need to ‘break out’ of this loop, using the ‘Break’ block. Another solution would be to use a while loop instead of a forever loop (which the students should have been able to correctly implement since lesson 3). This shows how a programming challenge can have multiple solutions that all result in the same output. Ask the students to add our counter to the drivetrain: we need to count our number of trips and display this on the LCD screen of the brain. (see start of the lesson, show previous program if needed). After adding the counter we can add the next part: our light needs to go to orange for 3 seconds, then the car needs to turn around. We will use a separate algorithm for turning (to keep the code easy to understand), so make sure the broadcast command is used. (Program in next slide).

Programming task: Robot car After waiting for 5 seconds, the light needs to become orange for 3 seconds. Next our car needs to turn around (use new broadcast command for this) while making the LED red. Finally we need a 3 second wait with an orange light followed by the next trip of our car (we already programmed this, so we can just call our routine back with a broadcast command). Try to gently guide the students to program these parts, they should be able to add these bit on their own. (solution on next slide).

Programming task: Robot car Allow some time for students to test their programs and debug if needed. Note: Stopping at 25cm with a 20% speed is a safe option. If there is time, allow the students to experiment with these values. (The slower the car drives the shorter the ‘breaking’ distance can be and the more accurate our turn.) If there is time left, or as an extension, this program can be adapted to follow a track up to a wall and follow the same track back. The next slide will show this program (also provided as RobotCarFinal-0.mk4v). Only the Drivetrain ‘Followline’ routine will change, the only part shown is the part that changed. Don’t forget to add the ‘color’ sensor in the robot view. The algorithm is identical to the one for lesson 5, so the students should be able to complete this task (possibly with notes from lesson 5).

Programming task: Robot car Please note that the black track leading up to a wall should be long enough for the car to turn 180 degrees and find the track back! (set the breaking distance to 100mm or even slightly less to make this as short as possible.

Automated Vehicles Open discussion. Guide the students to discuss where automated vehicles will be first seen and how this can change our way of life. Discuss how close their car came to a real life solution.

Summary Today you have: Revisited all your programming skills. Learning objective: Combining all the programming skills and using all the covered sensors, build an autonomous car. Extend our knowledge of variables. Today you have: Revisited all your programming skills. Learned more on how to work with variables. Programmed a robot car for a real life situation. Send the program to a robot, test and debug your code.