12.07.2015 Views

Jafer Micromouse.pages - EECS Senior Design Project

Jafer Micromouse.pages - EECS Senior Design Project

Jafer Micromouse.pages - EECS Senior Design Project

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2The focus of this report is to construct a small Robot (<strong>Micromouse</strong>) that has memory andis capable of navigating through the Standard Maze specified by the guidelines of theIEEE International competition with the exception for the size of the maze. TheMicromice are judged by the time it takes them to find the center. As a result, the Robotthat makes the fastest timed run from the start to the center of the maze is declared thewinner of the competition.


3Introduction Page 4History Page 5Major Constraints Page 8Rules Page 10<strong>Design</strong> ApproachPages13-50• Component Diagnostics and Results Page 13• System Schematic and <strong>Design</strong> Page 45• Mechanical Schematic and <strong>Design</strong> Page 48• Maze Solving design approach Page 50System Diagnostics, Layout and Results Page 61Microcontroller Selection and Programming Page 63Area of Improvement Page 98Conclusion Page 101References Page 102Appendices Pages 103-160INTRODUCTION


4A "Micro-Tank" or a type of “Micro-Mouse” is a fully autonomous robotdesigned to navigate and solve an arbitrary maze in the shortest period of time. Toachieve our goal, we will identify, analyze and test each component of the Robot toassure sub-system functionality. Next, we will generate a design schematic and assembleall the components together for the system level testing. Our Core objective in the end isto create a non-memoryless system that is capable of traveling through the Maze in theshortest period of time without drifting or hitting the side walls of the maze.The “Micro-Tank” encompasses a vast range of engineering fields which can be dividedinto Hardware and Software categories. The hardware consists of power subsystem,control system and sensory system for navigation. Each of these parts in our projectunderwent a through process of design, analysis and component selection. The softwareportion of our design implements various algorithms such as wall following, depth-firstsearch, flood filled algorithm as well as modified flood-fill algorithm to solve the maze.Our design uses the combination of depth-first algorithm and the newly proposedalgorithm by one of the members of our group. We in detail describe each of thesealgorithms and the method we have chosen to for programming our Micro-Tank.We selected this particular project to perform system level design and testing. This way,we are able to become familiar with a broad range of information related to Engineeringrather than focusing on one particular area. For example, the project requires electricalengineers to design the hardware section of our micro-tank, computer engineers to writethe algorithm and communicate with the components of our system, and mechanicalengineers to design and build the chassis and cause the mouse to make turns. By


5focusing on all these areas, were able to gain lots of experience in other fields. Toproceed to farther details, it is also important to describe the significance of this projectwhich relates to applications and advantages for the research in the field of Robotics.After all, research in the filed of robotics has a far-reaching social implications, includingadvancements in biomedical engineering (as in Miniature Robots used to performsurgery), automation of tasks unsuitable for human beings, rescue options, domesticapplications and more.HISTORYA: History of the MazeFor thousands of years in our history, the concept of mazes and labyrinths has intrigueddiverse cultures from around the world. A venture into the unknown, traveling the mazesymbolizes mankind’s own quest for truth or spiritual discovery.Unlike the modern notion of maze enclosing numerous false passages and dead ends, theancient labyrinth usually featured a winding universal design with only a single entranceand exit (1). Perhaps the most familiar story associated with the labyrinth is the GreekMyth of Theseus and Minotaur.The design of the Cretan Labyrinth, preserved on Cretan Coins of the 1 st century BC hasbeen encountered in various other places in the world. The Cretan labyrinth is also foundon rock cravings in Spain, on an Etruscan wine jug from Italy, on a roof tile from theGreek Parthenon, etc (2)


6Maze designs flourished in various parts of Europe and Asia for many centuries. Forexample, in Scandinavia, over 600 stone labyrinths line the shores of the Baltic Sea.Religions such as Judaism, Sufism, Buddhism, and Taoism used symbols of mazes formarriage fertility, birth, funeral, exorcism, wind control, healing, protective ritual, or evenas patterns to play games (3) Thus the mystery surrounding mazes make an indeliblemark upon many different areas of cultures. Today, in mathematics, finding the best pathis known as critical path analysis or CPA. Computer programs that perform critical pathanalysis are called autorouters. Autorouters help to reduce the size and cost of electronicsand have been a major factor in development of today’s advanced information technology(3). As a result, many algorithms for solving mazes have been evolved throughout theyears.B: History of the MouseThe micromouse competition has been running for over 25 years and is popular in theUK, USA, Japan, Singapore, Taiwan, Hong Kong, Australia and elsewhere. To challengeEngineers, the “maze solving” contest was designed as a way of competition. In 1977,IEEE Spectrum magazine introduced the concept of micromouse and the amazingmicromouse competition which would be held in 1979 in New York. This competitioninvolved mices finding their way out of 10 by 10 mazes.In 1980, Professor John Billlinsley, of Portsmouth Polytechnic, modified the rules andintroduced the first European competition-held in London at Euromicro. The rulechanges required the mice to find a goal in the center of the maze and wall followerscould be prevented from finding the goal. There were 200 enquiries and 100 entries, but


7only 9 mice at the finals. Nick Smith’s Sterling Mouse became the first ever (and thatyear the only) micromouse to find the center and know it had done so. Althoughperformance was less than stunning at about 0.18m/s, it was and still is a remarkable feat.In 1985, the ‘First World <strong>Micromouse</strong> Competition’ was held in Tsukuba, Japan. Mazeswere sent to a number of countries around the world in order to encourage entries. A widerange of mice from all over the world competed. The world champion was Noriko-1 fromJapan. The top six places were taken by Japanese entries. Seventh was Dave Woodfieldfrom England with Enterprise. In 1986, the US had its first competition, held in AtlanticCity, organized by the IEE (Institution of Electrical Engineers). Dave Otten of MIT hadhis first competition entry with Mitee Mouse I. Unfortunately it came last. (4)Today, various simpler versions of the contest have been created for schools and theunder 18’s. At certain schools, contestants must be an undergraduate IEEE studentmember at a Region 6 school from within the Area of Region 6 in which contest they willcompete at the time of entry in the MicroMouse contest. Any student who graduatesanytime during the Fall-Spring academic year in which the contest is held is eligible toenter the contest. (5)


8MAJOR CONSTRAINTSThe design of our Micro-Tank is subjected to several constraints. We will explain someof these constraints in detail.A: Economical ConstraintsOne of the constraints we have to deal with in our project relates to the cost. We have todesign our mouse based on the fact that the total bill of the material must be below $500.Being the students that are studying at UCI, we also have a budget limit of spending fromour own expense which cannot exceed $500 dollar. Such a constraint would deter usfrom making a great Micro-mouse design that can win the IEEE competition. We haveordered the parts for our Micro-tank considering our own budget limitation as well as theIEEE rule for the budgeting limitation. The parts that we have purchased are not as goodas the more expensive parts that other competitors may use. As an example, we couldhave purchase a DC motor that has a built in encoder and the fastest speed. But we hadto trade off such a great DC motor with its cost which was extremely expensive motor.Indeed, in our project, we had to make lots of trade off associated with having the top ofthe line parts compared to a part that is used by many Engineers who design the <strong>Micromouse</strong>.In this way, we have decided to order parts that are not very expensive and


9scarified the performance of our Micro-tank for it. The purchase of our Microcontrollerwould be another example that can be discussed. We were initially looking to purchase aZbasic microcontroller in which many Engineers use for the construction of their <strong>Micromouse</strong>.However, due to having small memory storage as well as a large cost, we havedecided to choose AVR Butterfly for the control of our Robot. The AVR butterfly on theother hand, even though cheap with lots of storage, has given us lots of problems anddifficulties for our design. Our project could have been better and easier to make if wehave chosen the Z-basic Microcontroller. We have overcome such challenges for theeconomic constraints we have encountered and we will always remember to incorporatesuch constraint in our future design when making a product for consumers. Figure belowshows the cost for this project:System CostsDescription Quantity Purpose Price/Unit Total PriceAVR Butterfly 1 Microcontroller $21.28 $21.28L293D 2 Motor Driver $3.17 $6.34MC7805ECTBU 2 Regulator $0.37 $0.74TSL261R-LF 6 Photoresistor $2.52 $15.12SN754410NE 2 Motor Driver $1.87 $3.74TSAL6100 6 IR LED $0.21 $1.26GP2Y0D340K 6 Sharp Distance Sensors $6.42 $38.52All Shipping Costs 1 All Shipping Costs $50.00 $50.00Chasis and Motors 1 Chasis and Motors $40.00 $40.00Miselinious 1 Resistors, Caps, wires, etc $100.00 $100.00Tools and Breadboard 1 Tools and Boards $25.00 $25.00Plexiglas 1 Chasis design $4.00 $4.00Maze Equipment 1 Construct Maze $30.00 $30.00Total Costs $336.00B: Environmental ConstraintThe environment in which the <strong>Micromouse</strong> will need to function is a maze compromisedof a 16 by 16 cm array. In other words, Our Micro-tank must be small enough to fit


