FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics.

Slides:



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

Apple Pi Robotics Logic System and Programming Basics 1 1.
Alpha Control System TheRobettes.com.
US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
Robot Code MVRT 2010 – 2011 Season. Robot code controls the robot Robot Main.vi –Calls all the smaller SubVis Rules of programming the robot –Be careful.
Session Objectives: Review basic math for single swerve module
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.
Add and Use a Sensor & Autonomous For FIRST Robotics
Jeff Beltramo NHTI-Concord’s Community College FRC Team 1922.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
1. 2 FRC 2010 Driver Station Doug Norman & Stephanie Brierty National Instruments January 8, 2010 Thanks to Joe Ross – Team 330.
Programming and Electronics Training
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.
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.
FRC LabVIEW Software Overview Joe Hershberger Staff Software Engineer National Instruments.
Vex 1.0 © 2005 Carnegie Mellon Robotics Academy Inc. Programming in easyC.
An Intro to Robots and Computer Programming
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
IR SENSORS AND ENCODERS. LCDs Timothy Friez Class # 2.
How to Use This Training Deck
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Driver Station MVRT 2009 – 2010 Season. Add information Breadboard Classmate PC USB Hub Joysticks Stop Button.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
Program ultrasonic range sensor in autonomous mode
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
Coding for the FIRST Tech Challenge: RobotC
Programming and Controls for FIRST – The Basics Tom Barch, Scott VanBrocklin and Kayla Peltier February 5 th, 2008.
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.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
FRC Robot Framework Labview Made Easy (er) For FIRST Robotics 1.
EasyC Programming Workshop January 30, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
1. 2 FRC 2010 Robot and Dashboard Projects Doug Norman & Stephanie Brierty National Instruments January 8, 2010.
Mechanics of LabVIEW Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
An Objective and Component View (Not included Drive: Balance and Turret: Axis Camera)
Default_Routine(); - PWM Mapping /******************************************************************** * FUNCTION NAME: Default_Routine * PURPOSE: Performs.
Part II Introduction to Robot Code. How to open a new FRC robot project 1.Open LabVIEW. 2.Click "FRC cRIO Robot Project" in the upper left section "New".
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.
Part III Robot Drive. Robot Main.vi The main body of your code: accesses all of the other programs in your project A big loop! Do not add any more loops.
Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury
Session 11 Intro to FRC API.
Electronics and Controls
Cr yptonite robotics labview beta findings December 19, 2015.
By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
RobotC Remote Control. Learning Objectives: Focusing on Virtual World with Physical Examples Understand Real-Time Joystick Mapping Understand how to use.
ROBOTC Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
VAFIRST LabVIEW Workshop 11/19/11 Presenters: Marin Kobin & Patrick Foley.
Creating Flexible, Script-Controlled Autonomous Software Example Explanation.
Get your software working before putting it on the robot! Example Explanation.
OpModes in FTC Eric Golde.
Exploring Computer Science Lesson 6-5
EE 200 Design Tools Laboratory 14
By Sanjay and Arvind Seshan
Programming Scratch to Control a K’NEX Fairground Ride
Learning Objective: to be able to design programs that use sequencing.
Doing some Boolean: On/Off
Sensors Training.
Exploring Computer Science Lesson 6-5
Training 11/11/16 Robot Code (WPILib).
INTERMEDIATE PROGRAMMING LESSON
Remote Control For this activity we will use the Squarebot
frclabviewtutorials.com/workshop
Advanced LabVIEW
Advanced LabViEW
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics

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

Where We Left Off: Read Gyro And PID Control Of Steering Correction In Autonomous  Get Gyro Refnum, Get Gyro Angle  Set Timer of loop (30ms used here)  Add PID function block 1.Setpoint – set to 0 to drive straight forward 2.Connect Gyro output as Process variable input to PID 3.Limit output range 4.Set PID gains 5.Connect output to X input to arcade drive (Steering)

The PID Function Block  Set-point  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

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. (or one bounce?) 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

Tuning the PID Hands on example of trial and error

Downloading Vs. Deploying Code When developing code it is convenient to run the code right from the lap top by pressing the single arrow in the top left of the Robot Main Front Panel VI and “downloading” it from the laptop. You must first be connected to the robot through the driver station (Prior session) f you get a ‘Conflict Resolution” message – it is ok – it only means that you will be overriding the code previously deployed to run at the start-up of the robot. Sometimes you get another warning that will require you to reboot the robot and try again.

Once code is developed it is then desirable to Deploy it to the cRio to run onboard the robot. This is required for competition. To Deploy: 1.On Project Explorer, right click on: “Build specifications” and select: New / Real Time Application 2.On source selection screen, Select Source Files, Then select Robot Main, and by clicking arrow add it to the “Startup.Vi’s”, then press “Build” 3.Once Build is complete – right click on this latest “Real Time Application” and select “Run at Start-up” 1.This deploys the compiled code onto the cRio, The robot should be connected by Ethernet cable for this step. 2.If you get a “Conflict Resolution” message – it is ok it means you will be replacing the existing code loaded on the cR io. 3.If you get a message that you cannot say ok to - you probably need to reboot the robot and try again. 4.Once deployed it will ask to reboot the robot – say yes. 1.Once rebooted it will be running your code on the cRio. Deploying the Code to the Robot

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 a)Open Dashboard Project, Modify to display Gyro angle on a gage (follow Labview tutorial number 7) b)Modify Robot code Tele-op to send data to dashboard (also part of Labview tutorial) DashboardMain.vi Front Panel:

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

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

Sequence While Loops After Each Other Set Time (= # Iterations) For Each Step In this case each is 100 iterations or 3 seconds.

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

Program a Robot From its Functional Spec Start with a list of components and how connected Apple Pi Robot: Mantis 2012 Robot Control System Data Connection Spreadsheet I/O Type Actuator/Sensor AIO DIO PWM Relay Pneumatic I/O Port If Actuator, controlled by : If Sensor, used to control: Left rear drive motorPWM1Joy1 axes 1&2 Right rear drive motorPWM2Joy1 axes 1&2 Right Front drive motorPWM1Joy1 axes 1&2 Left Front drive motorPWM2Joy1 axes 1&2 Lower Harvester MotorPWM3Joy2 button 7 Upper Harvester MotorPWM4Joy2 button 8 Shooter Motor1PWM5Joy2 button 1 Shooter Motor2PWM5Joy2 button 1 Ramp Knockdown Device MotorPWM6Joy2 Axes 2 Encoder Left drive 1DIO1Auton Drive Encoder Left drive 2DIO2Auton Drive Encoder Right drive 1DIO3Auton Drive Encoder Right drive 2DIO4Auton Drive Upper Limit switchDIO5Knockdown Device Lower Limit switchDIO6Knockdown Device Upper Harvester IR SensorAIO1Harvester motors Middle Harvester IR SensorAIO2Harvester motors Lower Harvester IR SensorAIO3Harvester motors Tech Tigers Robot: Tiogar 2012 Robot Control System Data Connection Spreadsheet I/O Type Actuator/Sensor AIO DIO PWM Relay Pneumatic I/O Port If Actuator, controlled by : If Sensor, used to control: Left rear drive motorPWM1Joy1 axes 1&2 Right rear drive motorPWM2Joy1 axes 1&2 Right Front drive motorPWM1Joy1 axes 1&2 Left Front drive motorPWM2Joy1 axes 1&2 Accessory Motor 1PWM3Joy2 button ? Accessory Motor 2PWM4Joy2 button ? Upper Limit switchDIO1 Lower Limit switchDIO2 Pressure SwitchDIO3 Compressor SpikeRelay1 Solenoid 1Pneum1 Solenoid 2Pneum2 Solenoid 3Pneum3

Program a Robot From its Functional Spec Start with Drive Functionality Base code may have most of this – may need to replace 2 motor with 4 motor In Begin Open 2w Drive or 4w Drive, set Refnum, set correct PWM #’s Open Joystick, Set Refnum In Tele-op Get Refnum, Get Joystick Axes Get Refnum, Set Arcade Drive Connect X & Y axes to the Arcade drive inputs Test & Debug this portion

Program a Robot From Its Functional Spec Next what do the other motors do, and how are they controlled? In Begin Open motors, set Refnum, set correct PWM #’s Open 2 nd Joystick (?), set refnum In Tele-op Get Refnum, Get Joystick2 Axes and/or Buttons Get Refnum, Set motor If using Buttons, need to add a case structure changing motor input from 0 if False to “Value” if On Test & Debug this portion

Program a Robot From Its Functional Spec Next Incorporate the Limit switches to their functions.? In Begin Open DIO(s), set Refnum, set correct PWM #’s In Tele-op Get Refnum, Get DIOs: read true (on) or False (off) Set up case structure(s) to set motor(s) to zero if limit switch is true Test & Debug this portion

Program a Robot From Its Functional Spec Look for Pneumatic Examples

Program a Robot From Its Functional Spec Automate the Harvester: 1.Two harvester rollers – can be independently turned on and off 2.3 IR Sensors can detect if ball is in front of them (On or Off = True or False) Set up a “truth table” Determine what you want the rollers to do based on what the sensors see. Three IR sensors used to detect presence of Ball 1 2 3

Automation Truth Table sets up a “State Machine” Truth Table for Mantis Auto Harvester Desired behavior is that when Auto harvester engaged - it will collect 3 balls and have them ready for shooting. Lower IR SensorMiddle IR SensorUpper IR SensorLower Harvester MotorUpper Harvester Motor This table tells us how we want the harvester to behave in response to the sensor readings.