Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

42
Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez Autonomous Ball Collector

description

Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez. Autonomous Ball Collector. Project Purpose:. Project Overview. Create a robot that is able to collect tennis balls either autonomously or manually. Goals and Objectives. To autonomously or manually pick up tennis balls. - PowerPoint PPT Presentation

Transcript of Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Page 1: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Group #2 Jorge AvillaLuis Bonilla

RedwoodDiego Nunez

Autonomous Ball Collector

Page 2: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Project Purpose:

Page 3: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Project OverviewCreate a robot that is able to

collect tennis balls either autonomously or manually.

Page 4: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Goals and ObjectivesTo autonomously or manually

pick up tennis balls.Recognize objects using a vision

system.Able to keep track of number of

balls collected.Wireless control from a remote

control if it’s not on autonomous mode.

Page 5: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Specifications & RequirementsRobot cost around $700.00.Weight less than 7 lbs.Ability to carry 3-5 tennis balls.Range of 120 ft.Battery life of around 1 hour.

Page 6: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Project ComponentsVision System: To identify objectsDC Motors: For movements of the

robotBatteries: To provide power to all

components of the robot to function properly

Ball Collecting Mechanism: To collect the tennis balls

Wireless Device: To manually operate the robot

Page 7: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Chassis DesignCustom ChassisModeled in

SolidWorksBuilt the actual

chassisusing clear acrylic sheets

Connect the robot’splatform using L-brackets

Page 8: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Paddle Wheel design.Built with PVC and clear

acrylic sheet.The system uses a DC

motor to rotate the paddle in order to collect the balls.

Ball Collecting Mechanism

Page 9: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Chassis Design

Page 10: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

ABC uses 2 Sharp IR Range Sensors.

Each sensor eliminates the 10 cm minimum distance of the other.

The sensors are located inside the chassis, behind the wheel paddle.

Ball Counter

Page 11: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Drive Train

Page 12: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Motors2 DC motors for movementOperating Voltage = 12 volt Operating Current = 90 mAStall Current = 1.5 AStall Torque = 123.20 oz.-inRPM = 120Weight = 5.36 oz.Price = 21.95 each

Page 13: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

WheelsRear Wheels

◦2 All Terrain Wheels

Front Wheels◦2 Caster Wheel

to provide balance

Page 14: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Visual SystemBlackfin Camera:

• Color Detection• Motion Detection• Compatible with WebBot Library• It communicates via UART

Specifications Blackfin CameraProcessor Blackfin BF537Processor’s Speed 500 MHzInput Voltage 3.3 VCurrent Draw (max) 145 mAUART 2Number of Timers 4Frames per Second 30I/O pins 16Resolution 640x480

Page 15: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

MicrocontrollerSpecs Atmega328

Pins 32I/O pins 23EEProm 1K

Program Memory 32KSPI Yes

USART 1Timers 8/16 bit 2/1

PWM pins 6ADC channels 8Programming

Language CMax Clock Rate 20 MHz

Voltage 1.8-5.5VPrice $5

Atmega328

Page 16: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Why atmega328:

• More Programmable Memory

• Previous experience with atmega8 and atmega168

• Already had programmer available.

• WebBot Library: Functions library compatible with the 328 and with the Blackfin Camera

• Simplifies programming process.

Microcontroller

Page 17: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Blackfin Camera

XBee

Motor ControllerL298N Counter

Main Controller

3 Microcontrollers:• Simplifies testing of the different parts separately• Allows for the coding to be divided among the group

Main Controller: Brain of the robot, receiving and transmitting information

between the other two microcontrollers and the camera

Motor Controller:Receives input from the main controller or the laptop(RC

mode). Controls the input of the h-bridges.

Counter: Keeps count of the number of balls the have been loaded on the vehicle and instructs the Main to return to the base once the goal has been reached.

Microcontroller Design

Page 18: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Main Controller and Counter Schematic

Page 19: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Motor Controller modes:• Autonomous mode: Receives its input from the main controller

Controlling Truth Table:

Pins Main Controller/Motor ControllerC3/C3 C4/C4 C5/C5 Action

0 0 0 Stop

0 0 1 Forward

0 1 0 Reverse

0 1 1 Turn Right

1 0 0 Turn Left1 0 1 Roller on Forward

1 1 0 Roller on Reverse

1 1 1 Roller OFF

Page 20: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Motor Controller Modes:

• Remote Control Mode: Receives its inputs from a Laptop via XBee.

Motor Controller

Xbee Receiver

Xbee Emitter

Laptop

Page 21: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

H-Bridge:

• Receives the input from the motor controller and provides the power to the DC motors.

