University of Southern Queensland FACULTY OF ENGINEERING AND SURVEYING MOBILE MANOEUVRING ROBOT A dissertation submitted by Mr.
ABSTRACT Robotic guidance is a large part of many research and design applications. It is being used more frequently in everyday lifestyles such as vacuum cleaners and lawn mowers, and is slowly being introduced into the automobile industry. The need for this technology is growing evermore and different aspects and methods are being implemented, from various sensor types to camera machine vision. This dissertation is compiled to explore the use of one of these technologies implemented into a small unit.
University of Southern Queensland FACULTY OF ENGINEERING AND SURVEYING ENG4111 & ENG 4112 Research Project Limitations of Use The Council of the University of Southern Queensland, its Faculty of Engineering and Surveying, and the staff of the University of Southern Queensland, do not accept any responsibility for the truth, accuracy or completeness of material contained within or associated with this dissertation.
Certification I certify that the ideas, designs and experimental work, results analysis and conclusions set out in this dissertation are entirely my own efforts, except where otherwise indicated and acknowledged. I further certify that the work is original and has not been previously submitted for assessment in any other course or institution, except where specifically stated.
ACKNOWLEDGEMENTS This research was carried out under the principal supervision of Mark Phythian. Many thanks are due for his expertise and advice in the area surrounding the Mobile Manoeuvring Robot Assistance was also obtained from Mr. Terry Byrnes. Many thanks also to his expertise and advice. The University of Southern Queensland supplied vital components for the construction of the Mobile Manoeuvring Robot. Many thanks for the use of these components.
TABLE OF CONTENTS Contents Page ABSTRACT i DISCLAIMER PAGE ii CANDIDATES CERTIFICATION iii ACKNOWLEDGEMENTS iv LIST OF FIGURES viii LIST OF TABLES ix LIST OF APPENDICES x NOMENCLATURE xi 1. CHAPTER 1 – Introduction 1 1.1. Outline of the study 1 1.2. The problem 1 1.2.1. Project Goals 2 1.2.2. Performance Guidelines 3 1.3. Research objectives 3 1.4. Conclusions: Chapter 1 4 2. CHAPTER 2 – Literature Review 5 2.1. Introduction 5 2.2.
3.1.3. During the Testing Procedure 17 3.2. Resource Requirements 17 3.3. Sustainability 18 3.4. Methodology 19 3.5. Justification of Methodology 20 4. CHAPTER 4 – Data Analysis 21 4.1. Initial Design 21 4.2. Second Prototype 22 4.3. Odometer sensors and interrupt control 23 4.3.1. Building the odometer sensors 23 4.3.2. Using interrupts to count odometer readings 24 4.4. H Bridge Motor Control 27 4.5. Infrared Distance Sensors 29 Requirements and Availability 29 4.5.
5.4. Overall Performance 60 5.5. Conclusions 61 6. CHAPTER 6 Debugging Module 62 6.1. Microcontroller Not working 62 6.2. Motors Not Turning 62 6.3. Not stopping for Objects 63 6.4. Not driving in a Straight Line 64 6.5. Stopping for Objects but irregular behaviour 64 7. CHAPTER 7 Future Work 7.1. 65 Hardware 7.1.1. Chassis Design 65 7.1.2. Sensor Design 65 7.1.3. Power Source Design 66 7.1.4. Software Design 66 8.
LIST OF FIGURES Number Title Page Figure 2.1: Army Bomb Deployment 6 Figure 2.2: Bomb Disposal Robot 6 Figure 2.3: Increasing technologies 7 Figure 4.1: Initial Chassis Prototype 21 Figure 4.2: Second Chassis Prototype 22 Figure 4.3: Motor setup 23 Figure 4.4: Chassis design 23 Figure 4.5: Odometer Sensor 23 Figure 4.6: Single hole odometer sensor 24 Figure 4.7: Odometer Sensor Circuitry 24 Figure 4.8: 4013 Flip-Flop configuration 25 Figure 4.
LIST OF TABLES Number Title Page Table 3.1: Cutting aluminium safety 15 Table 3.2: Grinding and die grinding safety 16 Table 3.3: Drilling safety 16 Table 3.4: Lathe safety 16 Table 3.5: Painting Safety 17 Table 3.6: soldering safety 17 Table 3.7: Testing safety 17 Table 3.8: Mechanical resources 17 Table 3.9: Electronic Resources 17 Table 5.
LIST OF APPENDICES Number Title Page A Project Specification 70 B Software Listing 71 C Software Design Procedure 85 D Component Data Sheets 91 x
NOMENCLATURE AND ACRONYMS The following abbreviations have been used throughout the text and bibliography:- CRO – Cathode Ray Oscilloscope DSE – Dick Smith Electronics Australia IC – Integrated Circuit IR – Infrared or Infrared Light LED – light emitting diode PCB – Printed Circuit Board PWM – Pulse Width Modulation USQ – University of Southern Queensland (Toowoomba Campus) xi
CHAPTER 1 INTRODUCTION 1.1 Outline of the study The final objective of this project is to implement a successful electronic system into a small mechanical unit in an attempt to make it travel throughout an area whilst avoiding obstacles to evade collisions. In this case the solution will come from the selection of a suitable microcontroller, drive system and sensors.
1.2.1 Project Goals In order to reach the overall objective of this project it is necessary to consider a set of guidelines or a set of project goals to direct the progress of achievement. They are set to be a set of open statements allowing a lot of movement and flexibility within them but to globally control the direction and outcome of the project. By pursuing the following goals the project objective should be reached satisfactorily. 1.
1.2.2 Performance Guidelines The first project goal is to define a guideline to assess the performance of the robot to the specifications of the project objective. For this project to be successful in accordance with the project objective, it is required that the robot perform to the following criteria. • Travel in a straight line when in a clear area with no manual assistance. • Stop before colliding with any obstacles that are in the path • “Decide” which way is more practical to turn and do so.
1.4 Conclusions: Chapter 1 From the contents of this chapter the overall project objective has become clear and broken down into sizeable sections that can be completed individually. The content of required research has been outlined and a set of performance guidelines has been created to show the true desired outcome. These are all vital parts of the project if the objectives are to be met successfully.
CHAPTER 2 LITERATURE REVIEW The purpose of this literature review is to discover and critically analyse similar concepts to that of the Mobile Manoeuvrable Robot. This will build a suitable framework to commence work and research on the project. The literature view will comprise of the following aspects: 1. Brief Background on the concept of autonomous control 2. Is there a need for autonomous appliances/applications 3. What is the most suitable method of sensing distances? 4.
http://www.army-technology.com Figure 2.1: Army Bomb Deployment State-of-the-art remote bomb disposal technology, the telerob Explosive Ordnance Disposal and observation robot tEODor. The German Army model is equipped with five cameras and a double shot disruptor type Richmond RE70. http://www.army-technology.com Figure 2.2: Bomb Disposal Robot A more closely related topic is the automatic vacuum cleaner. These units commonly use ultrasonic sensors to navigate around the room cleaning as it goes.
2.2 The Need for Autonomous Applications Imagine never having to wash, iron, clean or cook again. A robot could do it all for you while you sit back and relax. To some this seems like the perfect world, while to others it seems unethical and truly against their beliefs. The demand for autonomous applications is becoming ever more increasing and public acceptance is also on the increase.
The article “Appliances of the future’ states also that the need and expectations of this type of technology are growing at an alarming rate. It also mentions that for ideal autonomous work in the future that robots will need emotion such as fear, pride and caution.
From all of these details it seems that a very successful method of judging proximity, and also possibly recognising distance, is to use an infrared LED (Light Emitting Diode) and an infrared detector. When the robot is facing a wall or object within a certain distance (unknown at this stage and variable) infrared light will reflect from that object and be collected in the detector. The higher the voltage or current returned from the receiver, the closer the object must be.
perform this operation. The proposed algorithm is intended to create a logical path for a unmanned vehicle to take by use of sensors, videos and imaging data. ‘Our focus is to develop a object avoidance algorithm called SmartAvoidT that extracts multiple objects/targets out of video/imagery data, establishes individual tracks for each object and maps a path around each object to avoid collisions.’ (Tunnel D 2004).
If yes turn left If no, is right sensor clear? If yes turn right If no then reverse out or turn 180 degrees Continue in a straight line (loop to START) 2.5 Dual Motor Drive Systems Many systems use dual motors for directional control. A dual motor drive system refers to having one motor for each drive wheel also known as ‘differential drive’. Both motors driving forwards will make the unit move forwards; one motor forwards and one motor in reverse will result in the unit turning etc.
rotate unless the motors turn at different speeds. By monitoring the differential with a sensor algorithms can be written to control the navigation. For the purposes of this dissertation the clearest method is to use sensors on each wheel, or better yet on the actual drive motor, to measure the revolutions and therefore distance travelled. An algorithm will be written to ensure both drive wheels rotate at the same speed.
Although most of these cases still rely on human instruction, usually from remote control, they are all still based on a similar content to the technical side of this dissertation. Future development of this idea of autonomous mobile navigation may result in any number of new designs. Some of these may be: • Concept cars able to drive without human instruction. May be used for taxi services or courier and mail delivery.
2.7 Summary: Chapter 2 To summarise the literature behind the concept of a mobile manoeuvring robot it is obvious that most of this technology has been invented before. The content that will be covered in this dissertation will be on the basis of autonomous technology and hence will most likely not be an extension into new technology or concepts. The basis for this project is to explore and understand the basic essentials in an autonomous situation that may be used for any industrial or commercial purpose.
CHAPTER 3 RESEARCH DESIGN AND METHODOLOGY Before commencing any of the construction or completed design of any of the electronic or mechanical components, it was necessary to undertake some certain analysis. A safety analysis and a resource requirements and acquisition table was completed to fully understand the background, direction and precautions to consider whilst the project was under design and analysis. 3.1 Safety Issues Safety is a relatively low concern in this project.
When grinding, ensure that the appropriate sized grinder is used. For example, a nine inch angle grinder used on a small piece of aluminium is likely to cause damage to either operator and/or work piece. Grinding/ Die grinding Occurrence likelihood Consequence H/M/L Controls to avoid injury Risk after controls High- Grinding is a noisy operation H – Hearing Damage will occur for long use Hearing protection must be worn L – Small amount of cuts no problem.
Painting Occurrence likelihood Hazard Med – many fumes present Toxic Fumes Consequence H/M/L Controls to avoid injury M – Eye and respiratory damage Eye protection to be worn, fan or dust extraction present, ventilated area Risk after controls L – Adequately protected Table 3.5: Painting Safety 3.1.
The required resources can be categorized into two major fields, mechanical and electronic. The following explains these categories and the planned source.
At the conclusion of this project several components will be returned. The microcontroller will remain the property of USQ. The windscreen wiper motors will be beyond repair but may be reused in other applications. Wheels and other mechanical components will be returned to the workshop. The electronic components will be kept for other applications where sensors etc can be used. 3.
3.5 Justification of Methodology The methodology above has been chosen carefully to complete the project objectives. The first step of ‘Define a guideline to assess the performance of the robot to the specifications of the project objective’ has been chosen to give the robot a set of guidelines to be assessed against. Without having this goal, it will be impossible to determine if the robot has met all requirements.
CHAPTER 4 Construction and Design 4.1 Initial Design Several ideas were analysed before the initial prototype was built. The mechanical structure of the robot was a major consideration. Wheels versus tracks, mechanical steering versus dual motor drive and other considerations along with shape and dimensions were the chief factors. Initial analysis of these ideas provided a dual motor, two track setup with a wide wheel base for stability. This design is shown in figure 4.1 below. Figure 4.
The motor slipping in the tracks would have made this project a near impossibility without a delicate error correction system in place. Because of these difficulties a decision was made to use wheels connected as a direct drive to the motor. 4.2 Second Prototype The second prototype for the mechanical design consisted of an aluminium chassis with dual drive motors. A simple trundle wheel for stability was used to allow ‘on the spot’ steering and high manoeuvrability. Figure 4.
Figure 4.3: Motor setup Figure 4.4: Chassis design The chassis is a 100 x 100mm box section of aluminium commonly found on patio posts. The axle holes were formed with a die grinder and are designed for the motors to bolt straight into. The trundle wheel was placed on temporarily until final dimensions are known for extra hardware (batteries, microcontrollers, wiring etc). 4.3 Odometer Sensors and Interrupt Control 4.3.
The LED (DSE part number Z3235) and Infrared Receiving Diode (DSE part number Z1956) are mounted in an outer casing that mounts the motor to the gearbox. A 4mm hole is drilled through the motor drive shaft which aligns the LED with the Receiving Diode twice for every revolution of the motor. From this circuitry it is possible to obtain a 5 volt drop for every time the sensor is aligned. Figure 4.
4.3.2 Using interrupts to count odometer readings The circuitry detailed earlier was designed to provide a 5v drop twice for every revolution of the motors shaft. This 5 to 0 volt drop provides the perfect setup to use in one of the many Motorola HC12 interrupts. The Motorola has many different interrupts with varying priorities and ideal uses. Some forethought was applied to the needs of interrupts and it was considered that the odometry sensors would need the highest priority.
The above arrangement of a 4013 Dual D Type Flip Flop is set to work on a rising edge (0 to 5 volts). Using a falling or rising edge will not affect the accuracy of the counting; it will still see two rising edges every rotation of the motor. When the sensor rises from 0v to 5v, the flip flop is triggered and Q NOT changes from high to low which triggers the XIRQ (active low) interrupt.
4.4 H-Bridge Motor Control After having the mechanical unit constructed, encompassing the microcontroller and odometry sensors, it was necessary to decide on a method to control the motors. Two H bridges were sourced from the technician’s lab at USQ to allow the microcontroller to handle the large current flows. An H bridge works by a series of four switches which can control the current flow through the motor. The schematic below shows the basic operation of the common H Bridge.
Anything that can control a current is suitable for use as the switches in an H bridge such as relays, transistors or MOSFETS. In this case, four MOSFETS have been used with small heat sinks to cater for the 12V motors which are drawing approximately 2.5 amps each at full load. One excellent advantage of using an H Bridge is that it reduces the voltage and current spikes that occur from the motors starting, stopping or changing direction quickly.
control the frequency. By setting a number between $01 and $FF in the PWPER (0-3) registers, the pulse frequency can be set to a proportion of this clock rate. The duty cycle of this frequency can then simply be controlled by storing values between $00 and $FF into the PWDTY (0-3) registers. This value represents the proportion of high over low time; hence $FF/2 would be 50% duty cycle and the motor would be running at half speed, or $00 would stop the motor.
For accurate manoeuvrability in this application it is necessary that the sensors have a long enough range to avoid collision during turning. Figure 4.10 illustrates this need. Figure 4.10 Sensor Distance Requirements The above diagram illustrates that even after the robot has stopped to avoid an object, the turning circle will result in the corner of the robot still proceeding forwards. It is necessary for the sensor to be able to read further than this turning circle.
4.5.2 Choice of Sensor Almost all of the current household applications that require distance or proximity sensing utilise Ultrasonic or Infrared Light (IR) sensors. The market available choices are large and vary in specifications and range in price from around $40 - $120 each. Many hobbyist robot builders choose to construct IR sensors to save a lot of cost and custom design them to suit the necessary requirements.
Figure 4.11: 555 Timer Pulsing Sensor Light Initial calculated results differed substantially from the measured performance. It was necessary to connect a Cathode Ray Oscilloscope (CRO) to accurately measure the waveform output. Slight tuning of resistor values provided an accurate 38 KHz square wave with 50% Duty Cycle. The transistor is required on the output of the 555 timer to source the current needed to supply the three IR LED’s.
Figure 4.12: PCB Inside LED Torch Figure 4.13: LED Torch Complete With Wires The IR receiving diode should have responded with a voltage drop or even a noticeable resistance change when presented with the torch; however no change was found whatsoever. To check the frequency response of the chip, a function generator was hooked into the base of the transistor at the output of the 555 circuit. The chip was tested for response from 1 Hz up to a few hundred kHz but absolutely no response was found.
This was ideal for the purpose of the robot and so more of these chips were obtained. The Z1955 datasheet details a suggested bypassing and filtering circuit containing a few resistors and capacitors. A single circuit board was soldered containing three of these bypassing and filtering circuits and three receiving chips. Testing of these revealed that the first prototype circuit still worked fine, however the two new circuits (identical in every manner) would only work at a distance of approximately 20mm.
The noise filter, illustrated in figure 4.14, reduced the noise to a negligible level. From this, the Z1955 receiving chips delivered a different behaviour. First experiments on the bread board provided three working receivers over a distance of approximately 300400mm shown by a 5V drop. As this was suitable performance for the Mobile Manoeuvring Robot, the circuitry was soldered to a circuit board. Testing at a later date showed none of the circuits working again.
Figure 4.15 gives an overview of how the pulsing IR LED, Receiving diode and variable IR LED are positioned to provide a successful distance sensor. Figure 4.15: Position of Sensor Components The Z1955 IR Receiver is mounted onto the torch containing the pulsating IR LED. This provides an ideal position to pick up any objects located directly in front of the sensor.
Figure 4.16 Sensor mounting on the Robot There were two main options to communicate between the sensors and the microcontroller. Either the status wire from the receiver could be connected as an interrupt to the microcontroller; or it could be connected as a data line to any available port. Due to the fact that the robots guidance is more interested in knowing the current status of each of the sensors rather than knowing exactly when each is triggered, using the data line approach is far more effective.
provide inverters. The logic signal from the sensors was then applied through these joined inputs and the output provided an inverted signal of the input. The program code simply checks the status of each sensor in a loop by loading PORT A into an accumulator and performing logic decisions on the value loaded. The microcontroller now reads a logic one for an activated signal and a logic zero for a nonactivated sensor.
4.6 The Software The software used to control the Mobile Manoeuvring Robot was created in assembly language for the Motorola HC12. This allowed direct communication with the microcontroller and convenient access to all of its ports and functions. The software used to control the heading of the robot follows a relatively simple structure with small subroutines for each separable function or routine.
Robot. It is in the form of a tight loop main routine that branches out when individual activities require to be completed. The following outline was created to establish the necessary activities to be completed in the main loop and the appropriate related subroutines. While driving do the following: • Read the odometer sensors and increment odometer counters o Check odometer counters and adjust speed for straight driving • Watch obstacle sensors in a tight loop act accordingly when sensors triggered.
Process 2: Process 2 is a large subroutine called every time a turn is needed. It accesses data from port A. It checks sensors and turns relative to their status. After the motors have been adjusted to gain desired performance the code returns to the main loop, process 1. Process 3: This is an interrupt service routine that determines which odometer sensor has triggered and increments the respective counter. The counter is a byte stored in memory and is cleared regularly to avoid overflow issues.
This section of code is simply written to show and name all of the available addresses of ports etc inside the Motorola HC12. Credit for this section of code goes to Mr Terry Byrnes. The rest of the program then references these address names for ease of reading, understanding and debugging.
CLR COPCTL ;DISABLE COMPUTER OPERATING NORMALLY WATCHDOG JSR INITSC0 ;INITIALISE SERIAL PORT JSR INITKWG ;INITIALISE PORT G JSR INITPWM ;SET UP PULSE WIDTH MODULATION ON PORT P WAIT JSR INITIRQ ;INITIALISE IRQ INTERRUPT JSR INITPA BRCLR PORTA,$01,SKP ;CHECK FRONT SENSOR AND IF ON BRANCH TO TURNL SKP JSR TURNL LDAA COUNT CMPA #$5A ;HAS MOTOR A COUNTED xx TIMES YET (xx/2 REVOLUTIONS) BMI WAIT ;IF NOT ,WAIT AND CHECK AGAIN JSR COMP ;IF SO JUMP TO COMP (compare function) BRA
applies to the motor to be run. The byte moved is between $00 and $FF and is the percentage high time of the duty cycle of the pulse used to control the speed. A value of $FF will be full time on, hence maximum speed, and $00 will be full time low, hence not moving at all. The value $A0 has been chosen from physical observation to define the desired speed as smooth but reasonable pace.
commands a delay is implemented to reduce some of the jerky motion. The delay subroutine is used to create this delay.
the robot has turned in either direction the backup subroutine is exited and the main loop continues. BACKUP ;LDAA WFCLR #'K' ;SEND K THROUGH SERIAL PORT ;JSR TXBYTE ;(DEBUG) ;MOVB #$00,PWDTY0 ;| ;MOVB #$00,PWDTY2 ;|STOP MOTORS (DRIVING FORWARDS) ;JSR DELAY ;WAIT DELAY PERIOD ;MOVB #$A0,PWDTY1 ;| ;MOVB #$A0,PWDTY3 ;|REVERSE STRAIGHT BRCLR PORTA,$02,OUTL ;IF LEFT NOT SET BRA TO OUTL ;BRCLR PORTA,$04,OUTR ;IF RIGHT NOT SET BRA TO OUTR BRA WFCLR ;IF L&R SET, BRA WFCLR.
4.6.7 COMP Compare Subroutine The entire purpose of the COMP subroutine is to compare the speeds of each motor and ensure they run in parallel. This ensures straight line driving which was one of the major project guidelines. This function is called by the main loop every time the odometer for motor A reaches its defined value. When this occurs, it writes a new line through the serial port then compares ODMA (odometer of motor A) with ODMB (odometer of motor B).
SUBA #$01 STAA PWDTY2 ;SLOW MOTOR A SLIGHTLY BRA DONE ;EXIT PWDTY0 ;| ADDA #$01 ;|SPEED B UP ONE STAA PWDTY0 ;| BRA DONE FASTB LDAA ;IF MOTOR A IS FASTER THAN $C5 ;-------------------------------------B2FAST JSR NEWLINE ;CASE MOTOR B IS FASTER THAN A LDAA #'b' JSR TXBYTE ;TX BYTE THROUGH SERIAL (DEBUG) LDAA PWDTY0 ;LDAA WITH SPEED OF MOTOR B CMPA #$65 ;| BMI FASTA ; | IF MOTOR B GOING TOO SLOW, SPD UP A SUBA #$01 ;| STAA PWDTY0 ;|SLOW MOTOR B SLIGHTLY BRA DONE FA
;*****************KEY WAKE UP PORT G *********************** ;ADDS 1 TO COUNTER FOR CORRESPONDING MOTOR ;****SENSOR G 0************ KWGISR BRCLR KWIFG,$01,NOTG0 ;CHECK BIT 0 LDAA ODMB ;IF MOTOR B, LDA WITH ODOM COUNT B ADDA #$01 ;ADD 1 TO ODMB COUNT STAA ODMB ;STORE BACK TO ODMB LDAA #'B' JSR TXBYTE ;WRITE TO SERIAL PORT (DEBUG) ;****SENSOR G 1************ NOTG0 BRCLR KWIFG,$02,NOTG1 ;CHECK BIT 1 LDAA ODMA ;IF MOTOR A, LDA WITH ODOM COUNT A ADDA #$01 ;ADD 1 TO COUNT STAA ODMA ;S
4.6.10 Initialisation of Ports and Interrupts There are several different subroutines used to initialise ports and define interrupt control. One exists for each of the following: Pulse width modulation, port P; Port A; Key wake up Port G and the serial port. It is essential that these initialisation subroutines are run at the start of the program before any actual running commences.
RTS ;RETURN TO MAIN Initialisation for port A simply involves setting the three used pins for data input and setting all of the pins to initially start with logic low. This ensures no sensor readings take place until the sensor actually detects an object.
The serial port requires having the baud rate set and also to enable the transmitter. It is also adequate to enable the transceiver which accomplishes the same task. The baud rate value is chosen and then a corresponding number is found from the baud rate generation table in the HC12 data sheet. Loading accumulator A with the contents of SC0DRL clears the flags inside that register and readies the serial port for use.
LDAA #$0A ;LOAD LINE FEED ASCII JSR TXBYTE ;TRANSMIT TO SCREEN RTS ;RETURN The TXBYTE subroutine checks the serial ports status register to await the clear flag before sending the data stored in accumulator A through the serial port. It is essential to await the clear flag before sending data to avoid data contentions.
CHAPTER 5 PERFORMANCE AND DATA ANALYSIS No specific data was obtained from the results of this dissertation. This is due to the fact that it is a simple performance based outcome. If GPS tracking or similar had been used to control direction there would be headings and position plots to consider. The only way to assess the performance of the Mobile Manoeuvring Robot is to visually assess the performance.
Coordinate Position X Y Z 1 0 200 0 2 50 180 0 3 -55 180 0 4 0 180 65 5 0 180 -50 6 35 180 35 7 -35 180 -35 8 -35 180 50 9 35 180 50 10 45 180 30 11 -45 180 30 12 45 180 -20 13 -50 180 -20 14 20 180 60 15 -20 180 60 16 20 180 -40 17 -25 180 -40 TABLE 5.1: Sensor range Using computer software to plot these results shows the range the sensor can detect.
Figure 5.1 shows the MATLAB 3D plot which depicts roughly the boundary an object must enter to be detected by the sensor. The red line represents the perpendicular sensing distance and the blue lines show the extremities of the reflected light. Figure 5.1 Sensor spectrum This is a practical spread of detectable range. If pointed towards the driving surface the sensors will detect any object that comes within the driving direction of the robot.
5.2 Mechanical performance The chassis used for the duration of this project served its purpose sufficiently. It was possible to mount all the required equipment, however room for additional components is exhausted. The major problem with the chassis design at this point is the lack of room for a suitable battery. The battery used can sustain operation for only a short period of time and so either more cells or a new design of battery is required.
Figure 5.2: Layered approach to robot design. This design allows greatly for troubleshooting as each layer can be pulled apart separately to give room for soldering, viewing and modifying. It would also be advisable to allow a lower layer for the battery storage as they are likely to be one of the heavier components and mounting them high would affect the robots stability. 5.3 Software Performance The software as explained above follows a very simple structure.
Figure 5.3: Straight line testing Approximately 1 metre Figure 5.
Figure 5.4 shows the results of the straight line test. This section of line is approximately one metre from the start of the test and approximately one metre long. The chalk line has been drawn over to make more visible and a string line pulled tight to lie beside it as a control. It can be seen that as a whole, the robot drives in a very straight line with only slight variances in either direction.
Performance guideline three: • “Decide” which way is more practical to turn and do so. The robot follows a strict simple decision making process in turning operations. This operation is detailed in the code section of this dissertation. If there is not room for the robot to turn in any one direction, the robot will not attempt the turn and reverse until a clear path is found. This process ensures that the third performance guideline is met satisfactorily.
CHAPTER 6 DEBUGGING MODULE The Mobile Manoeuvring Robot has been designed and constructed in such a way for ease of troubleshooting. An example of this is that the software has been written to output certain characters through the serial port which can be used to gain understanding of the actual performance of the robot. The following sections are written to detail the methods of debugging or troubleshooting the robot when performance is not desirable. 6.
be the cause of problem. To ensure the push button has worked and been acknowledged by the microcontroller, connect the serial port to a computer and run a monitor program such as OC Console. Depress the button; a character ‘Q’ should be displayed on the screen if it has worked. A small delay follows this character send before power is sent to the H-Bridges. 6.3 Not Stopping for Objects The main cause for the robot not stopping at objects is for the sensors to have failed.
6.4 Not Driving in a Straight Line If the robot is moving but fails to drive in a straight line it is most likely caused by a fault in the odometer sensors. To check these, connect the serial port to a computer and run a monitoring program such as OC Console. Connect a voltage to one of the motors to make it spin. As the motor spins, either the character ‘A’ or ‘B’ should be repeated on the screen. (‘A’ for motor A; ‘B’ for motor B).
CHAPTER 7 FUTURE WORK This chapter summarises the future work that may be carried out on the Mobile Manoeuvring Robot. Future work has been detailed in each individual section such as chassis design and software; however this chapter aims to provide the possible future work in a neat summary. 7.1 Hardware 7.1.
outer of the torch so that the clocked IR light spreads further rather than being concentrated to a point. Another method would be to add more clocked light LED’s to transmit a greater quantity of light, and hence objects will reflect more light to the receiver. This is not deemed an important aspect of future work however may become important if the robots performance criteria change. 7.1.3 Power Source Design Currently, the Mobile Manoeuvring Robot has two power sources.
CHAPTER 8 CONCLUSIONS As discussed in chapter 5 (Performance and Data Analysis), the performance of the Mobile Manoeuvring Robot was a success. All of the performance guidelines were met including: • Travel in a straight line when in a clear area with no manual assistance. • Stop before colliding with any obstacles that are in the path • “Decide” which way is more practical to turn and do so. • Continue on its path in a straight line.
Figure 8.1: Working Prototype of Mobile Manoeuvring Robot Figure 8.1 shows the prototype robot to date without the power supplies attached. Overall, the Mobile Manoeuvring Robot was a success in every aspect of performance however would need substantial work to implement into a practical application.
APPENDICES Appendix A – Project Specification Appendix B – Software Listing Appendix C – Software Design Procedure Appendix D – Component Data Sheets 69
Appendix A – Project Specification University of Southern Queensland FACULTY OF ENGINEERING AND SURVEYING ENG4111/4112 Research Project PROJECT SPECIFICATION FOR: MATTHEW FREE TOPIC: Mobil Manoeuvring Robot SUPERVISOR: Mark Phythian ENROLMENT: BEng (Mtr) ENG4111 – S1, ONC, 2006 ENG4112 – S2, ONC, 2006 PROJECT AIM: This project aims to explore the use of sensors and Mechatronic technology in order to produce an obstacle avoiding robot based on a household sized application.
Appendix B – Software Listing This is the code stored in the Motorola HC12 ‘s memory which is executed on the event of the ‘start’ push button.
REFDV equ $39 ; PLLFLG equ $3B ; PLLCR equ $3C ; CLKSEL equ $3D ; SLOW equ $3E ; PWCLK equ $40 ; PWPOL equ $41 ; PWEN equ $42 ; PWPRES equ $43 ; PWSCAL0 equ $44 ; PWSCNT0 equ $45 ; PWSCAL1 equ $46 ; PWSCNT1 equ $47 ; PWCNT0 equ $48 ; PWCNT1 equ $49 ; PWCNT2 equ $4A ; PWCNT3 equ $4B ; PWPER0 equ $4C ; PWPER1 equ $4D ; PWPER2 equ $4E ; PWPER3 equ $4F ; PWDTY0 equ $50 ; PWDTY1 equ $51 ; PWDTY2 equ $52 ; PWDTY3 equ $53 ; PWCTL equ $54
ADR00H equ $70 ;A/D Converter Result0 ADR00L equ $71 ; ADR01H equ $72 ;A/D Converter Result 1 ADR01L equ $73 ; ADR02H equ $74 ;A/D Converter Result 2 ADR02L equ $75 ; ADR03H equ $76 ;A/D Converter Result 3 ADR03L equ $77 ; ADR04H equ $78 ;A/D Converter Result 4 ADR04L equ $79 ; ADR05H equ $7A ;A/D Converter Result 5 ADR05L equ $7B ; ADR06H equ $7C ;A/D Converter Result 6 ADR06L equ $7D ; ADR07H equ $7E ;A/D Converter Result 7 ADR07L equ $7F ; TIOS equ $80 ;Timer Input Captur
TC4 equ $98 ;TIC/TOC 4 TC4LOW equ $99 ;TIC/TOC 4 Low Byte TC5 equ $9A ;TIC/TOC 5 TC5LOW equ $9B ;TIC/TOC 5 Low Byte TC6 equ $9C ;TIC/TOC 6 TC6LOW equ $9D ;TIC/TOC 6 Low Byte TC7 equ $9E ;TIC/TOC 7 TC7LOW equ $9F ;TIC/TOC 7 Low Byte PACTL equ $A0 ;Pulse Accumulator Control PAFLG equ $A1 ;Pulse Accumulator Flag PACN3 equ $A2 ;Pulse Accumulator Count PACN2 equ $A3 ; PACN1 equ $A4 ; PACN0 equ $A5 ; MCCTL equ $A6 ; MCFLG equ $A7 ; ICPACR equ $A8 ; DLYCT equ $A9
SC0BDL equ $C1 ;SCI 0 Baud Rate Low Byte SC0CR1 equ $C2 ;SCI 0 Control 1 SC0CR2 equ $C3 ;SCI 0 Control 2 SC0SR1 equ $C4 ;SCI 0 Status 1 SC0SR2 equ $C5 ;SCI 0 Status 2 SC0DRH equ $C6 ;SCI 0 Data SC0DRL equ $C7 ;SCI 0 Data Low Byte SC1BDH equ $C8 ;SCI 1 Baud Rate SC1BDL equ $C9 ;SCI 1 Baud Rate Low Byte SC1CR1 equ $CA ;SCI 1 Control 1 SC1CR2 equ $CB ;SCI 1 Control 2 SC1SR1 equ $CC ;SCI 1 Status 1 SC1SR2 equ $CD ;SCI 1 Status 2 SC1DRH equ $CE ;SCI 1 Data SC1DRL equ $C
CTFLG equ $106 ; CTCR equ $107 ; CIDAC equ $108 ; CRXERR equ $10E ; CTXERR equ $10F ; CIDAR0 equ $110 ; CIDAR1 equ $111 ; CIDAR2 equ $112 ; CIDAR3 equ $113 ; CICMR0 equ $114 ; CIDMR1 equ $115 ; CIDMR2 equ $116 ; CIDMR3 equ $117 ; CIDAR4 equ $118 ; CIDAR5 equ $119 ; CIDAR6 equ $11A ; CIDAR7 equ $11B ; CIDMR4 equ $11C ; CIDMR5 equ $11D ; CIDMR6 equ $11E ; CIDMR7 equ $11F ; PCTLCAN equ $13D ; PORTCAN equ $13E ; DDRCAN equ $13F ; RxFG equ $140 ; Tx0 equ $150 ;
ADR10L equ $1F1 ; ADR11H equ $1F2 ; ADR11L equ $1F3 ; ADR12H equ $1F4 ; ADR12L equ $1F5 ; ADR13H equ $1F6 ; ADR13L equ $1F7 ; ADR14H equ $1F8 ; ADR14L equ $1F9 ; ADR15H equ $1FA ; ADR15L equ $1FB ; ADR16H equ $1FC ; ADR16L equ $1FD ADR17H equ $1FE ; ADR17L equ $1FF ; ; ;********************************************************************* ;MOTOR DIRECTION CONTROL ;pwm channel 0 = motor B CLOCKWISE ;pwn channel 1 = motor B ANTI CLOCKWISE ;pwm channel 2 = motor A ANTI
JSR INITSC0 ;INITIALISE SERIAL PORT JSR INITKWG ;INITIALISE PORT G JSR INITPWM ;SET UP PULSE WIDTH MODULATION ON PORT P WAIT JSR INITIRQ JSR INITPA BRCLR PORTA,$01,SKP ;INITIALISE IRQ INTERRUPT ;CHECK FRONT SENSOR AND IF ON BRANCH TO TURNL SKP JSR TURNL LDAA COUNT CMPA #$5A ;HAS MOTOR A COUNTED xx TIMES YET (xx/2 REVOLUTIONS) BMI WAIT ;IF NOT ,WAIT AND CHECK AGAIN JSR COMP ;IF SO JUMP TO COMP (compare function) BRA WAIT ;AFTER COMP GO BACK AND WAIT FOR ANOTHER xx/2 REVOLUTI
CONTL MOVB #$00,ODMB ;|CLEAR ODOM COUNTERS MOVB #$80,PWDTY1 ;TURN MOTOR B BACKWARDS LDAA #$00 LDAB ODMB CPD #90 ;SET NUMBER RELATIVE TO A 90 DEGREE TURN FALSE BLT CONTL MOVB #$00,PWDTY1 JSR DELAY JSR DRFWD ;WAIT FOR TURN TO COMPLETE ;CONTINUE FORWARDS RTS ;RETURN FROM SUBROUTINE ;------------------------------------TURNR ;BRCLR PORTA,$02,SKB ;IF RIGHT SENSOR(2) BLOCKED, BACKUP INSTEAD JSR BACKUP SKB LDX #$0A00 LP2 BRCLR PORTA,$04,FALSE2 ;| DEX ;| ;|LOOP TO CHECK SENS
WFCLR ;JSR TXBYTE ;(DEBUG) ;MOVB #$00,PWDTY0 ;| ;MOVB #$00,PWDTY2 ;|STOP MOTORS (DRIVING FORWARDS) ;JSR DELAY ;WAIT DELAY PERIOD ;MOVB #$A0,PWDTY1 ;| ;MOVB #$A0,PWDTY3 ;|REVERSE STRAIGHT BRCLR PORTA,$02,OUTL ;IF LEFT NOT SET BRA TO OUTL ;BRCLR PORTA,$04,OUTR ;IF RIGHT NOT SET BRA TO OUTR BRA WFCLR ;IF L&R SET, BRA WFCLR.
FASTB LDAA PWDTY2 ;LDAA SPEED OF MOTOR A CMPA #$65 ;IF MOTOR A IS SLOWER THAN $C5 BMI FASTB ;SPEED UP MOTOR B SUBA #$01 ;IF MOTOR A IS FASTER THAN $C5 STAA PWDTY2 ;SLOW MOTOR A SLIGHTLY BRA DONE ;EXIT LDAA PWDTY0 ;| ADDA #$01 ;|SPEED B UP ONE STAA PWDTY0 ;| BRA DONE ;-------------------------------------B2FAST JSR NEWLINE ;CASE MOTOR B IS FASTER THAN A LDAA #'b' JSR TXBYTE ;TX BYTE THROUGH SERIAL (DEBUG) LDAA PWDTY0 ;LDAA WITH SPEED OF MOTOR B CMPA #$65 ;| BMI F
LDAA #'B' JSR TXBYTE ;WRITE TO SERIAL PORT (DEBUG) ;****SENSOR G 1************ NOTG0 BRCLR KWIFG,$02,NOTG1 LDAA ODMA ;CHECK BIT 1 ;IF MOTOR A, LDA WITH ODOM COUNT A ADDA #$01 ;ADD 1 TO COUNT STAA ODMA ;STORE BACK TO ODMA LDAA COUNT ADDA #$01 STAA COUNT LDAA #'A' JSR TXBYTE ;WRITE TO SERIAL PORT (DEBUG) ;********FALSE INTERRUPT******** NOTG1 MOVB #%00000011,KWIFG RTI ;CLEAR WAKE UP FLAGS ;RETURN FROM INTERRUPT ;**********************IRQ SERVICE ROUTINE***********************
***************INITIALISE PORT A**************************************************** INITPA MOVB #%11111000,DDRA ;SET PORT A BITS FOR OUT AND IN 0 = INPUT MOVB #%00000000,PORTA ;ENSURE PORT A INPUTS ARE ZEROES WAITING FOR ACITVE HIGH RTS **************INITIALISE PORT G FOR KEY WAKE UP********************************** INITKWG MOVB #%11111100,DDRG ;BITS 0-4 AS INPUT MOVB #%00000011,KWIFG ;CLEAR WAKE UP FLAG 0-4 MOVB #%00000011,KWIEG ;ENABLE KEY WAKE UP INTERRUPTS MOVB #%00000000,PUCR ;SET
;--------------------------------------------------------; TRANSMIT A CHARACTER STORED IN ACCUMULATER A TXBYTE BRCLR SC0SR1, #$80 ;WAIT FOR CLEAR FLAG STAA SC0DRL ;SEND DATA THROUGH SERIAL PORT RTS ;************************************************************************************ 84
Appendix C – Software design procedure MOBILE MANOEUVRING ROBOT SOFTWARE DESIGN Objectives: To control the mechanical hardware of a two drive-wheel robot in order to avoid collision with obstacles. The software must be able to control the unit to travel in a straight line between objects and is based on assembly level language of the Motorola 68HC12 microcontroller.
System Model The following data flow diagram shows the basic flow of values through the system. sensors PORT A Obstacle Process 1 D1 Process 2 D3 D5 sensors PORT G D4 Odometer readings Process 3 D2 MOTOR CONTROL Process 4 D1 = Signal of which direction to turn D2 = odometer counters D3 = motor information for turning D4 = motor information for drive straight D5 = jump to process 4 when required Process 1: This is the main section of the program.
Software Specification Execution structures, Pseudocode MAIN set the stack pointer in a clear area Clear computer watchdog Initialise serial port Initialise Kew Wake up on port G Initialise IRQ Interrupt Initialise port A Start loop check sensor for objects Branch to turn if necessary Check odometer counters and branch to compare if necessary Repeat loop.
BACKUP transmit ‘K’ through serial port Stop the motors Delay Turn both motors backwards Start loop if left sensor clear, turn left then go forwards again If right sensor clear, turn right then go forwards again Repeat loop Return to main DELAY load a large number Decrement it slowly Return to main COMP new line through serial port Load accumulator with odometer count A Compare with odometer count B If B bigger than A branch to B2FAST IF A bigger than B branch to A2FAST A2FAST write ‘a’ through ser
Software Module Description (Major modules) Module Name: MAIN Purpose: To run a tight loop continuously monitoring all sensors and odometer readings.
Module Name: DELAY Purpose: To create a pause in the program. Called by: IRQISR, TURNL, TURNR, BACKUP Calls: N/A Validation: N/A Registers used: X and Y System Implementation Data dictionary Constants and variables used in this code are listed below.
Appendix D – Component Data Sheets The following data sheets are the main components used in the construction of the Mobile Manoeuvring Robot. Not all data sheets will be supplied such as the transistor sheets which are not specific to the purpose of the Mobile Manoeuvring Robot. The Microcontroller, Motorola MC68HC12 data sheet will not be included as it is far too extensive for the purpose of listing the data sheets. The MC68HC12 data sheet can be downloaded from various sources on the internet.
Z 1955 Buffered Infra Red Receiver System The Z 1955 Buffered IR Receiver system is a Dick Smith Electronics part available at Dick Smith Electronic stores. This component is used in the obstacle avoidance IR sensors to receive the clocked IR light from the transmitter.
Z 1956 Infrared Receiving Diode The Z 1955 IR Receiving Diode is a Dick Smith Electronics part available at Dick Smith Electronic stores. This component is used in the odometer counting sensors to receive the IR light.
CARD12 The card 12 sheet is placed here to show the layout of the MC68HC12 microcontroller. The card 12 is a user friendly PCB which splits the microcontroller’s pins out into the separate ports and channels. It provides easy access for soldering and can be attached to any other PCB by the use of two ‘2*25 pin plugs’. The serial port is accessed on the card 12 ready for connection to a PC.
Also included in this appendix are the important pages on Interrupt vectors used for the CARD12.
96
REFERENCES Polymicro 2004, Application Areas and Markets for polymer Micro-Optics, viewed 9 May 2006, POLYMICRO, http://www.polymicro-cc.com/site/pdf/POLYMICROmarkets.pdf Media Limited SPG 2006, ‘Explosive Ordnance Disposal and Mine Clearance Gallery’, viewed 9 May 2006, Electrolux, ‘Welcome to the Electrolux Trilobite’, viewed 9 May 2006, 2002, ‘Appliances of the Future’, Ricoh Journal, viewed 9 May 2006, http://www.jnd.org/dn.
Lee F Lin L, ‘Don't Worry, Be Happy,’ viewed 10 May 2006, http://robots6270.mit.edu/contests/2001/robots/10/www/ Knudsen J 2000, ‘The Straight and Narrow,’ Viewed 10 May 2006, http://www.oreillynet.com/pub/a/network/2000/05/22/LegoMindstorms.html Bitsoi H et al 2001, ‘F.U.B.A.R’, viewed 11 July 2006, www.ee.nmt.edu/~wedeward/EE382/SP01/group3.pdf McCoy T et al 2004, ‘Infrared Communications Link with Voice and Data’ viewed 19 July 2006, www.home.people.net.