28
Mechanics of LabVIEW Mechanics of LabVIEW Workshop Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Mark McLeod Advisor Advisor Hauppauge Team 358 Hauppauge Team 358 Northrop Grumman Corp. Northrop Grumman Corp. [email protected] [email protected]

Mechanics of LabVIEW Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp. [email protected]

Embed Size (px)

Citation preview

Mechanics of LabVIEW Mechanics of LabVIEW Workshop Workshop

January 10, 2009Farmingdale State College

SPBLI - FIRST

Mark McLeodMark McLeodAdvisorAdvisor

Hauppauge Team 358Hauppauge Team 358Northrop Grumman Corp.Northrop Grumman [email protected]@ngc.com

AgendaAgenda

ArchitectureArchitecture Project from Scratch Project from Scratch Default FrameworkDefault Framework

– BasicBasic– AdvancedAdvanced

Typical OperationsTypical Operations Mechanics of DownloadingMechanics of Downloading FRC Palette OverviewFRC Palette Overview Download Programs & TestDownload Programs & Test

2009 Control System 2009 Control System SoftwareSoftware(check periodically for latest update)(check periodically for latest update) Robot ProgrammingRobot Programming

– Wind River WorkbenchWind River Workbench– LabVIEWLabVIEW

PC DashboardPC Dashboard– LabVIEWLabVIEW

FRC cRIO Imaging Tool --Apply updates to FRC cRIO Imaging Tool --Apply updates to the cRIOthe cRIO

Setup Axis Camera --Create FRC user Setup Axis Camera --Create FRC user accountaccount

Vision Assistant –Play with camera visionVision Assistant –Play with camera vision

ArchitectureArchitecture

Hardware LayersHardware Layers– FPGAFPGA– PowerPCPowerPC– ModulesModules– Breakout Bumpers/SidecarBreakout Bumpers/Sidecar

Software LayersSoftware Layers– FPGA codeFPGA code– vxWorksvxWorks– WPILibWPILib– User Code in LabVIEW or C++User Code in LabVIEW or C++

Project From ScratchProject From Scratch

Limited by lack of Robot Mode Limited by lack of Robot Mode function, but works for Basic Teleopfunction, but works for Basic Teleop

Create a viCreate a vi– StructureStructure

Open -> Loop -> CloseOpen -> Loop -> Close

Create a projectCreate a project

Basic TasksBasic Tasks

• Solenoid control

• Compressor

• Driver Station Communication

• Watchdog

DrivesDrives

• Teleop Tank Drive

• Teleop Arcade Drive

MiscellaneousMiscellaneous

• Driver Station Custom Inputs

• Button Toggle

Default FrameworksDefault Frameworks

A Framework is required for full functionalityA Framework is required for full functionality BasicBasic

– Basic Robot Main.viBasic Robot Main.vi– Drive loopDrive loop– Camera loopCamera loop– Periodic loopPeriodic loop

– Autonomous Independent.viAutonomous Independent.vi AdvancedAdvanced

– Team CodeTeam Code Begin.viBegin.vi Teleop.viTeleop.vi Vision Processing.viVision Processing.vi Autonomous Iterative.vi or Autonomous Independent.viAutonomous Iterative.vi or Autonomous Independent.vi Periodic Tasks.viPeriodic Tasks.vi

Modifying the Modifying the Framework Framework

What’s Missing:What’s Missing: Tank Drive Tank Drive

– Drive loop or Teleop.viDrive loop or Teleop.vi Compressor & solenoid controlCompressor & solenoid control

– Compressor in periodicCompressor in periodic– Solenoid control in Drive loop or Teleop.viSolenoid control in Drive loop or Teleop.vi

Manipulator and other unique controlsManipulator and other unique controls– Their own loop or viTheir own loop or vi

Sample AutonomousSample Autonomous

LabVIEW Kills Autonomous Independent.vi at the end of autonomous mode

Downloading or Running Downloading or Running a Projecta Project

