2009 frc control system software overview dave doerr, mentor, team 67 november 15, 2008

32
2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Upload: tyler-matthews

Post on 12-Jan-2016

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

2009 FRC Control System

Software Overview

Dave Doerr, Mentor, Team 67

November 15, 2008

Page 2: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software Overview• Developing Programs (C/C++)• Developing Programs (LabVIEW)• WPI Robotics Libraries• Downloading and Debugging• The cRIO Imaging Tool• The Dashboard• Choosing LabVIEW or C++• References• Recommendations• Robot Operating Modes

Page 3: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Developing C/C++ Programs– WindRiver Workbench 3.0 Eclipse-based Embedded

Software Toolset• Software Project Management• Editor• Debugger• GNU C++ Compiler for PowerPC32• Console Terminal• FIRST Downloader

– Default Robot Code: Arcade/Tank Drive– Other Example Code: Gyro, Vision

Software OverviewDeveloping Programs (C/C++)

Page 4: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewDeveloping Programs (C/C++)

Page 5: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Developing LabVIEW Programs– LabVIEW 8.5, FRC Edition 2009

• National Instruments “G” Programming Language• LabVIEW Projects• Debugging via .vi Front Panel

– Default Robot Code: Arcade/Tank Drive– Other Example Code: Gyro, Vision…

Software OverviewDeveloping Programs (LabVIEW)

Page 6: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewDeveloping Programs (LabVIEW)

Page 7: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Software Development Cycle– Create Source Code– Build and Download Executable to RAM– Run and Debug

• LabVIEW Input/Output Available on vi Front Panel• C++ WindRiver Debugger• C++ Output Available in Console

– Download Debugged Executable to Flash– Reboot cRIO

• Power Cycle or CTRL-X in Terminal

– Run

Software OverviewThe WPI Robotics Libraries

Page 8: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewThe WPI Robotics Libraries

• An extensive set of high-level control system building blocks to make robot programming easier.

• Most of the work of interfacing to robot components is already complete.

• Sensors, Actuators, IO, Driver Station, Utilities• Open Source

– Library can be used as-is in “black box” mode.– Library can be customized.– To be further developed by the FIRST-community

• Default Robot: Run out-of-the-box• Default Dashboard• Demo Programs: Gyro, Vision, Tracking …

Page 9: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Sensors– Accelerometer, Encoder, Gear Tooth, Gyro, Compass, I2C,

Ultrasonic

• Actuators– Compressor, Motor (Victor, Jaguar), Relay, Servo, Solenoid

• I/O– Analog Channel, Analog Trigger, Digital Input, Digital Output,

PWM

Software OverviewThe WPI Robotics Libraries

Page 10: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Driver Station– Joystick (Complete set of Axes and Buttons), Analog Input,

Digital Input, Digital Output, Driver Display, Mode, Alliance, Battery Voltage, Dashboard

• Utility– Counter, PID, Drive (Tank, Arcade, Holonomic), Time, cRIO

LED, cRIO Temperature

• Vision– Camera, Tracking, Image Processing

Software OverviewThe WPI Robotics Libraries

Page 11: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewThe WPI Robotics LibrariesWorcester Polytechnic Institute

Page 12: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Deploying (temporary)– Code is loaded to cRIO RAM and run by:

• White Arrow (LabVIEW)• Run Kernel Task ( C/C++, WindRiver WorkBench)

• Deploying (permanent)– Code is loaded to cRIO flash memory by:

• Set as Startup (LabVIEW)• FIRST >> Download ( C/C++, WindRiver Workbench)

– Code will automatically run on cRIO reboot.

• Undeploy (delete permanent code)– Code is erased from cRIO flash memory by:

• Unset as Startup (LabVIEW)• FIRST >> Undeploy ( C/C++, WindRiver Workbench)

Software OverviewDeploying and Debugging

Page 13: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Debugging (LabVIEW)– Controls and Indicators can be used to provide real-time input

and output on a VI Front Panel

• Debugging ( C/C++, WindRiver WorkBench)– Debug Kernel Task– Console Output (printf) via ethernet (wired or wireless)

• Console Output via cRIO Serial Port– Diagnostic output can be sent to the cRIO serial port and viewed

in a another window or on another computer. The connection to the serial port can be wired or bluetooth.

– cRIO Console Output Switch set to ON

Software OverviewDeploying and Debugging

Page 14: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• cRIO Serial Port: 9600 Baud

– PC Terminal: Hyperterm, Tera Term, …• http://www.logmett.com/forum/index.php

– RS232 Crossover CableOr

– Firefly Bluetooth “Cable”

Software OverviewDeploying and Debugging

Page 15: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Class 1: 100m Range– Works with Class 1 or Class 2 on PC– Class 1 Needed on PC for 100m Range

• Operates on 5v from Power Distribution Board– Purchase Power Connector Plug (Radio Shack 274-1571)

