2008 KOP IR Sensor Workshop January 12, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.

Slides:



Advertisements
Similar presentations
Introduction to LEGO RCX robotics and Robot Sumo
Advertisements

US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
JED Microprocessors Pty Ltd Presenting the JED T430 low-cost Projector Controllers Nov 22nd, 2009.
Add and Use a Sensor & Autonomous For FIRST Robotics
Automation and Robotics
Wiring the new control system MVRT 2010 – 2011 Season.
OutLine Overview about Project Wii Robot Escaper Robot Problems and Solutions Demo.
From the NXT top menu Connect desired hardware as indicated Enter a command in the box indicated from the menu provided Repeat for all 5 boxes.
2008 FIRST Robotics Conference Prototyping Autonomous Operation of FRC/FTC Robots Presented by: Marc Center, FRC47, GM Hybrid Powertrain 2008 Chief Delphi.
IR SENSORS AND ENCODERS. LCDs Timothy Friez Class # 2.
Curry Mouse EE296 Final Presentation Wednesday, May 10, 2006.
Old control system ( ) MVRT. Main Circuit Breaker Connected to the red wire (power) of the battery When turned off, all power is cut off and robot.
Charging System Service
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
Embedded Programming and Robotics
 The Barkmaster2000 encourages your dog to bark  Barkmaster2000 waits in idle state for a bark  If the bark is angry enough it will start spinning.
