2009 Control Systems Fly By Wire & Autonomous Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 Upper Darby Kickoff Jan. 2009.

Slides:



Advertisements
Similar presentations
Introduction to Programming
Advertisements

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.
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.
ENGG1100 Introduction to Engineering Design Omni-wheel Car Additional Documentation.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
Team 5220 Roboknights. Outline  Getting Started  Hardware Setup/Wiring  Software Setup/Pragmas  Programming with RobotC  Grammar/Syntax  Basic Statements.
So you want to be a programmer!!!! Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 Philadelphia PA, Dec
Photos and Sensor Instructions
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.
Homework Any Questions?. Statements / Blocks, Section 3.1 An expression becomes a statement when it is followed by a semicolon x = 0; Braces are used.
EBOT: Programming Primer Sean Donovan Alexander Hecht Justin Woodard.
Programming – Touch Sensors Intro to Robotics. The Limit Switch When designing robotic arms there is always the chance the arm will move too far up or.
RobotC For Beginners Tyler Lutz and Keaton Bonds DRSS Enterprise.
ROBOTC Software Introduction. ROBOTC Software ROBOTC developed specifically for classrooms and competitions Complete programming solution for VEX Cortex.
FRC Java for Robotics Introduction Team 1279 ColdFusion January 8, 2011.
2010 Control Systems All we are saying… …is give C a chance! Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 Radnor PA, Dec
ROBOTC for VEX On-Site Professional Development
Coding for the FIRST Tech Challenge: RobotC
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
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.
Intro to Arduino Programming. Draw your circuits before you build them From Arduino 330 Ohm From Arduino 330 Ohm From Arduino 330 Ohm.
FTC New Platform Programming Workshop in Android Studio
ROBOTC Training Session 1 Timothy Friez 1/10/08 Revision 1.
EasyC Programming Workshop January 30, 2008 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
2010 Control System Writing and Reading the cRio Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 First 2010 Kickoff, Jan
Mechanics of LabVIEW Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Default_Routine(); - PWM Mapping /******************************************************************** * FUNCTION NAME: Default_Routine * PURPOSE: Performs.
Java Programming The Ponytail Posse - FTC #8808 9/12/15.
FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics.
Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury
Session 12 Sensors and Timers. 3 Main Types of Robot Projects Command-Based Robot A more complicated project for more complicated robots Iterative Robot.
Session 11 Intro to FRC API.
How to Use EV3 Lessons. OVERALL STRUCTURE Beginner Lessons: These lessons will teach you to move and turn the robot, use the sensors, and use loops and.
CSC 107 – Programming For Science. Science Means Solving Problems  Physics – How does an atom work?
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Programming with LabVIEW Intro to programming and.
Vex Robotics program three: using motors and sensors together.
Innovation First Hardware & Default Program The 5¢ Tour... Dr. Joe January 5, 2002.
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.
Creating Flexible, Script-Controlled Autonomous Software Example Explanation.
Project Overview  Introduction  Clawbot Build  Design Modification  Design Development  Programming  Sensors  Advanced Sensors  Open design challenges.
Get your software working before putting it on the robot! Example Explanation.
Programming Design ROBOTC Software. Behavior-Based Programming A behavior is anything your robot does –Turning on a single motor or servo Three main types.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
2015 FRC roboRio C++ and JAVA
Introduction to Programming in RobotC
Variables and Functions
OpModes in FTC Eric Golde.
Variables and Functions
Advanced EasyC Jim Cline July 20-21, 2017.
Project Overview Introduction Clawbot Build Design Modification
Config File and Robot Telemetry Implementation
ADVANCED BRAIN Training
Programming Part 2 Mod Kit
Variables and Functions
Programming – Touch Sensors
Variables and Functions
Variables and Functions
Variables and Functions
Variables and Functions
Variables and Functions
Omni-wheel Car Additional Documentation
Training 11/11/16 Robot Code (WPILib).
Homework Any Questions?.
Programming - Buttons Intro to Robotics.
Programming - Buttons Intro to Robotics.
Presentation transcript:

2009 Control Systems Fly By Wire & Autonomous Presented By: Frank Larkin Lansdale Catholic Robotics, Team 272 Upper Darby Kickoff Jan. 2009

Development Cycle Joy Pain  Time – Lots Of It! A brief moment of optimism usually followed by a crushing downfall! Warning: DO NOT BE FOOLED!

Big Al says…

Goals Get you to another room if you think this is a beginner’s seminar. Get you to understand the Iterative Robot. Get a good understanding of multi file programming Get a good understanding of Wind River. –How to edit, debug and load new code via Flash or FTP to the robot. Learn how to make disabled mode your friend Learn how to get autonomous working Presentation and files located at…

C vs C++ A few changes have to be taken into consideration –File extensions end in.cpp and.h –C++ can use classes Bundle all of a things, things into a single thing. –Example: a joystick has, X, Y & Z variables and many buttons. Joystick->GetX(); You can get to those “things” if they are public or they can br private. You then use methods to set values, get values. start processes, stop processes etc. compressor->start(); –3 Requirements to use variables Create –Servo *my_servo; Initialize –my_servo = new Servo(5); Use –my_servo->Set( my_leftStick->GetZ() ); Bad form for C++ –Servo *my_servo= new Servo(5);

C vs C++ Pointers vs Local Declarations –Pointers – References to things in memory Possibly looks cleaner How most examples are being done. –Declarations – The things in memory No need for pointers but a little more complicated –Why do I care? You will see code described both ways. Do not be afraid embrace them. Declaration Section: class IterativeDemo : public IterativeRobot { // Declare variable for the robot drive system Servo *p_servo; } Note: * means this is a pointer! Initialization Section: IterativeDemo(void) { printf("IterativeDemo Constructor Started\n"); p_servo = new Servo(5); } Usage: p_servo->Set(.50); p_servo->Set(p_leftStick->GetZ());

Discoveries Floating point power ranges –Stated as range is -1.0 to 1.0 with 0.0 being stop. Declare: Victor p_LeftWinch;// pointer Initialize: p_LeftWinch = new Victor(2); Use: p_LeftWinch->Set(0.0); // stop –Forward and Back are relative 2 motors side set to (1.0) are running at full power. But what direction? –All relative to the motors position. –Turn one around who is forward and who is back. –Joysticks Y axis Backwards to what you might think? Push forward get a value of Pull back get 1.0 Invert (reverse) for use f_WinchPower = -(p_joystick->GetX()); –Opposite motors driving in same direction. One is reversed f_WinchPower =.50; p_RightWinch->Set(f_WinchPower); p_LeftWinch->Set(-f_WinchPower);

Discoveries Using Wind River –Put all you variables into a structure. Then the intellisense works. typedef struct { Victor *p_FrontLeftMotor; Victor *p_FrontRightMotor; Victor *p_RearLeftMotor; Victor *p_RearRightMotor; Joystick *p_RightDriverStick; Joystick *p_LeftDriverStick; int i_FrontSonar; float f_FrontLeftMotor; float f_FrontRightMotor; float f_RearLeftMotor; float f_RearRightMotor; }struct_robotVars; struct_robotVars my;

Multi File programs Allow for collaborative effort –Multiple developers taking different roles –Separate files Start with place holder functions AutonomousPeriodic() { printf(“Auton Periodic: see Jim\n”); } Developed and tested separately added to final project Use.h files to expose variables to others –START_ROBOT_CLASS Main entry point of program in cRIO. In Multi file approach move from.h file to main.cpp file. Prevent multiple instances of this function

What is fly by wire? No operator direct control of output –Inputs are processed before going to outputs Something puts in input to variables –CBU (carbon based unit) via Joy Stick my.f_LeftDrive = my.p_LeftStick->GetY(); my.f_RightDrive = my.p_RightStick->GetY(); –SBU (silicon based unit) via autonomous program my.f_LeftDrive = 0.50; my.f_RightDrive = 0.50; Variables are processed –Changes made depending upon other input my.f_LeftDrive = gyroCorrect(my.f_LeftDrive); my.f_RightDrive = gyroCorrect(my.f_RightDrive); if( sonar < 80) my.f_LeftDrive = my.f_RightDrive = 0.0; Variables drive the output –Variable set final output motors or switches my.p_LeftMotor = my.f_LeftDrive; my.p_RightMotor = my.f_RightDrive;

IterativeDemo2 Functions GetDSInputs –Get Driver station inputs and set to variables Condition inputs for everyone else to use –Reverse sticks –Convert analog to digital GetRobotSensorInputs –Get inputs from Robot Sonar, contact switches RobotThink –Process the inputs ProcessOutputs –Update the variable to outputs

Basic Idea – Giant Loop Teleop code is looped through when in teleop mode. TeleopPeriodic() { GetDSInputs(); GetRobotSensorInputs(); RobotThink(); ProcessOutputs(); } Autonomous code is looped through when in Autonomous mode. AutonomousPeriodic() { GetRobotSensorInputs(); AutoProgramx(); // set vars RobotThink(); ProcessOutputs(); }

DisablePeriodic Use Disable Mode to test and setup for run –Check sensors (sonar) Use DS LED to see if sonar is working. –Select Auto Program to Run Use joystick buttons to set mode Use trigger to increment program counter. Use DS LEDs to see what program is selected #defines set limits Other possible tests –Is joystick zeroed? –Is gyro working? –Set an autonomous delay

Autonomous Basics AutoStatus structure –Keeps all Auto vars together autoStatus.Program –What program should run? Use switch statements to select program. select(autoStatus.Program) { case 1: autoProgram1(); break; case 2: autoProgram2(); break; case 3: autoProgram3(); break; } Note: autoPrograms can be in separate files.

Autonomous State Machine autoStatus.step –What am I doing now Parts of a step –Initialize Set up the step to be performed Set flag indicating setup done. –Perform Step Change variables to make something happen –Test to see if step is complete Did I go far enough? Is a wall is in front of me? Is the timer up? –Cleanup Unset setup done flag Bump step

Final Thought Unlike baseball crying is allowed in software development… but … …when your done, get back and make it work!