PHY 235 Robotics Workshop Day 8 IO, Multi-tasking Sample Start Program Team Projects.

Slides:



Advertisements
Similar presentations
Dublin Robotics Boosters NXT-Step Programming Workshop.
Advertisements

Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
In this presentation you will:
Team Spot Cooperative Light Finding Robots A Robotics Academy Project Louise Flannery, Laurel Hesch, Emily Mower, and Adeline Sutphen Under the direction.
Loops, and sub-routines Interrupts Can be very useful in control applications particularly when the microprocessor must perform two tasks apparently.
PHY 235 Robotics Workshop Day 6 DC Motors, H-Bridge Board, Simple Lego/Boe Bot.
VEX and Robot C Chris Patterson Presented by Modified by J. Andazola.
Boe-Bot Challenge. Advanced Users (those who have used Boe-Bots in Digital Electronics) There are suggested activities / programs for each challenge.
Navigating the BOE-BOT
PHY 235 Robotics Workshop Day 3 IR Distance Sensing.
Loops in LabVIEW (while,for and case)
Vex Robotics Introduction to Sensors. introduction to sensors Sensors assist robots in seeing and feeling the physical world through which they travel.
Available at: – Program Optical Quad Encoders in Autonomous Mode Program optical quad encoders in autonomous mode.
Engineering H193 - Team Project Gateway Engineering Education Coalition P. 1 Spring Quarter 2008 Robot Programming Tips Week 4 Day 2 By Matt Gates and.
Smart Irrigation System Raihan Haque Brian Moy Puneet Karnawat Group 7 ME 3484 Polytechnic University April 24, 2003.
Chapter 11 Operating Systems
LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
Introduction to Sensors
Engineering H193 - Team Project Gateway Engineering Education Coalition P. 1 Spring Quarter Week 6 Day 2 Lecture on and Examples of Electrical Circuits.
Colorado Space Grant Consortium Gateway To Space ASEN 1400 / ASTR 2500 Class #12 Gateway To Space ASEN 1400 / ASTR 2500 Class #12 T-58.
Testbed: Exercises.
PHY 235 Robotics Workshop Course Introduction. Learning Objectives Understand and build autonomous robotic systems. Apply concepts of computer science.
Teaching with Robotics Professor: Jeffrey Forbes
ROBOTC Software Introduction. ROBOTC Software ROBOTC developed specifically for classrooms and competitions Complete programming solution for VEX Cortex.
Programming Concepts Part B Ping Hsu. Functions A function is a way to organize the program so that: – frequently used sets of instructions or – a set.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
Coding for the FIRST Tech Challenge: RobotC
Introduction to Robo Pro
Programming the CheapBot-14. Start the Editor Set the Mode.
Forging new generations of engineers
1 RTOS Design Some of the content of this set of slides is taken from the documentation existing on the FreeRTOS website
VB Games: Preparing for Memory Brainstorm controls & events Parallel structures (again), Visibility, LoadPicture, User-defined procedures, Do While/Loop,busy.
A note on oral presentations These are the progress report presentations. Please note that the individual presentations should be ~8 min long. Since the.
Microcomputers Final Project.  Camera surveillance is an important aspect of Robotics.  Autonomous robots require the use of servos for camera control.
2008 SBPLI/FIRST Programming Workshop Tom Boehm Patchogue Medford High School, Team 329 Motorola Inc. Mark McLeod Hauppauge High School Team 358 Northrop.
Design of the New Handy Board for Robotics Using the NI LabVIEW Embedded Module for ADI Blackfin Processor Fred Martin, Assistant Professor, Computer Science.
CMP-MX21: Lecture 5 Repetitions Steve Hordley. Overview 1. Repetition using the do-while construct 2. Repetition using the while construct 3. Repetition.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Minds and Computers 2.1 The RCX l Hitachi H8/3297 series processor l 3 inputs/sensors (1, 2, 3) l 3 outputs/motors (A, B, C) l 32k RAM/ 16k ROM ä 12 kB.
PHY 235 Robotics Workshop Day 4 Robotic Behaviors, Light Sensing, Voltage Dividers, LCD-MOD.
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
PHY 235 Robotics Workshop Day 5 Distance Sensing Using The Ultrasonic Ping Sensor.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
Microcontrollers, Microcomputers, and Microprocessors
VEX and Robot C Chris Patterson Frisco ISD CTE Center Presented by.
Introduction to LabVIEW
DPS Secondary Science Institute 1 Agenda 8:30-8:45 Introduction and Overview 8:45-9:15 The Bumper Car 9:15-10:15 The Line Follower 10:15-10:30 Questions.
Lynxmotion Robotic Arm © 2013 Project Lead The Way, Inc.Computer Integrated Manufacturing
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Tutorial 2: Homework 1 and Project 1
Variables and Functions
By Sanjay and Arvind Seshan
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
IR & Servos Lab 3 Spring Quarter.
Variables and Functions
Variables and Functions
BEGINNER EV3 PROGRAMMING Lesson
The method invocation mechanism and the System Stack
CS 143A Quiz 1 Solution.
Variables and Functions
Multithreading.
The structure of programming
Prepared By: Deborah Becker
Compiled from various Internet sources Presented by Mr. Hatfield
CSE 153 Design of Operating Systems Winter 2019
Programming Concepts (Part B) ENGR 10 Introduction to Engineering
Lego MINDSTORMS EV3.
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

