Basics for Robotics Programming

Slides:



Advertisements
Similar presentations
How to utilize your iTunes for use with your SwiMP3 Please be aware that all the SwiMP3 line of players do not have licensing to any of the songs that.
Advertisements

US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
Mouse Tutorial for Win XP In this tutorial you will learn to: Move the mouse Click and double click Make selections Manage windows Use menus Click the.
Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Photos and Sensor Instructions
Teacher/Mentor Institute Hands-On Session: Building a Robot Scott McEwen & Kevin Barrett July 21-22, 2014.
V EX C OACHES ' T RAINING October 12, Agenda for Today 9 – 10 AM : Tina Reeves and the Engineering Notebook 10 – Noon : Finish Building, Basic Robot.
Reviewing Common Blocks for St. Agnes Elementary School Teachers by Jenny Chang Feb. 26th, 2007 USC & University Neighborhood Outreach Robotics STEM program.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
By Joshua Shaw.  This presentation demonstrates how to create a program  Take as much time as you need to go through this PowerPoint  Just remember.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Available at: – Operate the Tumbler using a Jumper Pin Operate the Tumbler using the jumper pin.
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Teacher/Mentor Institute Hands-On Session: Building a Robot Scott McEwen Chuck Powell.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
Teacher/Mentor Institute Hands-On Session: Building a Robot Carolyn Bauer July 30-31, 2015.
Vex Robotics Programming Sequence. Now that you’ve had some practice downloading and using the included programs, it's time to learn to write some of.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
As you look at an iMac you will notice that there are no buttons on the front of the machine as shown in figure 1.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Photos and Sensor Instructions
Created by Blake Ross Start EasyC. Created by Blake Ross.
Programming - Motion Intro to Robotics. Motors and Sensors Setup The first thing we need to do is tell ROBOTC that we have motors on our robot. Choose.
By Joshua Shaw.  Now that we have a program, we should see how it works in the real world  To do this we need the Cortex and the orange USB cable 
Vex Robotics program three: using motors and sensors together.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Lego Mindstorm Robots 9797 kit.  Students will learn how to identify how to detect a change in a condition.  Students will learn where and how to identify.
Digital Literacy Introduction to Computers Unit 1, Lesson 1.
Teacher/Mentor Institute Intro to easyC Programming Scott McEwen July 21-22, 2016.
By Joshua Shaw.  We have previously added a While Loop  We are now going to use it for programming the robot  We have also added two motor programs.
Teacher/Mentor Institute Hands-On Session: Building a Robot Carolyn Bauer July 21-22, 2016.
After Construction Name: Per #:.
Project Overview Introduction Clawbot Build Design Modification
Introduction to Vexnet
Introduction to Programming in RobotC
Using the Cyton Viewer Intro to the viewer.
Hands-On Session: Mini-Competition
ROBOTC for VEX Online Professional Development
Putting Objects in Motion
PowerPoint Activity 5: To Be Determined…
A Tutorial on How to Turn PowerPoint Presentations into Slideshows
Programming Scratch to Control a K’NEX Fairground Ride
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Dayton Metro Library Computer Basics September 19, 2018
Office 2010 and Windows 7: Essential Concepts and Skills
Microsoft Windows 2000 Professional
Learning to program with Logo
Automation and Robotics
MicroEconomix 1500 RSLogix 500 LAB#1
Programming Autonomy By Joshua Shaw.
Controlling your quadcopter
Programming a Servo By Joshua Shaw.
Dayton Metro Library Place photo here Computer Basics December 8, 2018.
Unit 11 – PowerPoint Interaction
An Introduction to Alice
Go to =>
VEXnet User's Guide.
Getting Started With Alice
Photos and Sensor Instructions
Microsoft Official Academic Course, Microsoft Word 2013
Introduction to PowerPoint
Microsoft Office Illustrated Fundamentals
Creating a Simple Game in Scratch
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Getting started with LEGO EV3 Mindstorms software
Downloading to the NXT requires the correct hardware setup
Controlling your quadcopter
Introduction to Programing the Cortex for BEST
Presentation transcript:

Basics for Robotics Programming by Joshua Shaw

Introduction to Programming This presentation demonstrates how to create a program Take as much time as you need to go through this PowerPoint. Just remember that you need to get the program finished as soon as possible so the drivers can practice Good Luck

Before We Get Started In this power point I will walk you through as many steps as possible to ensure that the program runs smoothly This includes several of the most obvious steps Such as using the start menu This power point will act as if I am there to help. I will say “we” often So, let us begin

What is Easy C Easy C is a simpler version of C++ It uses cause and effect statements, which allow you to manipulate the robot The next slide gives an example of a basic program It can be modified to fit the conditions of the game

