Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Labview Dawgma Team 1712 Bob Bellini, Paul Gehman.

Similar presentations


Presentation on theme: "Introduction to Labview Dawgma Team 1712 Bob Bellini, Paul Gehman."— Presentation transcript:

1 Introduction to Labview Dawgma Team 1712 Bob Bellini, Paul Gehman

2 Overview 1.What is LabVIEW? 2.What’s new for FRC LabVIEW 2015 3.Block Diagram and Front Panel 4.References

3 PART 1 WHAT IS LABVIEW?

4 LabVIEW Usage in Universities 110 7000+ Countries Universities LabVIEW Basics

5 More than 35,000 companies use NI Tools Companies that use LabVIEW

6 What is LabVIEW? Speak G –Graphical programming language used to develop sophisticated measurement, test, and control systems Go with the flow –Dataflow programming Easy writing –Easy to learn –Powerful debugging tools

7 Each VI has 2 Windows Front Panel User Interface (UI) – Controls = Inputs – Indicators = Outputs Block Diagram Graphical Code – Data travels on wires from controls through functions to indicators – Blocks execute by Dataflow LabVIEW Programs Are Called Virtual Instruments (VIs) 7

8 Block diagram execution – Dependent on the flow of data – Block diagram does NOT execute left to right Node executes when data is available to ALL input terminals Nodes supply data to all output terminals when done Dataflow Programming 8

9 Controls Palette Browse subpalettes Pin to keep open Right-click on the front panel (not the block diagram) to open the Controls Palette Search for controls

10 Controls Palette (Controls & Indicators) 10 Indicator: Numeric Slide Control: Numeric Customize Palette View

11 Functions Palette Right-click on the block diagram (not the front panel) to open the Functions Palette Contains the VIs, functions, and constants you use to create the block diagram FRC-specific palettes include the WPI Robotics Library, FIRST Vision, and PID Search for functions by name

12 Functions (and Structures) Palette 12 (Place items on the Block Diagram Window) Structure: While Loop

13 LabVIEW Nodes While loop For loop Boolean logic PID Control Arrays Signal processing Mathematics Timing

14 Floating point Integer Boolean String Array – note wire thickness Cluster LabVIEW Data Types

15 LabVIEW Tasks Multiple tasks in parallel Data flow still applies Loops 1, 2, and 3 will run Loop 4 runs after 3 stops

16 FRC Vision and Robotics Palettes Vision – manage and analyze images WPI Robotics – Robot Drive, Sensors, Actuators, I/O, Driver Station, Camera, Communications, Utilities. This contains most of what you will use to program your robot.

17 Debugging Techniques Finding Errors Execution Highlighting Probes Click on broken Run button. Window showing error appears. Click on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires. Right-click on wire to display probe and it shows data as it flows through wire segment. You can also select Probe tool from Tools palette and click on wire. 17

18 Context Help Window Help»Show Context Help or press Hover cursor over object to update window 18 Additional Help –Right-Click on the VI icon and choose Help, or –Choose “Detailed Help.” on the context help window

19 FRC Version of LabVIEW RoboRIO custom designed for robot control Vision and Robotics palettes FRC Getting Started Window Wizards to create robot and dashboard code FRC specific examples FRC specific tutorials

20 roboRIO CAN Support New controller for FRC 2015-2019 Built-In Accelerometer USB Programming / Deployment USB Webcam / Flash drive … Eliminates Digital Sidecar User Button MXP Custom Electronics Expansion Port Designed for FRC RS-232 / I²C / SPI serial interfaces Dual Core Processor Zip Tie Mounting Holes Setup

21 roboRIO vs cRIO ControllercRIO FRC IIroboRIO ProcessorFreescale 5125 400MHz PPC Xilinx Zynq 7020 667Mhz dual-core ARM Cortex-A9 OSVxWorksLinux with Real-Time Extensions RAM128MB256MB Disc256MB512MB Volume110 in³ *30 in³ Mass60oz *10oz Price$689 *$435 Specs include cRIO, modules, and 2 digital sidecars Setup

22 PART 2 WHAT’S NEW FOR FRC LABVIEW 2015

23 What’s new for FRC LabVIEW 2015 Based on LabVIEW 2014 Robot Simulation Supports NI RoboRIO & cRIO II (not 8 bay cRIO) Updated Driver Station –Joystick LED—lets you know if joysticks are not plugged in. –Test Mode allows you to run custom test code. –Driver Station Log Viewer improved to log more data. Also can now be run from the Start menu. –Dashboard Type lets you choose the programming language of your dashboard. The default is LabVIEW. New WPI Robotics Library Vis Updated Driver Station Updated Dashboard New Examples New Tutorials

