Available at: www.etcurr.comLesson 3.2 – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

MOTION CONTROL ECE 105 Industrial Electronics Engr. Jeffrey T. Dellosa College of Engineering and Information Technology Caraga State University Ampayon,
Add and Use a Sensor & Autonomous For FIRST Robotics
Sensors.
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
VEX Robotics Platform and ROBOTC Software Introduction.
VEX Robotics Platform and ROBOTC Software
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.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
Right Face Introductory Presentation. Opening Activity How can you use this to make a right turn program? This is your program from Full Speed Ahead to.
Diameter, Circumference, and Rotational Sensors Robotics Academy All Rights Reserved.
Micromouse Meeting #3 Lecture #2 Power Motors Encoders.
Available at: – Program Potentiometer in Autonomous Mode Program potentiometer in autonomous mode.
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.
Controller, Sensors and Motors Ding Ke Tutorial 1, UGB 230N.
Applied Control Systems Robotics & Robotic Control
VEX Robotics Platform and ROBOTC Software
Program ultrasonic range sensor in autonomous mode
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
ROBOTC for VEX On-Site Professional Development
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.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
Introduction to the VEX ® Robotics Platform and ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Available at: Lesson 3.6 – Program Line Follower in Autonomous Mode Program Line Follower in Autonomous Mode.
Application of Math and Science Principles Creating a robot that moves a specified distance straight ahead and Creating a robot that turns a specified.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
Programming a light sensor to follow a black line.
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
Available at: Lesson 3.5 – Program Light Sensor in Autonomous Mode Program Light Sensor in Autonomous Mode.
Vex Robotics Program six: combining autonomous and radio control.
Xtreme Robot Olympiad Programming Basics Dr. Peter Laz Associate Professor Department of Engineering University of Denver.
Negative Power or Negative Rotation makes robot go backwards. But if both are negative, the robot will go forward! Move Steering Block.
Find the Mindstorms Icon on the computer.. To start a new program click go.
EV3 Software EV3 Robot Workshop
Available at: – Program Functions to Accept Values Program Functions to Accept Values.
1 ©2006 INSciTE Common Blocks. 2 ©2006 INSciTE Common Blocks Common blocks are full featured actions Like English statements Move Wait for an action Display.
ROBOTC Software EV3 Robot Workshop
Available at: – Program Functions for VEX Robots Program Functions for VEX Robots.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
Vex Robotics Program Two: Using two motors. Program two: using the motors In the last section, you learned how to turn on one motor. Now, you will take.
Vex Robotics program three: using motors and sensors together.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Introduction to VEX® components
Basic Steps in Programming
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Programming & Sensors.
Sensors Quadrature Encoders Mike Zook 30-Aug-2016.
VEX IQ Mix & Match Curriculum
ROBOTC for VEX Online Professional Development
ROBOTC for VEX On-Site Professional Development
Robotics Programming Using Shaft Encoders
Sensors Quadrature Encoders Mike Zook 30-Aug-2016.
ROBOTC for VEX Online Professional Development
Pulse Width Modulation (PWM) Motor Feedback - Shaft Encoder
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
RobotC Sensors.
Movement using Shaft Encoders
Introductory Presentation
Storing Values as Variables
Repeating Behaviors.
Robotics Programming Using Shaft Encoders
Robotics Programming Using Shaft Encoders
An Introduction to VEX IQ Programming with Modkit
Robotics Programming Using Shaft Encoders
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Presentation transcript:

Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode

Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode  Performance Objective: Given the components of a VEX robotics design system program optical quad encoders in autonomous mode to have the robot travel in a two foot square.  Enabling Objectives:  explain the purpose of an optical quad encoder  explain how an optical quad encoder operates  draw a flow chart for using an optical quad encoder  program an optical quad encoder

Available at: – Program Optical Quad Encoders in Autonomous Mode Optical Quad Encoder  An encoder is a digital sensor whose signals can be used to measure and define rotational movement  A quad encoder has two outputs, typically called the A Channel and B Channel.  These outputs are out of phase with one another and are used to determine direction of rotation (CW or CCW)

Available at: – Program Optical Quad Encoders in Autonomous Mode How does it work?  The encoder works by shining light onto the edge of a disk outfitted with evenly spaced slots around the circumference  As the disk spins, light passes through the slots and is blocked by the opaque spaces between the slots  As the disk rotates, the encoder detects and counts the number of slots light has passed through (pulses) determining distance traveled and direction of rotation

Available at: – Program Optical Quad Encoders in Autonomous Mode Optical Quad Encoder  The encoder counts pulses and keeps track of the number in the variable name that you set for the encoder  1 full revolution of the encoder is 90 pulses  If you program a motor to turn for 90 pulses of an encoder, it will turn one revolution

Available at: – Program Optical Quad Encoders in Autonomous Mode Encoder Resolution  The number of pulses per revolution of the encoder is its resolution  If the encoder is turning faster than the motor, the resolution will be increased, if the encoder revolves twice (180 pulses) for one wheel revolution, you can be more accurate with the encoder  The resolution can be increased by putting the encoder on a shaft that is spinning faster than the shaft on the motor (gearing up)  The optical VEX quad encoder can detect up to 1,700 pulses per second, which corresponds to 18.9 revolutions per second

