1.1k likes | 1.42k Views
FRC LabVIEW Mentor Training Hands-On Seminar. National Instruments. Objective. To help recruit, train, and prepare mentors for the software development aspect of the FRC Mentors work with FRC pre-built mini robots and laptops to learn about Software development fundamentals
E N D
FRC LabVIEW Mentor TrainingHands-On Seminar National Instruments
Objective • To help recruit, train, and prepare mentors for the software development aspect of the FRC • Mentors work with FRC pre-built mini robots and laptops to learn about • Software development fundamentals • LabVIEW basics • LabVIEW FRC program template and components • Have fun!
I. Vision & Mission Vision “To transform our culture by creating a world where science and technology are celebrated and where young people dream of becoming science and technology heroes.” Dean Kamen, Founder Mission To inspire young people to be science and technology leaders by engaging them in exciting mentor-based programs that build science, engineering, and technology skills; that inspire innovation; and that foster well-rounded life capabilities includingself-confidence, communication, and leadership.
FIRST Programs • Organization & • Programs FIRSTRobotics Competition Junior FIRSTLEGO® League FIRSTLEGO League FIRSTTech Challenge K 1 2 3 4 5 6 7 8 9 10 11 12 Grade Level
Mission is to INSPIRE, not EDUCATE • BUT look atwhat is involved: • Math (algebra, geometry, trig, calculus) • Science (physics, chemistry, experimentation) • Language arts (writing, public speaking) • Business (marketing, PR, fundraising) • Finance (accounting) • Computer science (programming, 3D animation) • Fabrication (woodworking, metalworking) • Mentorship (working side-by-side with professionals) • Teamwork
Organization & • Programs FIRST Robotics Competition (FRC) • How it works: • Combines the excitement of sport with science and technology • Creates a unique varsity sport for the mind • Grades 9–12 students (ages 14–18) discover the value of education and careers in science, technology, and engineering • New game each year • Common kit of parts • 6-week build period
Organization & • Programs FIRST Robotics Competition Team Growth • FRC 2010 Season • 1,809 teams • 45,000+ high-school-age students • Average 25 students per team • 44 regional/state championships • 7 district competitions • 340 teams advance to FIRSTchampionship
VI. Get Involved Mentors • Become a mentor • Empower children with a sense of accomplishment • Provide valuable one-on-one interaction • Be respected and admired by team members • Be inspired and energized through your participation “I love working with these kids! I’m amazed and inspired by what they can accomplish, and their enthusiasm and energy is contagious.”Kristen Kelso, FLL Coach and Judge, Former FIRSTRobotics Competition Participant
FRC Control System: LabVIEW and CompactRIO Adoption of a Progressive Programming Platform • FIRST Robotics Competition: FIRST standardizes on NI CompactRIO hardware powered by NI LabVIEW software • FIRST Technical Challenge: Adoption of the LEGO® MINDSTORMS® NXT platform, programmable with NI LabVIEW
Students begin to program at age 6 with intuitive, graphical software • Progressive programming platform—Technology that meets the needs of students of all ages • Strong industry usage—Strong adoption of LabVIEW and CompactRIO in industry means students develop skills they can use in college and their careers
Wireless Access Pt Power Distribution CompactRIO Controller Digital Sidecar
Role of the Controller • Autonomous • Motor/actuator control • Motion control • Path control • Object avoidance • Teleoperated • Driver station input processing • Telemetry back to console • “Action” control • Motion smoothing
Superior Performance Enhanced Processing • 400 MHz PowerPC industrialreal-time processor • 128 MB DRAM memory, 256 MB flash storage • Embedded for reliable, autonomous operation 802.11 Wireless Ethernet • 0/100 Mbit/s Ethernetport • Programmatic communication over wireless network Rugged • 50 g shock rating • 20 to 55 °C
Flexible Inputs and Outputs NI 9472—Digital I/O • 8-channel digital I/O • 6 to 36 V output range • Pneumatics (relays and solenoids) NI 9201—Analog Input (x2) NI 9403—Digital I/O (x2) • 8 analog inputs • ±10 V input range • Sensors (accelerometers, gyros, and so on) • 32-channel digital I/O • 5 V/TTL, sinking/sourcing digital I/O • PWM motor control, encoders
Easy to Program • Programmable in C, Java, and LabVIEW • Wireless debugging • Laptop dashboard
Program Your Robot Stage 1 Stage 2 Stage 3 develop download deploy
Software Development Method • Define the problem (scenario) • Design an algorithm and/or flowchart • Implement the design • Test and verify the implementation • Maintain and update the implementation
Define the Problem Furnace Example You need to design a furnace system to keep a building within a comfortable temperature range. For simplicity, the building has only a furnace and no air conditioning.
Steps to Design a Flowchart • List all your inputs, outputs, and additional requirements • Define the possible states (nodes) and actions in each state • Define your state (node) transitions • Draw a flowchart linking the states (nodes)
Design a Flowchart—Furnace • This application has the following requirements: • The interior temperature must remain within a set range: 70 –75 °F • The heater turns on when the temperature is less than 70 °F and heat the room up until the temperature is 75 °F • There is no AC to control
Example—Furnace State and Action Related to State Transition/Decision
Example (Advanced)—Coke Machine • This application has the following requirements: • All Coke products are sold for 50 cents • The machine accepts only nickels, dimes, and quarters • Exact change is not needed • Change can be returned at any time during the process of entering coins • Only Coke is sold in machine (no buttons to select other beverage)
Example (Advanced)—Coke Machine Action Related to State Transition State
Example—Robot: Remote Control • This application has the following requirements: • Robot must navigate a field with obstacles and other robots and press a button that can be reached only by an extendable arm • There is a line on the course that marks a clear path from the robot’s starting position to the button’s location • Manual/Teleoperated mode only
Example—Robot: Autonomous • This application has the following requirements: • Robot must navigate a field with obstacles and other robots and press a button that can be reached only by an extendable arm • There is a line on the course that marks a clear path from the robot’s starting position to the button’s location • Autonomous mode only
Software Development Method • Define the problem (scenario) • Design an algorithm and/or flowchart • Implement the design • Test and verify the implementation • Maintain and update the implementationAddressed in Section 4: FRC Steps to Robot Success
What is LabVIEW? • Speak G • Graphical programming language • Go with the flow • Dataflow programming • Easy writing • Easy to learn • Powerful debugging tools
LabVIEW Programs Are Called Virtual Instruments (VIs) • Each VI has2 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 data flow
Controls Palette (Controls and Indicators) Customize Palette View Control: Numeric Indicator: Numeric Slide
Functions (and Structures) Palette (Place items on the Block Diagram Window) Structure: While Loop
Types of Functions (from the Functions Palette) • Express VIs: Interactive VIs with configurable dialog page (blue border) • Standard VIs: Modularized VIs customized by wiring (customizable) • Functions:Fundamental operating elements of LabVIEW; no front panel or block diagram (yellow)
Automatic Selection Tool Operating Tool Positioning/Resizing Tool Labeling Tool Wiring Tool Tools Palette • Recommended: Automatic Selection Tool • Tools to operate and modify both front panel and block diagram objects Automatically chooses among the following tools:
Status Toolbar Run Button Continuous Run Button Abort Execution Additional Buttons on the Diagram Toolbar Execution Highlighting Button Retain Wire Values Button Step Function Buttons
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; it shows data as it flows through wire segment. You can also select the Probe tool from the Tools palette and click on the wire.
Context Help Window • Help»Show Context Helpor press <Ctrl-H> • Hover cursor over object to update window • Additional Help • Right-click on the VI icon and choose Help, or • Choose “Detailed Help.” on the context help window
Dataflow Programming • 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
LabVIEW Shortcuts and Tools • <Ctrl-R>: Run the VI • <Ctrl-E>: Swap between front panel and block diagram • <Ctrl-H>: Turn on context help • <Ctrl-B>: Remove broken wires • <Ctrl-Z>: Undo • View»Navigation Window or Ctrl-Shift-N • Tools»CompactRIO Imaging Tool… • Tools»Setup Axis Camera • Tools»Options
LabVIEW Exercise 1:Create a Simple LabVIEW VI • You will learn • How to workin the LabVIEW environment • Create an application that • Simulates data collection • Turns on a front panel indicator when threshold is reached
Key LabVIEW Structures for FIRST • Project Explorer • Clusters • Loops • Case Structure • Shift Registers • Enums • State Machines