Presentation is loading. Please wait.

Presentation is loading. Please wait.

LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.

Similar presentations


Presentation on theme: "LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp."— Presentation transcript:

1 LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp. Mark.McLeod@ngc.com

2 Agenda How to Begin How to Begin LabVIEW Basics LabVIEW Basics FRC Palette FRC Palette How to Do Standard Operations How to Do Standard Operations Note: These slides approximate the material covered at a hands- on workshop where this work was all done in a live LabVIEW session.

3 How to Begin Start LabVIEW Start LabVIEW New -> FRC cRIO Robot Project New -> FRC cRIO Robot Project –Name your project –Set your cRIO IP address (10.xx.yy.02) –Choose “Basic Framework” or “Advanced Framework” or Open -> Browse (Existing Project) Open -> Browse (Existing Project)

4 Default Frameworks Basic Framework Basic Framework –Basic Robot Main.vi –Drive loop –Camera loop –Periodic loop –Autonomous Independent.vi –Robot Global Data.vi Advanced Framework Advanced Framework –Team Code Begin.vi Begin.vi Teleop.vi Teleop.vi Vision Processing.vi Vision Processing.vi Autonomous Iterative.vi or Autonomous Independent.vi Autonomous Iterative.vi or Autonomous Independent.vi Periodic Tasks.vi Periodic Tasks.vi Robot Global Data.vi Robot Global Data.vi

5 LabVIEW Basics Project Explorer Project Explorer –My Computer –RT CompactRIO Target What’s Important Here What’s Important Here –RT CompactRIO Target –Build Specifications –Basic Robot Main.vi –Autonomous Independent.vi Basic Framework

6 RT CompactRIO Target Right click –> “Properties” Right click –> “Properties” –General – IP Address 10.xx.yy.02 Only need this if IP address wasn’t set correctly when the project was created

7 Build Specifications Right click on a spec. for “Properties” Right click on a spec. for “Properties” –Source Files Startup VIs: Basic Robot Main.vi Startup VIs: Basic Robot Main.vi “Run as Startup” “Run as Startup” –Must reboot to take affect Use to download your program to the robot

8 Temporary Debug - Run Run - Used to test & debug Run - Used to test & debug –must be done from RobotMain.vi –Temporarily executes your code - Gone after a reboot –Stop or disconnect halts robot –Can disable Downloaded code, so test reboot

9 Edit a Program Double click on “Basic Robot Main.vi” Double click on “Basic Robot Main.vi” This is the “Front Panel” Click on Window -> “Show Block Diagram” Click on Window -> “Show Block Diagram” The Block Diagram is where you do most of your programming

10 Front Panel/Block Diagram Front Panel Block Diagram

11 Create Your Own VIs From existing code From existing code –Highlight code –Edit -> CreateSubVI From scratch (File -< New VI) From scratch (File -< New VI) Extras Extras –Change Icon –Add terminals (from Front Panel)

12 Palettes Different Palettes for Front Panel vs Block Different Palettes for Front Panel vs Block Right click in Block Diagram window Right click in Block Diagram window What’s Important What’s Important –Programming (structures & basic operations) –WPI Robotics Library (all robot stuff) –FIRST Vision (camera) Help -> Show Context Help Help -> Show Context Help –Detailed Help

13 Functions Palette Block Diagram Palette

14 FRC Palette Overview WPILib WPILib –Robot Drive –Sensors –Actuators –I/O –Driver Station –Camera –Communications –Utilities FIRST Vision FIRST Vision –Image Management –Intensity Measurement –Particle Analysis –Image Enhancement –Image Conversion –Display Interaction

15 Basic Functional Structure Open Open Operate: Start/Get/Set, etc. Operate: Start/Get/Set, etc. Close Close

16 Mouse Over Use Context Help (Help -> Show Context Help) naming each I/O Put cursor over vi icon To see inputs & outputs In Context Help click on “Detailed help” for detailed explanation of each I/O