• Protects the microcontroller from any shorts from the motors.

L298 from STMicroelectronics Characteristics:

Specs L298Logic Supply Voltage 5V

Voltage Supply (motors) Up to 45V

DC Current Supply per Channel 2A

# Channels 2

PWM Capable Pins Yes

Logical 0 Input Voltage Up to 1.5 V

Page 22: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

L298 Configuration Schematic:

• Diodes are fast response Schottky diodes.

Page 23: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Motor Controller with L298s Schematic:

Page 24: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Specs Xbee BlueSmirfRange 300ft 350ftVoltage 3.3V 4.5-5.5VCurrent TX 45mA Up to 120mACurrent RX 50mA 40mAIdle current <10uA 2mAFrequency 2.4GHz 2.4GHzInterface TTL TTLPrice $19 $64

Wireless Adapters

vs.

Page 25: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

12V Battery◦To power all the DC motors such as

the drive train and the ball collecting mechanism

9.6V Battery ◦To power all the electronic

components such as the camera, the sensors, and the wireless devices for the remote control

NiMH Rechargeable Batteries

Page 26: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Power Management

Page 27: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Component Quantity

Voltage

Max Curren

tDrive Train motors 2 12 V 1.5 A Ball Collecting Mechanism motor

1 12 V 1 A

Camera 1 3.3 V 150 mASensors 3 5 V 5 mAWireless devices for Remote Control

1 3.3 V 50 mA

Microcontrollers: ATMEGA 328

3 5V 80mA

H-Bridge: L298 2 5V 50mA

Power Distribution

Page 28: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Collision Avoidance• The Maxbotix LV-EZ1

ultrasonic rangefinder provides accurate readings from a minimum tested distance of 6 in. to a maximum of 255 in., according to Sparkfun Electronics.• The robot is designed such that it

registers any object sensed 1 ft. away as a possible collision, and performs a evasive procedure.

• The single rangefinder mounted on the chassis is not enough to provide full collision detection.

Page 29: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Programming Environment:

• AVR Studio 4

• AVR Pocket ProgrammerPros: Provides power to the microcontroller.

• Pololu USB AVR ProgrammerPros: Integrates directly to AVR Studio 4, allowing direct programming.

• WebBot Library

o http://webbot.org.uk/iPoint/ipoint“This site contains useful software utilities for both the amateur and professionalrobot builder. Whilst this software is Open Source I would hope, if it has beenuseful, that you will visit the download page  and click on the Donate button onthe top right of the page and give what you can.”

Software Design

Page 30: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

abcr_core.hIncludes

sys/atmega328P.hswitch.h

Definitions

Enumerationsoperation_mode

Structuresnone

Global VariablesopSwitch

FunctionsappControlappRCControlappAUTOControlretrieveOperationMode

• sys/atmega328P.hSystems file from the WebBot Library which configures the targets the functionalities of the Atmel Atmega 328.

• operation_modeRC – Remote Control.AUTO – Autonomous.

• Enable the program to be easily switched between the two different types of operation modes we want to handle.

Page 31: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

event.hIncludes

noneDefinitions

noneEnumerations

event_modeStructures

event_typeevent_map

Global Variablesnone

Functions

twoPowerOfappConfigureEventstransmitEventCodetransmitEventReftransmitEventNamereceiveEventCodereceiveEventNamereceiveEventRef

• event_typeRepresents an event that can be sent orreceived between microprocessors.

• event_mapStructure that represents an interaction thatwill occur between microprocessors.

• Intended for structuring the interactions

that will be performed betweenmicrocontrollers.

Page 32: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Acquisition.( h | c )

Includesabcr_core.ha2d.hevent.hSleep.hSensors/Distance/Maxbotix/EZ1.h

DefinitionsIR_LEFTIR_RIGHTPERCENT_ERROR_DETECTION_THRESHOLDCOUNTTHRESHOLDHOMEBASETHRESHOLDFREQUENCY

Enumerations

Structures

Global Variables_IREventMap__prevIRLeftDistance__prevIRRightDistance_totalCount_irSensingmDistanceSensor_ballAcquiredDelay

FunctionsisBallAcquiredappConfigureEventsappRCControlappInitHardwareappInitSoftwareappAUTOControlCollisionDetected

• Implements the sensing and counting of tennis balls as well as informing the autonomous code of a full tennis ball storage compartment.

• At each iteration of the main loop, we call the isBallAcquired function and determine the message to send to the autonomous controller from the result.

Page 33: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Command

vbc vccy1y2u1u2v1v2 vm

