Apple Pi Robotics Logic System and Programming Basics 1 1.

Slides:



Advertisements
Similar presentations
Teacher/Mentor Institute Using the Cortex Chuck Powell.
Advertisements

Alpha Control System TheRobettes.com.
LabVIEW Crash Course Presented by:.
US First Robotics Lab View Tutorials Jim Thomas Lawrence Berkeley National Laboratory Team 496 Port Jeff Powerhouse.
Exercise 1: Install PC Software & NXT Firmware
Crown CDi Series Control Click the Crown Logo at the top of any the screen to return to this Menu Interactive Main Menu Interactive Front Panel Display.
Lokotrack ST352 Presentation
Add and Use a Sensor & Autonomous For FIRST Robotics
Jeff Beltramo NHTI-Concord’s Community College FRC Team 1922.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
Networking By: Matt Motl… Programmer Brent Everson… Programming Mentor.
Microprocessor Motor Control Spring Introduction  Stamp projects Robots  Sensors  Motor control  Logic Rocketry  Reading acceleration (“g”
1. 2 FRC 2010 Driver Station Doug Norman & Stephanie Brierty National Instruments January 8, 2010 Thanks to Joe Ross – Team 330.
Programming and Electronics Training
Wiring the new control system MVRT 2010 – 2011 Season.
Bread Boarding and Operating The IFI Robotic Control System.
Part 1: Introduction FRC Introduction  FRC 2907 since 2008  Each area of the robot has a team assigned  The Electronics team is headed this year.
Introduction to LabVIEW 8.5
Overview of New System Beta Team from Wilsonville 1425 Wilsonville Robotics – Code Xero 2550 Oregon City Robotics.
FRC LabVIEW Software Overview Joe Hershberger Staff Software Engineer National Instruments.
 General notes/quirks › Letters only in the SSID › g & b only › Use a different router for internet and robotics › Use a simple password.
2015 FRC Control System = MOL = DUK Power Distribution Board Volts -12 Volts (4) 40 amp Circuits (4) (6) 20/30 amp Circuits (6)
AccuMax Multi-Point Injection Mechanics
Troubleshooting methods. Module contents  Avaya Wireless tools  Avaya Wireless Client Manager  Avaya Wireless AP Manager  Hardware indicators  Non.
2012 Beta Seminar 694 Software Engineering. Overview WPILib ▫Command-based programming ▫NetworkTables ▫SmartDashboard ▫Preferences ▫Laptop-based vision.
1. A guide to wiring your robot. Jerry Skene Past mentor – Chantilly Robotics
How to Use This Training Deck
Electrical Components.  This supplies all the power to the robot. It is a single 12 V battery. They are sealed to prevent battery acid from leaking.
Lecture 13LabVIEW and GPIB LabVIEW (National Instruments) –Graphical program language –Widely used in academia (lab) and industry (R&D) General Purpose.
Infinity-project.org Engineering education for today’s classroom The Infinity Project SM LabVIEW for The Infinity Project.
Drivers Station 2010 Joe Ross Team /12/2009.
Driver Station MVRT 2009 – 2010 Season. Add information Breadboard Classmate PC USB Hub Joysticks Stop Button.
Getting started with Microsoft.NET Gadgeteer Comberton Village College Gadgeteer Club.
US First Kickoff 2012 Software Programming (And Control System) Daniel Kohn University of Memphis.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
1999 Cabletron Systems. Wireless Networking RoamAbout RoamAbout Installation Installation/Configuration of: Network adapter card on a: Windows 95 system.
Coding for the FIRST Tech Challenge: RobotC
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
Programming and Controls for FIRST – The Basics Tom Barch, Scott VanBrocklin and Kayla Peltier February 5 th, 2008.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering 1 Hsu/Youssefi.
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
The New FTC Platform (Connecting your legacy hardware)
2009 FRC Control System Software Overview Dave Doerr, Mentor, Team 67 November 15, 2008.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
Introduction to Robo Pro
LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic.
FRC Robot Framework Labview Made Easy (er) For FIRST Robotics 1.
1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010.
Mechanics of LabVIEW Workshop January 10, 2009 Farmingdale State College SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
An Objective and Component View (Not included Drive: Balance and Turret: Axis Camera)
Robot sensors MVRT 2010 – 2011 season. Analog versus Digital Analog Goes from 0 to 254 Numerous values Similar to making waves because there are not sudden.
Part II Introduction to Robot Code. How to open a new FRC robot project 1.Open LabVIEW. 2.Click "FRC cRIO Robot Project" in the upper left section "New".
FRC Robot Programming 1.PID Continued 2.Downloading and Deploying Code 3.Program a 2012 Robot from Spec Basic code For FIRST Robotics.
Understanding The 2008 FRC Robot Controller Chris Gregory FRC1089 – Team Mercury
Session 11 Intro to FRC API.
Electronics and Controls
Cr yptonite robotics labview beta findings December 19, 2015.
Quick guide to ASIMON configuration For version 3.0 or greater SAFETY AT WORK Date: 3/18/2009.
Ethernet I/O Set-Up This presentation will step through a typical configuration of the DVT CON-IOE. Intellect 1.0 is used for the software portion.
Final Year Project(EPT4046) Development of an internet controlled Surveillance Mobile Robot By Mimi Madihah Bt Mohd Idris Id: BACHELOR OF ENGINEERING.
Mechanical Components and Programming Ken Youssefi Introduction to Engineering – E10 1.
Creating Flexible, Script-Controlled Autonomous Software Example Explanation.
FIRST ROBOTICS COMPETETION Introduction to Electrical & Control System Power and Signal Distribution/Interconnection Sensors, Motors, Speed Controllers,
After Construction Name: Per #:.
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
fischertechnik® RoboPro Software for Gateway To Technology® RoboPro
Trainings 10/28 Woooooo!!.
Field Management System
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Presentation transcript:

Apple Pi Robotics Logic System and Programming Basics 1 1

Agenda Review Control System Hardware LabView Programming Fundamentals On Robot Driver Station Where to begin application code LabView Interface LabView Programming Fundamentals Application Challenge From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 2 2

Control System Hardware Software Controller I/O and interface boards Communications Operator Interface Software Operating System Program Code From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 3 3

Let's Look at the Hardware Rack/Processor/Communication Analog Module Digital I/O Solenoid Module Extra Slot From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 The cRIO I had 8 slots, the newer cRIO II has 4. Both are compatible, and both are legal in competitions, if you have an 8 slot you may only use the 1st 4 slots. 4 4

12v Power from Power Distribution Board Additional Hardware Analog Breakout 12v Power from Power Distribution Board Up to 8 Analog sensors Jumper From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 Analog Breakout Board 5 5

All speed controllers (up to 10), relays (up to 8) connect to sidecar Additional Hardware Digital Sidecar From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 All speed controllers (up to 10), sensors (up to 16) and relays (up to 8) connect to sidecar Connect to 12V output on Power Distribution Board Robot Signal Light 6 6

Digital Sidecar Connections 7 Digital Sidecar Connections Status LEDs: These should always be green when robot is turned on PWM Outputs: Connect up to 10 Speed Controllers Servos also connect here must have a jumper on power pins to function Power connection: Connect to 12V output on Power Distribution Board Connects to the cRIO Digital Module Robot Signal Light Connector Sidecar image: http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2012_Assets/Digital%20Sidecar.pdf Relay Indicator Lights Red = REV Green = FWD Relay Outputs: Connect up to 8 Spike Relays Digital I/O: connect up to 14 digital sensors 7 7

Additional Hardware Solenoid Breakout 12v Power from Power Distribution Board Only used for pneumatics; spike relay, pressure switch From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 Solenoid Breakout Board 8 8

Driver Station Laptop Driver Station Software Joystick Custom Controls Dashboard 9

Laptop Classmate comes in the kit You can use any laptop that you like (Advanced) Software can run on the laptop and send data back to the robot, like vision processing 10

Driver Station Software Software that is run on the DS laptop Allows driver control of the robot Diagnostics of the communication to the robot Battery Voltage Read out Enter Key = Disable Spacebar Key = Emergency Stop (Use Enter normally) If you press Spacebar you will have to restart the robot before you can disable it 11

Driver Station Software 5 Tabs Provide Access to the different screens Operation Diagnostics Setup I/O Charts If you press Spacebar you will have to restart the robot before you can disable it 12

Driver Station Operation Tab Battery Voltage Display Team Number (Make sure it is correct) Mode Selection Teleoperated = Driver Autonomous = Computer Control Practice = Run like a match Elapsed time since start of robot communication PC Battery Communication Status Communication = a connection to the cRIO Robot Code = the user code is running User Messages (This area can be controlled by the robot program) Communication Status Enable/Disable Buttons Station Number for Competition Use 13

Driver Station Diagnostics Tab Communication LEDS: Green means they are active Hover over errors for messages that may help resolve issues View Driver Station Log can be useful for debugging errors Joystick and IO LEDS: Green means they are active Firmware Versions: These must be stay up to date for you to work at competition Reboot cRIO Useful if you have an error that a robot reset can fix 14

Driver Station Setup Tab Team Number Configuration: Make sure this is set correctly Choose NIC: Allows you select which network adapter is connected to the robot (Advanced) Allows you to configure Remote Dashboard Allows you to configure how the practice rounds are setup Joystick Setup: Drag Joystick up and down to switch which connected joystick is 1, 2, 3 or 4 in the program Exit: Logs off the Driver Station Account on the classmate 15

1616 Driver Station I/O Tab This tab is used for configuring custom interfaces with the cypress I/O module. If you aren’t using the cypress module you will not need this tab Cypress I/O Module Information can be found here: http://team358.org/files/programming/ControlSystem2009-/components.php There are several other ways to build custom I/O interfaces that don’t involve the cypress board or this I/O panel. You can find examples of these on Chiefdelphi.com 16

Driver Station Charts Tab This tab helps you diagnose problems with your robot Lost Pkts = Lost Packets this is an indication of connection issues, if you have a large amount of lost packets there is something wrong with your connection between the robot and the DS Volts = A graph of battery voltage this can be very useful to find correlations between battery volatage and problems that occur with the robot Msecs = This is reporting your trip time, which is how long it takes for information to go from the driver station to the robot, this should also be small CPU% = this is the percentage of CPU your cRIO is using, minimizing this will allow for better performance 17

Dashboard The Dashboard can be used to get feedback from robot systems. This is the default Labview Dashboard 18

D-Link DAP 1522 Router/Bridge 1919 D-Link DAP 1522 Router/Bridge Connects Robot to Driver Station Laptop Allows wireless control of the robot Also called the Radio Should be mounted away from motors and speed controllers to avoid interference Image 1: http://g-ecx.images-amazon.com/images/G/01/electronics/d-link/dlink-DAP-1522-hero-lg.jpg Image 2: http://www.negspace.com/wordpress/wp-content/gallery/clock_parts/DAP1522.jpg 19

D-Link DAP 1522 Router/Bridge Traffic Indicator Lights 2020 D-Link DAP 1522 Router/Bridge Image: http://g-ecx.images-amazon.com/images/G/01/electronics/d-link/dlink-DAP-1522-hero-lg.jpg Power Light (blue) Bridge Light (orange) Access Point Light (blue) Traffic Indicator Lights (blue) 20

D-Link DAP 1522 Router/Bridge rev.B 2121 D-Link DAP 1522 Router/Bridge rev.B Image: http://g-ecx.images-amazon.com/images/G/01/electronics/d-link/dlink-DAP-1522-hero-lg.jpg 21

D-Link DAP 1522 Router/Bridge 2222 D-Link DAP 1522 Router/Bridge Image: http://www.negspace.com/wordpress/wp-content/gallery/clock_parts/DAP1522.jpg 5v Power Connector Plugs in to grey power inverter Ethernet Ports AP/Bridge Switch AP = Practice/Home Bridge = At Competition Reset Button 22

Other Electrical System Devices Sensors Limit Switches Photo Detectors Infrared Sensors Encoders Potentiometers Gyro Speed Controllers Jaguars Victors Talons Solenoids Lights Pressure Switches Gyro Relays From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 23 23

Let's Talk Application Code Where do we Start? List Connected Hardware with purpose defined All Operator Interface Pushbutton/Switches Meters Lights All Robot Mounted Devices Limit switches Motor controllers Spike Relays Photo sensors From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 24 24

Application Code Where do we Start? Develop Sequence of Operations Documentation of how robot works; all subsystems defined including the purpose Ball collector/conveyor Shooter Drive train Knockdown All ties back to the hardware list From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 25 25

Knockdown Sequence of Operation Example: Knockdown Sequence of Operation The purpose of the Knockdown arm is to allow for the lowering of the bridges that are used to cross from the offensive side of the field to the defensive side. It is also used for lowering of the bridge during the “end game” to allow the robot(s) to get on the bridge to attempt balancing. Control devices include the “Arm Up” and “Arm Down” buttons on the Operator's joystick. The “Full Up” and “Full Down” limit switches control the stop points for actuation and prevent over travel. Both limit switches make use of the normally open contact. The “Knockdown Gearmotor” provides for the actuation of the arm. The motor operates clockwise for movement in the down direction (positive polarity) and counterclockwise for movement in the up direction (negative polarity). From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 26 26

Knockdown Sequence of Operation Example: Knockdown Sequence of Operation Operation: When the “Arm Down” button is depressed, the motor is commanded to rotate clockwise with a preset speed reference. The arm continues to advance in the down direction until either the button is released or the full down limit switch is engaged. If the button is released the arm stops at that point. If the full down limit switch is activated the arm stops in the down direction and can not be lowered further. Only the “Arm Up” button may be used at this location. When the “Arm Up” button is depressed, the motor is commanded to rotate counter clockwise with a preset speed reference. The arm continues to advance in the up direction until either the button is released or the full up limit switch is engaged. If the button is released the arm stops at that point. If the full up limit switch is activated the arm stops in the up direction and can not be raised further. Only the “Arm Down” button may be used at this location. From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 27 27

LabView Interface Overview: 1st do you have correct version installed? For those who don’t have correct version: We can start loading during initial discussion slides USB + 3 updates req’d Open a blank “vi” 28

LabVIEW Interface Each Virtual Instrument (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 Front Panel Block Diagram 29 29

Dataflow Programming Block diagram execution Dependent on the flow of data through wires Block diagram does NOT execute left to right It is good practice to lay out the code in an easy to follow left to right, top down manner Function executes when data is available to ALL input terminals Functions supply data to all output terminals when done Note – this slide is hidden LabVIEW follows a dataflow model for running VIs. A block diagram node executes when all its inputs are available. When a node completes execution, it supplies data to its output terminals and passes the output data to the next node in the dataflow path. Visual Basic, C++, JAVA, and most other text-based programming languages follow a control flow model of program execution. In control flow, the sequential order of program elements determines the execution order of a program. Consider the block diagram above. It adds two numbers and then multiplies by 2 from the result of the addition. In this case, the block diagram executes from left to right, not because the objects are placed in that order, but because one of the inputs of the Multiply function is not valid until the Add function has finished executing and passed the data to the Multiply function. Remember that a node executes only when data are available at all of its input terminals, and it supplies data to its output terminals only when it finishes execution. In the second piece of code, the Simulate Signal Express VI receives input from the controls and passes its result to the Graph. You may consider the add-multiply and the simulate signal code to co-exist on the same block diagram in parallel. This means that they will both begin executing at the same time and run independent of one another. If the computer running this code had multiple processors, these two pieces of code could run independent of one another (each on its own processor) without any additional coding. Logic Thinking: What functions are needed, and in what order? 30 30 © National Instruments Corporation 14 Introduction to LabVIEW Hands-On

LabVIEW Interface 31 31

LabVIEW Interface 32 32

LabVIEW Interface – function sets 3333 LabVIEW Interface – function sets LabVIEW palette sets Programming FRC specific palettes FIRST Vision WPI Robotics Library PID Toolkit palette Context Help LabVIEW palette – initial view is restricted for new users. In order to switch to the full palette set – use Switch Palette Set… in the tools menu. You get the standard LabVIEW palettes as well as 2 palettes that are specific to the FRC competition. FIRST Vision and WPI Robotics Library. The FIRST Vision palette will be mainly discussed in a later session. This session will focus primarily on the WPI Robotics Library. In addition to standard LabVIEW, we have also included the PID toolkit in the FRC installation. We will cover PID basics in the sessions as well. All of the functions in the palettes have additional help associated with them. If you have Context Help open (Ctrl-H) you can get a brief description of a palette or function with the option to access more detailed help. 33

WPI Robotics Library Interfaces with cRIO, sensors & actuators 3434 WPI Robotics Library Interfaces with cRIO, sensors & actuators Contains multiple palettes Robot Drive Sensors Actuators IO Driver Station Camera Communications Utilities WPI is used to interface with various devices including the cRIO, sensors, actuators, the camera, the driver station etc… The functionality will match what is available in the C/C++ version of WPI Lib, but because of language differences, the actual implementation may differ. Talk about the different palettes in a greater detail: 34

LabVIEW Interface Sample Block Diagram 35 35

LabVIEW Interface 36 36

LabVIEW Interface 37 37

LabVIEW Interface Help»Show Context Help, press the <Ctrl+H> keys 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 38 38

LabVIEW Best Practices Create a New Folder in your work directory for your LabVIEW work call it “Labview Data” You will save all your VIs & Projects to this folder. Saving your VI frequently is good, but know that once you choose to save your VI, it resets the ‘undo call’ (Ctrl-Z) and you will not be able to go back on any steps you made before saving your VI. Think function-to-function programming and not line-by-line Avoid crossing wires while connecting different objects on the block diagram. Crossed wires can be confusing to read and follow at times. (but can be unavoidable ) When in doubt, DEBUG! Use the light bulb icon on the status toolbar on the block diagram to highlight the path of the flow of data. From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 39 39

LabVIEW Best Practices Place output indicators at multiple steps during the data flow path of your VI to keep track of the output as it changes through the VI. PLAN PLAN and PLAN! Plan out the various stages of your VI/Program prior to placing objects on the block diagram. This will make it easier to end up with a clean picture of code and will also allow you to pick out the functions that best suit your needs. PRACTICE! The only way to get better at LabVIEW is to practice. We will teach basics and principles in next few weeks In order to be proficient – independent work is required From: Lee Harrisberger, "Engineersmanship ... The Doing of Engineering Design," 2nd Ed, Brooks/Cole Engineering Division, Monterey CA, 1982 40 40

LabView for FRC A template is provided to set up the code Open Labview FRC 2013 Select New FRC cRio Robot Project Change Project name Set IP Address to 10.20.67.02, select “Finish” In “Project Explorer” window select “Robot Main” Project explorer links multiple vi’s (Virtual Instruments)

That's All Folks! 42 42