PHY 235 Robotics Workshop Day 8 IO, Multi-tasking Sample Start Program Team Projects

IO Planning When planning the design of your robot, keep in mind how you will use the IO pins. You will need at least: 4 pins for Lego Motor control 4 pins for IR Beacon (discussed tomorrow) 1 pin for bottom photo-resistor to sense start light This makes 9 pins that are necessary, leaving 7 pins for your use.

IO Planning Possible uses for remaining 7 pins: DC Motor – This will require another motor controller board and 2-4 pins (1-2 motors) Servo Motors – This will require 1 signal pin for each servo IR distance/proximity sensor – 1 pin Other photo-resistors – 1 pin Bump (Whisker, Switch) sensor – 1 pin Ping – 1 pin LCD Display (This uses up to 4 of your IO pins)

Multi-Tasking Multi-tasking refers to the ability to create a program that will carry out more than one process at the same time. Zbasic allows for multi-tasking. If there is more than one task, then a task scheduler switches back and forth between tasks every CPU time tic (about 1.95 micro-sec’s) For the user, this gives the appearance of the two tasks happening simultaneously.

Multi-Tasking The subroutine Main() is a single task. To create another task we need to do two things: Reserve space for the new task on the Task Stack. The task stack is a portion of RAM set aside exclusively for the new task. Create the task by writing CallTask “NameOfTask”, taskStack

Multi-Tasking - Example Here is an example: Dim taskStack(1 to 80) as Byte Sub Main() CallTask "MyTask", taskStack Do Debug.Print "Hello from Main" Call Delay(1.0) Loop End Sub Sub MyTask() Do Debug.Print "Hello from MyTask" Call Delay(2.0) Loop End Sub

Multi-Tasking - Example From the Zbasic Reference: “This program has two tasks: Main and MyTask. The Main task is created automatically and its task stack is automatically allocated all of the remaining User RAM after explicitly defined variables are allocated. In contrast, additional tasks such as MyTask have to be explicitly invoked using the CallTask statement and each task’s stack must also be explicitly allocated, for example by defining a Byte array as shown above. A task is said to be “active” if it has been invoked by CallTask and has not yet terminated. Both of the tasks above never terminate so they are always active. “

