ece 3091 - final report-final

Upload: kaustav-das

Post on 04-Jun-2018

295 views

Category:

Documents


14 download

TRANSCRIPT

  • 8/13/2019 Ece 3091 - Final Report-final

    1/60

    Group 10: THE LIGHTSABER

    MONASH UNIVERSITY SUNWAY CAMPUS

    THE PEARL

    HUNTERECE 3091

    KESHAV RAMREKHA 21630283

    TRIANDI TANRI 21827559

    OMAR ABDULLAH 21837473

  • 8/13/2019 Ece 3091 - Final Report-final

    2/60

    ContentsList of Figures ................................................................................................................................................ 4

    List of Tables ................................................................................................................................................. 5

    Acknowledgement ........................................................................................................................................ 6

    Abstract ......................................................................................................................................................... 7

    Chapter 1 : Requirements Definition ............................................................................................................ 8

    1.Introduction .......................................................................................................................................... 8

    1.1 Objective ......................................................................................................................................... 8

    1.2 Capabilities of the final prototype .................................................................................................. 9

    1.3 Purpose of this Report .................................................................................................................... 9

    CHAPTER 2: LITERATURE REVIEW ............................................................................................................... 10

    2. Introduction .................................................................................................................................... 10

    2.1 Robot 1: Line following robot (MOBOT competition) ....................................................................... 10

    2.2 Robot 2: Hyper Squirrel..................................................................................................................... 11

    2.3 Robot 3: The $50 Robot with Sharp IR edge detection .................................................................... 12

    2.4 Robot 4: The OMNI-WHEEL ROBOT .................................................................................................. 13

    2.4 Literature review conclusion ............................................................................................................ 14

    CHAPTER 3: TEAM ORGANIZATION AND MANAGEMENT .......................................................................... 15

    Introduction ................................................................................................................................................ 15

    3.1 Planning Methods ................................................................................................................................. 15

    3.1.1 Work Breakdown Structure ........................................................................................................... 15

    3.1.2 Schedule for Network Activities (Critical Path Diagram) ............................................................... 16

    3.1.3 Gantt Chart..................................................................................................................................... 17

    3.1.4 Responsibility Matrix ..................................................................................................................... 19

    3.1.5 Cost Estimation .............................................................................................................................. 20

    3.1.6 Risk analysis ................................................................................................................................... 21

    CHAPTER 4: THE LIGHTSABER DESIGN (Prototype 1).................................................................................. 224. THE SUB-SYSTEMS ........................................................................................................................... 22

    Introduction ........................................................................................................................................ 22

    4.1 Mechanical sub-system ................................................................................................................. 22

    4.2 Locomotion sub-system ................................................................................................................ 24

    4.3 Electronics Sub-system ................................................................................................................. 26

    4.4 Pearl Detection and Collection ..................................................................................................... 30

    4.5 Assessment of Prototype 1 ........................................................................................................... 34

    CHAPTER 5: The Lightsaber (Prototype 2) .................................................................................................. 37

  • 8/13/2019 Ece 3091 - Final Report-final

    3/60

    5.1 Faults identified ................................................................................................................................ 37

    5.2 Prototype 2The Design .................................................................................................................. 38

    5.2.1 Mechanical sub-system .............................................................................................................. 38

    5.2.2 Locomotion sub-system ............................................................................................................. 39

    5.2.3 Electronics Sub-system .............................................................................................................. 40

    5.2.4 Pearl Detection and Collection .................................................................................................. 42

    CHAPTER 6: Evaluation ............................................................................................................................... 46

    6.1 Problems and Solutions .................................................................................................................... 46

    6.1.1 Hardware ................................................................................................................................... 46

    6.1.2 Software ..................................................................................................................................... 47

    6.2 Improvements and Optimization ...................................................................................................... 47

    6.3 The Final Competition ....................................................................................................................... 48

    6.3.1 Match 1 ...................................................................................................................................... 48

    6.3.2 Match 2 ...................................................................................................................................... 49

    6.3.3 Match 3 ...................................................................................................................................... 50

    6.3.4 Match 4 ...................................................................................................................................... 50

    Conclusion ................................................................................................................................................... 51

    References .................................................................................................................................................. 52

    Appendix ..................................................................................................................................................... 53

    Appendix ATesting Scheme for Prototype 2 ....................................................................................... 53

    i. Chassis strength .......................................................................................................................... 53

    ii. Speed .......................................................................................................................................... 54

    iii. The 90oleft turn .......................................................................................................................... 54

    iv. Battery Life .................................................................................................................................. 55

    Appendix BFull Code written for the Arduino Duemilanove .............................................................. 56

  • 8/13/2019 Ece 3091 - Final Report-final

    4/60

    List of FiguresFigure 1: The platform of the black pearl project ......................................................................................... 8

    Figure 2: Final Prototype ............................................................................................................................... 9

    Figure 3: Design layout of the Pikachu robot .............................................................................................. 10

    Figure 4: Design layout of the Hyper Squirrel robot ................................................................................... 11

    Figure 5: Design layout of the $50 robot robot .......................................................................................... 12

    Figure 6: Design layout of the omni wheel robot ....................................................................................... 13

    Figure 7: Work breakdown Chart ................................................................................................................ 15

    Figure 8: Critical Path Diagram ................................................................................................................... 16

    Figure 9: Gantt Chart Table ......................................................................................................................... 17

    Figure 10: Gantt chart Timeline .................................................................................................................. 18

    Figure 11: Design layout of the chassis ....................................................................................................... 22

    Figure 12: Design layout of the chassis (side view) .................................................................................... 23

    Figure 13: Design layout of the chassis (top view) ..................................................................................... 23

    Figure 14: Actual view with top layer mounted (side view) ....................................................................... 23

    Figure 15: Tamiya Double Gearbox schematics .......................................................................................... 24Figure 16: Actual view with wheels under test ........................................................................................... 25

    Figure 17: Initial prototype with wheels mounted on chassis .................................................................... 25

    Figure 18: L293D H-bridge .......................................................................................................................... 26

    Figure 19: H-bridge circuit connection ....................................................................................................... 27

    Figure 20: H-bridge circuit connected to wheels ........................................................................................ 28

    Figure 21: IR sensor circuit .......................................................................................................................... 29

    Figure 22: Arduino Duemilanove microcontroller ...................................................................................... 29

    Figure 23: The main circuitry as seen on top of the Lightsaber .................................................................. 30

    Figure 24: Pearl Detection and Collection method ..................................................................................... 31

    Figure 25: Flowchart for algorithm of Prototype 1 ..................................................................................... 32

    Figure 26: Pearl detection and collection ................................................................................................... 33

    Figure 27: The new design for the chassis (widened chassis) ..................................................................... 38

    Figure 28: The new design for the chassis (increased stability) ................................................................. 39

    Figure 29: Addition of ball casters to the chassis ....................................................................................... 39

    Figure 30: Use of the Sharp IR rangefinder for wall and robot detection and avoidance .......................... 40

    Figure 31: Use of the Sharp IR rangefinder for wall and robot detection and avoidance .......................... 41

    Figure 32: Flowchart for Prototype 2 .......................................................................................................... 42

    Figure 33: Start of Algorithm (Path 1) ......................................................................................................... 43

    Figure 34: Path 2 ......................................................................................................................................... 44Figure 35: Path 3 ......................................................................................................................................... 44

    Figure 36: Path 4 ......................................................................................................................................... 45

    Figure 37: Lightsaber Prototype 2 ............................................................................................................... 48

    Figure 38: Inability to return to base after getting stuck ............................................................................ 49

    Figure 39: New path taken after confusion ................................................................................................ 50

    Figure 40: Deflection of chassis frame ........................................................................................................ 53

    Figure 41: The 90oleft turn ......................................................................................................................... 54

    http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145827http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145828http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145830http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145834http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145846http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145850http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145851http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145857http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145858http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145859http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145860http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145861http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145862http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145863http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145865http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145865http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145865http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145865http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145863http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145862http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145861http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145860http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145859http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145858http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145857http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145851http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145850http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145846http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145834http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145830http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145828http://c/Users/KSHV/Documents/ECE%203091%20-%20FINAL%20REPORT.docx%23_Toc307145827
  • 8/13/2019 Ece 3091 - Final Report-final

    5/60

    List of Tables

    Table 1: Tabular Comparison of the 4 robots ............................................................................................. 14

    Table 2: Responsibility Matrix ..................................................................................................................... 19

    Table 3: Cost Estimation ............................................................................................................................. 20Table 4: Risk Assessment ............................................................................................................................ 21

    Table 5: Table of number of pearls collected ............................................................................................. 34

    Table 6: Table showing drop in voltage levels of batteries (powering H-bridge and sensors) ................... 35

    Table 7:Table showing drop in voltage levels of battery (powering Arduino)............................................ 35

    Table 8: Table describing faults identified in Prototype 1 .......................................................................... 37

    Table 9: Table for hardware problems and solutions ................................................................................. 46

    Table 10: Table for software problems and solutions ................................................................................ 47

    Table 11: Table of improvements and Optimization performed ................................................................ 47

    Table 12: Table of weight v/s deflection ..................................................................................................... 53

    Table 13: Speed v/s stability ....................................................................................................................... 54

    Table 14: Table of speed v/s angle .............................................................................................................. 55

    Table 15: Battery life of LiPo battery .......................................................................................................... 55

  • 8/13/2019 Ece 3091 - Final Report-final

    6/60

    Acknowledgement

    First and foremost, we would like to thank Dr. Melanie Ooi, the lecturer for ECE 3091. Dr. Ooi proved

    to be very helpful and was a constant source of encouragement and motivation which helped

    towards the completion of this project. Our thanks and gratitude also goes to the lab technicians, Mr.

    Paremanan and Mr. Hasnan, for always being ready to help us with our needs and providing us with

    all the necessary assistance required in the lab. Last but not least, our thanks go to our friends, who

    have been constantly helping us out in any way possible, be it to solve a technical problem, or to

    hang out and relax for a while.

    --

    Members of Group 10:

    Keshav Ramrekha

    Triandi Tanri

    Omar Abdullah

  • 8/13/2019 Ece 3091 - Final Report-final

    7/60

    Abstract

    Autonomous robots are intelligent machines capable of performing tasks pre-programmed into

    them. But for them to perform, proper research, planning, testing and debugging must be carried

    out. Some people ask themselves Who would we be without machines? and the answer is often

    another question: What would machines be without men? Food for thought? The following report

    gives an insight about the behind-the-scenes of this project which sees The Lightsabercoming to

    life. From a single rough sketch to a fully operational robot, this report is the work of three young

    minds put together.

  • 8/13/2019 Ece 3091 - Final Report-final

    8/60

    Chapter 1: Requirements Definition

    1. Introduction1.1 Objective

    The objective of this project is to design and build a robot which has the ability to collect allpolystyrene balls provided in the platform and bring them back to base within a specified time limit,

    while at the same time preventing other enemy robots from stealing from the home base. The base

    is defined as one of the corner encircled by an arc line. The purpose of this project is to apply the

    acquired knowledge in circuit theory and programming onto real life application likewise building

    the robot in this Pearl Hunter project. Furthermore, students are able to develop problem solving,

    self-independent and cooperative skills throughout this project.

    Figure 1: The platform of the black pearl project

  • 8/13/2019 Ece 3091 - Final Report-final

    9/60

    1.2Capabilities of the final prototype

    Figure 2: Final Prototype

    In this project, sensors are used as guidance to navigate the robot and also to locate the polystyrene

    balls. A number of implementation issues did surface, but were solved. The final prototype is

    capable of navigating its way in the arena and carry the polystyrene balls back to the base. It is also

    able to prevent wall collision and avoid being hit by enemy robots.

    1.3 Purpose of this Report

    This report comprises the summarized version of the project planning, design description, algorithm,

    testing scheme and also the problems that the group has encountered during the brainstorming

    stage circuit design stage assembly stage test and evaluation stage debugging and

    optimization stage. Moreover, this report explains the required specification for all components in a

    very clear manner that errors and risk can be identified easily so improvements and optimizations

    can be conducted to increase the reliability of the complete system. .

  • 8/13/2019 Ece 3091 - Final Report-final

    10/60

    10

    CHAPTER 2: LITERATURE REVIEW

    2.IntroductionThis section will provide information about the research carried out in order to gather ideas andbrainstorm for solutions as to how to build and improve The Lightsaber. Research was carried out on

    various platforms and ideas gathered were then put together for a selection.

    2.1 Robot 1: Line following robot (MOBOT competition)

    The robot was initially built to compete in the MOBOT competition. The robot is a line following robot

    capable of following a white strip line on different surfaces in an outdoor environment without its

    performance being compromised by external conditions (lighting, wind, surface).

    The robot chassis was made out of plastic board with servo motors used as wheels. A custom

    microcontroller was used, with the circuit design soldered on a veroboard to minimize use of space and

    to be very light.

    The robot was fitted with color sensors to detect the white line and to be move forward.

    While the overall performance of this robot was quite impressive, there were quite a number of issues

    to solve before finally getting a decent overall performance. IR emitter/detector can easily be flooded by

    Figure 3: Design layout of the Pikachu robot

  • 8/13/2019 Ece 3091 - Final Report-final

    11/60

    11

    sunlight and be made useless. Without these, performance of robot is compromised. It is essential to

    make sure the sensors are well shielded to get good results.

    Varying surfaces and levels were also a problem, as the robot needs to adapt to its surroundings and be

    able to brake to avoid collisions or going off-track. A DC motor braking technique can therefore be usedin this case.

    The robots performance can be improved by adding a camera to navigate through the course. This,

    while being a good idea, will increase workload and increase complexity of design and coding.

    While this robot is fairly easy to understand and make, it lacks a few features required as part of what

    the robot to be designed for ECE 3091 needs.

    2.2 Robot 2: Hyper Squirrel

    The Hyper Squirrel is a robot which can perform high speed reactive mapping. The robot travels at fast

    speeds while making decisions on directions based on input from its sensors.

    The robot makes use of 2 Sharp IR Rangefinders mounted on a servo motor which scan the environment

    the robot is placed in and can navigate on its own.

    The robot was built using acrylic as chassis and treads from a toy car for wheels. This enabled it to

    navigate through any rough surfaces without any problem.

    While the rangefinders were used to navigate around, 2 sets of IR emitter-detectors were used as

    bumper sensors to avoid any collisions with unwanted objects or walls.

    Figure 4: Design layout of the Hyper Squirrel robot

  • 8/13/2019 Ece 3091 - Final Report-final

    12/60

    12

    The Hyper Squirrel is a very interesting project and surely can be used as base for comparison for this

    current project. The treads make interesting motion wheels and the high-tech advanced mapping

    technique used by this robot is a very interesting prospect that could be used to find and collect the

    balls for this current project. The design will however need to be customized and modified so that a ball

    collection mechanism can be added to the robot which has to fit in the specific constraints set for this

    project.

    2.3 Robot 3: The $50 Robot with Sharp IR edge detection

    This is by far the easiest and perhaps the most interesting robot of its kind. It is made up of easy to find

    materials and costs less than $50.

    The robot uses a piece of acrylic as chassis, and 2 pieces of cardboard cut in circular shape for wheels.

    These are rotated by means of 2 servo motors.

    The Sharp IR rangefinder is used to make the robot go through its surroundings while avoiding obstacles

    and walls.

    Main advantages of this robot were the low costs of building and fairly easy level on of understanding

    required to build it. The performance on the other side was very basic while not having great purpose.

    The robot could however be easily modified and improved once built and working.

    Figure 5: Design layout of the $50 robot robot

  • 8/13/2019 Ece 3091 - Final Report-final

    13/60

    13

    2.4 Robot 4: The OMNI-WHEEL ROBOT

    This robot is one of the most interesting in its kind and perhaps the most complicated as well. It uses a

    series of Omni-wheels that can move in any direction at any angle without any prior rotation. This

    mechanism can be considered for the current project as the polystyrene balls are scattered all over thearena, and our robot needs to be able to move in any direction to move and collect them.

    The Omni-wheel robot is a very advanced piece of robotics, including 3 Sharp IR rangefinders

    performing 2D mapping as part of an intelligent navigation system. In addition to those, 3 sonars acted

    as obstacle detection and avoidance system, while 2 pairs of infrared emitter/detector sets were used

    for line following system.

    The omni-wheel robot is one of the best of its kind and built for a specific purpose. But while its superb

    features make it a hard-to-neglect choice, the cost of purchasing all the items needed to build it by far

    exceeds the budget limit we are allocated. Budget aside, the fuzzy logic algorithm and coding knowledge

    required to make it function is sadly one of the qualities we lack for now and would prove a very

    challenging task to get it right at the very first attempt.

    Figure 6: Design layout of the omni wheel robot

  • 8/13/2019 Ece 3091 - Final Report-final

    14/60

    14

    2.4 Literature review conclusion

    Table 1: Tabular Comparison of the 4 robots

    Key points identified during literature review:

    Size:

    Lightsaber needs to be small in size to enable all sorts of movements. Also, as per the set requirements

    of the project, the robot needs to fit a 20cmX20cm size.

    Speed:

    Lightsaber needs to be fast to be able to collect as many balls as possible during the allowed 5 minutes

    time limit.

    Consistency:

    Lightsaber needs to be consistent in the runs, being able to bring the pearls back to base on as many

    runs as possible.

    Cost:

    Lightsaber needs to be built by using materials which do not exceed the set limit of RM300.

    Robot Advantages Disadvantages

    Line Follower Small Simple design Ability to detect white

    lines and help with

    motion

    Inability to perform morecomplex operations

    No ball catching mechanismHyper Squirrel System uses high speed

    reactive mapping

    Very robust design Can easily detect objects

    around the arena and

    move to them

    Complex software Conveyor belt wheels provide

    too much friction and limit

    motion

    Heavy chassis$50 robot Simple design

    Cheap Materials readily

    available

    No specific function Not robust No ball collection system Movement limited by cardboard

    wheels

  • 8/13/2019 Ece 3091 - Final Report-final

    15/60

    15

    CHAPTER 3: TEAM ORGANIZATION AND MANAGEMENT

    Introduction

    No teamwork can be a one-man show and this project was not an exception. To achieve the aims set,

    the team members worked closely together to be able to be successful. This chapter will detail the work

    to be done by each team-member and provide a work timeline as well as a proper budget breakdown of

    the project.

    3.1 Planning Methods

    3.1.1 Work Breakdown Structure

    Group Members:

    - Keshav Ramrekha (KR)- Triandi Tanri (TT)- Omar Abdullah (OA)

    Figure 7: Work breakdown Chart

    "Black PearlProject"

    Hardware

    Assembling frameof robot - KR, TT, OA

    Assembling motorgearbox - KR

    Electrical

    Build sensors/leverswitches- OA

    Build H-driversmotor circuit - TT

    Software

    Programming - KR,TT

  • 8/13/2019 Ece 3091 - Final Report-final

    16/60

    16

    3.1.2 Schedule for Network Activities (Critical Path Diagram)

    This is also another project modeling technique that is used to determine the priority of each element and the most effective path or critical

    path that must be undertaken for the project to develop according to the proposed time.

    Figure 8: Critical Path Diagram

  • 8/13/2019 Ece 3091 - Final Report-final

    17/60

    17

    3.1.3 Gantt Chart

    This is a type of a bar chart that displays the data of the project schedule. They include the start and

    finish dates of each element in the project schedule. They also include the amount of time required to

    be spent on each element of the project and identifies the team members responsible for each element

    in the project schedule. The summary elements comprise of the work breakdown structure.

    ID Task Name Start Finish Duration

    11d8/12/20117/29/2011Research/Planning

    6d8/5/20117/29/2011Motor Gear Ratio

    10d8/11/20117/29/2011Robot Design and Layout

    8d8/9/20117/29/2011IR sensors

    8d8/9/20117/29/2011Phototransistors

    2d8/11/20118/10/2011Assembly

    1d8/9/20118/9/2011Motor Assembly

    1d8/10/20118/10/2011Toggle Switch

    10d8/23/20118/10/2011Design

    1d8/10/20118/10/2011Robot Dimensions

    9d8/23/20118/11/2011Framework

    5d8/18/20118/12/2011Testing

    1d8/12/20118/12/2011Wheel balancing

    4d8/17/20118/12/2011Sensor Sensitivity

    6d8/22/20118/15/2011Robot Construction

    3d8/17/20118/15/2011Circuit building

    3d8/19/20118/17/2011Circuit Troubleshooting

    35d9/30/20118/15/2011Software

    10d8/26/20118/15/2011Research Algorithm

    10d9/23/20119/12/2011Testing

    10d9/9/20118/29/2011Coding

    5d9/28/20119/22/2011Debugging

    15d10/19/20119/29/2011Finishing

    5d10/3/20119/27/2011Coding Finalization

    6d10/10/201110/3/2011Robot Finalization

    15d10/19/20119/29/2011Final Testing

    7d8/18/20118/10/2011Requirement Analysis

    11d8/29/20118/15/2011Design Specifications

    Figure 9: Gantt Chart Table

  • 8/13/2019 Ece 3091 - Final Report-final

    18/60

    18Figure 10: Gantt chart Timeline

  • 8/13/2019 Ece 3091 - Final Report-final

    19/60

    19

    3.1.4 Responsibility Matrix

    This is a matrix that identifies all the elements in the project schedule and displays the priority

    of the team members effort in each and every element. This management technique allows

    you to clarify the team members responsibilities in each task and displa ys whether there was

    efficient communication between the assigned team members by viewing their priority in the

    each specific task.

    Task KR OA TT

    Brainstorming

    Layout of Robot P S P

    Algorithm P S P

    Components S P P

    Hardware

    Motor Gear Box P S S

    Robot Frame P P P

    Electrical

    Sensors S P P

    H-Bridge S S P

    Software

    Ball Detection Algorithm P S P

    Ball Collecting Algorithm P P S

    Testing

    Wheel Balancing Test P S S

    Sensor Sensitivity Test S P S

    Ball Collecting Algorithm P P S

    Full Testing P P P

    Documentation

    Requirement Analysis P P P

    Design Specification P P P

    Presentation P P P

    Final Report P P PTable 2: Responsibility Matrix

    Note:Primary Responsibility (P)

    Secondary Responsibility (S)

  • 8/13/2019 Ece 3091 - Final Report-final

    20/60

    20

    3.1.5 Cost Estimation

    This method was done in order to estimate the cost of all the products that had to be bought in

    the implementation of the robot. This method gives us a rough estimate of the costs of each

    product for future reference and also determines the budget of the robot.

    Table 3: Cost Estimation

    Tools Quantity Price/unit (RM) Suppliers Price(RM)

    Diagonal Cutting Pliers 1 - Monash -

    Wire Cutter 1 - Monash -

    Wire Stripper 1 - Monash -

    Solder Sucker 1 - Monash -

    Precision Screwdrivers (set) 1 - Monash -

    Duwell Needle Files (set) 1 - Monash -

    Insulation Tape 3 1.00 Ace Hardware 3.00

    Materials Quantity Price/unit Suppliers

    Plastic-board 2 3.00 Popular 6.00Polystyrene board 1 5.00 Popular 5.00

    Bolts and Nuts several - Monash -

    Bread Board 3 - Monash -

    AAA Battery 6 - Monash -

    AA Battery (rechargeable) 2 - Monash -

    9V Battery (rechargeable) 1 - Monash -

    9V Battery connector 1 - Monash -

    Ball Caster 2 10.00 Cytron 10.00

    Battery Holders 3 2.004.00 Ace-hardware 8.00

    Gear Box 2 - Monash -

    Electrical components Quantity Price/unit Suppliers

    Micro-controller Board 1 - Monash -Sharp IR Rangefinder 1 55.00 Cytron 55.00

    Ribbon Cable 3 - Monash -

    9V Battery Connector 1 - Monash -

    IC (H-drivers) 1 - Monash -

    Push Switches 4 0.50 Ace Hardware 2.00

    Sensors 7 2.00 JalanPasar 14.00

    Servo Motor 2 20.00 E-shore 40.00

    Maximum budget : RM 300.00 Total 143.00

  • 8/13/2019 Ece 3091 - Final Report-final

    21/60

    3.1.6 Risk analysis

    Hazard

    No.Description of Hazard Corrective Actions/ Risk Controls

    H4 Electrical hazard such as contact with any electrical

    conductor resulting in current flow to the body

    Consequence Likelihood Risk

    Severe Injury Unlikely Low

    Make sure everything is assembled properly before switching on

    the power supply

    Timing Responsibility

    During wire connection KR, OA, TT

    R34 Cause burns

    Consequence Likelihood Risk

    Minor Injury Unlikely Low

    Wear protective gloves and glasses

    Timing Responsibility

    During soldering KR, OA, TT

    E3 Prolong repetitive movement/position

    Consequence Likelihood Risk

    Minor Injury Unlikely Low

    Take 5 minutes break for every hour sitting in front of computer

    Proper lighting, comfortable working environment

    Timing Responsibility

    During programming KR, OA, TT

    Table 4: Risk Assessment

  • 8/13/2019 Ece 3091 - Final Report-final

    22/60

    22

    CHAPTER 4: THE LIGHTSABER DESIGN (Prototype 1)

    The Initial Design

    4. THE SUB-SYSTEMSIntroduction

    No project consists of one main system, no matter what the nature of the project is. To facilitate work

    distribution and verification and problem solving, a problem is always broken down into sub-systems. In

    the case of The Lightsaber, the project was divided into four main sub-systems; the mechanical sub-

    system, locomotion sub-system, electronics sub-system and the pearl detection and collection sub-

    system. The following sections describe the system in greater details.

    4.1 Mechanical sub-system

    After a brainstorming session, the mechanical sub-system was the first issued tackled by the group. The

    mechanical part is one of the most important parts of the Lightsaber. This will be the whole body of the

    robot and needs to be very stable and reliable. All other sub-system will be linked to the mechanical part

    enabling proper functioning of the robot. As the need to be light and fast was clearly identified, the

    materials chosen to build the chassis were plastic-board, polystyrene and tape (double-sided and

    normal). These materials are readily available and are cheap.

    Figure 11: Design layout of the chassis

  • 8/13/2019 Ece 3091 - Final Report-final

    23/60

    23

    Figure 12: Design layout of the chassis (side view)

    Figure 13: Design layout of the chassis (top view)

    Figure 14: Actual view with top layer mounted (side view)

  • 8/13/2019 Ece 3091 - Final Report-final

    24/60

    24

    4.2Locomotion sub-systemThe main aim of this project is to have an autonomous robot which is to be used to detect and collect

    the pearls and return back to base. To be able in this task, motion of the robot is essential. For the robot

    to move, wheels with a proper gearbox are used.

    In this case, the group was provided with a set of Tamiya Double Gearbox system with adjustable gear

    ratios for different scenarios.

    The main aim of the project was to get a fast moving robot. Therefore, the gear ratio to be chosen had

    to be enough to be able to provide enough torque for the Lightsaber to move fast.

    Figure 15: Tamiya Double Gearbox schematics

    There are four different gearbox designs that are shown in the above diagram and out of this four, two

    were tried out and tested. The two choices that were considered are Aand B.

    A344:1This is the design that provides the highest torque but results in a very slow rotationof the wheel.

    B- 114.7:1- This is the design that provides the second most torque but provides a largerincrease in speed than A.

    The other two were not chosen since the speed of the wheel would be too fast for easy smoothnavigation.

    A

    B

  • 8/13/2019 Ece 3091 - Final Report-final

    25/60

    25

    Figure 16: Actual view with wheels under test

    Figure 17: Initial prototype with wheels mounted on chassis

  • 8/13/2019 Ece 3091 - Final Report-final

    26/60

    26

    4.3Electronics Sub-systemThe electronics sub-system acts like the bridge between the microcontroller and the mechanical system.

    It is the part that allows all motion to be possible, and at the same time is the carrier of messages from

    one component to the other.

    To power the wheels, a dual H-bridge was used.

    H-Drivers are used for the motor circuit as an integrated chip acts as a controller that connects the

    batteries, motors and I/O pins from the micro-controller in just one IC. One H-Driverchip can control up

    to two motors at the same instance.

    Figure 18: L293D H-bridge

  • 8/13/2019 Ece 3091 - Final Report-final

    27/60

    27

    Figure 19: H-bridge circuit connection

    In the design of the robot, only one L293D quadruple half H-Drivers were used. After some trials, it is

    found that both the motors for the wheel and also the servo motor could be controlled by just one H-

    Drivers.

    From the diagram above, the input voltage to the H-Driver is at pin 1, 8, 9, and 16. The minimum voltage

    that must be supplied to the H-Driver in order to get the robot moving is around 5V and above to ensure

    movement stability as some task that the robot has to perform requires more power from the motor

    than the others.

    This can be seen when the robot is doing a turn in which one of the motor have to turn clockwise and

    the other, counter clockwise. From all the trials performed, it is noticed that when the input voltage to

    the H-Driver is less than 4V the robot is unable to turn accordingly thus by making sure that the input

    voltage is at least 5V and above, the problem is eliminate

    Pins 2, 7, 10, and 15 are the I/O pins connected to the micro-controller. These pins are used for

    controlling the direction of movements of the motors. For example, if pin 2 is set to 1 and pin 7 is set to

    0 digital outputs, the motor will turn clockwise whereas if pin 2 is set to 0 and pin 7 is set to 1, the motor

    will turn counter clockwise.

    A dual H-bridge is a system component which allows control of 2 motors and allows rotation in both

    clockwise and anti-clockwise direction. In the case of the Lightsaber, a L293D chip was used to control

    rotation of motors.

  • 8/13/2019 Ece 3091 - Final Report-final

    28/60

    28

    Figure 20: H-bridge circuit connected to wheels

    The electronics subsystem also consists of the sensor circuits. In the case of the Lightsaber, sensors were

    used for ball and wall detection. The sensors were connected to the main circuitry of the robot system

    and powered through a common 5V rail.

    The sensors used in this project are of infrared type and it is of the 5mm category. It works by the

    photodiode sensing the amount of reflected energy/light, which is radiated by the transmitter, off any

    surface. The photodiode will have distinctive output reading across its terminals for different colour

    surface.

    The IR sensor used in the design is based on the schematic provided by the school. The only variation did

    to the schematic was the value of the pair of resistors used. The resistor used for the IR transmitter is

    120 and the resistor used for the IR receiver is 4.7k .

  • 8/13/2019 Ece 3091 - Final Report-final

    29/60

    29

    Figure 21: IR sensor circuit

    After performing some test on the micro-controller to determine its threshold between logic 1 and 0,

    the comparator is ignored and the output of the sensor is connected directly to the micro-controller.

    The threshold voltage for the given micro-controller is 1.07 V. Any values lower than 1.7 V will be

    interpreted as logic 0 and those above it will be logic 1.

    The Arduino Duemilanove was used as the main microcontroller for the Lightsaber due to its small size

    and lightweight.

    The board is very small in size and is very light as well. This would be an advantage as it would not add

    too much weight or take up too much space on the chassis. In addition to that, the Arduino, despite

    being small in size, has a decent number of I/O ports, some of which can be used as PWM ports to

    control speed/motion.

    1204.7k

    Figure 22: Arduino Duemilanove microcontroller

  • 8/13/2019 Ece 3091 - Final Report-final

    30/60

    30

    Figure 23: The main circuitry as seen on top of the Lightsaber

    4.4Pearl Detection and CollectionThis section is the most important section of the project as the main objective is to gather as many

    pearls as possible in the home base. The initial design made use of the sensory feedback as main source

    of information about pearls and their position.

    The Sharp IR rangefinder was used to locate the pearls as the robot moved and calculated the distance

    separating the distance from the robot to them. This helped the robot keep moving until it reached the

    pearls. Once it reached the pearls, they would get into the holding area of the Lightsaber, where they

    would cross the signal between the IR emitter and detector circuit.

    This would in turn activate two servo motors, which acted like flaps to close and hold the pearls inside

    the robot. This action would indicate to the robot to start the process of returning to base to drop the

    pearls safely back into the home base.

    Arduino DuemilanovH-Bridge

    Sensors connected to common rail Battery holder for batteries to power circuit

  • 8/13/2019 Ece 3091 - Final Report-final

    31/60

    31

    Figure 24: Pearl Detection and Collection method

    Sharp IR

    rangefinder used

    to locate pearls

    IR emitter/detector

    to detect whether

    pearl was inside

    holding area

    Pearl

    Servo Motors close flaps

    upon detection of pearls

  • 8/13/2019 Ece 3091 - Final Report-final

    32/60

    32

    3.4.1 Ball Collection Algorithm

    Start

    Move Forward

    Detect ball?Keep moving

    Forward

    Close Flaps

    Turn 180 degrees

    Move forward

    Detect wall

    Stop and release

    balls

    Reverse with preset

    delay

    NO

    YES

    YES

    NO

    Figure 25: Flowchart for algorithm of Prototype 1

  • 8/13/2019 Ece 3091 - Final Report-final

    33/60

    33

    The algorithm on the previous page gives an overall idea of how the Lightsaber performed its task of

    detecting and collecting the ball. It worked using a simple system of detection by using the Sharp IR

    rangefinder and the IR emitter/detector pair was used to help holding on to the ball.

    The robot will start moving and as soon as it detects a pearl, it will close the flaps, turn 180 o clockwise

    and return to base. When it detects the wall of the base, it will stop, release the pearl by opening the

    flaps, and then move backwards, turn to face the arena, but this time at another preset angle.

    Pearls

    Home

    Base

    Figure 26: Pearl detection and collection

  • 8/13/2019 Ece 3091 - Final Report-final

    34/60

  • 8/13/2019 Ece 3091 - Final Report-final

    35/60

    35

    4.5.2 Battery Life

    Battery life greatly affects performance of machines and the Lightsaber was no exception. As the testing

    was done, battery life was considerably reduced and had to be replaced constantly. Rechargeable

    batteries avoided extra cost of buying new ones, but at the expense of long waiting hours for charging to

    be complete. The battery levels were regularly monitored to assess performance of the robot.

    Set 1 Set 2 Set 3 Set 4 Set 5

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Trial 1 5.28 5.02 5.31 5.11 5.16 4.99 5.23 5.02 5.11 4.88

    Trial 2 5.24 5.12 5.27 5.10 5.20 4.86 5.18 4.83 5.13 4.92

    Trial 3 5.16 4.96 5.18 4.93 5.23 5.01 5.21 4.82 5.23 4.85

    Table 6: Table showing drop in voltage levels of batteries (powering H-bridge and sensors)

    Set 1 Set 2 Set 3 Set 4 Set 5

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Initial

    Voltage

    (Volts)

    Final

    Voltage

    (Volts)

    Trial 1 9.66 9.36 9.58 9.21 9.67 9.35 9.59 9.32 9.55 9.12

    Trial 2 9.55 9.15 9.52 9.07 9.36 9.01 9.32 8.99 9.30 9.06

    Trial 3 9.35 8.95 9.23 8.93 9.21 7.96 9.17 8.23 9.13 8.29

    Table 7:Table showing drop in voltage levels of battery (powering Arduino)

  • 8/13/2019 Ece 3091 - Final Report-final

    36/60

    36

    4.5.3 Testing of individual components

    4.5.3.1(IR emitter/detector circuit)

    These components were responsible to check whether pearls were inside the holding area of the arena

    or not. The result of that operation would then enable to servo motors to close the flaps. To check this

    part, the same concept was used as for the previous section and the number of times it worked was

    noted.

    Again, a set of 5 runs over 2 minutes was carried out and repeated.

    From the tests, it was noted that over the number of runs, only 6 times the sensors had failed to detect

    a ball inside the holding area. This was either due to a wire coming out hence causing an open circuit or

    the robot moving too fast and pushing the ball away before the sensors could react to the voltage

    change.

    4.5.3.2 Servo motors (flaps)

    The servo motors were used to open or close the flaps to either keep hold of the pearls or release them

    when in the home base.

    Results were collected over the same number of runs as in the above section

    From the tests, it was noted that over the number of runs, 9 times the servos had failed to open or close

    the flaps. This was either due to a wrong connection out hence causing an open circuit or wrong output

    from sensor readings causing the robot to ignore the decision.

  • 8/13/2019 Ece 3091 - Final Report-final

    37/60

    37

    CHAPTER 5: The Lightsaber (Prototype 2)

    After the old design was tested over and over again, a number of faults were identified and corrective

    measures were to be taken to improve the performance of the robot.

    5.1 Faults identified

    Components Faults

    Chassis Chassis started bending under weight of all other

    components mounted on it. Caused robot to move in a

    curved path.

    Holding area not wide enough to hold many pearls at

    one go.

    Batteries The batteries proved a major issue with them

    discharging fast and not providing enough power to the

    wheels. Motion of robot became erratic after power

    drops below full operating limit.

    Pearl collection using sensory feedback The detection of pearls using data obtained from

    sensors was not always reliable, since the number of

    pearls detected and collected was low.

    Servo motors Servo motors were found to be under the influence of

    fluctuating voltage and often were found to close

    without any signal sent to them. This caused the

    Lightsaber to miss the pearls.

    Table 8: Table describing faults identified in Prototype 1

  • 8/13/2019 Ece 3091 - Final Report-final

    38/60

    38

    5.2 Prototype 2 The Design

    For the prototype 2, the overall layout of the subsystems remained the same, with the same 4

    subsystems as mentioned for prototype 1. However, some changes were made to the design and

    components and are detailed below. The changes were made in order to correct and reduce the faultsidentified in the previous section

    5.2.1 Mechanical sub-system

    From the previous section it was observed that the chassis of the robot was not strong enough to

    withstand heavy testing. It was then modified in order to make it stronger and more resistant.

    The second issue noted was the fact that the holding area for pearls was not as wide as expected, and it

    was therefore widened to allow more pearls to be held.

    Figure 27: The new design for the chassis (widened chassis)

  • 8/13/2019 Ece 3091 - Final Report-final

    39/60

  • 8/13/2019 Ece 3091 - Final Report-final

    40/60

    40

    To assist the robot in moving around the arena, a Sharp IR rangefinder was placed at the top of the

    robot. It was programmed to detect walls and other robots, and stop and change directions if ever they

    came into contact. The Sharp IR rangefinder also helped in the path algorithm used for ball collection,

    which is described further down in this report.

    Figure 30: Use of the Sharp IR rangefinder for wall and robot detection and avoidance

    5.2.3 Electronics Sub-systemThe main components of the electronics sub-system were kept unchanged, although a few changes

    were made. The servo motors were removed as well as the IR emitter/detector circuits. The

    rechargeable batteries used for prototype 1 were all replaced by a single LiPo battery.

    The main reason for replacing all the batteries with a single LiPo battery was the improved performance,

    greater power and longer running hours on a single charge. The robot was found to be able to run

    smoothly for 2.5 hours on a single charge.

    Both the Arduino and the H-bridge circuitry were powered by the LiPo battery. This also helped reduce

    overall weight of the robot and with the battery placed at the center of the bottom layer of the robot;

    the center of gravity was made lower, thus improving stability of the robot.

    Sharp IR

    rangefinder, for

    wall and robot

    detection

  • 8/13/2019 Ece 3091 - Final Report-final

    41/60

    41

    Figure 31: Use of the Sharp IR rangefinder for wall and robot detection and avoidance

    Arduino

    Microcontroller

    H-bridge

    Switch to ON/OFF

    the robot

    Sharp IR rangefinder

    powered straight

    from Arduino

  • 8/13/2019 Ece 3091 - Final Report-final

    42/60

    42

    5.2.4 Pearl Detection and CollectionFor the prototype 2, the whole algorithm for ball collection changed, as this time a pre-defined motion

    path was programmed into the microcontroller.

    It was noted that in the case of prototype 1 that allowing the robot to move by using the sensors was

    erratic and a lot of errors were introduced due to unstable chassis, incorrect wheel alignment and wrong

    return to base movement.

    The use of a predefined path allowed a more consistent navigation of the robot, with it moving

    according to the program and returning to base before moving out again. The path algorithm is shown in

    the pictures below.

    Figure 32: Flowchart for Prototype 2

  • 8/13/2019 Ece 3091 - Final Report-final

    43/60

    43

    The robot starts to move from point A in the above diagram until it reaches the wall where it turns 900

    anti-clockwise. It then detects a second wall where again it turns 90 Oanti-clockwise. It will then move

    until it reaches the wall of the home base, and will reverse until it reaches point B.

    A

    B

    Figure 33: Start of Algorithm (Path 1)

    Home

    Base

  • 8/13/2019 Ece 3091 - Final Report-final

    44/60

    44

    From point B, it will turn 90oand move forward for 5 seconds and again turn 90o degrees anti-clockwise

    and move forward until it reaches the wall. It will turn and follow the motion defined by the arrows until

    it reaches point C.

    B

    C

    Figure 34: Path 2

    D

    Figure 35: Path 3

    Home

    Base

    Home

    Base

  • 8/13/2019 Ece 3091 - Final Report-final

    45/60

    45

    From Figure 30, the robot will move from position C, turn 90 o, follow a straight path for 7 seconds, and

    then again turn left 90o and move until it reaches the wall. The same procedure is used to reach the

    home base again with turning left each time the Sharp IR rangefinder detects a wall.

    In path 4 (Figure 31), the robot will follow the path indicated by the arrows after it reaches point D in

    Figure 30. The purpose of path 4 is to be able to steal the pearls from the enemy base and increase the

    chances of winning.

    In the end, the robot covers the area of the arena by covering it section by section using the algorithm

    showed in the previous figures and each time returns to base to deposit any pearls collected on its way.

    Home

    Base

    Figure 36: Path 4

    Enemy

    Base

  • 8/13/2019 Ece 3091 - Final Report-final

    46/60

    46

    CHAPTER 6: Evaluation

    One of the main issues about this project was the random scattering of the pearls all over the arena and

    how to collect the pearls and come back to the home base. The whole competition depended on the

    final number of pearls collected and brought back to base. The main concern was therefore to find theoptimized path and method to collect the most number of balls. After trying prototype 1 and noticing its

    shortcomings, the design was changed to Prototype 2 and test runs were carried out.

    It was found out that, after extended testing that the Lightsaber performed better while being on a pre-

    defined course than on a to-and-fro path using sensor feedback. Prototype 2 was also found out to

    move in a straight line better than prototype 1 due to its improved chassis and enhanced weight

    distribution.

    After the removal of the rechargeable AA and AAA batteries and the 9V battery, and replacing them

    with the new LiPo battery, it was found out that robot performed in a more consistent way with the

    drop in voltage levels not as considerable as the previous batteries. The absence of the need to

    constantly charge up the batteries made it easier to keep testing the robot and also maintaining

    constant performance for long hours.

    6.1 Problems and Solutions

    6.1.1 Hardware

    Table 9: Table for hardware problems and solutions

    No Hardware

    Problems

    Cause & Evolved Solution

    1 Sensor values

    changing too fast

    This was due to the motion of the robot. The sensor was secured properly with tape

    and values smoothened out.

    2 Driving motors

    not rotating

    This occurred mainly due to wires coming out of the breadboard. Proper connectors

    were used to solve the problem.

    3 Dying Batteries If the voltage supplied by the batteries is too low, the driving motors rotation speed

    decreases, resulting in a slow forward motion of the robot and sometimes getting

    stuck in one position while turning 90 degrees. All the batteries were replaced by a

    single LiPo 8.4V battery which solved these problems.

    4 Gearbox The initial gear-ratio chosen was for a light robot, however even when the robot

    chassis was changed, performance did not drop so no change was made to the

    gearbox.

    6 Servo Motors The servo motors had faults of jerking without even a microcontroller input. This is

    due to the connection between the servo and microcontroller not being fixed

    properly. Servo motors were taken off for Prototype 2.

  • 8/13/2019 Ece 3091 - Final Report-final

    47/60

    47

    6.1.2 Software

    Number Software Problem Cause & Solution

    1 Usage of delay in

    coding to createPWM.

    This is because the delay causes the drving motor rotation to

    decrease. Therefore, the delay may cause the robot to move inadifferent speed for old batteries, likely slower and if new

    batteries, it would increase the speed causing the hardware

    problem stated before.

    Solved by replacing batteries with a more powerful LiPo battery

    which kept voltage at an almost high and constant level.

    2 Coding issues and

    inability of robot to

    follow instructions

    There were issues where the robot did not follow the code

    programmed into the microcontroller. This problem was solved

    by breaking down the whole software into small pieces and

    testing individually and then compiling the whole code together

    once issues were resolved.Table 10: Table for software problems and solutions

    6.2 Improvements and Optimization

    Prototype I Prototype II

    Components one set of IR sensorsone Sharp IR rangefinderTwo wheel motorsOne ball caster as third wheelTwo servo motors as flaps

    One Sharp IR rangefinderWidened holding area

    Functions Capable of performing a to-and-for pearl detection and collection

    Able to detect wallAble to return to base accurately

    Weakness Unreliable motionDoes not always return to base At certain angle, wall or robotdetection may not work

    Changes from

    previous

    prototype

    N/A Servo flaps removedIR sensor circuit removedWidened holding areaImproved chassisNew LiPo batteryNot

    applicable

    reason

    Inconsistency of sensors andunreliable chassis was major

    issues.

    No flaps to capture the polystyreneballs

    Table 11: Table of improvements and Optimization performed

  • 8/13/2019 Ece 3091 - Final Report-final

    48/60

    48

    6.3 The Final Competition

    The final competition was the means by which the overall performance of the robot was to be tested in

    matches against different opponents. In the competition everything ranging from robustness, creativity

    to performance was assessed.

    Prototype 2 competed in the competition and had the following specifications.

    Size: 19x18cm (fits within preset 20x20cm limit) 1 IR rangefinder Arduino Duemilanove Microcontroller Breadboard containing connections and circuitry for H-Bridge Tamiya Dual Gearbox with gear ratio 114.7:1 1 Lipo 8.4V 1200maH battery

    6.3.1 Match 1

    During match 1, Lightsaber performed very well, managing to go through the entire path and algorithm

    preset and collecting pearls on its way back to base. In the end, it collected 14 pearls with a minimum

    amount of human interventions needed to help its motion. Eventually it ran out as winner of its match.No notable difficulty in navigation was observed. Design and algorithm was preserved.

    Figure 37: Lightsaber Prototype 2

  • 8/13/2019 Ece 3091 - Final Report-final

    49/60

    49

    6.3.2 Match 2

    Match 2 was a totally different scenario, where the enemy robot had a different approach to the match.

    This changed the game plans and soon after the match started, the 2 robots collided and had to be

    taken back to base. However collision was not the only problem faced in this case. The Lightsaber got

    stuck amongst pearls and therefore could not come back to base and had to be taken out. The same

    situation repeated itself and the match was lost in the end as the opponent team collected more pearls.

    In this match, there was also an example of preventing enemy robots stealing from the home base. The

    strategy was to time the predefined paths in such a way that Lightsaber returned to home base at

    regular intervals after completing the path motions. If ever an enemy robot were to come steal, it would

    either collide on the way to the base or collide in the base, in which case, no pearls could be taken off

    the home base.

    Figure 38: Inability to return to base after getting stuck

  • 8/13/2019 Ece 3091 - Final Report-final

    50/60

    50

    6.3.3 Match 3

    Match 3 started well, with path 1 (mentioned earlier) completed well. However in this match versus

    team Tornado, there was little that could be done to prevent the fan from blowing off all the pearls

    from our home base and from the arena into the enemy base. Attempts were made to steal from enemy

    base after path 4, but with the fan blowing hard the match was lost.

    6.3.4 Match 4

    Match 4 was a repeat of the scenario from match 2 with the Lightsaber again getting stuck due to a

    collision with a few pearls at an angle. This prevented it from moving correctly and not returning to base

    but instead moved to a second loop. It did however work after a human intervention was required, but

    in the end lost the match due to a smaller number of balls collected compared to the opponent.

    New path taken by

    Lightsaber, after

    getting confused.

    Did not return to base

    initially.

    Figure 39: New path taken after confusion

  • 8/13/2019 Ece 3091 - Final Report-final

    51/60

    51

    Conclusion

    Throughout this project, electrical knowledge learned in Monash University is put to practice. Besides,

    skills and teamwork cooperation are developed during the progress of the project.

    The planning of the project is arranged properly that every group member has the fair responsibility in

    this project. And the total cost used for this project is relatively affordable where it does not exceed the

    maximum planned budget.

    Although performance in the competition was not as successful as expected in terms of collection of

    pearls, the robot has considerably high reliability in straight line motion and wall or robot detection and

    avoidance. Have we had a little more chance to make a few more modifications to the robot, we would

    have been able to achieve far better results.

    In conclusion, we are successful in building a robot that is capable of fulfilling every requirement for this

    project thus we feel a great sense of achievement in it.

  • 8/13/2019 Ece 3091 - Final Report-final

    52/60

    52

    ReferencesSociety of Robots. (2011). Sensors: Sharp IR rangefinder. [Online]. Available:

    http://www.societyofrobots.com/sensors_sharpirrange.shtml

    Acroname Robotics. (2011). Sharp GP2Y0A21YK0F IR Package.[Online]. Available:

    http://www.acroname.com/robotics/parts/R301-GP2Y0A21YK.html

    Tamiya. (2011). Double Gearbox.[Online]. Available:

    http://www.tamiyausa.com/product/item.php?product-id=70168

    C. McManis. (2006). H-Bridges: Theory and Practice.[Online]. Available:

    http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/

    Price, D. A. Monash Minibot Version 1.0. 2005

    Elecrom. (2008). How to make simple Infrared Sensor Modules. [Online]. Available:

    http://elecrom.wordpress.com/2008/02/19/how-to-make-simple-infrared-sensor-modules/

    Ikalogic. (n.d.). Line Sensors. [Online]. Available:

    http://www.ikalogic.com/tut_line_sens_algo.php

    HPhy. (n.d.). Schmitt Trigger. [Online]. Available:

    http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/schmitt.html

    OP AMPS. LF 324 Datasheet.(2010).

    Silicon Labs. (2011). MCU Development Kits.[Online]. Available:

    http://www.silabs.com/products/mcu/Pages/C8051F020DK.aspx

    Arduino. (2011).ArduinoDuemilanove.[Online]. Available:

    http://www.arduino.cc/en/Main/ArduinoBoardDuemilanove

    Society of Robots. (2011). Mobot Competition.[Online]. Available:

    http://www.societyofrobots.com/competitions_mobot.shtml

    Society of Robots. (2011). Mobot 2007 Line follow robot tutorial.[Online]. Available;

    http://www.societyofrobots.com/robot_mobot_2007.shtml

    Society of Robots. (2011). Hyper Squirrel.[Online]. Available:

    http://www.societyofrobots.com/robot_hyper_squirrel.shtml

    Society of Robots. (2011). The $50 Robot.[Online]. Available:

    http://www.societyofrobots.com/robot_50_robot_sharpIR.shtml

    Society of Robots. (2011). Omni-Wheel Robot Fuzzy.[Online]. Available:

    http://www.societyofrobots.com/robot_omni_wheel.shtml#fuzzy

  • 8/13/2019 Ece 3091 - Final Report-final

    53/60

    53

    Appendix

    Appendix A Testing Scheme for Prototype 2

    The following pages will describe the testing procedures carried out on Prototype 2 and the discussion

    of the results obtained.

    i. Chassis strengthTo test the new chassis and whether it would be able to support the weight of the breadboard,

    microcontroller and battery, a simple test was done whereby objects of varying weight were placed on

    the chassis and the robot made to move. After a series of 10 test runs for each weight set, the chassis

    was checked for deflection.

    Figure 40: Deflection of chassis frame

    Weight Deflection, (cm)

    125g -

    245g 0.2

    330g 0.4

    Table 12: Table of weight v/s deflection

    The above table shows the deflection observed when different weights were applied. For small weights

    the deflection was negligible. When the weight was increased, the deflection was about 0.2-0.4cm,

    which was still very low. The total weight of the circuits, Arduino and battery did not exceed 300g and

    therefore was well within the limit of negligible deflection.

    Chassis was therefore reliable for operation with all the components integrated on it for the test runs.

    Deflection,

  • 8/13/2019 Ece 3091 - Final Report-final

    54/60

    54

    ii. SpeedTo test the speed of the robot, it was tested over a number of test runs. The test was to test the robot

    with all the components on it and allow it to complete the predefined path. The robot having a

    considerable weight now was tested at different PWM speeds to find an optimum PWM value to ensure

    enough speed and stability in motion.

    PWM Value Time taken to complete path Stability/Issues

    150 3min 08s Too fast. Unstable

    120 3min 48s Fast. Motion not entirely straight

    100 4min 10s Stable

    80 4min 32s Very Stable. Straight line motionTable 13: Speed v/s stability

    From the above table it can be seen that the robot was found to move perfectly well in a straight line

    motion with a PWM speed of 80. That speed was chosen for the competition as it offered great stability

    and enabled the robot to move well within the time limit of 5minutes.

    iii. The 90oleft turnTo be able to make the 90o left turn, a lot of testing was done to find the optimum PWM value that

    would enable the robot to turn at 90o. A reference mark was set and deviation and angle calculated

    from there.

    Figure 41: The 90oleft turn

    90oreference

  • 8/13/2019 Ece 3091 - Final Report-final

    55/60

    55

    PWM value Delay Angle (estimated)

    120 500 110

    150 300 25

    100 550 80

    80 600 90

    Table 14: Table of speed v/s angle

    From the above table, the speed of 80 and delay of 600 was chosen to make the robot turn at 90O.

    iv. Battery LifeThe battery life of the LiPo battery was tested over a series of test runs with initial value and final value

    noted.

    No of test runs Initial Value (V) Final Value (V)

    15 8.34 8.30

    20 8.28 8.17

    25 8.23 7.99

    50 8.20 7.64

    Table 15: Battery life of LiPo battery

    From the above table it can be noted that the voltage drop is not that considerable and the voltage level

    still being above the average operating limit, the robot performed well even at a high number of test

    runs. Charging time was only 25minutes for full charge, and was therefore an advantage over normal

    rechargeable AA, AAA batteries which have a charging time of 8 hours for full recharge.

  • 8/13/2019 Ece 3091 - Final Report-final

    56/60

    56

    Appendix B Full Code written for the Arduino Duemilanove

    //18th October 2011

    //Written by Triandi Tanri

    //Modified by Keshav Ramrekha

    #include

    int motor_left[] = {3, 5}; //Define pins for left motor

    int motor_right[] = {6, 11}; //Define pins for right motor

    int wall = 4; //Initialize a counter for walls

    int counter = 0; //Initialize counter

    void setup() {

    Serial.begin(9600);

    pinMode(motor_left[1], OUTPUT); //Pin definitions

    pinMode(motor_left[0], OUTPUT);

    pinMode(motor_right[0], OUTPUT);

    pinMode(motor_right[1], OUTPUT);

    ;

    }

    void loop(){ //Main loop

    float walls = analogRead(wall)*0.0048828125; // Converting reading from sensor to voltage

    Serial.println(walls);

    forward();

    if(counter2.5){

    path_1();

    }

    else if(counter==2 && walls>2.2){

    path_2();

    }

    else if(counter>2 && counter 2.5){

    path_1();

  • 8/13/2019 Ece 3091 - Final Report-final

    57/60

    57

    }

    else if(counter==5 && walls>2.2){

    path_3();

    }

    else if(counter>5 && counter2.5){

    path_1();

    }

    else if(counter==8 && walls>2.2){

    path_4();

    }

    else if(counter>8 && counter2.5){path_1();

    }

    else if(counter==12 && walls>2.2){

    backward();

    delay(750);

    left(80,80);

    delay(600);

    forward();delay(1500);

    left(80,80);

    delay(600);

    forward();

    delay(500);

    counter = 0;

    }

    }

    void path_1(){

    counter++;

    // backward();

    // delay(400);

    left(80,80);

    delay(650);

  • 8/13/2019 Ece 3091 - Final Report-final

    58/60

    58

    motor_stop();

    delay(500);

    forward();

    delay(500);

    }

    void path_2(){

    counter++;

    backward();

    delay(750);

    left(80,80);

    delay(620);

    motor_stop();

    delay(200);

    forward();

    delay(3000);

    left(80,80);

    delay(700);

    forward();

    delay(500);

    }

    void path_3(){counter++;

    backward();

    delay(750);

    left(80,80);

    delay(620);

    motor_stop();

    delay(200);

    forward();

    delay(4500);

    left(80,80);

    delay(700);

    forward();

    delay(500);

    }

  • 8/13/2019 Ece 3091 - Final Report-final

    59/60

    59

    void path_4(){

    counter++;

    backward();

    delay(750);

    left(80,80);

    delay(500);

    motor_stop();

    delay(200);

    forward();

    delay(500);

    }

    //-----------MOTOR FUNCTIONS----------------//

    void motor_stop(){

    digitalWrite(motor_left[0], LOW);

    digitalWrite(motor_left[1], LOW);

    digitalWrite(motor_right[0], LOW);

    digitalWrite(motor_right[1], LOW);

    //delay(2000);

    }

    void forward(){

    analogWrite(motor_left[0], 80);

    digitalWrite(motor_left[1], LOW);

    analogWrite(motor_right[0], 80);

    digitalWrite(motor_right[1], LOW);

    }

    void left(byte a, byte b){

    analogWrite(motor_left[1], a);

    digitalWrite(motor_left[0],LOW);

    analogWrite(motor_right[0], b);

    digitalWrite(motor_right[1], LOW);

    //delay(1000);

    }

  • 8/13/2019 Ece 3091 - Final Report-final

    60/60

    void right(byte a, byte b){

    analogWrite(motor_left[0], a);

    digitalWrite(motor_left[1], LOW);

    analogWrite(motor_right[1], b);

    digitalWrite(motor_right[0], LOW);

    }

    void backward(){

    analogWrite(motor_left[1], 90);

    digitalWrite(motor_left[0], LOW);

    analogWrite(motor_right[1], 90);

    digitalWrite(motor_right[0], LOW);

    }