A Basic Program This is the program used by Hillcrest at the 2011 Crowley's Ridge Best Competition in Jonesboro. It does have limit switch capability which will be discussed later.

Getting Started The first step to create the program is to start the Easy C software It will most likely be found on the desktop of your computer If not, then click the Start menu (indicated by red arrow below) Go to All Programs Click on easy C V4 for Cortex

To Begin a Program To begin a new program for the robot, click on New Standalone Project under New/Open Select Joystick Project (WiFi) Click Ok If you have already begun a program, click on the name of your program under Recent Projects

Start Programming We are going to need a statement that is always true in order for the program to be effective We will be applying a While Loop To do this, go to the Function Blocks box beside your program and click the “+” beside Program Flow

While Loop Then click and drag While Loop from the list and place it on the vertical line between Variable box and End box. At this point a dialog box appears Type a true expression such as (2<3) Click OK

Add a Motor Inside the While Loop a set of brackets appear, this is where we will create the program First lets add a motor to the program Since motor outlets “1” and “10” are not permitted for use in competition, we will not use them in the program Click the “+” beside Joystick under the Function Blocks Click and drag the Joystick To Motor function to the vertical line between the brackets in your While Loop When you do this, a dialog box appears

Motor Programming The Joystick to Motor dialog box should look like this However, we can not use Motor 1 in the competition For this example we will use Motor 2 We do this by clicking on the down arrow in the motor box and select Motor 2

Transmitter Channel A Transmitter Channel allows you to select which buttons or joysticks on the Joystick Controller you want to use for a specific purpose In this program we are going to use the left hand joystick to operate the wheels and the right hand joystick to operate an arm and a claw We can also change the Channel the same way as we changed the Motor For this example we will use Channel 1 Which just so happens to be the default Finally click Ok You can create as many motor programs as you need for your program. But lets keep this one simple

Preparing to Download Program Now that we have a program, we should see how it works in the real world To do this we need the Cortex and the orange USB cable Plug one end of the orange cable into the Cortex’s USB port located in the center of the Cortex Plug the other end into a USB port on the computer The LEDs on the Cortex should light up

Illustration of Hardware Connection Your lay out should look something like this

Downloading Program Now that the Cortex and the computer are plugged into each other, lets send the program to the Cortex To do this, we need to click on the Build and Download button on the toolbar Next, click on Build and Download Or by pressing F7 on the keyboard

Downloading Program cont’d You should see this dialog box Click Yes This will send you to another dialog box The green bar should begin at the left and move all the way to the right

After the Download After the Program has been Downloaded to the Cortex Remove the orange cable from the Cortex Insert a black USB control key into Cortex Insert the other black USB control key into the Joystick Controller At this point the robot’s motor(s) and/or servo(s) can be tested

Activating the Robot After attaching the motors and/or servos that you need (see “Wiring the Robot” PowerPoint for instructions on attaching motors and servos), and downloading the program to the Cortex, we need to turn on the robot To do this, you must first turn on the Cortex and then turn on the Joystick Controller ***You must turn these on in this order***

Using the Joystick Controller – Channel 1 You will use the Channel 1 on the Joystick Controller to operate the motor Move the Right Joystick left or right to control the Motor

Servo Programming Now lets make a servo operate with the flip of the joystick on the Joystick Controller Go back to Joystick in the Function Block Click and drag the Joystick to Servo function to your While Loop and place it on the vertical line between the JoystickToMotor function box and the lower bracket box

Servo Programming cont’d When you do this, another dialog box will appear Except for the name, it looks identical to the Motor Dialog Box For our example program Lets set the Channel to “2” and the Motor to “4” This is done the same way as we did with the Motor Click OK

Testing the Servo Program To test the Servo Program, we need to click on the Build and Download button on the toolbar Next, click on Build and Download Or by pressing F7 on the keyboard You can refer back to the downloading procedure illustrated in slide thirteen thru slide seventeen

After the Download After the Program has been Downloaded to the Cortex Remove the orange cable from the Cortex Insert a black USB control key into Cortex Insert the other black USB control key into the Joystick Controller At this point the robot’s motor(s) and/or servo(s) can be tested

Activating the Robot After attaching the motors and/or servos that you need (see “Wiring the Robot” PowerPoint for instructions on attaching motors and servos), and downloading the program to the Cortex, we need to turn on the robot To do this, you must first turn on the Cortex and then turn on the Joystick Controller ***You must turn these on in this order***

Using the Joystick Controller – Channel 2 You will use the Channel 2 on the Joystick Controller Move the right joystick up or down to control the servo The servo will only move about 60º in either direction for a total of 120º

Creating a Program for Wheels One of the most commonly used wheel configurations is a wheel on each side of the robot To avoid spinning in circles, the motors need to spin in opposite directions The wheels need to work in unison, as well as being independent of each other This can be achieved in an Arcade Program