• DB9 Connector– Female Preferred– Male Needs Gender Changer

• www.bluetooth-firefly.com– GC-BT-BLUEPORT DCE (female)

• www.sparkfun.com– WRL-08495, (male)

Software OverviewFirefly Bluetooth Serial Adapter

Page 16: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• cRIO serial port is DTE @ 9600 Baud– Set Switches 1,2,3 off and Switch 4 on

• Firefly should be configured as DCE– Male DB9 Connector Model

• Jumper Pins 1-3, 2-4, 6-8, 5-7

– Female DB9 Connector Model• Jumper Pins 1-3, 2-4, 5-6, 7-8

Software OverviewFirefly Configuration

Page 17: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Before use, the cRIO must be “imaged” by loading the VxWorks operating system, filesystem, FPGA code and the FIRST configuration files that determine whether LabVIEW or C++ will be used.

The cRIO Imaging Tool is used to “Image” and name the cRIO and set the cRIO IP address.

The tool is also used to select whether LabVIEW or C++ will be used for programming. This can be done at any time without re-imaging the cRIO.

Software OverviewcRIO Imaging Tool

Page 18: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewcRIO Imaging Tool

Page 19: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• A LabVIEW vi that runs on a PC that is connected to the Driver Station.

• Can display and analyze data from the robot.

• Can display and analyze images from the robot’s camera

• A default version is supplied, or a custom dashboard can be built by the user.

Software OverviewThe Dashboard

Page 20: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

Software OverviewThe Dashboard

Page 21: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• About LabVIEW– Laboratory Virtual Instrumentation Engineering Workbench– Dataflow Programming Language for Measurement and Automation– A Programming Environment– Specific Range of Use

• Data Acquisition• Instrumentation Control• Industrial Automation

– Functions are Virtual Instruments or VIs• Block Diagram• Front Panel• Connector Panel / Icon

– VIs can be debugged with real-time I/O on the Front Panel.

Software OverviewLabVIEW or C++ ??

Page 22: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• About LabVIEW– Hardware Support for Sensors, Actuators, etc.– Libraries

• WPI Robotics• Mathematics• Vision• Signal Processing• Data Communications• Signal Generation• Control (PID)

– Easy to create small programs–Skill needed to create large, complicated programs– Extra effort needed to document programs– National Instruments Proprietary

Software OverviewLabVIEW or C++ ??

Page 23: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• About C++ and WindRiver Workbench– Developed as an enhancement to C, “C with Classes”– A General Purpose Middle Level Language– Wide Range of Use

• Operating System• Embedded Controller• Server-Client (High Performance)• Entertainment Software (Video Games)• …

– WindRiver Workbench is a toolset to develop, build, debug and manage embedded software.

Software OverviewLabVIEW or C++ ??

Page 24: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• About C++ and WindRiver Workbench– Libraries

• WPI Robotics (including PID Control and Vision)

– Easy to create small programs– Skill needed to create large, complicated programs– ISO-ANSI Standard– Compilers available for purchase or as shareware

Software OverviewLabVIEW or C++ ??

Page 25: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Questions to Ponder

– Are you interested in software primarily as a means to an end, for example, to create a champion robot?

– Or are you interested in software for its own sake. Do you love programming and computers?

–Are you primarily interested in software engineering??

– Or are you primarily interested in another discipline that might involve testing, such as electrical or mechanical engineering?

Software OverviewLabVIEW or C++ ??

Page 26: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

ISBN 0-13-185672-3ISBN 0-596-00983-6

Software OverviewReferences

Page 27: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

ISBN 0-201-72148-1 ISBN 0-201-37926-0

Software Overview References

Page 28: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

ISBN 0-13-110370-9 ISBN 0-201-53992-6

Software Overview References

Page 29: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

http://forums.usfirst.org/

2009 Control System Information

2009 Control System Beta Test Public Forum

Learn about cRIO

Learn LabVIEW

WindRiver Workbench Evaluation

Learn C++

Software OverviewLinks

Page 30: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Spend time at http://forums.usfirst.org/• Download the WindRiver Workbench Evaluation and

learn how to use it.• Download LabVIEW from 2009 Control System

Information and learn how to use it.• Plan to try out both LabVIEW and C++/WindRiver

Workbench. The default code for both is easy to figure out if you Read the Directions.

• Pay the $60 and get your kit early.• Call us if you need help.

Software OverviewRecommendations

Page 31: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

• Disabled Mode: Before a match begins, robot outputs (motors) are not active. Robots can be programmed to initialize. Driver controls are active.

• Autonomous Mode: During the first 15 seconds of a match, driver inputs (joysticks) are not active. Robots can be programmed to use outputs (motors) and sensor inputs (encoders, gyros) for autonomous operation.

• Teleoperated Mode: During the remaining 120 seconds of a match, all inputs and outputs are active. Robots are programmed for driver control.

Software Overview Robot Operating Modes

Page 32: 2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008

?Software Overview