RobotC Sensors.

Slides:



Advertisements
Similar presentations
Engineering Roles We will be forming groups of 3 students
Advertisements

Automation and Robotics
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
VEX Robotics Platform and ROBOTC Software Introduction.
Photos and Sensor Instructions
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.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
Connecting VEX and ROBOTC
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
VEX Robotics Platform and ROBOTC Software
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
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.
VEX Robotics Design System Sensors A Brief Overview
AUTOMATION WITH ROBOTC Starting to write and troubleshoot computer code.
Photos and Sensor Instructions
Automated Mechanisms Help. Potentiometers Potentiometer Check –Analog Port 2 How they work –Analog sensor –Measures rotation of a shaft between 0 and.
ROBOTC Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
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.
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.
Connect VEX and ROBOTC Electrical Engineer Responsibilities © 2011 Project Lead The Way, Inc.Automation and Robotics VEX.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Introduction to VEX® components
Basic Programming: Until Commands. The Problem with Wait States Motor Speed is affected by battery power. –If the battery is fully charged, the motors.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Electrical Engineer Responsibilities
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
VEX® Robotics Platform and ROBOTC Software
Programming & Sensors.
Know your Robot Electrical Parts
VEX® Robotics Platform and ROBOTC Software
ROBOTC for VEX Online Professional Development
ROBOTC for VEX Online Professional Development
Electrical Engineer Responsibilities
VEX Robotics Platform and ROBOTC Software
ROBOTC for VEX On-Site Professional Development
Robotics Programming Using Shaft Encoders
ROBOTC for VEX Online Professional Development
Electrical Engineer Responsibilities
Programming Design ROBOTC Software Computer Integrated Manufacturing
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Electrical Engineer Responsibilities
Movement using Shaft Encoders
RobotC Sensors.
Automation and Robotics
TECH 1 BAMS Technology Education
VEX® Robotics Platform and ROBOTC Software
Line Following Behavior
VEX® Robotics Platform and ROBOTC Software
Line Following Behavior
VEX® Robotics Platform and ROBOTC Software
Automation with RobotC
VEX® Robotics Platform and ROBOTC Software
Robotics Programming Using Shaft Encoders
Photos and Sensor Instructions
Robotics Programming Using Shaft Encoders
Automation with RobotC
Robotics Programming Using Shaft Encoders
Compiled from various Internet sources Presented by Mr. Hatfield
Programming & Sensors.
Programming Design ROBOTC Software Principles of Engineering
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Lego MINDSTORMS EV3.
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

RobotC Sensors

Learning Objectives Take a look at some of the options for VEX Sensors Be able to configure sensors Be able to use a touch sensor/limit switch to limit the movement of an arm Be able to implement functions to help organize code Be able to use the Ultrasonic Sensor to drive forward until you are near an object Be able to use light sensors to track a line

Sensor Ports UART (Universal Asynchronous Receiver/Transmitter) Ports 1, 2 Analog Ports 1-8 I2C Inter-integrated Circuit Protocol Allows several devices to be chained to one port. Digital Ports 1-12 Speaker

Analog Sensors Light Sensor: 0 – 6 Feet 0 = Very Bright 255 = Dark Line Tracker: LED Light + Light Sensor

Analog: Line Tracker Infrared light sensor and infrared LED. Lights the surface and measures the light reflected. Analog: 0 = Bright, Full Scale (4096 for Cortex, 1023 for PIC) = Dark More Info at http://content.vexrobotics.com/docs/instructions/276-2154-Line- Tracker-Instr-0312.pdf

Potentiometer: Analog Measure the angle position Measures 0 to 250 degrees +/- 20 Return values from 0 to 4096 Be careful, the sensor should not rotate beyond 250 degrees.

Analog Accelerometer Measures acceleration non three axis simultaneously Each channel being used connects to the controller (Cortex)

Digital: Limit Switch/ Bumper Switch Can sense when arms reach their limit.

Digital Sensors Ultrasonic Uses two digital ports Sensitivity: Detects a 3cm diameter pole at greater than 2m Usable Range: 3.0 cm to 3.0 m / 1.5 in – 115 in

Digital Optical Shaft Encoder Takes two digital ports Can detect of to 1700 pulses per second = 18.9 rev/sec = 1133 rev/min

I2C Sensor Integrated motor encoders Since it is I2C you can chain several (8?) encoders onto one I2C port. http://www.vexrobotics.com/vex/products/ac cessories/sensors/encodermodules.html Measures 627.2 ticks per revolution when the motor is geared for torque.

We will use the Squarebot for Sensors Section

Configuring the Limit Switch 1) Select the Digital Sensors Tab Robot -> Motors and Sensors Setup 3) Use the pull-down menu to select Touch. 2) Name the Sensor frontLimit 4) Apply and OK.

Configuring the Potentiometer Robot -> Motors and Sensors Setup Select Analog Sensors tab Using port 6 Name the variable: armPot Select ‘Potentiometer’ from the drop down menu Apply OK

Using the Limit Switch Can sense when arms reach their limit. 0 when not pressed 1 when pressed

Preventing the Arm From Lowering Too Far Pseudo Code If the down button is pressed AND the limit switch is not pressed Go down AND? Remember the conjunctions?

Conjunctions Conditions can be combined using conjunctions && (AND) while ((SensorValue[rightEncoder]<1800) && (SensorValue[leftEncoder] <1800)) { //while both encoders are less than 1800 it will repeat the code in the {} block } || (OR) while ((SensorValue[rightEncoder]<1800) || (SensorValue[leftEncoder] <1800)) { // While either the leftEncoder<1800 or the rightEncoder is <1800 it will //repeat the code inside the {} block ! (NOT) Turns true to false and false to true while !(SensorValue(leftEncoder)>1800)

The && can only combine two complete conditions. Putting it together Pseudo Code If the down button is pressed AND the limit switch is not pressed Go down The && can only combine two complete conditions.

Using the Potentiometer to Limit Go to http://education.rec.ri.cmu.edu/products/cortex_video_trainer/lesson/5-2LimitingtheArm3.html And follow the video trainer lesson