Add and Use a Sensor & Autonomous For FIRST Robotics

Slides:



Advertisements
Similar presentations
Apple Pi Robotics Logic System and Programming Basics 1 1.
Advertisements

US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
Session Objectives: Review basic math for single swerve module
KEB COMBIVERT F5-M Exercises.
Chapter 4: Basic Properties of Feedback
ME 322: Instrumentation Lecture 35 April 18, 2014 Professor Miles Greiner.
Jeff Beltramo NHTI-Concord’s Community College FRC Team 1922.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
LabView Basics.
Using the NXT Light Sensor. 2 Connect One Light Sensor – 1 From My Files use Left / Right NXT buttons and get to View menu and push Orange button. From.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
FRC LabVIEW Software Overview Joe Hershberger Staff Software Engineer National Instruments.
IR SENSORS AND ENCODERS. LCDs Timothy Friez Class # 2.
BEGINNER EV3 PROGRAMMING Lesson
How to Use This Training Deck
Applied Control Systems Robotics & Robotic Control
Driver Station MVRT 2009 – 2010 Season. Add information Breadboard Classmate PC USB Hub Joysticks Stop Button.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
Program ultrasonic range sensor in autonomous mode
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Droids Robotics Workshop
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008.
FRC Robot Framework Labview Made Easy (er) For FIRST Robotics 1.
LabVIEW Basics Review LabVIEW Robotics Fundamentals.
1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010.
David GiandomenicoFeedback Control for your FIRST Robot’s DrivetrainDec 2010 WRRF Workshops #1 David Giandomenico Team mentor for Lynbrook Robotics – Team.
Robot sensors MVRT 2010 – 2011 season. Analog versus Digital Analog Goes from 0 to 254 Numerous values Similar to making waves because there are not sudden.
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics.
Negative Power or Negative Rotation makes robot go backwards. But if both are negative, the robot will go forward! Move Steering Block.
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.
Session 12 Sensors and Timers. 3 Main Types of Robot Projects Command-Based Robot A more complicated project for more complicated robots Iterative Robot.
System A collection of parts that perform a function.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Touch Sensor.
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.
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.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Get your software working before putting it on the robot!
Creating Flexible, Script-Controlled Autonomous Software Example Explanation.
ROBOTC for VEX Online Professional Development. Homework Questions Thoughts? Questions?
Get your software working before putting it on the robot! Example Explanation.
NXT Mindstorms Kit Programming
ME 322: Instrumentation Lecture 35
Lecture 10 Sensors.
Deriving Consistency from LEGOs
ROBOTC for VEX Online Professional Development
ROBOTC for VEX On-Site Professional Development
By Sanjay and Arvind Seshan
Servos The material presented is taken from a variety of sources including:
EET 2259 Unit 3 Editing and Debugging VIs
FlowArm PLTW Programming
Control Loops Nick Schatz FRC 3184.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Servos The material presented is taken from a variety of sources including:
Doing some Boolean: On/Off
Sensors Training.
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER PROGRAMMING LESSON
Storing Values as Variables
BEGINNER PROGRAMMING LESSON
frclabviewtutorials.com/workshop
Advanced LabVIEW
Advanced LabViEW
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Getting started with LEGO EV3 Mindstorms software
Presentation transcript:

Add and Use a Sensor & Autonomous For FIRST Robotics FRC Robot Framework Add and Use a Sensor & Autonomous For FIRST Robotics

Sensors – Adding Intelligence and Enabling Automation Types of sensors: Limit Switches – on/off Gyro - provides Robot rotation angle position Potentiometer – like a volume control – can be used to control arm rotation Encoder - measures shaft rotation – robot distance, lift height Light sensors – detect object breaking beam Infrared - detect presence of object nearby Ultrasonic - detects distance to object – such as wall Camera (Vision) - Direct feed to dashboard, Targeting with vision processing Kinect (Camera + Infrared) – For Driver Station or on board robot? not used ….. yet…

Session Objectives: Discuss principles and applications for “Gyro” sensor. Bicycle wheel demo Incorporate “Gyro” into Autonomous code: Control Robot to drive in straight line Open Gyro in Begin.vi Get Gyro Angle Tele-op.vi display on Front Panel Next use Gyro reading as “Feedback” to tell if robot is driving straight (at angle specified) PID control

FRC Project Browse to find your last code (or open new) Navigate to the Robot Main block diagram Then select Begin Go to Block Diagram