RoboPong Start Program Template For our contest, we will need to have the robot keep track of time and shut itself off at the end of 60 seconds. The best way to do this is to create a second task that will just sleep for 60 seconds and then shut things down. The code on the next slide is a prototype you can use for developing your program.

RoboPong Start Program Template Dim taskStack(1 to 80) as Byte ' Memory allocation for 2nd task Dim continueFlag as Boolean = true ' Motor IO pins const p0 as byte = 5 const p1 as byte = 6 const p2 as byte = 7 const p3 as byte = 8 ' Data for Bottom Photoresistor to read start light const p15 as byte = 20 'IO pin for bottom light sensor const startLightThreshold as integer = 300 Dim bottomLightVal as Integer = 1 ' where we store sensor value

RoboPong Start Program Template Sub Main() ' Wait for start light signal while bottomLightVal < startLightThreshold ' read photoresistor value bottomLightVal = GetADC(p15) wend ' Start the timing task CallTask "StopAfter60Seconds", taskStack ' Determine which side you are on - white or black Call SetSideForMatch() ' Main loop - read sensors and take action Do until continueFlag = false Call GetAllSensorVals() Call TakeAction() Loop End Sub

RoboPong Start Program Template Sub StopAfter60Seconds() 'Sleep for 60 seconds Call sleep(60.0) ' Lock this task so no other tasks can execute Call LockTask() ' Set the continueFlag just in case some other task ' is still executing continueFlag = false ' Turn off all motors call ShutDownMotors() ' Exit the Main() task - should exit the program call ExitTask() End Sub

RoboPong Start Program Template Sub GetAllSensorVals() End Sub Sub TakeAction() ' Motors rotate one direction call putpin(p0, 1) call putpin(p1, 0) call putpin(p2, 1) call putpin(p3, 0) call delay(0.5) ' Motors rotate other direction call putpin(p0, 0) call putpin(p1, 1) call putpin(p2, 0) call putpin(p3, 1) call delay(0.5) End Sub Sub ShutDownMotors() ' Stop both Lego Motors call Putpin(p0, 0) call Putpin(p1, 0) call Putpin(p2, 0) call Putpin(p3, 0) ' Stop any other DC motors or Servos End Sub Sub SetSideForMatch() End Sub

Team Projects In addition to preparing for the RoboPong contest, each team will research a specific advanced sensor (or interface device) to the Boe-bot CPU. The sensors are in three categories: I. Basic Sensor – Complex Usage Break Beam Sensor (See F. Martin Text) Shaft Encoding (See F. Martin Text) Sharp GP2D02 Distance sensor (Optical) (See F. Martin Text) Parallax 2-axis Joystick (Go to parallax.com for doc’s and examples

Team Projects II. Sensor Using Synchronous Serial IO (- Hvidsten Slides) Honeywell HMC6352 Compass Hitachi H48C Tri-Axis Accelerometer Parallax ColorPal Color Sensor Parallax Passive Infrared Motion Sensor DS1620 Digital Thermometer (Go to parallax.com for doc’s and examples on these) III. Interface to Winbond audio board (I have some ref’s for this project)

Team Projects The projects in group II require the use of Synchronous-Serial Interfacing. I have slides from a previous course on this topic. The most challenging project is the one in group III. I will assist any group who wishes to tackle this one. The 6 teams will work on 6 different projects. Teams will be given the opportunity to choose a project type based on a random selection of team order.

Team Project Requirements Each team will do research on their project, develop code, and produce two products: 1.A team presentation to the class on their project. The presentation should include: a.Background and theory on how sensor (device) works. b.Sample code to show how to use sensor/device. c.Demo of Robot (Lego or Boe-bot) using the device. 2.A written AppNote. This is a 2-3 page document which explains the sensor, shows breadboard/schematic and shows sample code. An example of such an AppNote is included on the Documents page of the course web site.

Team Project Timeline Wed, January 12 – Tuesday, January 18 Teams work on project Wednesday-Friday, January Team Presentations (2 per day)