Response ##vbc dd\r\n ssss x1 x2 y1 y2\r\n ....

###vcc\r\n ##vmean yy uu vv\r\n

Description

The 'vb' command searches for blobs matching the colors in color bin #c, indicates the number of blobs found as dd, and returns a count of matching pixels in the blob, along with coordinates of an x1, x2, y1, y2 rectangular region containing the matching pixels. up to 16 blobs can be returned, and the blobs are sent in order of pixel count, though blobs smaller than MIN_BLOB_SIZE (currently set to 5 pixels) aren't shown.

The 'vc' command directly sets the contents of color bin #c. this command will return string with 'vc' followed by the color bin number. For example, we could save a set of colors to color bin #3 corresponding to measurements taken at another time, such as the above mentioned orange golf ball color measurement, using 'vc3127176086111154200'. We could then confirm that the colors were properly stored by issuing the command 'vr3' to retrieve the contents of color bin #3.

Computes mean values for Y, U, and V over the entire image.

Page 34: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Autonomous.( h | c )Includes

buffer.habcr_core.hCameras/Surveyor/blackfin.hevent.hSleep.h

DefinitionsUART_RX_BUFFER_SIZEUART_TX_BUFFER_SIZEBLACKFIN_RESOLUTION_DEFAULTBLACKFIN_TENNIS_BALL_BIN_RANGEBLACKFIN_HOME_BASE_BINS_RANGEBLACKFIN_RESOLUTION_CENTER_WIDTHBLACKFIN_RESOLUTION_CENTER_HEIGHTOBJECT_CENTERED_WIDTH_RANGE_ERROR_NEAROBJECT_CENTERED_WIDTH_RANGE_ERROR_FAR OBJECT_CENTERED_HEIGHT_RANGE_ERRORBLOB_LOST_DEFAULT_WAITBLOB_LOST_DEFAULT_SPRINTROLLER_CHECK_DEFAULTROLLER_CHECK_BLOB_NEARDEFAULT_SERVO_SPEEDSERVO_SPEED_MAXSERVO_SPEED_MIDSERVO_SPEED_MINSERVO_STEPAUTO_ROLLER_ONAUTO_ORTH_TURN_DELAY 18AUTO_LONG_DELAY 70AUTO_MED_DELAY 30AUTO_SHORT_DELAY 12FREQUENCY 20000;

• Responsible for capturing of commands

from the Blackfin camera and transmittingthe right movement instructions to the drive train.

• setColorBinsDynamically change the color bin range that the camera searches for depending on the mean color of the image.

• detectBlobsProcess the action that needs to be performed from the data gathered from the camera.

Page 35: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

•Eagle Cad Software:• Extensive Library Parts and Good tutorials on the web

•Manufactured by 4PCB: Student discounts

PCB Design

Page 36: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

• Traces have different widths depending on the amount of current flowing on them.• Signal traces are thinner that power traces• Ground Plane• Combines surface mount parts with through hole.

PCB Design

Page 37: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

PCB with the surface components mounted.

PCB Design

Page 38: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Programming

Sensors

PCB

Camera

Remote Control

Drive Train

Power

0% 20% 40% 60% 80%100%

LuisJorgeDiego

Project Management

Page 39: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Project Budget

Item Amount

Camera $ 230.00

Battery/Charger $ 80.00

GPS $ 100.00

RC Unit $ 65.00

Chassis $ 30.00

Sensors $ 60.00

Motor/Wheels $ 50.00

Electronics $ 30.00

PCB $ 55.00

TOTAL $ 700.00

ExpectedProject Budget

Item Amount

Camera $ 171.56

Battery/Charger $ 60.35

XBee $ 91.45

Ball Collecting Mechanism $ 45.08

Chassis $ 120.00

Sensors $ 30.00

Motor/Wheels $ 75.80

Electronics $ 60.00

PCB $ 60.00

TOTAL $ 714.24

Final

Project Management

Page 40: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Caster wheels affecting motion◦Solution:

Compensate as much as possible in code

Missing connection on the board◦Solution: Soldered cables directly to

the board

Project Challenges

Page 41: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

Color Specification:

• The Blackfin camera takesa range of colors to define a blob.

• A color blob is not a accuratemethod for searching for a specificobject.

Possible improvements:

• Machine learning:http://research.microsoft.com/en-us/um/people/viola/Pubs/Detect/violaJones_IJCV.pdf

• Edge finding

Project Challenges

Page 42: Group #2 Jorge Avilla Luis Bonilla Redwood Diego Nunez

• All project information is available at: http://eecs.ucf.edu/seniordesign/su2010fa2010/g

02/

Questions?

More Information