FIRST Robotics LabVIEW Training -...

83
FIRST Robotics LabVIEW Training

Transcript of FIRST Robotics LabVIEW Training -...

Page 1: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FIRST RoboticsLabVIEW Training

Page 2: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

SECTION 1: LABVIEW OVERVIEW

Page 3: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming
Page 4: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

What is LabVIEW?

• It is a tool used by scientists and engineers to measure and automate the universe around us

• It is a graphical programming environment

– programming – it is a programming language and you won’t be an expert in a day or two

– graphical – you draw your code

– environment – it is more than measurement and automation, it has analysis and user interface capabilities created for scientists and engineers

• There is a learning curve, so plan to study it

Page 5: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

What is LabVIEW?

Examples of LabVIEW in the professional world

• LabVIEW controls the timing in the Large Hadron Collider

• LabVIEW tests the XBox console and controllers

• LabVIEW tests noise characteristics of Boeing planes

• LabVIEW is used for data acquisition more than C++, C#, or any other programming environment

• DARPA challenge video

Page 6: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming
Page 7: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

What is LabVIEW?

DARPA Video : http://www.youtube.com/watch?v=JclsrwSWzng&feature=related

Page 8: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

What is LabVIEW?

Page 9: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Learning LabVIEW

• Students will learn fastest by using LabVIEW

– Online tutorials provide a good start, but most will pick it up and learn faster than you can teach

• Adults need structured lessons

– www.ni.com/FIRST, LabVIEW Training

• Mini-modules for quick overviews of various LabVIEW features

• Use the support forums

– www.ni.com/FIRST, Community Support

– Most of your questions have been asked, and answered, several times

Page 10: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Installation• Install LabVIEW using the DVD provided to your team.

• Check ni.com/first, “Software Downloads” for updates

• Use your team’s serial number for activations.

• Activate on as many team computers as you need to complete the software programming. Obey the terms and conditions, limiting use to projects related to FIRST Robotics.

• To ensure teams are all on the same version at tournaments, the previous year’s version will expire in January of the following year.

• When your team receives the new DVD as part of your robot kit, install and use this new version.

– Uninstalling the old version is not required, but recommended.

• Troubleshoot installation and activation problems at ni.com/first

Page 11: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

LabVIEW Splash Screen

Check version forcurrent season

Page 12: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Using Examples

Splash Screen –

Examples –

More…

Page 13: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

New Programs

• Create a new program

– Splash Screen – Blank VI

Page 14: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel vs. Block Diagram

Page 15: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel

• User interface

• Input/Output to user

Block Diagram

• Program instructions

• Programming functions

Page 16: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel

Page 17: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel

Page 18: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel

Page 19: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Tools Palette

Automatic Tool Selection

Operate Value

Position/Size/Select

Edit Text

Connect Wire

Set/Clear Breakpoint

Probe Data

Set Color

Page 20: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Control Properties

Page 21: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Controls and Indicators

Controls Indicators

Page 22: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Front Panel Properties

Page 23: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Block Diagram

Page 24: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Wiring

Page 25: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Wiring

Page 26: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Wiring

Page 27: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Functions

• Categories

– Palettes

• Sub-palettes

Page 28: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Functions

Page 29: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Help Window

Page 30: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Wiring Functions

Page 31: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Wiring Functions

Page 32: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Running Programs

Page 33: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Structures

Page 34: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Create Control

Page 35: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

For Loop

Page 36: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Timing

Page 37: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Debugging

Page 38: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Data Flow

Page 39: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Sub VI’s

Page 40: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Arrays

Page 41: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Clusters

Page 42: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

SECTION 2: FIRST ROBOTICS TRAINING

Page 43: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

2. Understanding the hardware

• Architecture

• CompactRIO

• Programming approach

• FIRST version

Page 44: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FRC Topology

Page 45: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming
Page 46: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming
Page 47: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FRC System

LabVIEW Host Application

Access Point CompactRIO System

Ethernet

Programming Flow1. Develop CompactRIO Program using Laptop or Desktop2. Test/Debug across Ethernet3. Develop Windows Host Program4. Deploy Standalone cRIO code (build executable)5. Enjoy!

LabVIEW cRIO Application

Page 48: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Robot Control Hardware - CompactRIO

Page 49: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

• Reconfigurable FPGA for high-speed and custom I/O timing, triggering, control

• Processor for stand-alone operation and advanced floating-point analysis

• I/O Modules direct connection to industrial sensors/actuators

CompactRIO Architecture

Page 50: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

3. FIRST Architecture in LabVIEW• WPI Robotics

• FRC Robot Framework

• Dashboard Framework

Page 51: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Competition Flow

Autonomous Disabled Teleop Finish

Page 52: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

WPI Programming

All WPI Robotics Library Functions follow these steps:

• Initilize

• Get/Set values

• Close

Page 53: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

WPI Programming

Page 54: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

RefNums

Page 55: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

WPI Functions

• Functions for controlling motors, sensors, actuators, I/O, camera, driver station, and to perform other functions in the robot.

• All follow the same Open, Get/Set, Close process.

Page 56: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

RobotDrive

• Open 2- or 4- motor version

• Drive using Arcade, Tank, or Holonomic Drive

• Close Motor

• Use Joystick palette to read values from Joystick

Page 57: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Sensor

• Access sensors on your robot. Use these values to determine your robot’s next moves.

Page 58: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Actuators

• Use these VI’s to control additional motors and actuators on your robot to control arms, launchers, and other tools.

Page 59: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

I/O

• Send and receive analog and digital values on the cRIO, when other actuator and sensor VI’s don’t fit your application.

Page 60: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Camera

• Acquire images from the camera.

Page 61: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Utilities

• Several useful functions for low-level control of cRIO,

• Watchdog timer is an important set of VI’s for your robot.

Page 62: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Watchdog

• Shuts down robot in the event that your driver station loses communication with the robot.

• Requires that you periodically “feed” the watchdog to keep it from shutting down your robot.

• If you driver station shuts down, the watchdog is not fed and your robot turns off.

• Make sure you feed the watchdog or your robot will stop.

Page 63: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Driver Station

• Used to program the driver station and to pass data between driver station and robot.

Page 64: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Robot Project

• Create from splash screen

Page 65: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Robot Project

Page 66: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FRC Robotics Project

Page 67: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FRC Robot Front Panel

Page 68: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

FRC Robot Block Diagram

Page 69: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Begin.vi

Page 70: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Mode

Page 71: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

TeleOp Mode

Page 72: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Autonomous Mode

Page 73: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Timeout

Page 74: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Finish

Page 75: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Finish

Page 76: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Deploying the Robot Code

Page 77: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Dashboard Project

• Create from splash screen

Page 78: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Dashboard Project

Page 79: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Dashboard Project

Page 80: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Dashboard Front Panel

Page 81: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Dashboard Build

Page 82: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

Upgrade Firmware

Page 83: FIRST Robotics LabVIEW Training - .xyzlibvolume8.xyz/textile/btech/semester8/cadandcamintextiles/... · • LabVIEW is used for data acquisition more than C++, C#, or any other programming

4. Additional Resources

• Documentation

• From LabVIEW splash screen

– WPI Robotics Programming Guide

• NI.com/FIRST

– LabVIEW tutorials for your team

• Motor Basics

• Sensors basics

• PID tutorial

• Video processing

• New software feature training

– Software downloads

– Community support