Home

Chapter 4

image

Contents

1. Print At 1 1 Print At 2 1 Print At 3 1 Print At 4 1 GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop GoSub cir loop Cls GoTo main loop High PORTD 4 High PORTD 0 For i 0 To 300 PORTD 1 i DelayMS 1 Next i Low PORTD 0 Low PORTD 1 Low PORTD 4 Return med Low PORTD 5 High PORTD 6 If PORTD 7 1 Then Low PORTD 5 Low PORTD 6 GoTo nextl EndIf GoTo cir med DRAW BOT Please Wait circle now Drawing the small UI UI 52 nextl Print At 1 1 DRAW BOT Print At 2 1 Please Wait Print At 3 1 Drawing the medium Print At 4 1 circle now GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med GoSub cir loop med High PORTD 5 Low PORTD 6 DelayMS 1000 Cls GoTo main cir loop med High PORTD 4 High PORTD O For i 0 To 300 PORTD 1 i DelayMS 1 Next i Low PORTD 0 Low PORTD 1 Low PORTD 4 Return cir Irg Low PORTD 5 High PORTD 6 Print At 1 1 DRAW BOT Print At 2 1 Please Wait Print At 3 1 Dr
2. DelayMS 1000 GoTo main tri line High PORTD 4 High PORTD 0 High PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return BB wNHO tri deg loop sml High PORTD 4 High PORTD O Low PORTD 2 Loop sml For i 0 To 163 Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD BP wW he oO Return tri med Print At 1 Print At 2 Print At 3 Print At 4 HAHA UI DRAW BOT Please Wait Drawing the medium triangle GoSub tri line med GoSub tri line med GoSub tri line med DelayMS 1000 now UI UI 59 GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri line med GoSub tri line med GoSub tri line med DelayMS 1000 GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri line med GoSub tri line med GoSub tri line med DelayMS 1000 GoTo main tri line med High High High PORTD 4 PORTD O PORTD 2 For i 0 To 240 PORT PORT D Lei D 3 1 DelayMS 5 Next Low Low Low Low Low 1 PORTD PORTI PORTI PORTD PORT D BB wNHO Return tri deg loop med High High Low PORTD 4 PORTD O PORTD 2 1 0 To 163 PORTD PORTD PORTD PORTD PORTD E wNHO Return 60 tri l
3. Is size shape option pressed YES 17 Figure 4 System Flowchart Hardware Design The hardware design is shown as a system block diagram as presented in Figure 5 The Drawbot system would comprise of components that would be further explained The LCD display with three push buttons as the key switches The key switches are labeled left lt right gt and enter E The microcontroller unit consists of the PIC16F877 for the main program Another microcontroller PIC16F84A serves as a stepper motor driver The relay driver will be responsible with the DC Gear Motor And lastly the stepper motors and the gear motor itself The LCD display can be manipulated by the push buttons Then the microcontroller unit controls the stepper motors The other parts the stepper motors and wheel are controlled by the microcontroller unit The two stepper motors are connected to the two wheels These are the locomotive parts that produce the motion ability of the robot The key switches will serve as input devices This will browse the size and shape The inputted values will then be processed in the Drawbot s microcontroller Accumulated results will drive the motors inside the Drawbot Lastly the stepper motors are the ones responsible for moving the wheels of the Drawbot RELAY DRIVER RELAY DC GEARD BOARD MOTOR LCD DISPLAY e STEPPER MOTOR DRIVER STEPPER STEPPER MOTOR MOTOR KEY SWITCH
4. 18 Figure 5 System Block Diagram ign ircuit Des C ONS net e a ONE XZ Lo Draut A eis E sneeze anggez vhs Grat Set NA EN P Ww OND a 9 A ON am 6 a z o za n 2005 Saaz Lol aro sur PPA L gll 9849951 Vv e E Sa 7 Na D331 Sau NZ LT seu U zi 4 9 Le ai Cm ps Jazz i 13534 R sa Mag Sp ONE E o p s ZE HOWL a E H 294 E V Lo 280 Le ans gt ja St gue 1980 Sia em 22849 9Id 2 Or9 ABI cr cy nar lza ge dSa7zau do ga 99547904 A S SSH SdSd S0H Bes ae Bs pasa e ECH ES easa eau n bi Z LaSa DU WZ LG avs sur De eege L nave de net ga L0 xH 20H eS H9 X1 89H o 0 9Jam W bs 005 22 o Es 9S710S zNY 234 pr o o lt June ik n Si 57H05 SNS le OT Lado EE gt Jun WZ LA aro dur ZE A3 E RR SL suonng ysnd J s IHOLL sva A IH90L v6H mes a gm Aa ENS esu e Qi 29d Sher SE sau use tot E E vai Duer KZ a
5. RC3ISDO RCIISCKISCL a 18 23 RC4ISDIISDA RDOIPSPO a 19 22 J RD3 PSP3 RD1 PSP1 a 20 21 O RD2 PSP2 Peripheral Features Timero 8 bit timer counter with 8 bit prescaler Timer1 16 bit timer counter with prescaler can be incremented during SLEEP via external crystal clock Timer2 8 bit timer counter with 8 bit period register prescaler and postscaler Two Capture Compare PWM modules Capture is 16 bit max resolution is 12 5 ns Compare is 16 bit max resolution is 200 ns PWM max resolution is 10 bit 10 bit multi channel Analog to Digital converter Synchronous Serial Port SSP with SPI Master mode and CT Master Slave Universal Synchronous Asynchronous Receiver Transmitter USART SCI with 9 bit address detection Parallel Slave Port PSP 8 bits wide with external RD WR and CS controls 40 44 pin only Brown out detection circuitry for Brown out Reset BOR Key Features PiCmicro Mid Range Reference PIC16F873 PIC16F874 PIC16F876 PIC16F877 Manual DS33023 Operating Frequency DC 20 MHz DC 20 MHz DC 20 MHz RESETS and Delays POR BOR POR BOR POR BOR POR BOR PWRT OST PWRT OST PWRT OST PWRT OST FLASH Program Memo 14 bit words d AK ES SS Data Memory bytes 192 192 368 368 EEPROM Data Memory 128 128 256 256 Interrupts 13 13 14 I O Ports Ports A B C Ports A B C D E Ports A B C Ports A B C D E Time
6. change Ar in xis the differential dx of x Consequently the error in xis Ax dx SeeFig 1 1 The corresponding error in yis Ay f x dx f x and the corresponding differential of f at xis dy f x dx Intutively we can approximate Ay by dy Now let s show that we can do such an approximation By the 1st part of the previous section We have Sixt dx e f f x dx Hence Ay f x do f a F da f a f dx dy Indeed we can approximate Ay by dy Intuitively approximating the height of the graph of 7 by that of the tangent amounts to approximating the length Ay by the length dy as clearly seen in Fig 1 1 In summary 83 Ax dx Ay dy f x dx That is the error in x is dx and the corresponding approximate error in y is dy f x dx Fig 1 1 Ax dx Ay ze dy f x dx 4s seen above we say that the distance between 2 points is measured to be 1 000 m 1m when its measurement is 1 000 m with an error of 1m The measured distance is x 1 000 the error is dx 1 and the actual distance x is somewhere in the interval 1 000 1 1 000 1 999 1 001 If we instead interpret differently by treating that x is such that x 1 000 is somewhere in the interval Xa 1 x 1Jor x 14 1 000 lt x 1 then from x 1 lt 1 000 we get x lt 1 001 and from 1 000 lt x 1 we get 999 lt x It follows that 999 lt x 1 001 ie x is somewhere in the interval 999 1 001 the same situation as in
7. Tabulated Results of Allowable Percentage for Large Triangle Table 6A Tabulated Results of Allowable Percentage for Small Square Table 6B Tabulated Results of Allowable Percentage for Medium Square Table 6C Tabulated Results of Allowable Percentage for Large Square Table 7A Tabulated Results of Allowable Percentage for Small Rectangle 40 Table 7B Tabulated Results of Allowable Percentage for Medium Rectangle Table 7C Tabulated Results of Allowable Percentage for Large Rectangle 42 Table 8 Summary Results of Allowable Percentage Errors of Calculated Area 10 20 29 31 32 33 34 35 36 37 38 39 41 43 vi LIST OF FIGURES Figure 1 Conceptual Framework Figure 2 Data Gathering Procedure Flowchart Figure 3 System Flow Diagram Figure 4 System Flowchart Figure 5 System Block Diagram Figure 6 Full Schematic Diagram of Drawbot Figure 7 LCD welcome message of the Drawbot Figure 8 LCD Menu layout of the Drawbot 25 14 15 16 17 18 25 vii viii ABSTRACT A robot is said to be an automatic device that performs functions normally attributed to humans or machines The study was made in order to gain critical skills in computer engineering and to explore the use of microcontrollers through a robot which could be directed to perform a specific task The design named Drawbot has the capability of drawing basic shapes with a definite size These b
8. hearing and optical aids directly attached to the nervous system or wheelchairs for the seriously disabled The distance between man and machine disappears In the book Robots do it better R Siegwart K O Arras H Sachs C Scheidegger M Schnegg mentioned the evolution of personal robots and cyborgs This was published in 2000 GRASS DRAWING ROBOT This amazing invention gives the designers the idea of a Drawbot Similarly drawing lines but of different outcome and approach Here the Translator II Grower as the name of the robot is a rover robot which navigates hugging a room s walls and responding to the carbon dioxide levels in the air by drawing varying heights of grass on the walls in green ink Grower senses the CO2 level in the air via a digital sensor The more people in the exhibit space breathing in oxygen and exhaling CO2 the higher the grass line This simulated grass is just like the grass found in nature it needs CO2 to grow This was a research done by Sabrina Raaf in her Grass Drawing Robot study done in 2004 Conceptual Framework INPUT PROCESS OUTPUT Push Buttons Ge e i Stepper Motor Size and shape be e a i Ne E Movement of the object CD to the MCU Draws the MCU executes a from the menu specified shape pre programmed of the LOD A and size instructions Figure 1 Conceptual Framework When the Drawbot is turned on the LCD will display the options of the men
9. meter 2mm Adhesive Mightybond HE ED acetate foil acetate foil APPENDIX H Drawbot User Manual Drawbot A Microcontroller Based Drawing Robot User Manual Mapua Institute of Technology COE461D Computer Design 80 About Drawbot The design named Drawbot has the capability of drawing basic shapes with a definite size These are only basic shapes that consist of circle square triangle and rectangle with sizes of small medium or large The main purpose of this study is to design a robot that uses stepper motors and PIC microcontroller to draw Characteristics 1 Uses Microcontrollers PIC16F877 for the firmware 2 It uses an LCD for the menu 3 The three buttons represents the control of the LCD for user input 4 The pen holder pin downs the pen in place 5 The LCD displays the options for drawing the four 4 shapes namely circle square rectangle and a equilateral triangle that have three 3 different sizes which are small medium and large User Guide 1 When the Drawbot is turned on the LCD would display the options of the menu that are available 81 The Drawbot has three push buttons that can control the menu on the LCD namely left lt right gt enter E The options on the menu of the LCD will enable the user to input the desired shape and size The menu has twelve options to choose from It corresponds to the format size shape The LCD Menu layout of the Drawbot Once
10. 17 1 16 9 5 16 9 Average Absolute Error 0 48 Allowable Percentage Error of Calculated Area 5 82 Table 6A Tabulated Results of Allowable Percentage for Small Square 3 17 1 owo Table 6A shows the results of the trials for the small square The allowable percentage error of the calculated area would be the maximum allowable percentage 37 error In the use of this formula see Equation 3 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 5 82 Measured Side 24 7 00 24 7 At O 24 8 24 6 24 6 Average Absolute Error Allowable Percentage Error of Calculated
11. 8 bit timer counter with 8 bit programmable prescaler Special Microcontroller Features 10 000 erase write cycles Enhanced FLASH Program memory typical 10 000 000 typical erase write cycles EEPROM Data memory typical EEPROM Data Retention gt 40 years In Circuit Serial Programming ICSP via two pins Power on Reset POR Power up Timer PWRT Oscillator Start up Timer OST Watchdog Timer WDT with its own On Chip RC Oscillator for reliable operation Code protection Power saving SLEEP mode Selectable oscillator options Pin Diagrams PDIP SOIC A 17 E RA2 gt ot 8H lt RAI RA3 gt 2 17 gt RAO RAA TOCK 3 v 6H OSC1 CLKIN MCLR 4 9 5 OSC2 CLKOUT Vss og 5 S 40 voo RBO INT 6 2 13 RB7 RB1 7 gt 12H RB6 RB2 8 1 gt RBS RB3 9 o RB4 SSOP A L RA2 01 20 gt RA1 RA3 nl 19 gt Rao RA4 TOCKI o 3 v 18 H OSC1 CLKIN MCLR O 4 9 17 H OSC2 CLKOUT vss 5 a 16H voo vss 6 o 15H voo RBO INT gt 7 gt 14 RB7 J E RB1 8 13 RB6 RB2 9 12H RBS RB3 10 vi RB4 CMOS Enhanced FLASH EEPROM Technology Low power high speed technology Fully static design Wide operating voltage range Commercial 2 0V to 5 5V Industrial 2
12. I O Input Output P Power Not used TTL TTL input ST Schmitt Trigger input Note 1 This buffer is a Schmitt Trigger input when configured as the external interrupt 2 This buffer is a Schmitt Trigger input when used in Serial Programming mode 3 This buffer is a Schmitt Trigger input when configured in RC oscillator mode and a CMOS input otherwise 74 APPENDIX E LM7805 Voltage Regulator Data Sheet MC78XX LM78XX MC78XXA 3 Terminal 1A Positive Voltage Regulator Features Description Output Current up to 1A The MC78XX LM78XX MC7SXXA series of three Output Voltages of 5 6 8 9 10 12 15 18 24V terminal positive regulators are available in the Thermal Overload Protection TO 220 D PAK package and with several fixed output Short Circuit Protection voltages making them useful in a wide range of Output Transistor Safe Operating Area Protection applications Each type employs internal current limiting thermal shut down and safe operating area protection making it essentially indestructible If adequate heat sinking is provided they can deliver over 1A output current Although designed primarily as fixed voltage regulators these devices can be used with extemal components to obtain adjustable voltages and currents 1 input 2 GND 3 Output Internal Block Digram e CURRENT GEncasDA Onn Absolute Maximum Ratings Input Voltage for VO 5V to 18V for VO 24V Therma Resista
13. INTERFACE 4 LCD LINES 4 LCD TYPE 0 ALL DIGITAL TRUI GI Dim i As Byte TRISA 00000 TRISC 00000000 TRISB 00000000 TRISD 00000000 TRISE 111 DelayMS 500 PORI PORI PORI PORI TA 0 B 0 DC D 0 POR 1 TE 0 1 display Cls Print At 1 Print At 2 Print At 3 Print At 4 Ty OM iz School Lp T 1 UI L DelayMS 2000 disp2 Cls Print At 1 Print At 2 Print At 3 Print At 4 disp3 UI UI UI UI HAHA If PORTE 2 1 DelayMS 250 GoTo main EndIf GoTo disp3 main selectl next Sr Print At Print At Print At Print At PUNR Inx HAHAH ss L If PORTE O 1 DelayMS 250 GoTo cir sml EndIf If PORTE 1 1 DelayMS 250 GoTo sqr _ sml EndIf If PORTE 2 1 DelayMS 250 GoTo next s EndIf GoTo selectl Print At 1 1 MAPUA of EE ECE CoE copyright 2008 The Wizard s Ryan Henry Panganiban next sl Print At 2 1 Print At 3 1 Print At 4 1 If PORTE O 1 DelayMS 250 GoTo tri sml EndIf If PORTE 1 1 DelayMS 250 GoTo rec sml EndIf If PORTE 2 1 DelayMS 250 GoTo menu med EndIf GoTo next sl menu med select2 Print At 1 Print At 2 Print At 3 Print At 4 HHHA If PORTE 0 1 DelayMS 250 GoTo cir med EndIf If PORTE 1 1 DelayMS 250 GoTo sqr med EndIf If PORTE 2 1 DelayMS 250 GoTo nex
14. Problem The Objective of the Design The Significance of the Design The Scope of Delimitation Definition of Terms Chapter 2 METHODS AND PROCEDURES Research Design System Flowchart Hardware Design Circuit Design List of Materials Hardware Components Software Design Chapter 3 PRESENTATION AND INTERPRETATION OF DATA 26 Chapter 4 CONCLUSION AND RECOMMENDATION BIBLIOGRAPHY ii iii iv vi vii viii WM Gi 0 1 CEA 13 13 15 17 18 20 21 22 45 47 iv APPENDICES APPENDIX A Main Program Source Code APPENDIX B Schematic Diagram APPENDIX C PIC16F877 Microcontroller Data Sheet APPENDIX D PIC16F84A Microcontroller Data Sheet APPENDIX E LM7805 Voltage Regulator Data Sheet APPENDIX F Picture of Prototype APPENDIX G List of Miscellaneous Materials APPENDIX H Drawbot User Manual APPENDIX I Approximations of Errors in Measurement 48 49 67 68 71 74 76 78 79 82 LIST OF TABLES Table 1 Drawbot Shape Measurments Table 2 List of Materials Table 3 Area Formula of the Shapes Table 4A Tabulated Results of Allowable Percentage for Small Circle Table 4B Tabulated Results of Allowable Percentage for Medium Circle Table 4C Tabulated Results of Allowable Percentage for Large Circle Table 5A Tabulated Results of Allowable Percentage for Small Triangle Table 5B Tabulated Results of Allowable Percentage for Medium Triangle Table 5C
15. and mobile robots Mobile robots have the capability to move around in their environment and are not fixed to one physical location In contrast industrial manipulators usually consist of a jointed arm and gripper assembly that is attached to a fixed surface Mobile robots are the focus of a great deal of current research and almost every major university has one or more labs that focus on mobile robot research Mobile robots are also found in industry military and security environments This was mentioned in Joe Campbell s book Assembly Robots 101 which was published in 2004 Basically a mobile robot is provided with a sensor based and map based navigation system for navigating in its environment The navigation is based on the classification of pre existing instructions This system can then compensate for an accurate robot system s motion control sensor information and landmark classification Other domestic robots are aimed at providing companionship or play partners to people Examples are Sony s Aibo a commercially successful robot pet dog Paro a robot baby seal intended to soothe nursing home patients Other humanoid robots are in development with the aim of being able to provide robotic functions in a form that may be more aesthetically pleasing to customers thereby increasing the likelihood of them being accepted in society PERSONAL ROBOTS AND CYBORGS The new information technology focuses on the development of robot techn
16. error that may be made in measuring the radius is a a Zo 02 0 01 F 2 A oi Pc Thus the approximate maximum allowable percentage error that may be made in measuring the radius is 0 01 100 100 1 Note Here the exact error of the function area is given and the approximate error of the variable radius is to be found The symbol a Or 8 represents the relative error not an approximate relative error of the radius It s the value 0 01 that s an approximate value of this relative error Source CALCULUS 1 PROBLEMS amp SOLUTIONS An Introductory Calculus Tutorial By Pheng Kim Ving BA amp Sc MSc http www geocities com phengkimving index htm
17. estimated 6 allowable percentage error the shape drawing was almost 90 correct 44 Chapter 4 CONCLUSION AND RECOMMENDATION Conclusion The researchers were able to meet the required objective to develop the prototype The program of the microcontroller can receive data and control the stepper motors to perform specific actions The PIC controls the robot in a way that it moves in a programmed path similar to drawing the shapes The system is able to perform its major function which is to draw shapes and the size selected for each shape Input from the user is obtained and transmitted to the microcontroller of the Drawbot The Drawbot then processes the input and draws the output depending on the size and shape entered on the 45 push buttons With the use of the design users can be able to draw the shapes accurately without effort and mistakes The design can help people in drawing because they no longer need to bring measuring tools to determine the exact dimensions of the shape The design also draws the shapes in a single sweep which a person cannot normally do and which may lead to inaccuracy of the drawing Using the design could make drawing faster thus save a great amount of time on the part of the user since it does the work without stopping until it reaches the end of its course Recommendation The design can be further improve by implementing the following 1 Addition of more shapes that the Drawbot can draw to increa
18. is the constant flow of electric charge Electronics and Radio Today Basic Electronic Concepts Electricity Electricity is a general term for a variety of phenomena resulting from the presence and flow of electric charge Electronics and Radio Today Basic Electronic Concepts High Impedance It means high resistance that is there is no current flow Electronics and Radio Today Basic Electronic Concepts I O port It refers to the input and output pin in a microcontroller Lessons In Electric Circuits copyright C 2000 2008 Tony R Kuphaldt Microcontroller A microcontroller is a computer on a chip It is a type of microprocessor emphasizing self sufficiency and cost effectiveness in contrast to a general purpose microprocessor Lessons In Electric Circuits copyright C 2000 2008 Tony R Kuphaldt Power Electric power is defined as the rate at which electrical energy is transferred by an electric circuit Electronics and Radio Today Basic Electronic Concepts 12 8 RAM It is the data memory used by a program during its execution Lessons In Electric Circuits copyright C 2000 2008 Tony R Kuphaldt 9 Tristate Circuitry It is a special kind of digital circuitry which allows control of I O pins Lessons In Electric Circuits copyright C 2000 2008 Tony R Kuphaldt 10 Volt The International System unit of electric potential and electromotive force equal to the difference of ele
19. proved the effect of the pen The allowable percentage error of calculated area yielded 5 82 Measured Side 24 6 24 6 24 5 om O 24 7 Am O 24 7 o owo O os O Average Absolute Error 0 52 Allowable Percentage Error of Calculated Area 4 32 Table 5B Tabulated Results of Allowable Percentage for Medium Triangle Table 5B shows the results of the trials for the medium triangle The allowable percentage error of the calculated area would be the maximum allowable percentage 35 error In the use of this formula see Equation 2 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded
20. quantity first use the variable x not the value V then use the value V when a value is to be obtained 2 Types Of Errors A measurement of distance d yields d 100 m with an error of 1 m A measurement of distance d yields d 1 000 m with an error of 1 m Both measurements have the same absolute error of 1 m However intuitively we feel that measurement of d has a smaller error because it s 10 times larger and yet has the same absolute error Clearly the effect of 1 m out of 1 000 m is smaller than that of 1 m out of 100 m This leads us to consider an error relative to the size of the quantity being expressed This relative error is accomplished by representing the absolute error as a fraction of the quantity being expressed For example the relative error for d is 1 m 100 m 1 100 0 01 and that for d is 1 m 1 000 m 1 1 000 0 001 As desired the relative error for d is smaller than that for d The percentage error is the absolute error as a percentage of the quantity being expressed For example the percentage error for d is 1 m 100 m 100 100 1 100 100 0 01 100 1 and that for d is 85 1 m 1 000 m 100 100 1 1 000 100 0 001 100 0 1 We see that the percentage error is the relative error expressed as a percentage If the relative error is r then the percentage error is p r 100 100 r 100 So conversely if the percentage error is p then the relative erro
21. rg rg rg _lrg Es _lrg E Lee Lee 65 66 ONS Low PORTD O Low PORTD 1 Low PORTD 2 Low PORTD 3 Low PORTD 4 Return AA ano z GA Q r3 sul D Ki L L z e angaa AMO v s T wz B Draut R EM net W AND e 9 OND D LE on E D Ra Saaz d lf est ae PPA d 5 9v8 49 LOTA de ZER m E Grat i sau p NZ bH va 4 eau Le A SCT Jazz i 13534 Z SS INI aai CND 9 o LE Dogaru E HIH a 8 A SES 7 e V z250 VEER S Ga e eg Sp 78434914 XZ DYSAHI l t cAr ei nar gx ge 9947 404 d om s 94507904 SdSd Sdu a ES De Ze 55 vasa vaui EdSa E0H _ E kee s Zisai zau LaSa CH Gill avg sur Be SZ kl azi Y ET adSd ady m i S sga 19 x8 292H ER E EE o 0 3 Jam W et g 005 52H om r EE 90S IGS ZNY 234 pr Er o lt Jro 4 m Si ar 1257H0S 8NG 3H HG GET gt Wes EE EE o gt Jun asa s 2299 A oT suoung ysnd d E L St DOLL sva IMOOL poe LS cer gr doa Ene E Reber sg 29d Suel E Se S
22. shape since the error in the measurement of x has been associated with the calculated value of y Get the absolute error of the corresponding dimension by dx actual measurement ideal measurement On the trials the x corresponds to the measured dimension of the drawn shape The Ax will then be from its comparison between the ideal measurement of the dimension and the actual measurement from the trial The ideal measurement would come from the programmed size of the microcontroller The actual measurement would be assessed on the five trials The average of the five trials will be the error in x Get the allowable percentage error of the calculated area The y represents the calculated derivative area of the shape By using the error in x the allowable percentage error of the calculated area can be determined as dy f x dx This would be the allowable percentage error of the calculated area because it was related to its corresponding error that was caused by the actual 29 measurement By getting its derivation the allowable would be based on the absolute error made on the measurement For each shape the area formulas are in Table 3 Equilateral Triangle Circle Area Ser Area mr r radius s length of a side CI Square Rectangle Area a Area bxh a length of side b breadth h height Table 3 Area Formula of the Shapes For each shape the solution and formula for obtainin
23. the option is pressed the Drawbot would draw the shape and the LCD would display a waiting message Drawbot Please wait Drawing small circle now After the drawing the Drawbot would return to its menu awaiting the new input from the user 82 APPENDIX I Approximations of Errors In Measurement Calculus 1 Problems amp Solutions Chapter 5 Section 5 3 2 5 3 2 Approximations Of Errors In Measurement Return To Contents Go To Problems amp Solutions 1 Approximations If a quantity x eg side of a square is obtained by measurement and a quantity y eg area of the square is calculated as a function of x say y f x then any error involved in the measurement of x produces an error in the calculated value of y as well Suppose the distance between 2 points is measured to be 1 000 m with an error of 1 m This means that the measured distance Xm is 1 000 m Zen 1 000 and the actual distance x is somewhere between 1 000 m 1m 999 m and 1 000 m 1m 1 001 m it s somewhere in the interval 999 1 001 We say that the distance is measured to be 1 000 m 1m The error of 1 mis how much x can differ from Xy Xa Xm 1 Now Ze and x are 2 particular values of a variable say x More precisely xy is a value of xand x is avalue which xcan change from xy to So the error of 1 m can be considered as a change in x The error in x can be considered as a change in x and thus is denoted by Ax The
24. the shape circle It moves on the left if the circle size is small on the middle if the size is medium and on the right if the circle drawing is large The motor rotations on the left and on the right are controlled by two relays configured as H bridged configuration It means that supplying the motor with the correct polarity will move the motor on a clockwise direction while on the other side the motor rotates counter clockwise 20 All inputs are tied at ground which means that the microcontroller inputs are triggered only in high inputs and all levels are monitored by the microcontroller program Both microcontrollers PIC16F877 and PIC16F84A are clocked at 4MHz The DC gear motor and stepper motor are directly supplied on its 12volts DC lead acid maintenance free battery List of Materials ory Da O Dm TT ory ary a mm O Table 2 List of Materials 21 Hardware Components Component Name Push Buttons The Push buttons serve as an input device of the key in circuit The device consists of 3 switches namely lt gt and E Component Name Microcontroller Microcontroller is responsible for all the process of the system PIC16F877 This MCU processes the inputs obtained from the push switches and it is configured to receive the input signals at PORTE and to produce output signals at PORTC Component Name Stepper Motor Driver Stepper motor driver is responsible for controlling the
25. through the design suggests the flexibility of the microcontroller programming For the community and common people technology comes in by having a robot or a machine that can be used as a teaching material Drawing basic shapes would help a child familiarize himself with the use of technology The task would be simpler because the parent would only need to press a button and the robot would be the one to draw the shape In the industry it could be used for automatic drawing like painting jobs It would no longer need a person to manually draw He would only need to push the buttons on the robot Scope and Delimitations The designer s group prototype named Drawbot has the capability of drawing shapes in a definite size Like any other designs it has limitations when it comes to its results and processing s Listed are the capacity and extent of its functionality 1 The user can manually turn the Drawbot on or off using the switch button 2 The three buttons represent the control of the LCD for user input 3 The pen hole holds the writing instrument and a screw is used to lock it in place The pen hole can basically hold a regular sized pencil 4 The options for the shapes and sizes are displayed on an LCD 5 The four 4 shapes namely circle square rectangle and an equilateral triangle that have three 3 different sizes which are small medium and large are the options that can be selected 10 6 Stepper motors are used to
26. 00 GoSub rec line GoSub rec line GoSub rec line DelayMS 1000 GoTo main rec line High PORI DD High PORI D DRAW BOT Please Wait Drawing the small rectangle now High PORTD 2 For i 0 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return rec _90loop High PORTD High PORTD Low PORTD For i 0 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return rec_med Print At 1 Print At 2 Print At 3 Print At 4 GoSub rec To 240 0 1 2 3 4 4 lt 0 2 To 240 0 1 2 3 4 i 2 DRAW BOT x Ay T Please Wait 1 Drawing the medium p ly T rectangle now line_med GoSub rec line med GoSub rec line med DelayMS 10 GoSub rec GoSub rec DelayMS 10 00 90100p med 90loop med 00 GoSub rec line med GoSub rec line med GoSub rec line med GoSub rec line med DelayMS 1000 GoSub rec 90loop med GoSub rec 90loop med DelayMS 1000 GoSub rec line med GoSub rec line med UI UI UI UI GoSub rec line med DelayMS 1000 GoSub rec 90loop med GoSub rec 90loop med DelayMS 1000 GoSub rec line med GoSub rec line med GoSub rec line med GoSub rec line med DelayMS 1000 GoTo main rec line med High PORTD 4 High PORTD O High PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low P
27. 0V to 5 5V Low power consumption lt 2 mA typical O 5V 4 MHz 15 uA typical 2V 32 kHz lt 0 5 pA typical standby current O 2V PIC16F84A TABLE 1 1 PIC16F84A PINOUT DESCRIPTION e I O P Buffer ane Pin Name Description E Type Type P OSC1 CLKIN ST CMOS S Oscillator crystal input external clock source input OSC2 CLKOUT O Oscillator crystal output Connects to crystal or resonator in Crystal Oscillator mode In RC mode OSC2 pin outputs CLKOUT which has 1 4 the frequency of OSC1 and denotes the instruction cycle rate I P ST Master Clear Reset input programming voltage input This pin is an active low RESET to the device PORTA is a bi directional I O port I O TTL I O TTL I O TTL I O TTL RA4 TOCKI 3 3 I O ST Can also be selected to be the clock input to the TMRO timer counter Output is open drain type PORTB is a bi directional I O port PORTB can be software programmed for internal weak pull up on all inputs RBO INT HO rs RBO INT can also be selected as an external interrupt pin RB1 O TTL RB2 I O TTL RB3 I O TTL RB4 I O TTL Interrupt on change pin RB5 I O TTL Interrupt on change pin RB6 vO TTL ST 2 Interrupt on change pin Serial programming clock RB7 vo TTLSTO Interrupt on change pin Serial programming data Vss 5 6 P Ground reference for logic and I O pins VDD 15 16 P Positive supply for logic and I O pins Legend Input O Output
28. 4 32 Trial Measured Side Ee mwe 41 3 2 406 41 3 3 ws 41 2 en Ae 412 en O 406 en O ei O 41 2 5 Average Absolute Error Allowable Percentage Error of Calculated Area 3 15 Table 5C Tabulated Results of Allowable Percentage for Large Triangle Table 5C shows for the results of the trials for the large triangle The allowable percentage error of the calculated area would be the maximum allowable percentage 36 error In the use of this formula see Equation 2 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 3 15 Trial Measured Side 1 16 9 2
29. Area 4 81 Table 6B Tabulated Results of Allowable Percentage for Medium Square Table 6B shows the results of the trials for the medium square The allowable percentage error of the calculated area would be the maximum allowable percentage 38 error In the use of this formula see Equation 3 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 4 81 Trial Measured Side Ee mwe 41 3 2 406 41 3 3 ws 41 2 en Ae 412 en O 406 41 3 en O 5 Average Absolute Error 0 Allowable Percentage Error of Calculated Area 3 25 Table 6C Tabulated Results of Allowable Percenta
30. CBASIC programming It can be used to improve programs on finished design prototypes The program of the Drawbot is explained below It covers two parts The initializations needed for the microcontroller to functions are declared The next part is about the simple flow of operations within the program on how it controls the stepper motor and how the researchers programmed the menus on LCD display Initialization Processs During the initialization process the ports to be used on the microcontroller were declared The I O mode of port A B C D and E were setup In the development of the Drawbot the ports E C and D were the ones used Port E was utilized for the push buttons This served as the only input on the system Port C and D were for the outputs Port C was connected with the LCD display and Port D was connected to the stepper 23 motor drivers for the controlling of the stepper motors and gear motor The following declarations are shown Device 16F877 Declare XTAL 4 This defined the device to be used as the microcontroller PIC16F877 The crystal oscillator has a capacity of 4Mhz LCD_DTPIN PORTC 0 LCD_RSPIN PORTC 4 LCD ENPIN PORTC 5 LCD INTERFACE 4 LCD LINES 4 LCD TYPE 0 TRISC 00000000 TRISB 00000000 TRISD 00000000 TRISE 111 These were the port modes that were declared for the microcontroller The LCD was defined for port C Each pin configuration was declared The next part pertain
31. Drawbot A Microcontroller Based Drawing Robot by Daniel B Chua Ryan Henry C Latigay Toni Rose C Panganiban Virnali G Sy A Design Documentation Submitted to the School of EE ECE CoE in Partial Fulfilment of the Requirements for the Program Bachelor of Science in Computer Engineering Mapua Institute of Technology March 2008 APPROVAL SHEET This is to certify that this design study entitled Drawbot A Microcontroller Based Drawing Robot prepared by Daniel B Chua Ryan Henry C Latigay Toni Rose C Panganiban and Virnali G Sy in partial fulfilment of the requirements for the degree Bachelor of Science in Computer Engineering have been supervised the preparation of and read the design documentation and hereby recommended for final examination by the Oral Examination Committee Engr Marc Joseph B Cabrera Reader Adviser As members of the Oral Examination Committee we hereby APPROVED this design study which was presented before a Panel of Examiners of the School of EE ECE COE on March 17 2008 Engr Analyn N Yumang Engr Ernesto M Vergara Jr Panel Member 1 Panel Member 2 Engr Donnalee Silanga Panel Member 3 Accepted in partial fulfilment of the requirements for the degree Bachelor of Science in Computer Engineering Dr Felicito Caluyo Dean School of EE ECE CoE iii ACKNOWLEDGMENT Our design would not be a reality without the help of those who took part in finishing our project With this w
32. ORTD Low PORTD Low PORTD Low PORTD Low PORTD Return BP w Dhe O rec 90loop med High PORTD 4 High PORTD O Low PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return rec lrg Print At 1 Print At 2 Print At 3 Print At 4 BB wNHO HAHAHA GoSub rec line UI UI GoSub rec line GoSub rec line GoSub rec line DRAW BOT Please Wait Drawing the large rg rg rg rg rectangle now UI 64 DelayMS 1000 GoSub rec 901oop GoSub rec 90l100p DelayMS 1000 GoSub rec line rg GoSub rec line rg GoSub rec line rg DelayMS 1000 GoSub rec_90loop GoSub rec 90loop DelayMS 1000 GoSub rec line 1 GoSub rec line GoSub rec line 1 GoSub rec line DelayMS 1000 GoSub rec 901oop rg rg rg rg GoSub rec_90loop DelayMS 1000 GoSub rec line GoSub rec line 1 GoSub rec line DelayMS 1000 GoTo main rec line _ lrg High PORTD 4 High PORTD 0 High PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return BB wNHO rec 90loop lrg High PORTD 4 High PORTD 0 Low PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 1 DelayMS 5 Next i
33. ad NYZ Lo Le E yeu ans as E ll aro sur GE Here e U Ge 28H Leide HEH de fe vai 1N0N719 2950 7 FE ANT ad NIHT9 1050 EF OND za heii a l FIRE aaa za 3 PPFEjfef nule PF ONE HOLOW 1457 UA I g E 990500009 MIM cec Er 13S3u T Noatun Cp Dou A a 16 E GN o noe D O a DT NS sr E WOW PPA APPENDIX C PIC16F877 Microcontroller Data Sheet 67 68 o MICROCHIP PIC16F87X Data Sheet 28 40 Pin 8 Bit CMOS FLASH Microcontrollers MICROCHIP 69 PIC16F87X 28 40 Pin 8 Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet PIC16F873 PIC16F874 PIC16F876 PIC16F877 Microcontroller Core Features High performance RISC CPU Only 35 single word instructions to learn All single cycle instructions except for program branches which are two cycle Operating speed DC 20 MHz clock input DC 200 ns instruction cycle Up to 8K x 14 words of FLASH Program Memory Up to 368 x 8 bytes of Data Memory RAM Up to 256 x 8 bytes of EEPROM Data Memory Pinout compatible to the PIC16C73B 74B 76 77 Interrupt capability up to 14 sources Eight level deep hardware stack Direct indirect and relative addressing modes Power on Reset POR Power up Timer PWRT and Oscillator Start up Timer OST Watchdog Timer WDT with its own on chip RC oscillator for rel
34. asic shapes are circle square triangle and rectangle with sizes of small medium or large The main purpose of this study was to design a robot that used stepper motors and PIC microcontroller to draw The PIC microcontroller used was the PIC16F877 This microcontroller was chosen because of its numerous bidirectional I O ports It will receive data from the user through the push buttons and control the stepper motors to perform specific actions based on the data The study was conducted by using descriptive research to determine the extent to which the method would yield data supporting similar conclusions about the design being developed The design draws the shapes in a single sweep which a person cannot normally do and which may lead to inaccuracy of the drawing Using the design could make drawing faster thus save a great amount of time for the user since it does the work without stopping until it reaches the end of its course Keywords Microcontroller PIC PIC16F877 bidirectional I O port Stepper motor Chapter 1 INTRODUCTION AND REVIEW OF RELATED LITERATURE AND STUDIES Research Setting The development of robots is motivated by man s inner wish to build human like creatures Robots should resemble us both physically and intellectually displaying human like behaviors A robot is said to be an automatic device that performs functions normally attributed to humans or machines It could be a mechanism which moves and reacts to its envi
35. awing the large Print At 4 1 circle now GoSub cir loop lrg GoSub cir loop lrg GoSub cir loop _ lrg GoSub cir loop lrg UI UI UI 53 GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop GoSub cir Loop High PORTD 5 Low PORTD 6 DelayMS 1000 Cls GoTo main cir loop lrg High PORTD 4 High PORTD O For i 0 To 300 PORTD 1 i DelayMS 1 Next i Low PORTD O Low PORTD 1 Low PORTD 4 Return sqr_sml Print At 1 Print At 2 Print At 3 Print At 4 GoSub sqr GoSub sqr HAHA line line DelayMS 1000 GoSub sqr 90loop GoSub sqr 901oop DelayMS 1000 GoSub sqr line line DelayMS 1000 GoSub sqr 90loop GoSub sqr 90loop DelayMS 1000 DRAW BOT Please Wait Drawing the small square now UI 54 GoSub sqr GoSub sqr DelayMS GoSub sqr GoSub sqr DelayMS 1 DelayMS 1 GoTo main sgr line High PORT High PORT High PORT For i 0 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return sqr line2 line2 line2 1000 D 4 D O D 2 To 240 BB wNHO High PORTD 4 High PORTD 0 High PORTD 2 For i 0 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD L
36. ctric potential between two points on a conducting wire carrying a constant current of one ampere when the power dissipated between the points is one watt Columbia Encyclopedia 11 Voltage Voltage which sometimes also called electric potential or electrical tension is the difference of electrical potential between two points of an electrical or electronic circuit expressed in volts Electronics and Radio Today Basic Electronic Concepts 13 Chapter 2 METHODS AND PROCEDURES Research Design This study utilized the method of descriptive research in order to determine the extent to which the method would yield data supporting similar conclusions about the design being developed For the descriptive analyses certain topics about the components were gathered to determine what could be used to further improve the design The capability and specifications of the components that were gathered through readings were carefully matched for the system to work The design was also subjected to an assessment and testing where it was exposed to functional analyses that manipulated variables in an ideal environment In this case the device underwent certain trials where all its functions the shape drawings were tested under a fully charged battery The results were analyzed to identify relevant events for the development of the device Using the outcomes of the testing analysis as the standard for comparison the results indicated that the
37. d The kind of robot that can be created with its use should be directed to do specific actions These will be its navigation and it will be intended to implement shape drawing Its programming capabilities should help navigate the pre determined path Objective of the Design The main objective of the group is to be able to design a robot that uses stepper motors and PIC microcontroller to draw the following objects circle square triangle and rectangle Specifically the group wishes to attain the following 1 to program a microcontroller that can receive data and control the stepper motors to perform specific actions based on the data 2 to design the PIC in a way that it controls the robot to move in a programmed path similar to drawing the shapes mentioned Significance of the Design For us students the design is very important because through this study the designers are able to apply and practice their technical skills The things learned on this research were mostly the components and how they could be used to develop the design This study showed the PIC16F877 capability as a microcontroller This study was an improvement of the mobile robot The study suggests that the PIC16F877 can be programmed to move on a specified path by controlling the stepper motors The paths are the shapes that were stated Doing this study could serve as future reference for other related studies The PIC features and stepper motor capability shown
38. descriptive analysis was useful in identifying the components that affected the enhancement of the Drawbot The data gathering procedure is shown in Figure 2 The flowchart presents the problem analysis Certain information was collected through readings and related topics were likewise gathered for the development of a solution This procedure helped the researchers in choosing the components and important supplies that made up the system A draft was constructed out of the information that was brought together This draft 14 served as the blue print for the design The next step was the determination of the supplies that would be used The resources were first completed before the construction of the design When the design was fully assembled testing and analysis of the desired output took place Figure 2 Data Gathering Procedure Flowchart 15 Figure 3 indicates the flow of the system which starts with the push buttons the one responsible for accepting inputs from the user to control the menu on the LCD The buttons represents three types of input which are left right and enter key The menu displays the size and shape to be drawn The input is then passed on the microcontroller which will process the data using the specific instruction programmed in the unit The stepper motors or the drivers are then moved depending on the instructions given by the microcontroller Finally the motor creates the desired outpu
39. e would like to thank all of them First of all we would like to thank our Lord Almighty who gave us the wisdom to come up with the ideas and concepts for this project We also thank HIM for giving us the strength and time to finish our project our Drawbot We also would like to thank our parents for giving us all the love and care for providing us our needs and for their ever willing financial support Our gratitude likewise goes to our friends who willingly and patiently helped us no matter what to the other computer design groups who helped us on finding the components we were seeking and to our Mapua professors for sharing their profound knowledge and wisdom to our young minds and for equipping us with the proper skills we need in our chosen field Our group would also like to extend our gratitude to Engr Marc Joseph Cabrera our adviser The time we spent with him to help us improve the prototype was all worth it And most especially we want to thank our professor Engr Noel Linsangan for giving us the opportunity to show and enhance our talents and knowledge Daniel B Chua Ryan Henry C Latigay Toni Rose C Panganiban Virnali G Sy TABLE OF CONTENTS TITLE PAGE APPROVAL SHEET ACKNOWLEDGEMENT TABLE OF CONTENTS LIST OF TABLES LIST OF FIGURES ABSTRACT Chapter 1 INTRODUCTION AND REVIEW OF RELATED LITERATURE Research Setting Review of Related Literature and Related Studies Conceptual Framework Statement of the
40. ed to the tristate mode of the circuitry This tristate circuitry controls whether the given port would be an output or an input On the work area initialization the only literal used aside from the declaration of the ports was the literal i declared as byte It was used for the looping of the pulses that would move the stepper motor This is shown below Dim i As Byte 24 Stepper motor Routine and Procedures The controlling of the stepper motors was the next part of the program The sample procedure below illustrates how the flow of operation on the main program works It also explains how the researchers were able to find a way to control the stepper motors label High PORTD 0 For i 0 To 300 PORTD 1 i DelayMS 1 Next i Low PORTD O Low PORTD 1 Return In controlling the stepper motors the particular pin on port D should be enabled The literal i would then be used to loop the pulse of the opened or high enabled pin The delay would serve as the incremental of the literal i The next step would be to close the high enabled pins to stop the motor Each pulse corresponds to the movement of the stepper motor This would convert the movement to the length of any shape The movement of each stepper motor would be dependent on the shape that would be used as well as the pins to be enabled to Gosub label causes the program to call a subroutine base on the index value A subsequent RETURN will continue the program i
41. g the Allowable Percentage Error of the Calculated Area are presented as Equation 1 to Equation 4 30 Circle Area 7v Allowable Percentage Error of Calculated Area AMA dA 277dr 2dr A A ze r dA 100 2dr 100 y A 100 r Equation 1 Allowable Percentage Error for Circle Square Area s Allowable Percentage Error of Calculated Area AA dA 2sds 2ds A A s S dA 100 2ds 100 ke A 100 S Equation 2 Allowable Percentage Error for Square Triangle Equal Sides Area a Allowable Percentage Error of Calculated Area VS ay Nai AA _ dA 4 ag OI DAS A A s Ves 4 4 d4 100_ 245 no ke A 100 s Equation 3 Allowable Percentage Error for Equilateral Triangle Rectangle Area l xw w x l x 7 6 A x x 7 6 Allowable Percentage Error of Calculated Area A4 dA ee 7 6x dx _ 2x 7 6 dx A A x 7 6x x 7 6x dA 100 CEIT OEE 65 4 Al 100 x 7 6x Equation 4 Allowable Percentage Error for Rectangle 31 The results of the trials are tabulated below Small Circle Trial Ideal Radius Measured Radius Absolute Error 1 10 1 2 10 1 10 1 O oo O oo 3 10 1 O oo 10 1 O oo 5 10 1 A0 Average Absolute Error 000 Allowable Percentage Error of Calculated Area 000 Table 4A Tabulated Results of Allowable Percentage for Small Circle Refer to Table 4A shows the results of the trials for the small ci
42. ge for Large Square Table 6C shows the results of the trials for the large square The allowable percentage error of the calculated area would be the maximum allowable percentage 39 error In the use of this formula see Equation 3 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 3 25 Small Rectangle Trial Measured Width 1 2 3 oo jet O Average Absolute Error bech bet ju bet kt bell bebe bel ka N N 0 5 Allowable Percentage Error of Calculated Area 5 48 Table 7A Tabulated Results of Allowable Percentage for Small Rectangle Table 7A shows the res
43. here The volume of asphere of radius 7 is K 4 3 ar7 Solution Let 7 and H be the radius and volume of the sphere respectively The absolute error of the radius is dr 10 cm 0 1 m Ae H 4 3 ar the approximate relative error of the calculated volume of the sphere is 4 D 3 yr layne ar av a _ _3dr _ 30 1 4 ros 3 r 0 06 Tr to So the approximate percentage error of the calculated volume of the sphere is 0 06 100 100 6 3 The edge of a cube is measured to within 2 tolerance Approximately what percentage error can result in the calculation of the volume of the cube Solution Let a be the edge and Vthe volume of the cube Then V a The percentage error of the edge is 2 and so its relative error is da a 2 100 0 02 The approximate relative error that can result in the calculation of the volume is dV _3a2da __ da __ on gt RI 30 02 0 06 p EN a 87 Thus the approximate percentage error that can result in the calculation of the volume is 0 06 100 100 6 4 It is desired that the computed area of a circle is with at most 2 error by measuring its radius Approximate the maximum allowable percentage error that may be made in measuring the radius Solution Let 7 and Abe the radius and area of the circle respectively Then A mr The maximum relative error of the computed areais AA A 2 100 0 02 Now A A Tr 2 r So the maximum allowable relative
44. human tasks often in environments that are too hazardous for humans or in situations that are too repetitious or tedious for humans Just as long as there are tasks to perform different types of robots can exist The word Robot comes from the 1921 play R U R Rossum s Universal Robots by the Czech writer Karel Capek pronounced chop ek Robot comes from the Czech word robota meaning forced labor This came from Moravec Hans in his book Robot published in 1999 Robots may be controlled directly by a human such as remotely controlled bomb disposal robots robotic arms or may act according to their own decision making ability provided by artificial intelligence However the majority of robots fall in between these extremes being controlled by pre programmed computers Such robots may include feedback loops such that they can interact with their environment This will involve much more complex design Robots can be classified into categories depending upon their function and the purpose for which they are designed for In this research robots are classified into two categories Industrial robots and Service robots INDUSTRIAL ROBOTS According to the Robotic Industries Association an Industrial robots is an automatically controlled reprogrammable multipurpose manipulator programmable in three or more axes which may be either fixed in place or mobile for use in industrial automation application These robots are growi
45. iable operation Programmable code protection Power saving SLEEP mode Selectable oscillator options Low power high speed CMOS FLASH EEPROM technology Fully static design In Circuit Serial Programming ICSP via two pins Single 5V In Circuit Serial Programming capability In Circuit Debugging via two pins Processor read write access to program memory Wide operating voltage range 2 0V to 5 5V High Sink Source Current 25 mA Commercial Industrial and Extended temperature ranges Low power consumption lt 0 6 mA typical 3V 4 MHz 20 pA typical 3V 32 kHz lt 1 uA typical standby current D D D D D D D D D D Pin Diagram PDIP MCLRIVer gt 1 WO 40 RB7 PGD RAD ANO e 2 39 J RBGIPGC RA AN1 a 3 38 J RB5 RA2 AN2 VREF 4 37 Res RA3IAN3VREF e 5 36 las RB3 PGM RA4ITOCKI a 6 35 J RB2 RAS AN4 SS a DI ss Bt REO RD ANS lt 8 mo 33 RBO INT RETAWRIANS 9 O 325 vo RE2 CS AN7 a DI 10 E 31 Us vss voo Dn Di 201 rovse7 vss 12 29 RDE PSP6 OSC1 CLKIN gt 13 5 28 J RD5 PSP5 OSC2 CLKOUT a 14 a 27 gt RDAIPSPA RCO T10S0 T1CKI e 15 26 e RCTIRXIDT RC1 T10SI CCP2 a 16 25 J lt RCBTXICK RCZICCP1 e 17 24
46. ion 4 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated 42 showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 4 21 SUMMARY RESULTS OF THE ALLOWABLE PERCENTAGE ERRORS Allowable Shape Size Absolute Error dx qn Error Calculated Area oh Smat II ow radius Medium 000 o0 Large 0 00 om Equilateral Trianel 4 32 one side Large 0 64 3 15 Square one side Large Am 3235 Rectangle length x width Table 8 Summary Results of Allowable Percentage Errors of Calculated Area 43 Table 8 presents the summary results of the allowable percentage error of the calculated area As shown in the previo
47. lculated area would be the maximum allowable percentage error In the use of this formula see Equation 4 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated 41 showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 5 35 Large Rectangle Trial Measured Width 1 32 5 2 32 5 3 32 6 32 5 5 32 6 Average Absolute Error Allowable Percentage Error of Calculated Area Table 7C Tabulated Results of Allowable Percentage for Large Rectangle Table 7C shows the results of the trials for the large rectangle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equat
48. might occur The checking of the battery on how long it would last was considered during the simulation It could last the simulation for 4 hours on an assumption that the lead acid battery was fully charged Assumptions before the trials 1 2 The pen is at a stationary position The pen to be used is a fine tip point ball pen to avoid error in the measurement of the thickness of the drawing All measurements are in centimeters The circle has no error that is perfect circle The length of the rectangle is 3 inches bigger than the width of the rectangle Converted to centimeters it is 7 6 cm Step by step Procedure 1 Measure the actual shape drawing The obtained measurement will be the data needed to prove the efficiency of the design to draw the desired shape The designers came up with the solution for testing the Drawbot by calculating the approximation of errors in measurement The plan was that if a 28 quantity x e g side of a square is obtained by measurement and a quantity y e g area of the square is calculated as a function of x as y f x then any error involved in the measurement of x produces an error in the calculated value of y as well The error in x can be considered as a change in x and thus is denoted by Ax On the succeeding trials it meant that by calculating y denoted as dy f x dx the area of the shape what is actually obtained was the allowable percentage error of the
49. mmediately after the On Gosub command The gosub command was then used to cause the program to call a subroutine The subsequent RETURN command would continue the program immediately after the On Gosub command 25 LCD screen layout Routine and Procedure After the LCD configurations were defined at the initialization the simple command for displaying the output would be the Print At command together with the line number and the character position of the text The sample displays are shown below disp2 Cls Print At 1 Print At 2 Print At 3 Print At 4 m Chua Daniel 8 Latigay Ryan Henry Panganiban Toni R Sy Virnali ul HAHA Figure 7 LCD welcome message of the Drawbot main Print At 1 1 DRAW BOT ve Print At 2 1 lt Small CIRCLE D Print At 3 1 gt Small SQUARE Print At 4 1 E NEXT LI in O ul E fc d bo KI EO ae oo ul OGO DOGO OC Figure 8 LCD Menu layout of the Drawbot 26 Chapter 3 PRESENTATION AND INTERPRETATION OF DATA Accuracy of the Design The testing of the design required the checking of the shapes on their sizes This would test the accuracy of the design with its desired figure In testing while the Drawbot was switched to ON the three buttons representing the browsing of the shapes will be the ones pressed first The Drawbot then automatically performed its process based on the inputs There were problems enco
50. move the Drawbot when drawing any of the three shapes triangle square and rectangle depending on its size and a gear motor is used to move the pen when drawing the circle The Drawbot also has its limitations Due to the designer s beginning expertise on the subject it was not unavoidable for the Drawbot to have its setback The following limitations are listed 1 It needs a 12 volt electric cell to supply the voltage needed It consumes the battery in order for it to work which can last for a maximum of four hours 2 The Drawbot can only run on a smooth surface uneven flooring and irregular surfaces are to be avoided 3 Collision during the drawing process will produce a distorted output 4 The drawing of shapes will be limited within the exact measurements programmed in the microcontroller Refer to Table 1 Measurement in cic a in Shape Size Ei Circle Small 10 1em TE cm radius Equilateral Triangle one side Square Small 16 5 cm one side Large 40 6 cm Rectangle length x width Table 1 Drawbot Shape Measurments 11 5 There is a small discrepancy that would be left as a gap for the rotation of the pen 6 The Pen should be placed on the Drawbot at a stationary point Definition of Terms 1 Current Electric current is the flow of electric charge Electronics and Radio Today Basic Electronic Concepts Direct Current Direct current DC or continuous current
51. nce Juncton Cases TO 220 Thermal Resistance Junction Ar TO 220 Operating Temperature Range Storage Temperature Range TSTG B5 150 Electrical Characteristics MC7805 LM7805 Refer to test circuit DC lt Ty lt 125 C 0 500mA VI 10V C 0 33uF CO 0 1uF unless otherwise specified MC780S LM7805 Parameter Conditions Ty 25 9 Output Voltage vo 5 0mA lo 1 04 PO 15W VI 7V to 20V Vossa 40 100 ine R ion Note Regii TJ EEN PE user is so Cio mV Load Regulation Note TJ lO 250mA to 50 750mA ID BmA to 1 0A Quiescent Current Change Vi TV to 25V Output Votage Drif avout io ma RER Output Noise Voltage f 10Hzto 100KHz Ta 25 C 42 uvivo Penim om ew IC ICI IEI ICR i A TJ 257 PERES ARE 95 NE PR Ouputessance ro eme e ma VIE 38V TA T250 oj m Peak Curent k nes A Note 1 Load and line regulation are specified at constant junction temperature Changes in Vo due to heating effects must be taken imo account separately Pulse testing with low duty is used APPENDIX F 75 76 Picture of Prototype Actual Design Front View Actual Design Top View Actual Design Back View APPENDIX G 77 78 List of Miscellaneous Materials MISCELLANEOUS MATERIALS we eS Mom Ser ot De Gearea Morar Eaton ame tarate cote are Wire connor a Kniet aint secret DO 2 Cooke Leet nete meiner connector
52. ng in complexity and their use in industry is becoming more widespread The main use of robots has so far been in the automation of mass production industries where the same definable tasks must be performed repeatedly in exactly the same fashion Car production is the primary example of the employment of large and complex robots for producing products Robots are used in that process for the painting welding and assembly of the cars Robots are good for such tasks because the tasks can be accurately defined and must be performed in same way every time SERVICE ROBOTS According to the International Federation of Robotics another professional organization a service robot is a robot which operates semi or full automatically to perform services useful to the well being of humans and equipment excluding manufacturing operations Personal robots are service robots that educate assist or entertain at home These include domestic robots that perform daily chores and robots that can serve as companions or pets for entertainment Now available are domestic robots that perform simple tasks such as vacuum cleaning and grass cutting Mobile robots fall on this category They are robots capable of movements on their own One good example is an autonomous vehicle The field of mobile robot navigation is active and vibrant with more great systems and ideas being developed continuously Mobile Robots generally fall into two classes linked manipulators
53. ologies The information society is characterized by an increasing speed in accessing information The development of robotics during the last decades confirms this observation Personal Robots and Cyborgs employ the idea of allowing information to flow without a human body as interface By looking into the point of view of those involved in the construction of technical subsystems into the human body the designers were able to understand how they considered a human being through a robot as well as the boundaries it undertook from it Personal robots are analogous to personal computers appointed to one or more persons They are defined as robots which share physical and emotional spaces with the user Their working field lies in everyday areas business household and recreation Personal robots are characterized by interactivity autonomy intelligence and a close link to man They denote the relationship robot individual The distance between man and machine is close to but greater than zero In the book Robots do it better R Siegwart K O Arras H Sachs C Scheidegger M Schnegg mentioned the evolution of personal robots and cyborgs This was published in 2000 Cyborgs from cybernetic organism are systems whose functions are based on an irreversible union of an organic human and technical subsystems Typical properties are biocompatibility distributed intelligence and partial autonomy Examples include pacemakers mechatronic limbs
54. ow PORTD Low PORTD Return sqr 90loop To 230 BP w DHe O High PORTD 4 High PORTD 0 Low PORTD Low PORTD Low PORTD Low PORTD To 240 H sqr med Low PORTD 3 Low PORTD 4 Return med Print At 1 Print At 2 Print At 3 Print At 4 GoSub med sq GoSub med sq GoSub med sq DelayMS 1000 GoSub med sq GoSub med sq DelayMS 1000 GoSub med sq GoSub med sq GoSub med sq DelayMS 1000 GoSub med sqr GoSub med sq DelayMS 1000 GoSub med sq GoSub med sq GoSub med sq GoSub med sq GoSub med sq DelayMS 1000 DelayMS 1000 GoTo main sgr line High PORTD 4 High PORTD O High PORTD 2 UI UI For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD BB wNHO DRAW BOT Please Wait Drawing the medium line line line loop loop line line line loop loop line line line loop loop line line line square now UI UI 56 Return med sqr High High Low 90loop PORTD 4 PORTD O PORTD 2 PORT D PORTD PORTD PORTD PORTD BwWNH HO Return lrg_sqr Print At 1 Print At 2 Print At 3 Print At 4 GoSub lrg sq GoSub lrg sq GoSub lrg sq GoSub lrg sq DelayMS 1000 GoSub lrg sq GoSub lrg sq DelayMS 1000 GoSub lrg sq GoSub lrg sq GoSub lrg sq GoSub lrg sq DelayMS 1000 GoSub lrg sq GoSub lrg
55. r is r p 100 In general dx absolute error of x ax 2 relative error of x x amp zech percentage error of x dx 100 x 100 dy approximate absolute error of y dy approximate relative error of x Se 100 d d e gt ch approximate percentage error of y X y Example 2 1 The side of a square is measured to be 200 m 60 cm Find the percentage error of the side and the approximate percentage error of the calculated areaof the square Solution Let sbe the side and A the area of the square Then A e The absolute error of the side is ds 60cm 0 6 m The relative error of the side is So the percentage error of the side is 0 0033 100 100 0 3 The approximate relative error of the calculated area is d d 2sds 2ds 20 6 _ 5S 0 006 gt ai Ste A st e 200 Thus the approximate percentage error of the calculated area is 0 006 100 100 0 6 EOS 86 Problems amp Solutions 1 The side of a square is measured to be 200 m 60 cm Find the approximate error of the calculated area of the square Solution Let s be the side and A the area of the square Then A The error of the side is ds 60 cm 0 6 m The approximate error of the calculated area is dA 2s ds 2 200 0 6 240 m 2 Theradius of a sphere is measured to be 5 m 10 cm Find the approximate percentage error of the calculated 3 volume of the sp
56. rcle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equation 1 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement In the case of drawing circles it had no errors The Drawbot perfectly draw the circle The radius could not be diverted to the ideal measurement because the drawing would not look like a circle if it would be so Having no errors the allowable percentage error yield 0 Medium Circle Ideal Radius Measured Radius Absolute Error a o CM jo Ms 2 una Tt 3 n oo na To 000 O 32 4 11 4 11 4 0 00 5 ua ua TI 000 Average Absolute Error wu Allowable Percentage Error of Calculated Area 000 Table 4B Tabulated Results of Allowable Percentage for Medium Circle Table 4B shows the results of the trials for the medium circle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equation 1 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed
57. rg Print At 1 1 DRAW BOT Print At 2 1 Print At 3 1 Print At 4 1 triangle GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg DelayMS 1000 GoSub tri deg loop lrg GoSub tri deg loop lrg GoSub tri deg loop lrg GoSub tri deg loop lrg GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg DelayMS 1000 GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri deg loop med GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg GoSub tri line lrg Cri DelayMS 1000 GoTo main tri line lrg High PORTD 4 Err High PORI High PORI D 0 DD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return BUN O deg loop lrg High PORI High PORI D A D O Please Wait Drawing the large now UI 61 Low PORTD 2 rec sml Print At 1 Print At 2 Print At 3 Print At 4 e W NU EF O To 163 UI PRR x GoSub rec line GoSub rec line DelayMS 1000 GoSub rec 901oop GoSub rec 901oop DelayMS 1000 GoSub rec line GoSub rec line GoSub rec line DelayMS 1000 GoSub rec 90l1oop GoSub rec 90loop DelayMS 1000 GoSub rec line GoSub rec line DelayMS 1000 GoSub rec 901oop GoSub rec 90loop DelayMS 10
58. ronment by Ben Nagler in his year 2000 published book Your First Robot As it is defined it already pertains to a mobile robot It comes as no surprises since all humans animals and insects are the typical role models for this robot genre A non neglecting part of our time is devoted to entertain ourselves Thus while we may provide robots with the capacity to perform useful tasks we may also want those to entertain us Across the centuries humans have shown an eager interest in drawing There are many ways to draw The basics of them all are the shapes Shapes are the basic technique for image processing that have slowly crawled their way into our everyday making of a picture In this paper the researchers utilized entertainment as an interesting application for mobile robots As an improvement the researchers have thought of a way to utilize the use of a mobile robot and add another specific task the process of drawing This project was named DRAWBOT which is a combination of two words draw and robot The design is a drawing mobile robot which has the capability of drawing shapes in a definite size This robot has the ability to create basic shapes and these are the circle square triangle and rectangle Review of Related Literature and Related Studies ROBOTS A robot is a machine designed to execute tasks repeatedly that is a lot advantageous than human capability in terms of speed and precision Robots are capable of performing
59. rs 3 3 3 3 Capture Compare PWM Modules 2 2 2 2 Serial Communications MSSP USART MSSP USART MSSP USART MSSP USART Parallel Communications PSP PSP 10 bit Analog to Digital Module Instruction Set 5 input channels 8 input channels 5 input channels 35 instructions 35 instructions 35 instructions 8 input channels 35 instructions 70 71 APPENDIX D PIC16F84A Microcontroller Data Sheet MICROCHIP PIC16F84A Data Sheet 18 pin Enhanced FLASH EEPROM 8 bit Microcontroller MICROCHIP 72 PIC16F84A 18 pin Enhanced FLASH EEPROM 8 Bit Microcontroller High Performance RISC CPU Features Only 35 single word instructions to learn All instructions single cycle except for program branches which are two cycle Operating speed DC 20 MHz clock input DC 200 ns instruction cycle 1024 words of program memory 68 bytes of Data RAM 64 bytes of Data EEPROM 14 bit wide instruction words 8 bit wide data bytes 15 Special Function Hardware registers Eight level deep hardware stack Direct indirect and relative addressing modes Four interrupt sources External RBO INT pin TMRO timer overflow PORTB lt 7 4 gt interrupt on change Data EEPROM write complete D D Peripheral Features 13 I O pins with individual direction control High current sink source for direct LED drive 25 mA sink max per pin 25 mA source max per pin TMRO
60. se its function 2 The design works properly only on flat surfaces so if it is used in rough or uneven surfaces problems in the drawing will occur It is therefore recommended that the pen holder be improved so that it can draw even on rough surfaces The prototype should be able to add that specific feature through modifying the screw that holds the pen in place 3 Improvements on its motion are also recommended so that it can work on different types of surfaces 46 4 The Design Modification can be made so that it can be used for large scale projects such as road works and floor painting Such design may greatly decrease the time and effort needed in doing these types of projects 5 A better power supply is also advisable so that it can operate for a longer period of time BIBLIOGRAPHY Floyd Thomas L 2007 Electronic Devices Conventional Current Version 8 Edition Prentice Hall Colorado Sison Luis 2000 Learning Microcontrollers thru Experiments Alexan Foundation Metro Manila Casey Reas Ben Fry 2007 Processing A Programming Handbook for Visual Designers and Artists Cook David 2002 Robot Building for Beginners Irwin J David 1997 The Industrial Electronics Handbook Gottlieb Irving M 1994 Electric Motors and Control Techniques 47 APPENDICES APPENDIX A Main Program Source Code Device 16F877 Declare XTAL 4 LCD DTPIN PORTC 0 LCD RSPIN PORTC 4 LCD ENPIN PORTC 5 LCD
61. sq DelayMS 1000 GoSub lrg sq GoSub lrg sq GoSub lrg sq GoSub lrg sq GoSub lrg sq GoSub lrg sq DelayMS 1000 GoSub lrg sq GoSub lrg sq GoSub lrg sq KS EE RES 1 0 To 240 UI DRAW BOT Please Wait Drawing the large line line line line 90 loop _90loop line line line line _90loop 90100p line line line line 90100p 90100p line line line square now GoSub lrg sgr line DelayMS 1000 GoTo main lrg sqr line High PORTD 4 High PORTD 0 High PORTD 2 For i 0 To 240 PORTD 1 i PORTD 3 i DelayMS 5 Next i Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return BUN O lrg sgr 90100p High PORTD 4 High PORTD O Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Low PORTD Return tri sml Print At 1 Print At 2 Print At 3 Print At 4 GoSub GoSub DelayM ct ct n GoSub GoSub GoSub GoSub Ch ER ck Gt GoSub tri GoSub t Ct ci ri cio ri 2 To 240 BB wNHO HAHA line line 1000 ri deg 1 ET deg 1 deg 1 W DRAW BOT Please Wait Drawing the small ii triangle Loop_sml Loop_sml Loop_sml deg 1 line line DelayM 1000 Loop sml now UI UI Loop sml Loop sml Loop sml GoSub tri deg 1 GoSub tri deg 1 GoSub tri deg 1 GoSub tri deg 1 GoSub tri line GoSub tri line
62. stepper motors PIC16F84A serves as the Stepper motor driver for the stepper motors these are the stepper motor drivers and they are being used as buffers for the output signals to drive the stepper motors since the microcontroller can not produce sufficient current to drive these motors The output current ranges from 1 3A up to 3A PIC16F84 is a stepper motor driver It is a motor control integrated circuit that particularly handles a DC motor In this design it pertains to the stepper motor Component Name Stepper Motor and Gear Motor Stepper motors are responsible for the movements of the wheels These stepper motors are being controlled by the MCU Microcontroller They serve as the muscle part of the Drawbot and provide mobility by turning the wheels The gear motor is responsible for moving the pen when 22 drawing the circle shape on its desired size It is also controlled by the microcontroller Component Name Lead Acid Battery The Lead Acid Battery is used to provide power voltage in the Drawbot system It supplies 12 V 1 3A hr and can last up to 4hrs depending on its usage Software Design The main program is created using PICBASIC The PICBASIC compiler made it easy for the designer team to write programs for the PIC16F77 Microcontroller The system programmability of this chip makes the flexibility of the design possible after assembling and testing have been completed This capability can be used for easy PI
63. sul gE wodveau E E Se 28H Ligne HEH 7 A fe 184 Loes Zeckt FE INT ay NIX13 1950 EE EL e OND des bech k a EP Pune a22 s hirt ul PRE ano HOLOW 1557 MN 09000909 MIT cec aL LEDENI Nooson 8 FH MOG d o 16 Aa MOU of gt or BEA PPA 19 The heart of the Drawbot is the PIC16F877 microcontroller It controls all the f Figure 6 Full Schematic Diagram of Drawbot functions including the drawing measurements and LCD display functions The full schematic diagram of the Drawbot is shown in Figure 6 Upon power ON all ports of the PIC16F877 are initialized Then the LCD display shows the main menu and put it in standby mode Pressing the Enter Key will show all pre programmed functions of the circle square triangle and rectangle Selecting the desired shape and size the firmware will execute the appropriate shape routine The PIC16F877 will pulse a signal going to another microcontroller the PIC16F84A and turn on the transistor switch IRF640 to rotate the stepper motor The number of pulses is equivalent to the length of travel or rotation of the stepper motor The directions of stepper motor are also controlled by the PIC16F877 by putting its pin to high or low output The microcontrollers are controlled by a firmware program The LM7805 regulates the 12 volts DC input to 5volts required by the microcontrollers Another motor is the DC gear motor It is meant for sizing
64. t The MCU The user browses is commands the the desired shape P stepper motor The motor input from the A h and size to be EC driver and pulses __ creates the drawn i clock data for desired output display all pre Push Buttons programmed sizes angle position and linear distance Figure 3 System Flow Diagram System Flowchart Figure 4 presents the system flowchart that shows the flow of data and operations for the whole design When Drawbot is turned on a welcome message appears on the LCD It will then wait for an enter key press for it to display the menu After the menus is displayed the user can press the right or left key corresponding to the size shape 16 option the user wants the Drawbot to draw The microcontroller then processes the option to perform the necessary instructions The output will be passed to the stepper motor drivers which will operate the stepper motors The movement will cause the robot to draw the shape ER o User turns on the DrawBot Processes Microcontroller Unit Instructions Stepper motor e drivers activate the stepper motors Displays Welcome Message on LCD NO Draws the output according to the shape and size inputted Is Enter button pressed END Displays Menu with the twelve we size shape options
65. t menu EndIf GoTo select2 next_menu next s2 Print At 1 Print At 2 Print At 3 Print At 4 HAHA If PORTE 0 1 DelayMS 250 GoTo tri med EndIf lt Small TRIANGLE gt Small RECTANGLE E NEXT Then Then Then WW DRAW BOT lt medium CIRCLE gt medium SQUARE H E NEXT D Then Then H DRAW BOT lt medium TRIANGLE gt medium RECTANGLE E NEXT Then 50 If PORTE 1 1 Then DelayMS 250 GoTo rec med EndIf If PORTE 2 1 Then DelayMS 250 GoTo menu lrg EndIf GoTo next s2 menu lrg Print At Print At Print At Print At select3 If PORTE O 1 Then DelayMS 250 GoTo cir med EndIf WW DRAW BOT large CIRCLE W large SQUARE E NEXT m L i d HAHA VA E uw N k L If PORTE 1 1 Then DelayMS 250 GoTo sqr med EndIf If PORTE 2 1 Then DelayMS 250 GoTo next menus EndIf GoTo select3 next_menus Print At 1 Print At 2 Print At 3 Print At 4 d DRAW BOT d lt large TRIANGL gt large RECTANGLE E NEXT d Ia HAHAH next oi If PORTE 0 1 Then DelayMS 250 GoTo tri lrg EndIf If PORTE 1 1 Then DelayMS 250 GoTo rec_lrg EndIf If PORTE 2 1 Then DelayMS 250 GoTo display main EndIf cair cir CI GoTo next s3 _sml High PORTD 5 Low PORTD 6
66. the 1st interpretation Also see Fig 1 2 fl ag Fig 1 2 1st and 2nd axes if 1 000 x 1 then tH 0 1 999 1 000 1 001 x 1 001 1st and 3rd axes if 1 000 x 1 then Rp 0 1 999 1 000 1 001 lt x Xa 999 therefore x is somewhere in 999 1 001 We say that a quantity is measured to be or its measurement is x dx where dx gt O when its measurement is x and the error in the measurement is dx The measured value of the quantity is x the error is dx and the actual value of the quantity is somewhere in the interval x dx x dx 84 Example 1 1 The side of a square is measured to be 1 000 m 1 m Find the approximate error of the calculated area of the square Solution Let s be the side and A the area of the square Then A s The error of the side is ds 1 m The approximate error of the calculated area is dA 2s ds 2 1 000 1 2 000 m EOS Note that we calculate dA from the equation A s since the values of s and ds are given To find the differential of 4 we must have an equation relating A to s So even if the measured value of the side is given we still define the variable s that takes on as a value the measured value In general when the measured value say V of a quantity and the error say E in the measurement are given we define a variable say x for the quantity so that x V and dx E which will be used later on in the solution When using the
67. the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement In the case of drawing circles it had no errors The Drawbot perfectly draw the circle The radius could not be diverted to the ideal measurement because the drawing will not look like a circle if it would be so Having no errors the allowable percentage error yield 0 Large Circle Trial Measured Radius 1 2 3 5 Average Absolute Error Allowable Percentage Error of Calculated Area Table 4C Tabulated Results of Allowable Percentage for Large Circle N 1 pd bei bech bech pad Gel Sac lt LG ke Dk KZ RK KT 33 Table 4C shows the results of the trials for the large circle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equation 1 the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement In the case of drawing circles it had no errors The Drawbot perfec
68. tly draw the circle The radius could not be diverted to the ideal measurement because the drawing will not look like a circle if it would be so Having no errors the allowable percentage error yield 0 Trial Measured Side 1 17 2 2 17 0 3 16 9 16 9 5 16 9 Average Absolute Error Allowable Percentage Error of Calculated Area 5 82 Table SA Tabulated Results of Allowable Percentage for Small Triangle Table 5A shows the results of the trials for the small triangle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equation 2 the absolute error produced by the 34 Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These
69. u that are available Refer to Figure 1 Conceptual Framework The system should receive its input from the push buttons The Drawbot has three push buttons that can control the menu on the LCD namely left lt right gt enter E The options on the menu of the LCD will enable the user to input the desired shape and size The menu has twelve options to choose from which correspond to the format size shape The definite sizes are small medium and large The small sizes are the ones presented first followed by the medium and large sizes There are only four shapes to choose from namely circle square triangle and rectangle The shapes together with the sizes are the inputs of the system that will come from the LCD The Drawbot will process the data and automatically execute the instruction given by the microcontroller unit The output of the microcontroller will run the stepper motor drivers This in turn will execute the movement of the stepper motors The turning of the stepper motors will draw the shape desired by the user Statement of the Problem The study teaches critical skills to computer engineering students The project was time consuming but invaluable to the designers for mastering the skills needed for designing embedded microcontroller prototypes As the title suggests the designers focused on robots to apply this designing method In this study exploring the use of microcontroller to create the robot will be analyze
70. ults of the trials for the small rectangle The allowable percentage error of the calculated area would be the maximum allowable percentage error In the use of this formula see Equation 4 the absolute error produced by the 40 Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement With the small triangle the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on it made the percentage errors These were already mentioned on the scope and delimitation section of this study The gap made by the pen when the Drawbot rotated would be considered the absolute error of the measurement As seen in the tabulated results it was only the triangle rectangle and square that was with errors These proved the effect of the pen The allowable percentage error of calculated area yielded 5 48 Medium Rectangle Trial Measured Width 1 23 6 2 23 6 3 23 5 060 23 6 5 23 7 Average Absolute Error Allowable Percentage Error of Calculated Area 5 35 Table 7B Tabulated Results of Allowable Percentage for Medium Rectangle Table 7B shows the results of the trials for the medium rectangle The allowable percentage error of the ca
71. untered during the assemblage and testing The overall function of the Drawbot was not in order This was due to the uncharged battery It is recquired that the lead acid battery be checked first for its capacity for the Drawbot to work on full operation The sizes were the last that occurred The designers made it sure that the small shapes were the first ones to be successfully drawn before programming the IC for the larger sizes On the trials the user first pressed an option for the desired size and shape The user checked the exact measurement of the sizes that were drawn In obtaining the accuracy of the design the researchers were faced with several questions on how to prove it The first question that was asked was what data should the researchers need to get for the testing Knowing what data to look for the researchers now prepared the environment to which testing would be done In this set up it was assumed that all components were in proper working condition including the supply of the battery There 27 would only be five trials with each size and shape The next question concerned with how the designers would prove the accuracy of the design The step by step procedure and the formulas that were used are presented to further explain the process of obtaining the accuracy of the design and the reason for using such procedure and formulas The trials done on the Drawbot helped the researchers anticipate any errors that
72. us tables this would be the maximum allowable percentage error In the use of this formula the absolute error produced by the Drawbot would be related to its calculated area The percentage error of the calculated showed the approximation of errors in measuring the dimensions since the absolute error was taken into consideration To interpret the data the percentage error represents the percentage it would take for the area to be derailed from the ideal measurement The trials showed that the circle had no errors The allowable percentage error was 0 With the other shapes the inaccuracy in the placement of the pen and how it affected the Drawbot s rotation on the shapes made the percentage errors These were already mentioned on the study s scope and delimitation The gap made by the pen when the Drawbot rotated was considered the absolute error of the measurement As seen in the tabulated result only the triangle rectangle and square had the errors These proved the effect of the pen The range of the allowable percentage error reached almost up to 6 with 5 82 as the maximum It was observed however that as the shape gets bigger in size absolute error increased and the allowable percentage error decreased This was due to the fact that the bigger the size to be drawn the higher the occurrence of errors in measurement to occur It was then to be concluded that the Drawbot s accuracy to draw the shape was within the allowable range With its

Download Pdf Manuals

image

Related Search

Related Contents

Safety Notices  DigitalEye™ 7.2 Digital Trail Camera Instruction  COLOR CALIBRATION LCD MONITORS Color  Guide d`installation  The Crakker™ - FAQ` s  Télécharger (3,33 Mo) - Ville de Crépy-en  User Manual  User Manual Skillsbank  Anleitung Skipper LCD  DSL-N17U  

Copyright © All rights reserved.
Failed to retrieve file