Available at: – Program Optical Quad Encoders in Autonomous Mode Optical Quad Encoder  When you drag an Optical Quad Encoder block into the Programming Window, the Optical Quad Encoder dialog box appears, allowing you to choose one of four commands for the encoder function to process:

Available at: – Program Optical Quad Encoders in Autonomous Mode Programming a Quad Encoder  The Start option tells the encoders to start counting encoder pulses  The Preset option allows you to set the encoder to a fixed value or to the value of a variable  The Get option allows you to store the feedback from the encoder into a variable  The Stop option tells the encoders to stop counting encoder pulses.  It is important to stop your encoders when they are not in use to keep from overloading your system

Available at: – Program Optical Quad Encoders in Autonomous Mode Programming a Quad Encoder  Select the Interrupt Port number for the A channel that corresponds with the port on the Vex controller  Select the Input Port number for the B Channel that corresponds to the port on the Vex controller  Use Invert Direction to reverse the positive direction of rotation

Available at: – Program Optical Quad Encoders in Autonomous Mode Flow Chart a Quad Encoder  Draw a flow chart for a program that will turn two encoders on, set preset value to 1, and begin to count the pulses  If the encoders are less than a certain value, then turn the motors on, once the encoders reach that value, the motors should shut off

Available at: – Program Optical Quad Encoders in Autonomous Mode Flow Chart for Quad Encoder Start Encoders End Drive Forward Stop Motors Yes No If encoders < X

Available at: – Program Optical Quad Encoders in Autonomous Mode Program the robot using the quad encoders  Using the prepared robot, plug the two quad encoders into appropriate ports on the microcontroller  Begin a new competition project in easyC  Configure the project microcontroller accordingly  Define two global variables for the two quad encoders  Program the robot in a driving mode of your choice in the Operator Control tab  Go to the Autonomous tab to being programming the quad encoders

Available at: – Program Optical Quad Encoders in Autonomous Mode Program the robot using the quad encoders  Insert a start block for each of the encoders  Insert a preset block for each encoder, presetting each encoder to 1

Available at: – Program Optical Quad Encoders in Autonomous Mode Program the robot using the quad encoders  Insert a while loop for 1==1  Inside the while loop insert a block to get the value for each variable defined for the quad encoders

Available at: – Program Optical Quad Encoders in Autonomous Mode Program the robot using the quad encoders  Insert an If statement  The If statement should read “encoder1 && encoder2 <= 90”  “Encoder1 and encoder2” are the variable name for each encoder  “&&” means “and”, both variables must be less or equal to 90  Insert two motor modules to make the move forward

Available at: – Program Optical Quad Encoders in Autonomous Mode Program the robot using the quad encoders  Insert an Else statement that stops the motors once the value in the if statement has been reached

Available at: – Program Optical Quad Encoders in Autonomous Mode Download the code  Build and download the code to the microcontroller  Use the Competition Switch Simulator to test the program  The robot should turn the motors/wheels one revolution and then stop  If your code works show your instructor before proceeding to the next slide  If your code does not work, go back through the lesson and see if you can determine the cause

Available at: – Program Optical Quad Encoders in Autonomous Mode Move the robot 5 feet  With the quad encoders you can program the robot to move a predetermined distance  This can be done by adjusting the number of pulses the motors move  How many pulses will make the robot move 5 feet?

Available at: – Program Optical Quad Encoders in Autonomous Mode Travel Distance  Recall the 90 pulses equals one revolution  We can determine how far the robot moves with one revolution of the wheels  The wheel moves the distance of its circumference for each revolution  What is the circumference of the wheels?

Available at: – Program Optical Quad Encoders in Autonomous Mode Calculating Circumference  Circumference(C) equals the diameter(d) of the wheel times(x) pi(3.14)  C = d x 3.14  Measure the diameter of the a wheel on the robot  Multiply that measurement by 3.14  You now have the circumference of the wheel

Available at: – Program Optical Quad Encoders in Autonomous Mode  If a wheel is 5 inches in diameter, its circumference is 15.7 inches  If I wanted to move forward 15 feet (180 inches) I would divide 180 inches by 15.7 inches (the circumference) to calculate the number of revolutions required, ” / 15.7” = rev  Then multiply times 90 (number of pulses in one revolution) to calculate the number of pulses, rev X 90 pulses = pulses How many pulses?

Available at: – Program Optical Quad Encoders in Autonomous Mode You Calculate  If you wanted the robot with the encoders to travel 5 feet, how many pulses should it go?  Modify your program code to have you robot move forward 5 feet

Available at: – Program Optical Quad Encoders in Autonomous Mode Finished!  If your robot moves forward 5 feet and then stopped, your done!  Show your instructor your success  For more technical data on the optical quad encoder, visit:

Available at: – Program Optical Quad Encoders in Autonomous Mode Challenge  Now that you know how to program the optical quad encoders...  Draw a flow chart that utilizes optical quad encoders to have the robot travel in a two foot square  Program the robot to travel in a two foot square  When you have completed this challenge, have your instructor check this activity off on the performance evaluation