Software Tutorial 26 Sept 2009. Agenda Development Environment Brain Board API Sensors Basic Behaviour Control.

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
LabView Basics.
Microprocessor Motor Control Spring Introduction  Stamp projects Robots  Sensors  Motor control  Logic Rocketry  Reading acceleration (“g”
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
Indian Institute of Technology Hyderabad ROBOTICS LINE FOLLOWER HARI KISHAN TANDEY – ES12B1008 DILIP KONDAPARTHI – ES12B1010 SAI KARTIK – CE12B1015.
We deal with voltage signals Sensors convert environment data to electrical signals Output: Voltage Input: Time/Distance/Whatever Move Receiver around.
ELECTRICAL. Circuits Outline Power Hub Microcontroller Sensor Inputs Motor Driver.
By Solid State Workshop. ● A microcontroller is an integrated circuit that is programmed to do a specific task. ● Microcontrollers are really just “mini-computers”.
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Project performed by: Safi Seid-Ahmad Emile.
Solar Car Data Collection System Matt Boyden Rene Dupuis Ryan Lavallee 4/23/08.
EE396 Project Micromouse Team: Ocha. Team Members Kanoa Jou (Programmer) Ryan Sato (Hardware) KiWoon Ahn (Recorder) Alan Do (Programmer)
Preliminary Design Review
1 Color Discriminating Tracking System Lloyd Rochester Sam Duncan Ben Schulz Fernando Valentiner.
1 Built-In Test Software for Deformable Mirror High Voltage Drivers Jianwei Zhou Home Institution: University of Hawaii at Manoa CfAO Akaimai Intership.
Microcontrollers Lecture L12.2 Section Microcontrollers Microcontrollers vs. Microprocessors Two standard architectures PIC microcontroller 68HC12.
Patent Liability Analysis Andrew Loveless. Potential Patent Infringement Autonomous obstacle avoidance 7,587,260 – Autonomous navigation system and method.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Easy on the Tini Bill Barker Carey Davis Ben Irwin Travis Majors Cell phone detector.
Basics of Sensors. A sensor is a device which is used to sense the surroundings of it & gives some useful information about it. This information is used.
ECE 477 DESIGN REVIEW TEAM 7  SPRING 2013 COST ROBOT CAROLINE TRIPPEL, ANDREW LOVELESS, ERIC OSBORNE, BRYAN DALLAS.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
ENGG1100 Lecture 6: Introduction To Engineering Design (Digital Logic) Part 1 Kin Hong Wong ENGG1100. Ch6-Digital Logic (Part1) 25/2/14 1.
ENGG1100 Lecture7: Introduction To Engineering Design (Digital Logic) Part 2 Kin Hong Wong ENGG1100. Ch7-Digital Logic (part 2) 16/02/15 1.
VEX Robotics Platform and ROBOTC Software
ENGG1100 Introduction to Engineering Design Digital Logic (Part 2) Prof. Kin Hong Wong Department of Computer Science and Engineering.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Daniel Pickem and Rowland O’Flaherty 12/04/2012 Mechatronics (ME 6405) Student Lecture On Arduinos *Some slides courtesy of Eoin Brazil
AMMAR HAJ HAMAD IZZAT AL KUKHON SUPERVISOR : DR. LUAI MALHIS Self-Driven Car.
Teacher/Mentor Institute Using easyC Joel Kirkland July 30-31, 2015.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
What is Mechatronics? Mechatronics is the synergistic combination of mechanical engineering, electronics, controls engineering, and computers, all integrated.
Behavior Control for Robotic Exploration of Planetary Surfaces Written by Erann Gat, Rajiv Desai, Robert Ivlev, John Loch and David P Miller Presented.
ENGG1100 Introduction to Engineering Design Digital Logic (Part 1) Prof. Kin Hong Wong Department of Computer Science and Engineering.
Introduction 2 Smart Design. What is smart design? 2 Everything is designed except nature The packaging of a Band-Aid The curve of a bike frame The shape.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
1 Model Checking of Robotic Control Systems Presenting: Sebastian Scherer Authors: Sebastian Scherer, Flavio Lerda, and Edmund M. Clarke.
Mark Randall & Kevin Claycomb Faculty Advisor: David Mitchell Industrial Sponsor: IEEE.
Mindstorms 1.1 Today’s topics l AI l History of Robotics l Uses of robots l The RCX l ROBOLAB l Upcoming ä Basic control ä Kinematics ä Robot architectures.
ME 142 Engineering Computation I Review Exam 1.  2 Part Exam In-Class Portion Testing Center Portion Equally weighted.
ECE 192: NATCAR Team (Triton X) Sponsored by IEEE ( Vincent Bantigue, Joseph Formanes,
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
Robot Project by Ahmad Shtaiyat Supervised by Dr. Salem Al-Agtash.
Microcontrollers A Practical Approach Ernesto Arroyo
Microcontrollers JULES CALELLA. Microcontrollers vs Microprocessors  Microprocessors – do not contain RAM, ROM, I/O  Microcontrollers – The whole package.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Get your software working before putting it on the robot!
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
Infrared Proximity Sensors & Liquid Crystal Display Instructor Dr Matthew Khin Yi Kyaw.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
ROBOTC for VEX Online Professional Development
ECE Computer Engineering Design Project
ARDUINO LINE FOLLOWER ROBOT
COMP541 Sequential Logic – 2: Finite State Machines
OPSE 301: Lab13 Data Analysis – Fitting Data to Arbitrary Functions
Review and Ideas for future Projects
The George Washington University Electrical & Computer Engineering Department ECE 1020 Dr. S. Ahmadi Lab 1.
CSCI1600: Embedded and Real Time Software
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Introduction to Arduinos
CTY SAR FCPS Alexander Velikanov
Equations & Graphing Algebra 1, Unit 3, Lesson 5.
Presentation transcript:

Software Tutorial 26 Sept 2009

Agenda Development Environment Brain Board API Sensors Basic Behaviour Control

MPLAB/C18 MPLAB: IDE, free download from microchip.com C18: C compiler for PIC microcontrollers, also from microchip.com

MPLAB IDE

Brain Board Capabilities PIC18F4580 –32KB program memory, 16K instructions –1536 B SRAM –256 B EEPROM Board –2 independent 5A motor drivers –6 Analog inputs (10-bit) –4 LEDs

API main.c: Master loop, setup functions brain.c: Functions called by master loop control.c: I/O filtering utilities.c: String output, delay function

API sensor_val[0-5] automatically updated Set motor1_speed, motor2_speed to a value in [-100,100] Logic: brain.c/stateMachine() Sensor conversion: control.c/readDist()

Sensors IR rangefinders –Sharp GP2D120(4-30 cm) IR line sensors –QRD1114

Sharp IR Rangefinders Pros –Low cost, low power, low mass –Sensor emissions are at speed of light –Divergence is not too bad Cons –Other IR sources can interfere (sun, other sensors) –Surface properties (absorption/reflection/transmission)

Sharp IR Rangefinders

Line Sensor Circuit

Behaviour Control Deliberative Control –“Traditional approach”, tends to use brute force –Better at being goal-directed –Path planning, localization, “AI” Reactive Control –Freeform, attempts to mirror nature –Roomba vacuum, “BEAM” robotics

Deliberative Control LocalizationCognition Perception Motion Control

Reactive Control React Perception Motion Control

Finite State Machines Easy to implement Easy to debug

Finite State Machines Exhibits different behaviour depending on the state “State” is general description of behaviour –Explore/Recharge/Hide –One state at a time “State transitions” are defined

Example State Diagram Search Attack Avoid Line

Example Code state = SEARCH while(true) { switch(state) case ATTACK: drive_straight if (nothing_on_sensors) state = SEARCH case SEARCH: drive_in_circles if (something_on_sensors) state = ATTACK else if (line_sensors_on) state = LINE case LINE: back_up state = SEARCH } Ignores lines Prioritizes ATTACK over LINE Hardcoded, unchanging behaviour

Example State Diagram Search Attack Avoid Line

Example State Diagram Search Attack Reversing Turning case LINE Augmented Finite State Machine (AFSM)

Example Code state = SEARCH while(true) { switch(state) case ATTACK: drive_straight if (nothing_on_sensors) state = SEARCH case SEARCH: drive_in_circles if (something_on_sensors) state = ATTACK else if (line_sensors_on) state = LINE case LINE: counter1 = 0 if (something_on_sensors) state = ATTACK else if counter1 < 10 drive_back else if counter1 < 20 turn_around else state = SEARCH } Allows transition to attack at any point Sequenced behaviour within state Global variable

Questions? Me: James

Appendix A Calibrating IR Rangefinders

Response Graph Important note: –Here, independent variable is distance –From a software perspective, independent variable is input voltage –Need to invert the function (in a swap x&y sense)

Response Graph

Possible Models y = a 1 e -a 0 x y = a 1 ln(x) + a 0 y = a 1 x -a 0 y = a 1 /x + a 0 Fastest to compute All models have a decent fit

Example Data Analog ValueActual Distance [cm]

Fitting Curve y = a 1 /x + a 0 Can find a 1,a 0 in many ways –Invert matrix, iterative techniques Software: MATLAB, Excel Excel Worksheet available –Uses built-in Excel matrix functions –Can also use “Goal Seek” (not in all versions of Excel)

Worksheet Input From debug output From measurement

Worksheet Output Intermediate calculation Final result (also, these cells contain the solution equations) Fitted data for display on graph (solid line)

Using Worksheet Fill in analog value/distance pairs (bordered in red on sheet) –14 pairs – take this amount of measurements or modify the sheet Results are bordered in blue on sheet

Integrating into API In main.c/setup(): –Set sensor_type[i] to SENSOR_RANGE or SENSOR_LINE (depending on type) –In example code: for (i = 0; i < 3; i++)//first 4 inputs range sensors sensor_type[i] = SENSOR_RANGE; for (i = 3; i < 6; i++)//last 4 are line sensors sensor_type[i] = SENSOR_LINE; In control.h: –For IR sensors, set each sensor’s constants to Excel-computed values #define ADx_MULT6000 #define ADx_ADD5 If the i-th sensor is a line, just check: –sensor_val[i] == ON_LINE or sensor_val[i] == OFF_LINE Otherwise, sensor_val[i] contains the distance in cm