Arcade Programming-Channels Go back to Joystick under the Functions Blocks Click and drag the Arcade - 2 motor anywhere on the vertical line of the While Loop Click the down arrow on the Forward\Reverse Channel to choose the channel that will operate the forward and backwards motion of the robot (select “3” for this program) Do this for the Rotate Channel (select “4”)

Arcade Programming-Motors Click the down arrow on the Left Motor and select a motor to operate the wheels For this example select “6” Do this for the Right Motor except with a different motor For this example select “8”

Arcade Programming - Invert Direction of Motors To operate the wheels properly we will need to invert the direction of one of the motors We will Invert Direction for Left Motor “6” by clicking the down arrow of Invert Direction and selecting “1” If the robot goes backwards than we will return Invert Direction of Left Motor “6” to “0” and select “1” under Invert Direction for Right Motor “8” Finally click OK

Completed Arcade Program This is what the program for the Arcade – 2 motor will look like

Using the Joystick Controller – Channel 3 and 4 You will use the Channels 3 & 4 on the Joystick Controller Move the left Joystick in any direction to control the two motors Both motors will run simultaneously

Basic Program At this point the program should look something like this This is the basic program which can be modified by the addition of motors and/or servos

Test the Program Again Now we will test the program and with the two additional motors. Download the program to the Cortex. You can refer back to the downloading procedure illustrated in slide thirteen thru slide seventeen Now test the program. slide eighteen

Servo Controlled by Buttons We will now create a servo program that operates with buttons instead of the joystick Go to the Function Block Under the Joystick folder Click and drag the Joystick Digital to Servo onto the vertical line between the bracket boxes in the While Loop

Servo Controlled by buttons cont’d The program for the servo in this example will look similar to the default The difference is that the Servo # will be “3” and not “2” Change the number by clicking on the down arrow Then click on the “3”

Completed Servo Controlled by Buttons Program The final program for the servo will look like this Finally click OK

Using the Joystick Controller – Channel 5 You will use the Channel 5 buttons on the Joystick Controller Push the top left button to move the servo to the left Push the bottom left button to move the servo to the right When you let off of the button the servo will return to neutral To change the direction of the servo, first release the button being pushed.

Test the Program Again Before we move any farther it is best to save the program. It is also good to save it on a mobile hard drive This gives the advantage to access the program on another computer that has Easy C Now lets test the robot Download the program to the Cortex. You can refer back to the downloading procedure illustrated in slide thirteen thru slide seventeen Now test the program. slide eighteen

Motor Controlled by a Button The buttons on the Joystick Controller can be used to operate a motor The procedure to create the program to operate a motor from the buttons is the same as the program previously created for the servos Drag and drop the Joystick Digital to Motor into the vertical line between the brackets in your While Loop Lets change the Channel to “6” and the Motor to “5” Click OK

Using the Joystick Controller – Channel 6 You will use the Channel 6 on the Joystick Controller Push the top right button to move the motor to the left Push the bottom right button to move the motor to the right When you let off of the button the motor will slow down and stop

Analog -vs- Digital Programming The downside to using this program, which enables the buttons to control the motor, is that you can not vary the speed of the motor The motors speed remains constant at all times The first program that we created with a motor, which was controlled by a joystick, allows you to control the speed of the motor It is known as an analog program

Noise Pollution As you have probably notice, the motors of your robot give off a high pitch whining sound This is due to the slight push on the joysticks from any number of forces Slight breeze Gravity Slight push from the fingers It is able to be fixed fairly easily

Reducing Noise for Channel 1 Motor Go back to the Function Block Go to the Joystick commands Drag and drop the Joystick Analog Deadband between the Variable box and the While box Since we have a motor that is controlled by Channel 1 on the Joystick Controller. We will reduce the noise of this motor by setting the Analog Channel # to “1” Set both the Positive Deadband and Negative Deadband to “20”

Completed Deadband Program The program should look like this Push OK Now do this as may times as needed In this example we need three of these programs because we have three motors Each motor requires one of these programs to keep the noise down

Reducing Noise for Channel 3 and Channel 4 Motors You need one for each of the analog channels that where used In this example we used Channels 3 and 4 Drag and drop the Joystick Analog Deadband between the Variable box and the While box Since we have a motor that is controlled by Channel 3 set the Analog Channel to “3” Set both the Positive and Negative Deadband to “20” Click OK Since we have a motor that is controlled by Channel 4 set the Analog Channel to “4” Set both the Positive and Negative Deadbands to “20”

The Final Program The program should look like this You can modify this program to meet the requirements of the BEST Robotics Game

Test the Program One Last Time Download the program to the Cortex. You can refer back to the downloading procedure illustrated in slide thirteen thru slide seventeen Now test the program. slide eighteen