Labview Presentation - Heroes of Tomorrow

Download Report

Transcript Labview Presentation - Heroes of Tomorrow

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
Software Overview
Developing Programs (C/C++)
• 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 Overview
Developing Programs (C/C++)
Software Overview
Developing Programs (LabVIEW)
• 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 Overview
Developing Programs (LabVIEW)
Software Overview
The WPI Robotics Libraries
• 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 Overview
The 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 …
Software Overview
The WPI Robotics Libraries
• 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 Overview
The WPI Robotics Libraries
• 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 Overview
The WPI Robotics Libraries
Worcester Polytechnic Institute
Software Overview
Deploying and Debugging
• 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 Overview
Deploying and Debugging
• 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 Overview
Deploying and Debugging
• cRIO Serial Port: 9600 Baud
– PC Terminal: Hyperterm, Tera Term, …
• http://www.logmett.com/forum/index.php
– RS232 Crossover Cable
Or
– Firefly Bluetooth “Cable”
Software Overview
Firefly Bluetooth Serial Adapter
• 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 Overview
Firefly Configuration
• 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 Overview
cRIO Imaging Tool
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 Overview
cRIO Imaging Tool
Software Overview
The Dashboard
• 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 Overview
The Dashboard
Software Overview
LabVIEW or C++ ??
• 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 Overview
LabVIEW or C++ ??
• 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 Overview
LabVIEW or C++ ??
• 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 Overview
LabVIEW or C++ ??
• 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 Overview
LabVIEW or C++ ??
• 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 Overview
References
ISBN 0-596-00983-6
ISBN 0-13-185672-3
Software Overview
References
ISBN 0-201-72148-1
ISBN 0-201-37926-0
Software Overview
References
ISBN 0-13-110370-9
ISBN 0-201-53992-6
Software Overview
Links
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 Overview
Recommendations
• 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 Overview
Robot Operating Modes
• 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