Top Banner

of 31

frc_labVIEW

Apr 05, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 7/31/2019 frc_labVIEW

    1/31

    Team 1912 Combustion

    Ignition Team ManualAn Introduction to FIRST LabVIEW

    Written by Rachel Holladay

  • 7/31/2019 frc_labVIEW

    2/31

    Programming in FIRST

    Language Choices LabVIEW, Java, C++

    Used for Robot Control -

    Autonomous: decisions made based on senorsor preprogrammed movements

    Tele-op: decisions made based on operator

    input from the drivers

  • 7/31/2019 frc_labVIEW

    3/31

    Two part System

    Front Panel -

    Looks like a display board, user interface Controls allow you to input data

    Indicator allow you to extract data

    Block Diagram -

    Home to the actual code

    Full of loops, conditionals, statements Most of the work is done here

  • 7/31/2019 frc_labVIEW

    4/31

  • 7/31/2019 frc_labVIEW

    5/31

    General Structure

    Graphical, object are represented by icons

    Circuitry system data follows along wires VI 'Visual Instruments'

    Easy to learn, hard to master

  • 7/31/2019 frc_labVIEW

    6/31

    Basics: WPI Library

    Created by theWorcesterPolytechnic Institute

    Contains all the

    specialty FIRSTsubVIs

    Includes eightsubcategories -

    Robot Drive

    Sensors

    Acuators Driver Station

    Camera

    Communications

    Utilities

  • 7/31/2019 frc_labVIEW

    7/31

    Framework

    The main structure that holds FRC codetogether, allows it to run smoothly on the robotetc.

    You must work within the framework and YOU

    SHOULD NEVER EDIT THE FRAMEWORK Otherwise the FMS (field management system)

    will be unable to connect to you robot and it will

    not move. Ever.

  • 7/31/2019 frc_labVIEW

    8/31

    Project Explorer

    All files are stored inpre-made projects

    Acts as file directory

    Holds all files needed

    for robot control All specialty made Vis

    must be added

  • 7/31/2019 frc_labVIEW

    9/31

    Vis: Robot Main

    The main combining point of focus for theproject

    Should not be edited under any circumstances

    Mainly helps the FMS system understand and

    runs the code DO NOT EDIT THIS

  • 7/31/2019 frc_labVIEW

    10/31

    Robot Main

  • 7/31/2019 frc_labVIEW

    11/31

    VIs- Begin

    Called once at beginning, to open I/O, initializesensors and any globals, load settings from afile, etc.

    First thing run on robot boot up

    Opens and assigns all variables and hardware EX) Opens a joystick and assigns it to USB 1

    EX) Opens a motor and assigns it to PWM 1 with atrue inversion

  • 7/31/2019 frc_labVIEW

    12/31

    Begin

  • 7/31/2019 frc_labVIEW

    13/31

    VIs- Finish

    Called before exiting, so you can save data,clean up I/O, etc.

    Doesn't actually run in competition

    Does the inverse of begin, it closes everything

    EX) Closes the joystick, motor, etc.

    If you open something in Begin, close it in

    Finish, it's just neat practice

  • 7/31/2019 frc_labVIEW

    14/31

  • 7/31/2019 frc_labVIEW

    15/31

    VIs- Autonomous

    Automatically started with the first packet ofautonomous and aborted on the last packet.Write this Team VI to loop for the entirety of theautonomous period.

    Runs autonomous code for 15 second period Can either be based on sensor input or based

    on dead reckoning

    Framework provides an example of a simpledead reckoning driving maneuver

  • 7/31/2019 frc_labVIEW

    16/31

  • 7/31/2019 frc_labVIEW

    17/31

    VIs - Tele-Op

    Called each time a teleop DS packet isreceived and robot is enabled.

    Main body hold Tele-Op code

    Normally holds drive code and any Challenge

    related code, such as an arm or kicker Framework provides arcade drive

  • 7/31/2019 frc_labVIEW

    18/31

    Tele-Op

  • 7/31/2019 frc_labVIEW

    19/31

    VIs Timed Tasks

    Called each time a teleop DS packet isreceived and robot is enabled.

    Also called Periodic Tasks

    Runs during Autonomous and Tele-Op

    Great for things you want running for both

    EX) This is where you enable a compressor

    Some people heavily use Tele-Op, others preferTimed Tasks. Its a personal thing really

  • 7/31/2019 frc_labVIEW

    20/31

    Timed Tasks

  • 7/31/2019 frc_labVIEW

    21/31

    VIs- Vision

    A parallel loop that acquires and processescamera images.

    Holds any code related to your camera

    Often gets neglected because the camera is a

    very commonly neglected element Framework provides a camera feed on the

    dashboard, which is a neat feature

  • 7/31/2019 frc_labVIEW

    22/31

    Vision

  • 7/31/2019 frc_labVIEW

    23/31

    The Re-Imaging Tool

    Used to wipe/cleanthe cRIO clean of

    software

    Often fixes corrupted

    files or helps restorethe cRIO to thedefault, blank slat

    Assigns robot IPaddress (10.xx.yy.2)

  • 7/31/2019 frc_labVIEW

    24/31

    Puts code on therobot only temporarily

    Code will be lost oncethe robot is turned off

    Great for when onlytesting code

    Code can be pushedwith the run arrow aninfinite amount oftimes

  • 7/31/2019 frc_labVIEW

    25/31

    Builds a package of the code and then deploysthe code on to the robot

    Will stay on the robot permanently even afterturned off

    Does take a few minutes to do An executable must run for competition

    To remove or change a new executable mustbe pushed down or the cRIO must be re-imaged

  • 7/31/2019 frc_labVIEW

    26/31

    Making an Executable

  • 7/31/2019 frc_labVIEW

    27/31

    Driver Station

    Used to enable and control the robot

    Various tabs for a variety of indicators The robot must have communications and code

    before enabled and can run

  • 7/31/2019 frc_labVIEW

    28/31

    Dashboard

    Gives more indicators including a cameraimage feed. You can create a custom

    dashboard to view particular barometers

  • 7/31/2019 frc_labVIEW

    29/31

    Classmate Clamshell

    A smaller portable computer given in the KoP

    Two mode of operation: Developer: acts as a regular computer

    Driver Station: automatically pulls up the Driver

    Station and Dashboard. Used in competition This computer should not be used as the main

    programming laptop. A separate computer

    should be used.

  • 7/31/2019 frc_labVIEW

    30/31

    Good Practices

    Keep I/O log for documentation

    Limit closed loop and sensor control Plan out code before coding

    When possible, break things into steps

    The best programmer understands theirmechanical environment and is embedded

    within the design and implementation process.That and (hopefully) stays on schedule..

  • 7/31/2019 frc_labVIEW

    31/31

    Tip Jar

    An excellent way to teach yourself LabVIEW isthrough a series of videos produced by NI, the

    Tip Jar. This useful set of almost 20 videosincludes topics that range from "DebuggingYour FRC code" to "LabVIEW intro for C++

    Programmers" http://www.lvmastery.com/tipjar