Run Run – Used to test & debug using your PCUsed to test & debug using your PC– Temporarily executes your codeTemporarily executes your code– Gone after a rebootGone after a reboot– Can disable Downloaded code, so test Can disable Downloaded code, so test

rebootreboot Download/Deploy Download/Deploy

– As a stand-alone applicationAs a stand-alone application– Must reboot to take affectMust reboot to take affect

My ComputerMy ComputerTargetTarget

For programs that run on your PCFor programs that run on your PC Dashboard templateDashboard template What it doesWhat it does How to customize the default How to customize the default

DashboardDashboard– DS Digital/Analog input displayDS Digital/Analog input display– Digital Sidecar PWMs, Relays, DIODigital Sidecar PWMs, Relays, DIO– Analog/SolenoidAnalog/Solenoid

FRC-cRIO-358 (10.3.58.2)FRC-cRIO-358 (10.3.58.2)TargetTarget

For Robot programsFor Robot programs Build SpecificationsBuild Specifications

– Run as StartupRun as Startup– Build/DeployBuild/Deploy

CautionsCautions

Set the cRIO as a LabVIEW environmentSet the cRIO as a LabVIEW environment If you get conflict messages when “Running”, then If you get conflict messages when “Running”, then

the formerly deployed code will execute on rebootthe formerly deployed code will execute on reboot Development is still underway, so expect the Development is still underway, so expect the

process and behavior to change somewhat process and behavior to change somewhat Careful when relocating LabVIEW projects due to Careful when relocating LabVIEW projects due to

relative directory paths.relative directory paths. Examples are not setup to download as stand-Examples are not setup to download as stand-

alone applications, but “Run” worksalone applications, but “Run” works Must use delay in master While loop to avoid Must use delay in master While loop to avoid

running as fast as possible and sucking up the CPU running as fast as possible and sucking up the CPU Must use WATCHDOG as of Update 2Must use WATCHDOG as of Update 2 ““Run” must be done from RobotMain.viRun” must be done from RobotMain.vi

FRC Palette Overview FRC Palette Overview

WPILibWPILib– Robot DriveRobot Drive– SensorsSensors– ActuatorsActuators– I/OI/O– Driver StationDriver Station– CameraCamera– CommunicationsCommunications– UtilitiesUtilities

FIRST VisionFIRST Vision– Image Image

ManagementManagement– Intensity Intensity

MeasurementMeasurement– Particle AnalysisParticle Analysis– Image Image

EnhancementEnhancement– Image ConversionImage Conversion– Display InteractionDisplay Interaction

FRC WPI PalettesFRC WPI PalettesRobot DriveRobot Drive

FRC WPI PalettesFRC WPI PalettesSensorsSensors

FRC WPI PalettesFRC WPI PalettesActuatorsActuators

FRC WPI PalettesFRC WPI PalettesI/OI/O

FRC WPI PalettesFRC WPI PalettesDriver StationDriver Station

FRC WPI PalettesFRC WPI PalettesCameraCamera

FRC WPI PalettesFRC WPI PalettesCommunicationsCommunications

FRC WPI PalettesFRC WPI PalettesUtilitiesUtilities

FIRST Vision PalettesFIRST Vision Palettes

Programming PalettesProgramming Palettes

Where to Find Further Where to Find Further InformationInformation NI FIRST forum: NI FIRST forum: http://http://decibel.ni.comdecibel.ni.com

/content/community/first/content/community/first Video TutorialsVideo Tutorials

– http://decibel.ni.com/content/docs/DOC-http://decibel.ni.com/content/docs/DOC-25112511

– http://labviewzone.blip.tvhttp://labviewzone.blip.tv– http://www.lvmastery.com/tipjar2008-1http://www.lvmastery.com/tipjar2008-1

2-122-12– http://first.wpi.edu/FRC/contro876.htmlhttp://first.wpi.edu/FRC/contro876.html

Presentation slides at: Presentation slides at:

Team358.orgTeam358.org

Questions/Help please email Questions/Help please email

[email protected]@ngc.com