24 New Palette VIs Get Robot Battery Voltage Report Robot Code State Kinect VIs Camera Loop VIs Compressor Loop VI

25 Driver Station Charts tab – performance and logging Log Viewer – C:\Program Files\FRC Driver Station –Driver Station Log File Viewer.exe Kinect Status Space bar = E-Stop

26 Dashboard Kinect Skeleton Tab – displays skeleton image Camera Image Tab – now uses mjpeg file type

27 New Examples EZ1 MB1010 Sonar – Analog EZ1 MB1010 Sonar – Digital CAN Motor CAN Speed Control CAN Tank Drive CAN Position Control CAN Current Control

28 PART 3 BLOCK DIAGRAM AND FRONT PANEL

29 Block Diagram and Front Panel Control Indicator

30 Controls Palette

31 Functions Palette First Robotics Library First Vision Library

32 Tools Palette Wire Tool Edit Text Scroll Window Operate Value Probe Data Position / Size / Select

33 Block Diagram Terminals –Exchange data between the front panel and the block diagram –Controls Front Panel  Block Diagram –Indicators Block Diagram  Front Panel Data Types –Floating Point Numeric –Integer Numeric –Enumerated –Boolean –String –Array –Etc –Colors indicate data type Building the Block Diagram

34 Block Diagram Nodes –Functions – Built in execution elements, comparable to operators, functions, or statements. –SubVIs — VIs used on the block diagram of another VI, comparable to subroutines. –Express VIs—SubVIs designed to aid in common measurement tasks. You configure an Express VI using a configuration dialog box. –Structures—Execution control elements, such as For Loops, While Loops, Case structures, Flat and Stacked Sequence structures, Timed structures, and Event structures. Building the Block Diagram

35 Wires –Color and size indicate data type –Connect between terminals on nodes –Cursor changes to wire spool –Mouse over terminal to determine type –Broken wires appear as dashed black line with red X Incompatible data types Mouse over wire to determine error Triple click wire and press delete to remove Right click wire for additional options Building the Block Diagram

36 Block Diagram Data Flow –The flow of data rather than the sequential order of commands determines the execution order of block diagram elements. –create block diagrams that have simultaneous operations Building the Block Diagram – run two For Loops simultaneously and display the results on the front panel, as shown

37 Building the Block Diagram Running Vis –Run button - VI is ready to run –Run button changes to a darkened arrow, shows that the VI is running. –VI contains errors Click the broken Run button or select View»Error List to find out why a VI is broken

38 Building the Block Diagram Loops and Structures –graphical representations of the loops and case statements of text-based programming languages. –distinctive, resizable border to enclose the section of the block diagram that executes –For Loop—Executes a subdiagram a set number of times. –While Loop—Executes a subdiagram until a condition occurs. –Case structure—Contains multiple subdiagrams, only one of which executes depending on the input value passed to the structure.

39 Building the Block Diagram For Loop –A For Loop, shown as follows, executes a subdiagram a set number of times. –The value in the count terminal (an input terminal), specifies how many times to repeat the subdiagram. –Set the count explicitly by wiring a value from outside the loop to the left or top side of the count terminal, –The iteration terminal (an output terminal), shown as follows, contains the number of completed iterations.

40 Building the Block Diagram While Loop –executes a subdiagram until a condition occurs. –The While Loop executes the subdiagram until the conditional terminal, an input terminal, receives a specific Boolean value. The default behavior and appearance of the conditional terminal is Stop if True –change the behavior and appearance of the conditional terminal by right-clicking the terminal or the border of the While Loop and selecting Continue if True

41 Loops can accumulate arrays at their boundaries with auto-indexing For Loops auto-index by default While Loops output only the final value by default Right-click tunnel and enable/disable auto- indexing Wire becomes thicker Wire remains the same size Auto-Indexing Disabled Auto-Indexing Enabled Only one value (last iteration) is passed out of the loop 1D Array 0 1 2 3 4 5 5 Building Arrays With Loops

42 Available at left or right border of loop structures Right-click the border and select Add Shift Register Right terminal stores data on completion of iteration Left terminal provides stored data at beginning of next iteration Initial Value Shift Register: Access Previous Loop Data Use for next iteration

43 Building the Block Diagram Case Structures –two or more subdiagrams or cases. –Only one subdiagram is visible at a time, and the structure executes only one case at a time. –An input value determines which subdiagram executes. –The case selector label at the top of the Case structure, contains the name of the selector value