10within the maze cell that has the 16 by 16 cm dimension. Even though we have violatedthis rule due to selecting a tank for our design project, we still have constraint for sizewhich is very important when our tank is going to make a turn. In addition to the mazeenvironmental constraint, we have another environmental constraint in which the robotcannot cause any damages to the maze or leave behind any debris in its path. As a result,the engineer must think of a way to make such an environment suitable. For this project,we have changed the rules of the maze (size is changed to 40cm by 40 cm array) simplydue to time and economical constraints. By doing so, we were able to overcome theenvironmental constraint in a way. However, such an issue will be a challenge for ourfuture work in designing smaller autonomous devices.There is also another environmental constraint to illustrate and that is related toReduction of Hazardous Substances. Our micro-tank uses components that are made upof reduction of hazardous substances. According to Wikipedia, RoHS is a new Europeanenvironmental directive being adopted in America which includes the banning of lead,Mercury, Cadmium, Hexavalent Chromium, PBB, and PBDE from all computerelectronics (6). The safety of the environment is a major factor for any engineer toconsider while designing as it is the case for our team.RULESA: MicroTank• A MicroMouse shall be self-contained (no remote controls).


11• A MicroMouse shall not leave any part of its body behind while going through themaze.• A MicroMouse shall not jump over, fly over, climb, scratch, cut, burn, mark,damage, or destroy the walls of the maze.• The dimensions of a MicroMouse that changes its geometry during a run shall notbe greater than 25 cm x 25 cm. there are no restrictions on the height of aMicroMouse.• Any violation of these rules will constitute immediate disqualification from thecontest and ineligibility for the associated prizes.B: Maze• The maze is composed of multiples of an 18 cm x 18 cm unit square. The mazecomprises 16 x 16 (38 x 38 in our case) unit squares. The walls of the maze are 5cm high and 1.2 cm thick.• The slides of the maze walls are white, the tops of the walls are red, and the flooris black. The maze is made of wood, finished with non-glass paint.• Multiple paths to the destination square are allowed and are to be expected.C: Contest:


12• Each contesting MicroMouse is allocated a total of 10 minutes of access to themaze from the moment the contest administrator acknowledges the contestant(s)and grants access to the maze.• Any time used to adjust a mouse between runs is included in the 10 minutes.• Each run (from the start cell to the center zone) in which a mouse successfullyreaches the destination square is given a run time.• The minimum run time shall be the mouse’s official time.• Changing ROMs or downloading programs is NOT allowed once the maze isrevealed.DESIGN APPROACHOur design approach is a simple classical control system block diagram. Consider thefigure below:


13The sensory subsystem will sense the incoming walls or the side walls as well as thepositioning of the Micro-Tank and sends a signal to the Microcontroller. TheMicrocontroller then processes the incoming signal and output signal to the Motor Driver.The motor driver will then turn on the motors according to the logic received from theMicrocontroller. The power subsystem will power up all the subcomponents of theMicro-Tank. This block diagram is the basis of the Negative Feedback. It is important tonote that in our design we did not include an encoder as power of our sensory subsystemdue having a different design implementation and time limitation we have had. As aresult, our circuit is a close look system only with the side sensors as well as the middlesensors. The microcontroller is the sensory system will assist in controlling the Microtankto navigate in a straight line as well as detects any incoming holes o walls in themaze. Below, we will describe the functionality of each component and state our results.A: Component Diagnostics and Results


141. Center LED/Sensors:Sensors are the main part of the micromouse that detects the distance from the walls andcommunicate with the microcontroller. In other words, sensors give robots the mean toperceive its environment and the robot will processes the information received from itssensors and reacts in a predetermined manner according to the design of control systemwe have shown above. Our Micro-tank is required to detect the surrounding walls, deadends and two way openings as well as keep itself aligned in the center. In fact, the mainpurpose of the Center LED Sensors is to keep the mouse navigating in a straight path. Inselecting the type of sensors that keeps our Mouse in a straight path, we were introducedto many types of sensors such as IR Sensors, Ultrasonic or sonar sensors, touch or bumpsensors, reflective sensors, side looking sensors, differential sensors, and top downsensors.Reflective SensorsMany Engineers use the reflective sensors for the design of their <strong>Micromouse</strong> simplybecause they are relatively easy to build and the parts are easy to come by (7). Some ofthe examples of these groups of sensors include the IR sensor which can be used tomeasure the distance and positioning from the side-walls. A major problem with anyreflective sensor is that the nature of surface can have a large effect on the size of thereflected signal (4). Another major problem with these types of sensors is that at somepoint the signal can be non-linear due to effect of light spreading out from the emitter.This problem is also known as Radar equation and can be solved by using a non-linearAmplifier in the circuit. The second problem with these types of sensors is that the level


15of reflected light is dependent upon the reflected angle. This problem becomes worsen asmore light is reflected in a shiner surface. In relation to math, this problem is called theCosine law.Side-looking wall sensorsA side looking wall sensor returns an analog value that carries information related to thedistance from the walls in a form of voltages. This type of sensor is used in roboticsapplications often but it has its own disadvantage as well. One of the issues with thistype of sensor is that variation in wall reflectivity from wall to wall or cell to cell canmake getting the results a bit more difficult. Such variations require auto-calibrationwhich must happen when the mouse is running.Top Down SensorsTop Down sensors also work as a result of reflecting a light from the walls, but thesesensors are used to detect the top section of the walls and output the digital signals to theMicrocontroller. These types of sensors can have a huge advantagein that they areable to detect walls in adjacent cells.In addition to gaining knowledge related to the kinds of the sensors described, we haveperformed some research related to different groups of sensors namely proximity sensors,flex sensors and distance sensors. According to our research, proximity and flex sensorsare used to keep the <strong>Micromouse</strong> centered within the cell and for environmental mappingin adjacent cells while distance sensors are mainly used to detect the length of the path infront and to the sides of the <strong>Micromouse</strong>. In some cases, we can use the IR distancesensors as proximity sensors which can give us the analog value of voltages from the side


16walls positioning our Micro-tank centered in the maze. After conducting our researchand considering our economical constraints, we have decided to select the Infrared Lightemittingdiode and photo-resistor sensors which are a type of reflectivity sensors that cangive us the reading distance from the walls in a form of analog voltages. The type of theLED we have selected is the high power infrared emitting diode with the wavelength of950 nm made from GaAlAs/GaAs (TSAL6100). Figure below shows the picture of ourIR LED, TSAL6100.If we place this LED next to an object or a barrier that has a reflective white color, wewill see that the strength of the signal detected or the irradiance is dependent upon thedistance of the receiver (the white barrier). As a result, the closer the LED is to thereceiver, the higher the strength of the signal is at the sensor and vise versa. Figure belowshows this relationship in detail:


17When connecting the LED in a circuit, we must consider adding a resistor in series with itto reduce the current and hence any damage to the LED. The resistance we havecalculated to add to this circuit is 100 ohm with an input voltage supply of 5V as shownin the figure below:Using the KVL, we are able to calculate the current passing through the diode with ourknowledge of the turn on voltage for the diode specified in the data sheet of this productand compare it to our measured calculation. We have done this and it is an approximatematching results. It is also important to note that based on our schematic, the forwardcurrent usage of the LED at maximum for certain period of time is 200 mA. Our resultsfor the LED are shown below:IR LED MeasurementMeasured Diode Voltage (V) 1.23Measured Current (A)4.86E-02Measured Resistance (Ohm) 25.30864198It is also important to note that in order to reduce the signal interference to other sensorswe have covered the side hemispherical window of the LED with the electric tape.Interference occurs when light reflected from the walls with the wide range will bounce


18off into other sensors resulting to an output with incorrect information. As a result, weare not able to detect the location and distance from the walls and the mouse may hit thewalls at some point. This was a problem we have encountered when initially tested outMicro-tank and after covering the LEDs with tape part of our problem was resolved.Figure below shows the view for positioning our IR Center sensors in our Micro-Tank:The Photo resistor that we have selected is of the type TSL262R Infrared light-to-voltageoptical sensors as shown in figure below:


19Due to having high irradiance responsively at the wavelength of 940 nm and a linearcorrespondence with the output voltage, these photo resistors are designed to detectsignals clearer with reduction in noise and a full output voltage. Figure below shows thestructure design of this sensor in details:As shown on the figure above, the sensor is comprised of a photodiode and an amplifier.The LED will send IR light to the sensor and the sensor will detect the signal and givesan output voltage that is very weak. The weak voltage will then pass through anamplifier and picks up a gain that is about 2.9 Volt. The higher the intensity of light, thehigher voltage we are able to read from the voltmeter. The figure below shows the graphof irradiance vs. output voltage for our photoresistor:


20As shown from the figure above, there is a direction linear relationship between theirradiance and the output voltage we receive from the sensor. The higher the radiation,the higher output voltage we will get. This output voltage will then feed through theAnalog to digital converter port of the microcontroller where it will be processed for thecontrol of the Micro-Tank in navigating a straight path. For matching our output voltageto that of the Vdd or the regulated voltage of the regulator, we have chosen to add a 100Kohm resistor connected between the output and input voltage of the photo resistor. Theresistor in this case is a pull-up resistor in which extends the linear output range to nearVdd with minimal effect on Vdark. Figure below will describe our connection:


21After selecting both the LED and the Photoresistor, we have connected these parts to thecircuit to perform component testing. It is important to note that the purpose of thesesensors is to compare the two voltage readings obtained from the two center sides of theMicro-tank and set them equal for the mouse to travel in a straight path. To perform ourcomponent testing in a more accurate way, we have tested our two IR sensors in fourtrials and averaged them together to get a graph with the accurate results on it. Below wewill find these results:


22Trial 1 Trial 2Distance Output Voltage Distance Output Voltage1 0.96 1 1.012 3.79 2 3.793 3.79 3 3.794 3.79 4 3.795 3.79 5 3.795.2 3.77 5.2 3.76 2.75 6 2.597 1.845 7 1.7258 1.33 8 1.279 0.937 9 0.85810 0.655 10 0.65311 0.56 11 0.51112 0.427 12 0.43813 0.336 13 0.33114 0.303 14 0.29215 0.248 15 0.23816 0.199 16 0.21717 0.185 17 0.18618 0.16 18 0.16119 0.148 19 0.14520 0.14 20 0.14121 0.131 21 0.13422 0.125 22 0.127


23Trial 3 Trial 4Distance Output Voltage Distance Output Voltage1 1.57 1 1.222 3.79 2 3.793 3.79 3 3.794 3.79 4 3.795 3.79 5 3.795.2 3.75 5.2 3.696 2.61 6 2.617 1.84 7 1.838 1.23 8 1.189 0.865 9 0.91810 0.628 10 0.67711 0.535 11 0.50312 0.442 12 0.4413 0.346 13 0.33114 0.285 14 0.28515 0.245 15 0.24116 0.212 16 0.22517 0.181 17 0.18318 0.157 18 0.14919 0.142 19 0.14420 0.136 20 0.1421 0.134 21 0.13822 0.12 22 0.119


24Average of All TrialsDistance Output Voltage1 1.192 3.793 3.794 3.795 3.795.2 3.72756 2.647 1.818 1.25259 0.894510 0.6532511 0.5272512 0.4367513 0.33614 0.2912515 0.24316 0.2132517 0.1837518 0.1567519 0.1447520 0.1392521 0.1342522 0.12275The supply current for this photo-resistor is 1.1 mA which is very low and a benefittoward our design.


26In addition to the two center IR sensors, our micro-tank also uses 5 additional side andcorner sensors which are made by sharp and output a digital value based on hysteresiseffect. The Sharp GP2Y0D340K is a type of a distanced sensor in which can also beused as a proximity sensor. Figure below shows the picture of this type of sensor:We are using this type of sensor for detecting the walls and openings in front of ourdevice as well as on the corner section of our tank. Since our output from this sensor iseither high near vdd or low, we cannot use were not able to use it for any otherapplications. At the time of order this type of sensor, we assumed that we are able to getwide range of output voltage reading. However, later on we realized that this sensor givean output of high or low based on hysteresis effect. One of the good features of thissensor is that it has long range distance detection at maximum of 40cm. The resistor thatis connected to the LED’s internal feedback loop can be changed to reduce the distancerange suitable for our project. In addition, we also connect a 0.1 uF capacitor to theground from the input voltage of this sensor to reduce the existence of noise generated


27from rotation of the motor. Another great feature of this sensor is that the variety of thereflectivity of the object, the environmental temperature, and the operating duration arenot influenced easily to the distance detection. Finally, another great feature of this sensoris that it draws very little current for its operation which results to reduction in powerconsumption. Figure below shows the functionality of this sensor which matches ourcomponent testing:As shown in the figure above, the output voltage is low until the 40 cm distance limit.Then, due to internal hysteresis, the voltage will become high with the variation of+-80mm. This is the characteristics that we have also obtained based on ourmeasurement.


28The figure below shows how these sensors are positioned in our Micro-tank:3. The Motor Driver:The main purpose of using a driver in our system is to control the motors and turn themon and off through communicating with our Microcontroller. To understand the conceptof driver which in reality is nothing but H-Bridge ICs, we have examined theunderstanding of a simple H-Bridge Circuit as shown in the figure below:


29As shown from the figure, the main purpose of an H-Bridge is to connect the input of themotor to the battery voltage supply using some sort of switching mechanism. The reasonwe want to do this is because the motors require large amount of current which is not safefor a sensitive microcontroller. In addition, our most microcontrollers have an externalpower supply range of up to 5 volt which is not sufficient enough to run the motors at ahigh velocity or may be not enough operating voltage for the motors at all. In order to fixthese issues, we use the H-Bridge configuration shown on the figure above. Whenclosing switches A and D above, we are connecting the positive supply of the battery tothe positive side of the motor and the ground to the negative side of the motor. Theresulting schematics would be one shown below where the motor will be spinningforward.


30ForwardBy closing the switches B and C, we will cause the motor to rotate backward as shown inthe figure below:BackwardBy closing switches A and C, we will disconnect the batter from the Motor as shown onthe figure below:BrakingOne of the major mistakes that can cause battery burning is by closing switches A and B.In this way, we are connecting the positive side of the battery to the negative side of the


31battery which results to melting of wires as a result of shorting the circuit. The figurebelow will describe this phenomenon:Don't Short the Battery!!Now that we have insight about how the H-Bridge Circuit works as a switchingmechanism, the question remains in how can we make this switching effect? The answerto this question is straight forward; we will use a transistor to that performs the switchingmechanism for in our circuit. The type of transistor that can be used to implement ourdesign varies, but most of these transistors operate in the same way. Consider thetransistor H-Bridge Figure below:An H-Bridge with Transistors


32When supplying a VDD regulated voltage of 5 Volt to the gate of the transistors connectedto the resistor (let’s consider gate A in this case), two things may happen:If Vdd is higher than the turn on voltage of the transistor which is related to the thresholdvoltage, then there will be channel formed between the source and drain of the transistor(considering a CMOS Transistor). The connection of the source and drain (collector andemitter in case BJT Configuration) resembles the closing of the switch A which will thenconnect the positive side of the motor to the positive supply voltage of the battery.If the Vdd is lower than the turn on voltage of the transistor, the nothing will happen andthe switch is still off. It is important to note that selecting a right transistor in this case isa critical step. Most transistors however have a threshold voltage much less than 5 Volt.The job of our microcontroller in this case is to supply continuous pulses that have 5Vpeak to peak value in order to turn on the motors.The driver we have selected for our design project is the L293D driver which is thequadruple high-current half-H drivers. These drivers consist of H-Bridges that canconnect two DC motors inputs to the battery supply. Similar to the H-bridge, our driverworks in a similar fashion with an advantage of having several safety features added intoit. This driver has been designed by the Texas Instrument to provide bidirectional drivecurrents of up to 1A at the input voltage ranges of 4.5 to 36 volt. In addition, this driverhas a safety feature of internal ESD protection, thermal shutdown, and internal fly backdiodes used for the back induced EMF voltage of the motors. The internal logic of our


33driver will prevent the battery positive and negative terminals to be shorted as it was thecase with a regular H-Bridge.In order to describe the truth table for our driver, consider our driver schematic below:As shown in the figure above, our L293D driver has two enable pins that are pins 1 and 9.When the enabled inputs are high, the associated drivers are enabled and their outputs areactive and in phase with their inputs. On the other hand, when the enable inputs are low,those drivers are disabled and their outputs are off and in the high impedance state. Theenable pins in our driver are mainly used to control the speed of the motors throughgeneration of the pulse waves from the Microcontroller, a method known as Pulse WidthModulation. In our design, we ignored the use of Pulse Width modulation to control thespeed of the Micro-tank and connect our enable pins directly to Vdd regulated 5 Volt.The reason for doing so is that our AVR Butterfly Microcontroller has limited I/O portsand we were unable to use additional I/O ports for controlling the speed of the tankthrough the enable pin of the driver. This will however be one of the tasks that is goingto be accomplished in future for improvement and better control of our device.


34Pins 4,5,13 and 12 of our driver are connected directly to the ground as shown in thepicture above. From the figure above, Pin 8 is connected directly to the supply voltage ofthe battery and pin 26 is connected to the 5 V regulated voltage from the regulator forpowering up the internal logic of the driver. The remaining pins are the input pinscharacterized by letter A and output pins characterized by letter Y. Table below shows thetruth table of our driver and how it is related to forward, reverse, backward and stopmovement of our micro-tank.Truth TableMotor 1Input OutputPin 2 Pin 7 Pin 3 Pin 6Motor Action0 0 0 0 Stop0 1 0 1 Forward1 0 1 0 Backward1 1 1 1 Stop (Prevent Using this Logic)Motor 2Input OutputPin 10 Pin 15 Pin 11 Pin 14Motor Action0 0 0 0 Stop0 1 0 1 Forward1 0 1 0 Backward1 1 1 1 Stop (Prevent Using this Logic)Below is our component testing results for the driver under the truth table conditionabove (Analog Results):Input Voltage Output ResultsPin 2 Pin 7 Pin 3 Pin 6Motor 1Motor Action


350 Volt 0 Volt 0 0 Stop0 Volt 5 Volt 0 6.87 Forward5 Volt 0 Volt 6.87 0 Backward5 Volt 5 Volt -- -- Stop (Prevent Using this Logic)Total Current Drawing perchannel Measured 0.4 ABattery Voltage Measured7.96 VoltVoltage Difference1.09 vMotor 2Input Voltage Output ResultsPin 2 Pin 7 Pin 3 Pin 6Motor Action0 Volt 0 Volt 0 0 Stop0 Volt 5 Volt 0 6.87 Forward5 Volt 0 Volt 6.87 0 Backward5 Volt 5 Volt -- -- Stop (Prevent Using this Logic)Total Current Drawing perchannel Measured 0.45 ABattery Voltage Measured7.96 VoltVoltage Difference1.09 v4. Motors and Chassis:Motors are the equipment in which gets the car moving. Without the motors, the<strong>Micromouse</strong> would not be able to do much of anything (Last year Report). Selection of asuitable motor for our project has been a controversial issue among the members of ourgroup. We had to make a decision in selecting a motor that would give us maximumspeed, a good amount of torque during turning, higher stalled current, high internalimpedance and low power consumption. There were various types of motors in which wehave conducted a research for in our project. In general, the types of motors used in thedesign of a micromouse lies in two categories; Dc motors and Stepper Motors.DC Motors Vs. Stepper Motors