Begin .vi Updated for adding Gyro Edit vi: Add an accessory motor: Open function palette and select: WPI Robotics Library / Sensors / Gyro Add Open Gyro .vi Identify where plugged in Add Refnum Set.vi Give it a name

Open the “Autonomous VI” Remove diagram disable Put cursor on edge of disabled structure, right click and select “Remove Diagram Disable Structure” Delete the last 2 while loops After noting what the default code is intended to do A method of sequencing operations in autonomous that we may return to

Set up a While Loop in Autonomous In remaining While Loop: Enlarge, create space to add Gyro and PID functions Change length of time to 5 seconds Each loop is 50 ms, 100 loops = 5 secs. Change motor inputs to 0 For now

Modify Autonomous.VI to Read Gyro From WPI Robotics Library/ Sensors/ Gyro palette Bring the Refnum Get and provide name it was given in the Begin.vi Bring Gyro Get Output vi and connect them Put cursor on “angle” output, right click, select, create indicator Indicator shows up on Front Panel Digital indicator is default but can be replaced with a Dial or Linear Indicator

Modify Front Panel Indicator for Gyro reading Put Cursor on indicator, right click and select “Replace”, then “Gauge” Enlarge gauge by dragging diagonally Click on the 10 and change to: 180 Click on the 0 and make it: -180 Hover on the 180 until you see the rotation arrows – then drag the 180 around to the -180.

Test the Code See if in Autonomous the Gyro is being read Next: Lets use it for an Autonomous code With “Feed-back” control

Feed-Back Control Open Loop: Examples: In an (older) car: turn heater knob to high Heater turns on and stays on until the driver gets too hot and manually turns it down Robot Harvester(2012): Operator holds button to turn harvester motor, watches until sees ball move up and then releases which stops motor Controller Robot

Feed-Back Control Closed Loop Examples: In a (newer) car: turn heater knob to 70oF Heater goes on until the thermostat (sensor) reads that it is 70oF , then automatically turns it off until it gets too cool, then back on, etc. Robot Harvester: Operator presses button to start harvester motor Motor goes until on board light sensor “sees” ball – sends signal back to cRio Labview program then directs motor to stop Controller Robot Sensor Generally using it to see if a process is complete, then stabilize

PID Control PID stands for Proportional-Integral-Derivative A method of closed loop feedback control A way of using what you know from your sensors to compute an “intelligent” motor output. Proportional – P – looks at difference between desired position and actual and sets motor speed to close gap proportional to that gap Incorporates the idea that you need to slow down as you get close so you don’t overshoot the target.

The PID Function Block Set-point Process variable Desired value to get to Process variable Actual value as measured by a sensor Output determined by magnitude of difference (error) between setpoint and process variable PID Gains adjust sensitivity

Add: Read Gyro And PID Control Of Steering Correction Get Gyro Refnum, Get Gyro Angle Add PID function block Setpoint – set to 0 to drive straight forward Connect Gyro output as Process variable input to PID Limit output range Set PID gains Connect output to X input to arcade drive (Steering)

Suggested method for determining PID gains Method for Setting Values  Start with CP small and CI, CD both zero.  Raise CP until the robot is oscillating consistently around the target.  Once this is accomplished, start increasing CD until the robot stops oscillating.  Then add CI until the robot stops within a desired range of the target. Often we have only used the P, or PD

Next we will see if our code works!

Homework Challenge Slides Learn how to modify the Dashboard Make an autonomous Drive Sequence Drive a square pattern Learn to use the “examples” and be able to code a variety of sensors – including encoder

Modifying the Dashboard – Gyro Indicator Open Dashboard Project, Modify to display Gyro angle on a gage (follow Labview tutorial number 7) Modify Robot code Tele-op to send data to dashboard (also part of Labview tutorial) DashboardMain.vi Front Panel:

Incorporating Sensors – Gyro:: Open Dashboard Project, Modify to display Gyro angle on a gage (follow Labview tutorial) Modify Robot code Tele-op to send data to dashboard (also part of Labview tutorial) Follow Tutorials 4-7 Adds Gyro Opens Dashboard Project

Homework / Challenge # 2 Update the Autonomous code Add 3 sequential While loops (like in default disabled structure) Have robot go straight, turn 90 degrees, Repeat 3 times to drive in a square.

Homework / Challenge # 3 Add variety of sensors to Begin and Tele-op Use “Examples” as source to copy correct formats

Begin.VI - Open and name sensors

Tele-op.VI - Get values and display