Week 10 Today 1.Homework presentations and critique. 2.Review digital and analog inputs. 3.DIY - jumpers, soldering etc.
Mentors Workshop Control System Sub-System Mark McLeod Team 358 Festo/Hauppauge H.S. F For I Inspiration and R Recognition of S Science and T Technology.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
Electric Components. Basics 1 Current: electrons moving together in same direction (electrons are always moving in materials like metals but in a random.
Group 1 Casey Byers Nick Johnson Felix Liu Matt Long.
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Beginner Programming Workshop Simona Doboli Assistant Professor Computer Science Department Hosftra University November.
EasyC Programming Workshop January 30, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
An Objective and Component View (Not included Drive: Balance and Turret: Axis Camera)
Programming Design ROBOTC Software Principles of Engineering
Default_Routine(); - PWM Mapping /******************************************************************** * FUNCTION NAME: Default_Routine * PURPOSE: Performs.
Example Design Programming controls for an imaginary robot. The robot has to drive around, use a camera to track a green light, aim using a turret, and.
FIRST Electrical Design FIRST Robotics Championship Conference Steven Shade Team 1111 April 16, 2003.
2008 SBPLI/FIRST Programming Workshop Tom Boehm Patchogue Medford High School, Team 329 Motorola Inc. Mark McLeod Hauppauge High School Team 358 Northrop.
Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
Robot Project by Ahmad Shtaiyat Supervised by Dr. Salem Al-Agtash.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
Automation and Robotics.  First you select the platform type so that you can use Natural Language PLTW.
 10:30am Workshops  Auditorium: “Stopping Robot Failures” by Hans Wolf  Room 308: “FTC Awards and How to Win Them” by Steve Willingham  11:15am Workshops.
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.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Istituto Tecnico Industriale A.Monaco EURLAB Object Detection Object Detection by Ultrasonic How to install and program a ultra sonic sensor with Arduino.
SERVICE TRAINING EXPERT ALPHASTAR 1132 © MAO-SE-TC 1132_SE_EX_Handout_EN_12_  Collision protection switch  Collision protection switch retrofit.
Creating Flexible, Script-Controlled Autonomous Software Example Explanation.
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?
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.
Application Case Study Christmas Lights Controller
Introduction to Programming in RobotC
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Using Arduino to modify RC controls Nick Carter 12/31/2015
Deriving Consistency from LEGOs
ROBOTC for VEX On-Site Professional Development
Touch Sensor.
Electrical Engineer Responsibilities
Automation and Robotics
Programming Part 2 Mod Kit
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Electronic Automatic Transmissions
2010 LabVIEW Intermediate Workshop
Automation and Robotics
Sasha Popov November 16, 2018 iRobot Create.
Motorization Site and Troubleshooting Tips
TECH 1 BAMS Technology Education
Copier Jam Detector Design Problem
P2.5.Mains Electricity AC and DC Current Cables and Plugs
Compiled from various Internet sources Presented by Mr. Hatfield
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
724 Temperature Calibrator
Presentation transcript:

2008 KOP IR Sensor Workshop January 12, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.

IR Board

Cautions Beware Hooking Power Up Backwards! Beware Hooking Power Up Backwards! –Safer to test with 9v battery first Beware Static Electricity! Beware Static Electricity! –Place on non-conductive surface (the bag it comes in is conductive) –Ground yourself while touching the board Compatible IR Remote Compatible IR Remote May need to test with several models of IR remotes to find a compatible frequency/protocol (universal remotes should work) A few H/W failures have been reported A few H/W failures have been reported –Failure to work at all –Partial operation –Broken while using

Training the IR Sensor Needed: Needed: –IR Remote, IR sensor board/cable, 9v battery, 2 alligator leads to connect the battery Learn: Learn: –Hold button down, add power, hold 2 secs, release LEDs LEDs –Error, cmd0, cmd1, cmd2, cmd3 s_and_Updates/2008_Assets/FIRSTIR%20- %20Instructions%20_ pdf

Wiring to Robot Controller 12v power & ground 12v power & ground –Go to breaker panel on robot--Recommend 9v battery to practice with (less chance of accidental damage) –+7-15v --Pins 1/2 –Ground --Pins ¾ –Possible to use fully charged 7.2v backup battery (4) RC Signal pins (4) RC Signal pins –Go to signal pins on Robot Controller –Cmd0 --Pin 8 –Cmd1 --Pin 6 –Cmd2 --Pin 5 –Cmd3 --Pin 7

Code Slow enough (.1 sec) to check from the slow loop (.026 sec)—active for 3 to 4 slow loops Slow enough (.1 sec) to check from the slow loop (.026 sec)—active for 3 to 4 slow loops Signals: Signals: –All 0’s if none are selected If using a separate 9v battery then they are all 1’s If using a separate 9v battery then they are all 1’s –All 1’s if nothing is connected or connection is loose –“1” if selected by IR remote, “0” if not selected –Save selection, don’t use signal pin directly—chance of half & half state and it will change while using it

Powering the IR Sensor Normally powered from a 12v breaker Normally powered from a 12v breaker Can be powered from the fully charged 7.2v backup battery Can be powered from the fully charged 7.2v backup battery If the voltage drops too low the IR sensor will stop operating If the voltage drops too low the IR sensor will stop operating Special Note when testing with a 9v battery: Special Note when testing with a 9v battery: –If 9v battery is used on a Robot Controller the input pins at rest will all register “1” (ground is not common) –If using the same 7.2v or 12v power as the Robot Controller the input pins at rest will register “0” (common ground) –So the code is slightly different for independent 9v battery testing

Coding Notes The IR sensor signal will start and last for 3 or 4 of our slow loops The IR sensor signal will start and last for 3 or 4 of our slow loops At the end of the signal there is a window where some pins can start to change & be in an intermediate state At the end of the signal there is a window where some pins can start to change & be in an intermediate state Capture the value of the pins all at once or when they first start to be received and you’ll avoid any half & half states Capture the value of the pins all at once or when they first start to be received and you’ll avoid any half & half states

Sample Code -- version 1 Checking individual pins char IR_cmd0=0, IR_cmd1=0, IR_cmd2=0, IR_cmd3=0; //declare as extern to use elsewhere // Can use a single “IR_cmd” variable to indicate the command received (1,2,3,4) // Can use a single “IR_cmd” variable to indicate the command received (1,2,3,4) void Process_Data_From_Local_IO(void) { static char latch=0; static char latch=0; if (latch == 1) if (latch == 1) { //**** Use this check when an independent 9v battery to power the IR Sensor //**** Use this check when an independent 9v battery to power the IR Sensor // if (rc_dig_in15 == 1 && rc_dig_in16 == 1 && rc_dig_in17 == 1 && rc_dig_in18 == 1) // **** Use this check when the Robot Controller 7.2v or 12v powers the IR Sensor // **** Use this check when the Robot Controller 7.2v or 12v powers the IR Sensor if (rc_dig_in15 == 0 && rc_dig_in16 == 0 && rc_dig_in17 == 0 && rc_dig_in18 == 0) // Normal common ground if (rc_dig_in15 == 0 && rc_dig_in16 == 0 && rc_dig_in17 == 0 && rc_dig_in18 == 0) // Normal common ground { latch = 0; // Avoid being caught by a half & half state of the IR sensor by taking the first change latch = 0; // Avoid being caught by a half & half state of the IR sensor by taking the first change } } else if (rc_dig_in15 == 0 || rc_dig_in16 == 0 || rc_dig_in17 == 0 || rc_dig_in18 == 0) else if (rc_dig_in15 == 0 || rc_dig_in16 == 0 || rc_dig_in17 == 0 || rc_dig_in18 == 0) { // Checking the pins individually like this can leave a window for the IR sensor to change in the middle { // Checking the pins individually like this can leave a window for the IR sensor to change in the middle // We avoid that problem by taking only the first change, but a better way would be to capture the pins all at once. // We avoid that problem by taking only the first change, but a better way would be to capture the pins all at once. //When the IR Sensor sends us a command it will stay steady for at least four or more times before the next change //When the IR Sensor sends us a command it will stay steady for at least four or more times before the next change IR_cmd0 = rc_dig_in15; IR_cmd0 = rc_dig_in15; IR_cmd1 = rc_dig_in17; IR_cmd1 = rc_dig_in17; IR_cmd2 = rc_dig_in18; IR_cmd2 = rc_dig_in18; IR_cmd3 = rc_dig_in16; IR_cmd3 = rc_dig_in16; latch = 1; latch = 1; }}

Sample Code Use – version 1 extern char IR_cmd0, IR_cmd1, IR_cmd2, IR_cmd3; void Default_Routine(void) { if (IR_cmd0 == 1) if (IR_cmd0 == 1) { pwm01 = 127; pwm01 = 127; pwm02 = 127; pwm02 = 127; } else if (IR_cmd1 == 1) else if (IR_cmd1 == 1) { pwm01 = 254; pwm01 = 254; pwm02 = 0; pwm02 = 0; } else if (IR_cmd2 == 1) else if (IR_cmd2 == 1) { pwm01 = 0; pwm01 = 0; pwm02 = 254; pwm02 = 254; } else if (IR_cmd3 == 1) else if (IR_cmd3 == 1) { pwm01 = 254; pwm01 = 254; pwm02 = 254; pwm02 = 254; }}

Sample Code – Better Version Grabbing all the pins at once Void Default_Routine(void) { static char latch=0; static char latch=0; unsigned char sensorReading; unsigned char sensorReading; //**** Check the IR Sensor for a new command //**** Check the IR Sensor for a new command sensorReading = PORTJ>>4; // Combined digital inputs sensorReading = PORTJ>>4; // Combined digital inputs if (latch == 1) if (latch == 1) { if (sensorReading == 0) if (sensorReading == 0) { latch = 0; // Take only the 1st reading to avoid latch = 0; // Take only the 1st reading to avoid // being caught by a half & half state of the IR sensor // being caught by a half & half state of the IR sensor } } else if (sensorReading != 0) else if (sensorReading != 0) { latch = 1; latch = 1; if (sensorReading == 8) IR_cmd = 1; if (sensorReading == 8) IR_cmd = 1; else if (sensorReading == 4) IR_cmd = 4; else if (sensorReading == 4) IR_cmd = 4; else if (sensorReading == 2) IR_cmd = 2; else if (sensorReading == 2) IR_cmd = 2; else if (sensorReading == 1) IR_cmd = 3; else if (sensorReading == 1) IR_cmd = 3;} switch(IR_cmd) switch(IR_cmd) case 1: case 1: pwm01 = 127; pwm01 = 127; pwm02 = 127; pwm02 = 127;break; case 2: case 2: pwm01 = 254; pwm01 = 254; pwm02 = 0; pwm02 = 0; break; break; case 3: case 3: pwm01 = 0; pwm01 = 0; pwm02 = 254; pwm02 = 254; break; break; case 4: case 4: pwm01 = 254; pwm01 = 254; pwm02 = 254; pwm02 = 254; }}

Potential Use Four Commands ONLY (but can be a different set each match) Basic Drive Control: Basic Drive Control: –forward, reverse, left, right –forward, left, right, raise arm to hit ball –Left, right, arm up, arm down Autonomous Assist: Autonomous Assist: –Trackball position-left / center / right –Trigger to hit ball –Stop current action and go to next pre-programmed act Driver Assist: Driver Assist: –Signals to help herd ball on far side of field, make turns, negotiate traffic jams

Issues Range of IR Remote (power) Range of IR Remote (power) Duplicate IR remotes/protocols/buttons Duplicate IR remotes/protocols/buttons Repeat or once only IR signal Repeat or once only IR signal –Repeat will case more interference –Once only may be hard to drive by IR Interference with partners and opponents IR Interference with partners and opponents –Coordinate w/ Alliance partners –May get through less frequently or not at all Sensor blocked from Robocoach at times Sensor blocked from Robocoach at times –Turn is 180 degrees –Center wall may reflect IR

Suggestions Make sensor directional, E.g., tube Make sensor directional, E.g., tube Closer / more power can override interference Closer / more power can override interference Plan for the IR commands to fail and still have your robot accomplish something during Hybrid, e.g., Plan for the IR commands to fail and still have your robot accomplish something during Hybrid, e.g., –Basic auto command to drive straight to get the first 4 points –Further action commanded by Robocoach at far end controlling the turn and backstretch Shield sensor from overhead ambient light Shield sensor from overhead ambient light Watch the FIRST Q&A for rulings that change things Watch the FIRST Q&A for rulings that change things

Alternatives Can modify the IR sensor to another frequency by replacing the sensor Can modify the IR sensor to another frequency by replacing the sensor Can use a different technology within the rules, e.g. no lasers, to send your four commands to the robot during Hybrid Mode Can use a different technology within the rules, e.g. no lasers, to send your four commands to the robot during Hybrid Mode –Visible light –Sound Replacement Replacement Equivalent TinyIR2 Equivalent TinyIR2 – remote-control-receiver.htm remote-control-receiver.htmhttp:// remote-control-receiver.htm

Lap Counter Mounts on your flag holder-- The top of the holder must be 51” high Mounts on your flag holder-- The top of the holder must be 51” high 180 degree horizontal arc around the top of the flag holder must be kept clear within a 2-inch radius and be uncovered and visible from above. 180 degree horizontal arc around the top of the flag holder must be kept clear within a 2-inch radius and be uncovered and visible from above. The LAP INDICATOR is powered via a standard three-wire PWM cable. An easily accessible, powered, male PWM connector must be located at the top of the flag holder The LAP INDICATOR is powered via a standard three-wire PWM cable. An easily accessible, powered, male PWM connector must be located at the top of the flag holder Distributed for each match Distributed for each match Details at Details at