17 Wiring Right-click vi icon in Block Diagram to get menu Right-click vi icon in Block Diagram to get menu “Create” “Create” –Constant (inputs, e.g., use to select PWM) –Control (inputs used for debugging) –Indicator (outputs used for debugging) “Cluster, Class & Variant Palette” “Cluster, Class & Variant Palette” –Unbundle by Name (e.g., get at joystick buttons)

18 Standard Functions Single Solenoid control Compressor Relay Double Solenoid control

19 Drives Teleop Tank Drive (2-joystick) Teleop Arcade Drive (1-joystick)

20 More Motors Single Motor Servo control

21 Motor Control Limit Acceleration (both speeding up & slowing down) Can be annoying to drivers Limit Switch (one-way) SPECIAL CONCEPT: Coerce vi- restrict value +/-

22 More Control Samples Joystick Curve (simple cubed)

23 Miscellaneous Driver Station Custom Inputs Analog Input (e.g., potentiometer) Digital Input (e.g., limit switch)

24 Button Control Button Direct: Action occurs continuously while button is held 2 Button system: 1 st button = ON 2 nd button = OFF

25 Toggle Button Button Action once on Push SPECIAL CONCEPT: Feedback Node

26 Timed Sequence Button Timed Operation 2 methods SPECIAL CONCEPT: Sequence Structure

27 Sensors Encoder Requires extra step converting Digital Input to a Digital Source Gyroscope

28 Autonomous LabVIEW Kills Autonomous Independent.vi at the end of autonomous mode SPECIAL CONCEPT: Matched Device Open/Close

29 Default Autonomous Requires the motors & watchdog to be opened elsewhere SPECIAL CONCEPT: Global Variables

30 Global Variables Use to open devices in one vi and use in other places Use to open devices in one vi and use in other places –Primary example is using your drive motors in both Autonomous & TeleOp Devices anything you Open including: Devices anything you Open including: –Joysticks –Motors –Relays –Solenoids –Digital & Analog inputs

31 Basic Framework Global Variables Open devices in one place and pass them around to other vi’s using Globals –Start with an “Open” –Double-click “Open” –Copy Device Reference –Paste into “Basic Robot Global.vi” –From the Project Explorer window drag “Basic Robot Global.vi” onto the Block Diagram window next to the “Open” & Select the new Device Reference in the icon you get. (You can also copy/paste an existing icon. –Wire the “Open” Device output to the icon for “Basic Robot Global.vi” How to create a new Global vi How to create a new Global vi –Project Explorer->New…->Global Variable

32 Advanced Framework Global Variables Add Open’s to Begin.vi Add Open’s to Begin.vi Double-click Open & Copy Device Ref Double-click Open & Copy Device Ref Open “RobotData.ctl” Open “RobotData.ctl” Right-click “RobotData” & Open Type Def Right-click “RobotData” & Open Type Def Paste new Device Ref & drag into RobotData Paste new Device Ref & drag into RobotData Wire Open to feed new typedef Bundle Wire Open to feed new typedef Bundle

33 Further Training Examples on LabVIEW startup screen Examples on LabVIEW startup screen NI FIRST forum: http://decibel.ni.com/content/community/ first NI FIRST forum: http://decibel.ni.com/content/community/ first http://decibel.ni.com/content/community/ first http://decibel.ni.com/content/community/ first Video Tutorials Video Tutorials –http://decibel.ni.com/content/docs/DOC-2511 http://decibel.ni.com/content/docs/DOC-2511 –http://labviewzone.blip.tv http://labviewzone.blip.tv –http://www.lvmastery.com/tipjar2008-12-12 http://www.lvmastery.com/tipjar2008-12-12 –http://first.wpi.edu/FRC/contro876.html http://first.wpi.edu/FRC/contro876.html

34 Presentation slides at: Presentation slides at: Team358.org Team358.org under Workshops Questions/Help email is the best way to reach me Questions/Help email is the best way to reach meMark.McLeod@ngc.com


Download ppt "LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp."

Similar presentations


Ads by Google