44 Building the Block Diagram Developing a program –What do you want to accomplish? –What do you want to outcome(s) to be? –What resources (inputs) do you need? –Develop a flowchart –Write the code –Observe the program to verify the operation

45 FRC 2015 Getting Started Window Select FRC RoboRIO Project

46 Create Project Screen Remember to enter your team number! Make sure you know where your files are going! Select the type of drive your are using! Click Finish

47 FRC Project Explorer Expand the Team Code to view individual VIs Make note of the Teleop, Autonomous and Periodic Tasks Special Interest: Vision Processing

48 Basic Robot Main.vi Front Panel Press -E to view Block Diagram Or Window  “Show Block Diagram”

49 Basic Robot Main.vi Block Diagram

50 Basic Robot Begin.vi Boolean Constant Enum Constant Open 2 Motor Drive VI Choose between Jaguar, Victor or Talon motor controller Joystick open VI

51 Basic Teleop.vi Arcade Drive Joystick – Get Axis (Read the joystick) Select the Axis to read from the joystick Arcade Drive VI Axis 1  X Axis (Left / Right) Axis 2  Y Axis (Fwd / Rev) Common Joystick reference Publish the Robot Drive Motor values to the dashboard Where is the loop?

52 Tank Drive Example Joystick – Get Axis (Read the joystick) Open 2 Motor Drive Tank Drive VI Joystick open VI

53 PID PID is one method of closed loop control Proportional integral derivative An algorithm used in a control feedback loop to regulate a process such as the motion of a motor or the flow through a valve Output feeds back into the input (closed-loop control)

54 PID in LabVIEW Shift register required for PID NI Example Finder»General PID Simulator.vi Coefficients set on front panel Setpoint

55 PID Example Try the PID Simulator example. NI Example Finder»General PID Simulator.vi PID coefficients Setpoint

56 Building a Stand Alone Application to Deploy to the Robot Program deployed to RoboRIO and available on power-up without computer –14 Step procedure – follow it carefully!!! –Refer to Tutorial #4 within Labview Getting Started

57 Tutorials

58 Set up RoboRIO Set up Axis Camera Set up Robot Radio Develop Robot Project Editing Team Code Custom Dashboard Integrating Examples Integrating Vision Robot Simulation Getting started with CAN

59 FRC Examples Find FRC Examples

60 FRC Specific Examples !!!

61 Utilities RoboRIO Imaging tool Setup Axis Camera tool Radio Configuration tool cRIO Imaging tool

62 RoboRIO Imaging tool Connect RoboRIO with a USB cable Select “Format Target” and then choose which Image to load Then click “Reformat”

63 cRIO Imaging Tool Works for both: –NI cRIO-FRC –NI cRIO-FRC II Same image for both Shows installed modules cRIO switches: –Read NI cRIO-FRC –Read/Write NI cRIO- FRC II

64 Axis Camera Setup Tool Connection choice Directions Troubleshooting

65 PART 5 REFERENCES

66 References JOIN+VISIT: UserID and Pwd --- PLEASE --- BY JANUARY 5 th !!!!!!! FIRST (FRC: First Robotics Competition) –http://www.usfirst.org/roboticsprograms/frchttp://www.usfirst.org/roboticsprograms/frc Chief Delphi –http://www.chiefdelphi.com/http://www.chiefdelphi.com/ National Instruments: Getting Started with the LabVIEW™ –https://decibel.ni.com/content/community/first/frchttps://decibel.ni.com/content/community/first/frc Worcester Polytechnic Institute (WPI) –http://thinktank.wpi.edu/article/201http://thinktank.wpi.edu/article/201 TRAIN: Labview Application Tutorials Labview Introduction videos http://www.lvmastery.com/tipjar2008 (Classics: circa 2008-2009 ;)http://www.lvmastery.com/tipjar2008 http://www.frcmastery.com/ (Classics: circa 2010-2011 ;)http://www.frcmastery.com/ Labview Code Snippets http://www.team358.org/ Technical Resources -> Control System (left hand side) -> FRC Control System – 2009-present -> Programming -> Labview Programming

67 FRCMastery / LVMastery Tipjars

68 Team 358

69

70 NI Software on a Thumb Drive NI LabVIEW for FRC installs from a thumb drive Extra 3.5 GB partition for team use


Download ppt "Introduction to Labview Dawgma Team 1712 Bob Bellini, Paul Gehman."

Similar presentations


Ads by Google