36DC motors will almost certainly give you the best combination of power to weight ratioand top speed (http://micromouse.cannock.ac.uk/motors/dcmotors.htm). Figure belowshows a picture of a DC motor:When applying a voltagewill start to rotate andan opposite voltage thatto the DC motor, the motorresults into the induction ofopposes the current.Eventually, the speed of the motor stabilizes. The DC motors generally run moreefficiently at higher speeds where the available torque will be less than that of the stalltorque. As a result, we will have issues with turning when having a smaller torque. Tosolve this issue, DC motors are connected to the gear boxes driving gears. The mainfunctionality of the gear is to increase the torque while the speed of the motor will bereduced a little. The combination of high speed velocity and gear box damping effect inDC motors makes them suitable for design of the <strong>Micromouse</strong> Robots that require highspeed and adequate amount of torque. In addition, DC motors without an encoder arerelatively cheaper than the stepper motors and are very light weighted as well comparedto the stepper motors. So, now, one may ask, why did we have to debate aboutpurchasing a stepper motor when DC motors have all these advantages? To answer thisquestion, let’s consider discussing more about the stepper motors. Figure below shows apicture of a Stepper motor:


37Stepper motors only rotate a specific number of degrees when receiving a pulse ofelectricity at the inputs. In the similar fashion, the more the motor is pulsed, the fartherthe motor will travel. Counting the number of pulses will already give us the velocityand positioning distance we need. Stepper motors are usually more bulky than the DCmotors and have higher torque than the DC motors. As it is described in any motorequation, having a higher torque indicates a lower velocity. Unlike stepper motors, DCmotors have no sensory mechanism that can automatically measure their rotationalvelocity. To solve this issue, the designer must incorporate an additional part in his or herdesign that can measure the velocity as well as determine the positioning of the<strong>Micromouse</strong>. This specific part is called an encoder. There are various types of encodersthat can be used for the design of the micromouse. Figure Below shows a typical pictureof a paper encoder wheel:These encoders are attached to the wheel or the gear disk. In addition to this paperencoder there is an emitter and a detector connected in the circuit. When the wheels


38rotate, the shaft encoder provides pulse train (since the white color reflects the ray andblack does not so we have 0 and 1 logical values considered as voltages in an analogterminology) that can be counted and allow the microcontroller to determine the velocityof the motor as well as how far the motor has traveled. Some DC motors come with aninternal encoder, but with the downfall of having higher costs. Adding the additionalencoder part to our system in addition to dc motor also increases the cost of the wholething. Since stepper motors do not need encoders (Stepper motors turn based on giving itinput pulses) they would be in the long term more cost effective. In addition, it is mucheasier to program the stepper motors than DC motors because stepper motors turn atcertain specified angle when supplying input pulses to them. As a result, measurement ofvelocity and position is obtained through the motor itself whereas DC motors requireencoders that need to be connected to the I/O port of the Microcontroller for detectionand control of speed. In other words, the advantage of the stepper motor over DC motoris that there is no need for feedback from the wheels to determine the speed and distancetraveled for the input pulse trains will already do that (7) All of these factors would makethe stepper motor suitable for the beginners who are just starting to design a <strong>Micromouse</strong>with the trade of weight, size, lower speed, hardware complexity and at some point costs.Now that we have covered the two types of motors let’s specify which type of motor wehave selected for our design. Initially, our team was leaning toward using a stepper motorsimply because of the ease of programming when using these motors. As time elapsed,one of the team members in our group was not able to communicate with the rest of theteam so we have decided to change our method from Stepper motor configuration that


39came up with the chassis to using DC motors of a tank. The chassis we have purchasedfor our tank has already included integrated DC motors as well as the gear box with it.We immediately liked the idea of using the tank since the gear box would reduce thespeed and provide adequate torque that would make turns suitable. Even though themotors that were included with our chassis did not have an encoder, we came up withmethods for programming this tank that we thought at the time did not require the use ofan encoder. This obviously is not true since encoder is needed for stabilizing theovershoot effect, an idea we have learned in classical control system. Later on, werealized that one of our gears have a spot in which we can use for building our ownencoder on it. In addition to motor issues that has focused our attention of using the tankfor our design, we have also considered the chassis itself as an advantage to our design.Wheels vs. TreadsBased on our understanding from last year design of the <strong>Micromouse</strong>, the mouse wouldnot stop right away and there were factors such as wheel drifting and skidding involved.To solve this issue we have decided to choose a Tank that operated with treadsincorporating higher surface friction than wheels. This by far was one of the mainreasons we leaned toward choosing the Tank chassis composed of two DC motors ratherthan using the Two Wheel chassis with stepper motor connection. We will now show ourcomponent rest results for chassis as well as the motors in the table below:Motor Test ResultsMotor's Maximum Operating Voltage (V) 12


40Motor's Stalled Current (A) 0.6Motor's Impedance (Ohm) 20Motor TypeDC BrushlessEncoder IncludedNoOperating Voltage6VTank/Chassis SpecificationTank Width13 cmTank Height5.5 cmTank Length17 cmTank Weight Including Wheels Not SpecifiedWheel Diameter4.5 cmFigure below shows the relationship between the dimension of the tank and the maze,material of the maze as well as the Algorithms used that will be explained later5. Batteries:Our choice for battery selection was a difficult task for we had to consider system levelpower analysis before selecting our batteries. When choosing the battery, we considered


41three criteria related to our system design. The first criterion is battery voltage, next oneis the battery capacity and the third one is the type of battery we had to select from. Let’sconsider battery voltage selection for our design at first. In doing so, we first figured outthe two main elements that have a direct relation to the battery voltage. The two elementswere the limitation on the input supply of our regulator as well as the minimum operatingvoltage of our motor. Based on our analysis from the motor and regulator, we haveobserved that the minimum operating voltage of the motor as well as minimum operatingvoltage of the regulator is about 6 Volt. Considering the marginal changes in voltage, wehave decided to select 6 1.2 Volt battery cells that would give us total of 7.2 Volt. Thiswould be suitable for both the regulator and the motors. Now let’s consider the secondcriterion which is related to the battery capacity and the type of battery. These twocriteria are related in some ways as we are going to discuss. The battery capacity willdetermine the life time of the battery or the period of time in which the battery willremain charged for while providing the maximum current to the components. Since thisis our first design project, we wanted to make sure that we have the maximum capacityavailable, and that our batteries do not heat up or go bad soon. After a few searches fromone store to another, we have found batteries that have 2700 mAH charging capacity,giving our tank plenty of time to navigate through the maze without the battery goingbad. The size of the battery we have selected for this purpose was AA batteries sincesmaller sizes did not give such a high capacity. It is important to note that when selectingbatteries, size is also a very important factor; the larger size the battery is the more spaceit will occupy in our tank and the heavier it is, resulting to even more power


42consumption. As a result, we did not choose to have larger size batteries with morecapacity simply due to this fact. In addition, we have conducted a few researches from<strong>Micromouse</strong> designers in which they have stated AA size batteries were the best typicalsize to use in the <strong>Micromouse</strong>. Finally, when selecting batteries, we had to choose from avariety of batteries that are out there in the market. Table below will illustrate generalspecification of each type:Alkaline NiCad NiMH unitCell Voltage 1.5 1.2 1.2 voltCapacity 2000 500 1100 mAhEnergy Density 190 44 53 Wh/kgInternal Resistance 150 10 30 mohmCharger none simple harderhttp://www.micromouseinfo.com/introduction/batteries.htmlAlkaline: These batteries are regular batteries that are out there in the store and they havea higher cell voltage compared to other batteries. However, because of their high internalresistance, they cannot provide current needed for the motors.NiCad: These types of batteries have lower cell voltages so there need to be more cellsto obtain the required voltage. These batteries also have a very low capacity, but they arevery easy to recharge and because of their small internal resistance, they are good forpowering the motors for a short period of time however.NiMH: NiMH batteries are similar to the more expensive NiCad batteries except thatthey can deliver current for a longer period of time due to having higher capacity. Thesetypes of batteries take longer time to charge, but they are more suitable for Roboticapplications.


43Based on the researched performed above, we have selected 6 AA sized NimH batteriesfor the total of 7.2 Volt (1.2 Volt per cell) and capacity of 2700 mAh connected in seriestogether. The results below describe our measurement for the batteries as well as thediagram of our selected battery:Battery TestVoltmeter Measured Voltage (V) 7.96Battery Capacity (mAH) 2700Internal Resistance (Ohm) ~0.2Battery TypeNiMhBattery SizeAARechargeable?YesInternal Resistance Calculation: We have calculated the internal resistance byconnecting the battery to the 100 ohm resistor in series for a short period of time andmeasuring the current drawing from the battery. By knowing the current, the voltage ofthe battery as 7.2 Volt and the resistance value of 100 ohm (R1), we have used the voltagedivider technique to solve for rb as follows:


44rbR1Voltage DividerVin6. Regulator:The main purpose of using a regulator in our design project is to step down the batteryvoltage to a 5 volt regulated output that can be used for powering the sensors and themicrocontroller. Regulated voltage is required in our circuit to reduce the change involtage that may damage the sensors or in many ways it can cause the sensors to give uswrong readings due to input voltage distortions. In choosing a regulator, we had manychoices to select from. We were mostly interested to purchase the voltage regulatorMax727 which is the switch mode regulator with the peak efficiency of 90%. However,this product was discontinued when we wanted to order it. So, we have decided tochoose the regular 7805 regulator that would give us 5V regulated output voltage. Themanufacture we have selected this regulator from is the Fairchild semiconductor. Thistype of regulator can supply an output current of up to 1A which is very suitable for ourdesign. To determine the turn on voltage of the regulator, we have performed anexperiment in the lab. Table below as well as the chart below will describe our results forthe component testing of the regulator:Regulator Test ResultsInput Voltage 7.96Output Voltage 4.95Maximum Current 1AHeat Sink Included Yes


45Input VoltageOutput Voltage0 0.0261 0.2472 1.243 3.194 4.1325 4.9616 4.9647 4.9648 4.9649 4.96410 4.96411 4.964


46B: System <strong>Design</strong> Schematics and ConnectionAfter we have tested each individual components of our Micro-tank, we were ready todesign a schematic that incorporates everything together with the addition of a fewcomponents such as capacitors and resistors added to our tested components. Toillustrate our system design, let’s consider the schematic below.


47As shown on the schematic, initially, the batteries provide a voltage of 7.2 volt to theregulator and the VCC2 of our L293D Driver. Since each channel of the driver will candraw maximum of 1A from the batteries, and since other components in our circuit willdraw less than 700 mA current, our battery will not overheat or discharge very fast. Inthe worst case scenario, our battery should discharge in an hour when 2.7 Amp of currentis drawn. The regulator as shown on the schematic will provide an output voltage of 5Volt to all the sensors, Vcc1 (logic voltage) of the driver, as well as the external voltage ofthe Microcontroller. The main question in here is that if the total amount of current thedriver can supply to the loads is about 1A, are the loads drawing one amp or more? Thisis critical factor to know since if our loads are drawing more than 1A and our regulator


48supply current limit is only 1A, we will overheat the regulator and at some point causethe component to burn. So, in order to prevent such thing from happening, we haveperformed calculation for the worst case scenario current drawings of our loads whichinclude the sensors, microcontroller, and the driver logic circuits. The calculation is asfollows:Description QuantityMaximum CurrentDrawingTotalIR LED TSAL6100 2 0.15 0.3IR PhotoresistorTSL260R2 0.001 0.002Sharp GP2Y0D340KSensor5 0.033 0.165L293D Driver Vcc1 1 0.1 0.1Avr ButterlyMicrocontroller1 0.12 0.12Total Current Drawing 0.687As we can see from our calculation, under the worst condition, our regulator must supplythe current of 0.687 to the loads in our circuit and this is possible since the maximumrating for current supply of the regulator is rated at 1A. Nevertheless, even 0.7 A is alarge current for the regulator, we are using a heat sink to get rid of an excess heat (if it’sthere) from the regulator in order to not damage it. In the system schematic designabove, we can also see the addition of 0.1 uF capacitors and 10K Ω resistors to thecircuit. We are using the 0.1 uF ceramic capacitors in or circuit to reduce the noise thatcan be generated from the motors in our circuit. This noise as a result of back emf of themotor can damage the sensors and even the driver logic circuit. To avoid such damage,we are filtering the high frequency noise as a low pass filter by adding a capacitor to the


49ground of our circuit. After all, the equation for the capacitor can be written as thefollowing:Based on this equation, at high frequency w, we have an infinite impedance Zcorresponding disconnection of our circuit to pass the high frequencies through. The 10K resistors, on the other hand are used connecting the driver’s input to themicrocontroller output port. The purpose of these resistors is also to protect themicrocontroller from the back emf characteristics of the circuit as well as noisegeneration from the motors.D: Mechanical Schematic and <strong>Design</strong>


50The mechanical schematic for our Micro-Tank consists of consists of screws, shortmetallic column extenders, tall column extenders and a transparent thick Plexiglas thatcan be drilled at four corners on top of the tank. As part of our design, the tall columnextenders are made to hold the board on top of the tank so that it would be easier to movethe battery from the inside of the tank when the battery needs to be recharged. We had tocut a rectangular piece from the inside of the transparent tick Plexiglas in order to be ableto access the battery from the inside of the tank. Doing this was not an easy task sincethe Plexiglas was very brittle and it would crack easily during the cutting process.However, after destroying two of them, we were finally able to make one that was goodfor mounting around the tank. In order to mount the screws around the tank, it wasnecessary to do exact measurements since the edge of the tank was short. The diagrambelow shows how this measurement has been done and how we marked the perimeter forcutting a piece of tick transparent Plexiglas and indicate the locations where the screwswere used to connect the column extenders to the body of the tank as well as to the boardon top. (Note: the short column extenders used for connecting the microcontroller to thesurface of the board)Mechanical SpecificationPlexiglas dimension (cm) 18 by 11Plexiglas length thicknessPlexiglas width thicknessPCB Board Dimension (cm) 10 by 16Screw SizingDrill Size 4Microcontroller Dimension (Cm) 6.6 by 4.42 cm from each side1 cm from each side4-40 1/4 SLOT ROUND


51Tank WidthPlasticPlexiglasScrews


52D: Maze Solving <strong>Design</strong> ApproachNow that we have constructed our design schematic, it is important to focus our attentionto find ways in solving the maze to generate our own algorithms in combination withother types of algorithms that may be used for programming of our microcontroller. Wehave generated a method in solving a maze that combines 5 sensors, and 2 center sensorsin trying all possible paths through the maze in order to find the destination. Here, thereare a few questions that need to be addressed; when does the Tank decides to turn? Howdoes the Tank know what direction to turn? And how can we recognize the paths that aredead-end and omit them after the first round of Navigation? The answers to thesequestions rely on our maze solving strategy which is illustrated on the next page:1. When does the Tank decide to turn?


53The answer to this question is explained based on the few figures below:Initially our tank is moving centered between the two side walls. The upper left, upperright, lower left and lower right distance sensors detect these walls as the mouse isnavigating forward. The center sensors on the left and right also control the mouse tonavigate through the center of the maze.


54The next step is that the mouse will navigate forward until it reaches the intersection orthe position at t he upper left sensor and upper right sensors cannot detect any walls.When this happens, the upper left and upper right sensors will send a signal to themicrocontroller telling the microcontroller to reduce the speed of the motors through theprocess of Pulse Width Modulation.


55As our tank navigates forward, it will eventually reach a point where all the four sidesensors (the upper left, the lower left, t he upper right, and the lower right) does not detectany walls as shown in the figure above. At this point, the sensors send a signal to themicrocontroller to reduce the speed of the tank to 0 and begin the turning process at 90degree angle. Notice that the programming we are doing does not stop the tankimmediately, rather it will reduce the speed to 0 and turns 90 degrees toward the right.The concept of why the tank will turn right and not left will be explained in the answer tothe next question.


56Sometimes, the mouse may navigate through a route that is dead-end. In this case, allfour side sensors, the upper left, the upper right, the lower left and the lower right sensorsas well as the front sensor detects wall. When this scenario occurs, there will be a tankwill stop and brakes before hitting the wall in the range of sensor detection we havespecified in our design. Then, once the tank stops, it will make a 180 degree turn to turn


57around. Our original idea about this was to add a back sensor so that it can back-up, butwe have observed that the tank is capable of making the 180 degree turns easily.The following describes the turning mechanism of the tank shown on the diagramsbelow:


61How does the Tank know what direction to turn?The tank knows which direction it should turn based on the programming algorithm thatwe are using. When programming the microcontroller, we will initiate the tankmovement by clicking on the joy-stick button on the microcontroller. Our design is builtin a way that when pressing the joystick up, the mouse will navigate through the mazeand uses the long path algorithm or what we call the special kind of Depth First algorithmRFLB. RFLB simply indicates that the mouse will always prioritize turning right first,then forward, then left and then backward or turn. In doing so, the tank will travelthrough all of the paths in the maze in order to get toward the destination and will alwaysfind the path toward destination. It is important also to note that when the mouse isnavigating through the maze for the first time, it will record the data in the form of anarray and saves it to the flash memory of the AVR butterfly for use in the second round.Based on this design, the first round of navigation through the maze is always timeconsuming and slow. The next section of our programming Algorithm comes into effectwhen pressing the joystick downward and having he mouse navigate through the maze


62for the second time. At this point, there will be a new algorithm written by Arya Ahmadiused. This algorithm will always work and eliminates the paths that were unnecessary tonavigate through from the first round.Figure below shows the basic concept behind RLFB Depth First Algorithm:We now use the RFLB Depth First Algorithm in the figure above. At first the mouseconsiders turning right. However, since the upper right and lower right sensors detect awall, the mouse will not turn right. The next step it for the mouse to consider going


63forward. However, since the front sensor detects wall, this is not going to happen. Thirdthe mouse tries to look at the left side. Since the upper left and lower left sensors are notdetecting any walls, the mouse will turn left and move forward. Such an analogy willhappen repeatedly until the mouse finds the center of the maze. (In our case, our tankdoes this)SYSTEM DIAGNOSTICS, LAYOUT AND RESULTSAfter having all the possible design approaches specified above, we were now ready tocreate the PCB layout of our Micro-tank. Due to time limitation we have encounteredduring this project, we were not able to draw the PCB layout using express PCB or anyother Engineering software available to accomplish this task. Instead, we purchased aPCB board that was suitable for any connection and required a little wiring for completeconnection of our components underneath the board. The soldering process as well astroubleshooting of our system took a long time and it was by far the hardest part of ourproject. In the end, our PCB layout looks as shown in the figure below:


64Our design for the PCB layout above was constructed in a way that would makeRegulatortroubleshooting of it very easy. For example, the board itself can easily get disassembledfrom the tank due to having removable harnesses that our wires were attached to as wellas screws on the side that mounted the board to the body of the tank. In other words, youcould easily disassemble the board from the tank by removing the wire harnesses andscrews without the use of soldering or unsoldering any component as well as withoutdamaging any parts on the tank. This technique of design has made our task easier fortroubleshooting our system since every time we though there was a problem withconnection of our components, we were able to easily disassemble the board, fix theproblems, and then connect the board back to the tank. We have also used a switch in ourlayout to securely test our system and if God forbid there was a problem, we would be


65able to immediately turn off the switch to prevent any major damage to our system. Afterfinishing our layout, we had no more issues and problems with our tank, except that at thelast minute of program testing, one of our side sensors malfunctioned.MICROCONTROLLER SELECTION ANDPROGRAMINGProbably one of the hardest parts of this design project has been the programming of themicrocontroller as well as finding the suitable microcontroller. The microcontroller is theconsidered to be the brain of our Micro-tank in which it controls all the components onthe tank. The information form the sensors is sent to the microcontroller and processed inorder to send a signal to the drivers to turning on and off the motors. In addition, themicrocontroller has several other features in which allow us to incorporate otherfunctionalities in our tank. The microcontroller that we have selected is the AVRButterfly as shown in the figure below:


66The decision to purchase this microcontroller was perhaps the biggest mistake we havedone for we were not that is processor shares most of the I/O ports with other functions init. Our main decision to purchase this microcontroller was based on have a large memorydata flash which many other microcontrollers did not have. The features of the AVRbutterfly that was useful in this project includes Atmega 169 microprocessor, 100segment LCD display, 4Mbt of Dataflash, 32Khz Oscillator for the Real time Clock orRTC, 4-way directional button, light sensor pins, temperature sensor pins, as well as theUART port for connection to the computer. The main disadvantage of thismicrocontroller is that the ports that we were planning to use of Tank were mostly sharedwith other modules within the system. As a result, our task became very challenging intrying to find a way to disable some of these sharing ports. In addition, we were not ableto disable everything since some of the ports shared important components that we wereusing. An example of this would the LCD display. The figure below will illustrate theports that we used for connecting the components of our micro-tank:


67PORT B is used for connecting the motor driver inputs to it.Port D is used for the Corner Sensors and the Front SensorThe JTAG port is used for connecting the center sensors from our Microtank


68In order to become familiar with which section are these part sharing with, it is importantto look at the Atmega 169 processor schematic used for this microcontroller. The picturebelow will illustrate this:Programming(Note: this section of our project has not been completed well. We are still working oncompleting this section and when we are done, we will update our results to this section.Sorry about this we had time limitation and issues in our group. Thanks)#include #include "adc.h"


69#include "mboard.h"//#define LIGHT_SENSOR 2int ADC_read(void);/******************************************************************************* Function name : ADC_init** Returns : None** Parameters : char input** Purpose : Initialize the ADC with the selected ADC-channel******************************************************************************/void ADC_init(char input){ADMUX = input; // external AREF and ADCxADCSRA = (1


70******************************************************************************/int ADC_read(void){char i;int ADC_temp;// mt int ADC = 0 ;int ADCr = 0;// To save power, the voltage over the LDR and the NTC is turned off when not used// This is done by controlling the voltage from a I/O-pin (PORTF3)sbiBF(PORTF, PF3); // mt sbi(PORTF, PORTF3); // Enable the VCP (VCperipheral)sbiBF(DDRF, DDF3); // sbi(DDRF, PORTF3);sbiBF(ADCSRA, ADEN);// Enable the ADC//do a dummy readout firstADCSRA |= (1


71//***************************************************************************// File........: BCD.c// Author(s)...: ATMEL Norway// Target(s)...: ATmega169// Compiler....: IAR EWAAVR 2.28a// Description.: AVR Butterfly BCD conversion algorithms// Revisions...: 1.0// YYYYMMDD - VER. - COMMENT - SIGN.// 20030116 - 1.0 - Created - KS//***************************************************************************/****************************************************************************** Function name : CHAR2BCD2* Returns : Binary coded decimal value of the input (2 digits)* Parameters : Value between (0-99) to be encoded into BCD* Purpose : Convert a character into a BCD encoded character.* The input must be in the range 0 to 99.* The result is byte where the high and low nibbles* contain the tens and ones of the input.*****************************************************************************/char CHAR2BCD2(char input){char high = 0;}while (input >= 10){high++;input -= 10;}return (high


72/******************************************************************************* Function name : CHAR2BCD3** Returns : Binary coded decimal value of the input (3 digits)** Parameters : Value between (0-255) to be encoded into BCD** Purpose : Convert a character into a BCD encoded character.* The input must be in the range 0 to 255.* The result is an integer where the three lowest nibbles* contain the ones, tens and hundreds of the input.******************************************************************************/unsigned int CHAR2BCD3(char input){int high = 0;while (input >= 100){high++;input -= 100;}// Count hundredshigh


73//// Author(s)...: ATMEL Norway//// Target(s)...: ATmega169//// mt - used for debugging only - may not work// Include files.#include #include #include #include #include "lcd_driver.h"#define BOOL char#define FALSE 0#define TRUE (!FALSE)// Variable from "button.c" to prevent button-bouncing


74extern unsigned char gButtonTimeout;extern BOOL gAutoPressJoystick;// Used to indicate when the LCD interrupt handler should update the LCD// mt jw char gLCD_Update_Required = FALSE;volatile char gLCD_Update_Required = FALSE;// LCD display buffer (for double buffering).char LCD_Data[LCD_REGISTER_COUNT];// Buffer that contains the text to be displayed// Note: Bit 7 indicates that this character is flashingchar gTextBuffer[TEXTBUFFER_SIZE];// Only six letters can be shown on the LCD.// With the gScroll and gScrollMode variables,// one can select which part of the buffer to showvolatile signed char gScroll;volatile char gScrollMode;////Start-up delay before scrolling a string over the LCD


75char gLCD_Start_Scroll_Timer = 0;// The gFlashTimer is used to determine the on/off// timing of flashing characterschar gFlashTimer = 0;// Turns on/off the colons on the LCDchar gColon = 0;// Look-up table used when converting ASCII to// LCD display data (segment control)// mt __flash unsigned int LCD_character_table[] =unsigned int LCD_character_table[] PROGMEM ={0x0A51, // '*' (?)0x2A80,// '+'0x0000, // ',' (Not defined)0x0A00,0x0A51,// '-'// '.' Degree sign0x0000, // '/' (Not defined)0x5559, // '0'


760x0118, // '1'0x1e11, // '20x1b11, // '30x0b50, // '40x1b41, // '50x1f41, // '60x0111, // '70x1f51, // '80x1b51,// '9'0x0000, // ':' (Not defined)0x0000, // ';' (Not defined)0x0000, // '' (Not defined)0x0000, // '?' (Not defined)0x0000, // '@' (Not defined)0x0f51,// 'A' (+ 'a')0x3991, // 'B' (+ 'b')0x1441, // 'C' (+ 'c')0x3191, // 'D' (+ 'd')0x1e41,0x0e41,// 'E' (+ 'e')// 'F' (+ 'f')


770x1d41,0x0f50,// 'G' (+ 'g')// 'H' (+ 'h')0x2080, // 'I' (+ 'i')0x1510, // 'J' (+ 'j')0x8648, // 'K' (+ 'k')0x1440, // 'L' (+ 'l')0x0578, // 'M' (+ 'm')0x8570, // 'N' (+ 'n')0x1551, // 'O' (+ 'o')0x0e51,// 'P' (+ 'p')0x9551, // 'Q' (+ 'q')0x8e51,// 'R' (+ 'r')0x9021, // 'S' (+ 's')0x2081, // 'T' (+ 't')0x1550, // 'U' (+ 'u')0x4448, // 'V' (+ 'v')0xc550,0xc028,// 'W' (+ 'w')// 'X' (+ 'x')0x2028, // 'Y' (+ 'y')0x5009, // 'Z' (+ 'z')0x0000, // '[' (Not defined)0x0000, // '\' (Not defined)


780x0000, // ']' (Not defined)0x0000, // '^' (Not defined)0x0000// '_'};/******************************************************************************* Function name : LCD_Init** Returns : None** Parameters : None** Purpose : Initialize LCD_displayData buffer.* Set up the LCD (timing, contrast, etc.)******************************************************************************/void LCD_Init (void){LCD_AllSegments(FALSE);// Clear segment buffer.LCD_CONTRAST_LEVEL(LCD_INITIAL_CONTRAST); //Set the LCD contrastlevel// Select asynchronous clock source, enable all COM pins and enable all// segment pins.LCDCRB = (1


79//Enable LCD start of frame interruptLCDCRA |= (1= '*') && (c


80{// c is a letterif (c >= 'a')c &= ~0x20;c -= '*';// Convert to upper case// if necessarry}//mt seg = LCD_character_table[c];seg = (unsigned int) pgm_read_word(&LCD_character_table[(uint8_t)c]);// Adjust mask according to LCD segment mappingif (digit & 0x01)mask = 0x0F; // Digit 1, 3, 5elsemask = 0xF0; // Digit 0, 2, 4ptr = LCD_Data + (digit >> 1); // digit = {0,0,1,1,2,2}}for (i = 0; i < 4; i++){nibble = seg & 0x000F;seg >>= 4;if (digit & 0x01)nibble


81******************************************************************************/void LCD_AllSegments(char show){unsigned char i;if (show)show = 0xFF;}// Set/clear all bits in all LCD registersfor (i=0; i < LCD_REGISTER_COUNT; i++)*(LCD_Data + i) = show;/******************************************************************************* LCD Interrupt Routine** Returns : None** Parameters : None** Purpose: Latch the LCD_displayData and Set LCD_status.updateComplete******************************************************************************/SIGNAL(SIG_LCD){static char LCD_timer = LCD_TIMER_SEED;char c;char c_flash;char flash;char EOL;unsigned char i;///!!! static char timeout_count;///!!! static char auto_joystick_count;


82c_flash=0; // mt/**************** Button timeout for the button.c, START ****************//*!!! if(!gButtonTimeout){timeout_count++;if(timeout_count > 3){gButtonTimeout = TRUE;timeout_count = 0;}}*//**************** Button timeout for the button.c, END ******************//**************** Auto press joystick for the main.c, START *************//*!!! if(gAutoPressJoystick == AUTO){auto_joystick_count++;if(auto_joystick_count > 16){gAutoPressJoystick = TRUE;auto_joystick_count = 15;}}elseauto_joystick_count = 0;*//**************** Auto press joystick for the main.c, END ***************/LCD_timer--;// Decreased every LCD frameif (gScrollMode){// If we are in scroll mode, and the timer has expired,// we will update the LCDif (LCD_timer == 0){


83if (gLCD_Start_Scroll_Timer == 0){gLCD_Update_Required = TRUE;}elsegLCD_Start_Scroll_Timer--;}}else{ // if not scrolling,// disble LCD start of frame interrupt// cbi(LCDCRA, LCDIE); //DEBUGgScroll = 0;}EOL = FALSE;if (gLCD_Update_Required == TRUE){// Duty cycle of flashing charactersif (gFlashTimer < (LCD_FLASH_SEED >> 1))flash = 0;elseflash = 1;// Repeat for the six LCD charactersfor (i = 0; i < 6; i++){if ((gScroll+i) >= 0 && (!EOL)){// We have some visible charactersc = gTextBuffer[i + gScroll];c_flash = c & 0x80 ? 1 : 0;c = c & 0x7F;if (c == '\0')EOL = i+1;}elsec = ' ';// End of character data// Check if this character is flashing


84}if (c_flash && flash)LCD_WriteDigit(' ', i);elseLCD_WriteDigit(c, i);// Copy the segment buffer to the real segmentsfor (i = 0; i < LCD_REGISTER_COUNT; i++)*(pLCDREG + i) = *(LCD_Data+i);// Handle colonif (gColon)*(pLCDREG + 8) = 0x01;else*(pLCDREG + 8) = 0x00;// If the text scrolled off the display,// we have to start over again.if (EOL == 1)gScroll = -6;elsegScroll++;}// No need to update anymoregLCD_Update_Required = FALSE;// LCD_timer is used when scrolling textif (LCD_timer == 0){/* if ((gScroll


85}//// Author(s)...: ATMEL Norway//// Target(s)...: ATmega169//// mt - used for debugging only - may not work// Include files#include #include #include #include "lcd_driver.h"#include "lcd_functions.h"#include "BCD.h"#include "main.h"#define FALSE 0#define TRUE (!FALSE)char CONTRAST = LCD_INITIAL_CONTRAST;// Start-up delay before scrolling a string over the LCD. "LCD_driver.c"extern char gLCD_Start_Scroll_Timer;/****************************************************************************** Function name : LCD_puts_f** Returns : None** Parameters : pFlashStr: Pointer to the string in flash* scrollmode: Not in use** Purpose : Writes a string stored in flash to the LCD******************************************************************************/


86// mt void LCD_puts_f(char __flash *pFlashStr, char scrollmode)void LCD_puts_f(const char *pFlashStr, char scrollmode){// char i;uint8_t i;while (gLCD_Update_Required);// Wait for access to buffer// mt: for (i = 0; pFlashStr[i] && i < TEXTBUFFER_SIZE; i++)for (i = 0; pgm_read_byte(&pFlashStr[i]) && i < TEXTBUFFER_SIZE; i++){// mt: gTextBuffer[i] = pFlashStr[i];gTextBuffer[i] = pgm_read_byte(&pFlashStr[i]);}gTextBuffer[i] = '\0';if (i > 6){gScrollMode = 1; // Scroll if text is longer than display sizegScroll = 0;gLCD_Start_Scroll_Timer = 3; //Start-up delay before scrolling the text}else{gScrollMode = 0;gScroll = 0;}}gLCD_Update_Required = 1;/****************************************************************************** Function name : LCD_puts** Returns : None** Parameters : pStr: Pointer to the string


87* scrollmode: Not in use** Purpose : Writes a string to the LCD******************************************************************************/void LCD_puts(char *pStr, char scrollmode){uint8_t i; // char i;while (gLCD_Update_Required);// Wait for access to bufferfor (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++){gTextBuffer[i] = pStr[i];}gTextBuffer[i] = '\0';if (i > 6){gScrollMode = 1; // Scroll if text is longer than display sizegScroll = 0;gLCD_Start_Scroll_Timer = 3; //Start-up delay before scrolling the text}else{gScrollMode = 0;gScroll = 0;}}gLCD_Update_Required = 1;/****************************************************************************** Function name : LCD_putc** Returns : None*


88* Parameters : digit: Which digit to write on the LCD* character: Character to write** Purpose : Writes a character to the LCD******************************************************************************/// mt void LCD_putc(char digit, char character)// mt void LCD_putc(char digit, char character)void LCD_putc(uint8_t digit, char character){if (digit < TEXTBUFFER_SIZE)gTextBuffer[digit] = character;}/****************************************************************************** Function name : LCD_Clear** Returns : None** Parameters : None** Purpose : Clear the LCD******************************************************************************/void LCD_Clear(void){uint8_t i; // char i;}for (i=0; i


89* Function name : LCD_Colon** Returns : None** Parameters : show: Enables the colon if TRUE, disable if FALSE** Purpose : Enable/disable colons on the LCD******************************************************************************/void LCD_Colon(char show){gColon = show;}/****************************************************************************** Function name : LCD_UpdateRequired** Returns : None** Parameters : update: TRUE/FALSE* scrollmode: not in use** Purpose : Tells the LCD that there is new data to be presented******************************************************************************/void LCD_UpdateRequired(char update, char scrollmode){while (gLCD_Update_Required);gScrollMode = scrollmode;gScroll = 0;}gLCD_Update_Required = update;


90/****************************************************************************** Function name : LCD_FlashReset** Returns : None** Parameters : None** Purpose : This function resets the blinking cycle of a flashing digit******************************************************************************/void LCD_FlashReset(void){gFlashTimer = 0;}/****************************************************************************** Function name : SetContrast** Returns : char ST_state (to the state-machine)** Parameters : char input (from joystick)** Purpose : Adjust the LCD contrast******************************************************************************//*char SetContrast(char input){static char enter = 1;char CH, CL;if (enter)


91{}LCD_Clear();enter = 0;CH = CHAR2BCD2(CONTRAST);CL = (CH & 0x0F) + '0';CH = (CH >> 4) + '0';LCD_putc(0, 'C');LCD_putc(1, 'T');LCD_putc(2, 'R');LCD_putc(3, ' ');LCD_putc(4, CH);LCD_putc(5, CL);LCD_UpdateRequired(TRUE, 0);if (input == KEY_PLUS)CONTRAST++;else if (input == KEY_MINUS)CONTRAST--;if (CONTRAST == 255)CONTRAST = 0;if (CONTRAST > 15)CONTRAST = 15;LCD_CONTRAST_LEVEL(CONTRAST);if (input == KEY_ENTER){enter = 1;return ST_OPTIONS_DISPLAY_CONTRAST;}}return ST_OPTIONS_DISPLAY_CONTRAST_FUNC;*/


92// mt - used for debugging only - may not work#include #include //#include //#include //#include //#include #include #include "main.h"#include "lcd_functions.h"#include "lcd_driver.h"#include "adc.h"#define pLCDREG_test (*(char *)(0xEC))// extern unsigned int LCD_character_table[] PROGMEM;/******************************************************************************* Function name : main** Returns : None** Parameters : None** Purpose : Contains the main loop of the program******************************************************************************/int main(void){int leftwall;int rightwall;//rightwall//PGM_P statetext;Initialization();sei();//statetext= PSTR("arya");char ss[5];


93int arya;_delay_ms(2000);//left_tmt_right();//right_tmt_left();ADC_init(SENSOR_LEFT);//forward();//_delay_ms(10000);//backward();//_delay_ms(10000);//leftturn();//_delay_ms(10000);//rightturn();//_delay_ms(10000);//stop();//_delay_ms(10000);while(1){//leftwall = ADC_read();arya = ADC_read();//itoa(arya,ss,10);//LCD_puts(ss,0);//right_tmt_left();if (arya> 50 && arya < 200 )right_tmt_left();//while (arya250)left_tmt_right();elseforward();//forward();//if (bit_is_set(PINB,6))//{//LCD_Init();// LCD_puts("hell",0);//}//else// LCD_puts("NO",0);//PORTB & _BV();}//sprintf("a","1",223);}return 0;


94/******************************************************************************* Function name : Initialization** Returns : None** Parameters : None** Purpose : Initializate the different modules******************************************************************************/void Initialization(void){/*CLKPR = (1


95}init_PORTS();void init_PORTS(void){//motor 1: pin 0 and pin 2//motor 2: pin 2 and pin 4////////DDRB = 0xff;//output - motorsDDRB = 0b10101010; //motors DDRB = 0xff//PORTB = 0x00;//PCMSK1 = 0x00;//DDRF = 0x00;//PORTB = 0x00;//DDRB = 0x55;//input ports//PORTB |=_BV(0);//SEG22 = 0x00;/*LCDDR0 = 0;LCDDR1= 0;LCDDR2= 0;LCDDR3= 0;//LCDDR4= 0;LCDDR5= 0;LCDDR6= 0;LCDDR7= 0;LCDDR8= 0;//LCDDR9= 0;LCDDR10= 0;LCDDR11= 0;LCDDR12= 0;LCDDR13= 0;//LCDDR14= 0;LCDDR15= 0;LCDDR16= 0;LCDDR17= 0;LCDDR18= 0;*/


96}//0x00


97PORTB = 0b00000000;}void left_tmt_right(void){PORTB = 0b10000000;_delay_ms(20);PORTB = 0b00001000;//_delay_ms(2);//rightturn();//_delay_ms(200);//stop();//leftturn();//_delay_ms(100);//stop();}void right_tmt_left(void){PORTB = 0b00001000;_delay_ms(20);PORTB = 0b10000000;//_delay_ms(2);//_delay_ms(2);//leftturn();//_delay_ms(2);//stop();//rightturn();//_delay_ms(100);//stop();}#define BOOL char#define FALSE 0#define TRUE (!FALSE)//#define NULL 0// Macro definitions//mtA -


98// sbi and cbi will not be supported by future avr-libc// version - changed to sbiBF/cbiBF "everywhere"#define sbiBF(port,bit) (port |= (1


99// mt - used for debugging only - may not work/************************************************************************/// Definitions/************************************************************************/#define LCD_INITIAL_CONTRAST 0x0F#define LCD_TIMER_SEED 3#define LCD_FLASH_SEED 10#define LCD_REGISTER_COUNT 20#define TEXTBUFFER_SIZE 25#define SCROLLMODE_ONCE#define SCROLLMODE_LOOP#define SCROLLMODE_WAVE0x010x020x03/************************************************************************///MACROS/************************************************************************///active = [TRUE;FALSE]#define LCD_SET_COLON(active) LCD_Data[8] = active// DEVICE SPECIFIC!!! (ATmega169)#define pLCDREG ((unsigned char *)(0xEC))// DEVICE SPECIFIC!!! (ATmega169) First LCD segment register#define LCD_CONTRAST_LEVEL(level) LCDCCR=(0x0F & level)/************************************************************************/// Global variables/************************************************************************/


100extern volatile char gLCD_Update_Required;extern char LCD_Data[LCD_REGISTER_COUNT];extern char gTextBuffer[TEXTBUFFER_SIZE];extern volatile char gScrollMode;extern char gFlashTimer;extern char gColon;extern volatile signed char gScroll;/************************************************************************/// Global functions/************************************************************************/void LCD_Init (void);void LCD_WriteDigit(char input, char digit);void LCD_AllSegments(char show);//// Author(s)...: ATMEL Norway//// Target(s)...: ATmega169//// mt - used for debugging only - may not work#include //Functions// mt void LCD_puts_f(char __flash *pFlashStr, char scrollmode);void LCD_puts_f(const char *pFlashStr, char scrollmode);void LCD_puts(char *pStr, char scrollmode);void LCD_UpdateRequired(char update, char scrollmode);//void LCD_putc(char digit, char character);void LCD_putc(uint8_t digit, char character);void LCD_Clear(void);void LCD_Colon(char show);void LCD_FlashReset(void);char SetContrast(char input);// mt - used for debugging only - may not work#define BOOL char


101#define FALSE 0#define TRUE (!FALSE)#define NULL 0#define AUTO 3void Initialization(void);#include #include #include #include #define F_CPU 8000000UL // 8 MHz#include #include #include #include #include "mboard.h"#include "lcd_driver.h"#include "usart.h"#include "button.h"#include "adc.h"#define MIN(x, y) ((x) < (y) ? (x) : (y))#define MAX_STRING_SIZE 25#define DEFAULT_DELAY_CYCLES 3#define SWEEP_SHIFT 7 // shift amount to divide light level to get speedschar myString[MAX_STRING_SIZE];int stringLen;int offset;typedef enum {INIT,NORMAL,SLEEP,RS232RECV,SPI_MASTER,SPI_SLAVE


102} States;int delayCount = DEFAULT_DELAY_CYCLES;States currentState = INIT;ISR(__vector_default){// do nothing, but make sure the thing does not crash}void RS232GetString(){int count;char rs232Char;currentState = RS232RECV;LCD_WriteDigit(' ', 5);}for (count = 0; count < MAX_STRING_SIZE - 1; count++) {rs232Char = Usart_Rx();LCD_WriteDigit(rs232Char, 5);if (rs232Char == '\r')break;myString[count] = rs232Char;}stringLen = count;myString[count] = '\0';void SPI_Reset(){DDRB = 0; // set as inputs// PORTB = (1


103}SPCR = 1


104Microcontroller Problem: The AVR Butterfly has the problems in which we did notnotice at the time we have ordered this microcontroller. These problems are describedbelow in the order of importance:Ports are sharedNo USB I/O port (for programming)Finding the Right CompilerLCD driver not compatible with integerInterrupts hard to handleNot enough resources such as books and necessary informationMicrocontroller Solutions:Ignored and Disabled I/O Port Sharing (But we still were not able to do this to all theports)We used Serial to USB converterWe downloaded the GCC (C Compiler)We have added Drivers from other C compilers itoa()Unfortunately, we did not have time to use Interrupt and end up with problemsWe downloaded the actual Chip's manufacturer's user manual as our only source ofinformation.Obviously, the better solution for future is to select a microcontroller that has lots of I/Oports that are not shared, has USB I/O port as well as it has a great environment for


105programming and using interrupts. In addition, we need to also consider purchasing amicrocontroller that has plenty of books published from it as well as includes lots ofresources online or anywhere.Algorithm Update: It would be a good idea if we would have used the Modified Flood-Filled Algorithm to solve the maze since this algorithm would find the shortest pathtoward the center even when navigating fist time in the maze. The implementation of thisalgorithm is explained in many text books and it would be the future goal of our team tochange the microcontroller and implement this algorithm.Use of Encoder: Another major factor for improvement of our Micro-Tank would be touse an encoder so that along with the sensors, it would have been easier to determine theposition of the micro-tank in the maze and control the speed of the tank.PCB Manufacturing Layout: It would have been a great idea if we would use thesoftware such as express PCB to design the layout of our circuit and send it formanufacturing. The PCB layout would be done through the use of Express PCB softwareand the manufacture would do a better job in designing the layout on the board. In thisway, we need no need for soldering he wires together and our design would have beenmore professional efficient. It is also important to note that even though we have usedwires for connecting our components, we have used a design that would require the leastamount of wires connected from one component to another. This is due to the fact that


106the protoboard that we have purchased had several busses and printed connections thatfrom ground, and Vdd. This has allowed us to configure a way that would use the leastamount of wiring as we have done. (Nevertheless, making the PCB layout through theuse of Express PCB software would have been a better idea) Figure below shows ourwiring connection:CONCLUSION


107In conclusion, this project was a very touch project that we have encountered and yet itwas one of the projects that was of the most interest to our group. I want to thank ourmentor professor Jafar for suggesting this project to us and the rest of the designinstructors who have given us more time to accomplish this task. Even though ourMicro-tank did not work the way we wanted to, we will still work on it and try to finishprogramming of it.


108REFERENCES(1)“ A short history of mazes.” Adrian Fisher Mazes Ltd.http://www.mazemaker.com/history_mazes.htm.(2)“The History of Mazes and Labyrinths.” Amazeingart.com.http://www.amazeingart.com/maze-faqs/Ancient-mazes.html. .(3)“A brief history of Mazes.” The Amazing Hedge Puzzle.http://www.btinternet.com/~mazes/history.htm.(4)“<strong>Micromouse</strong> Information Center” Peter Harrisonhttp://micromouse.cannock.ac.uk/history.htm(5)Supportive Information from Last Year <strong>Senior</strong> <strong>Design</strong> <strong>Project</strong>(6) http://en.wikipedia.org/wiki/RoHS(7)“<strong>Micromouse</strong>info.com:” Steve Benkovichttp://www.micromouseinfo.com/introduction/steppers.htmlOther Sources of websites used:http://www.piclist.com/techref/piclist/jal/DrivingBipolarStepperMotors.htmhttp://www.supplyframe.com/campaign/?gclid=CIDNppHB-5ACFRsFagodGwIm1whttp://www.datasheetcatalog.com/datasheets_pdf/A/3/9/6/A3968.shtmlhttp://micromouse.cannock.ac.uk/sensors/side_looking.htmhttp://www.atmel.com/dyn/products/tools_card.asp?tool_id=3146


APPENDIX109


110


111


112


113


114


115


117


118


119


120


121


122


123


124


125


126


127


128


129


130


131


132


133


134


135


136


137


138


139


140


141


142


143


144


145


146


147


148


149


150


151


152


153


154


155


156


157


158


159


160


161


162


163


164


165


166


167


168


169


170


171


172


173


174


175


176


177


178


179


180THE END!Thanks GOD it’s the END

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!