Sunteți pe pagina 1din 5

A Low Cost Implementation of GPS Guided Driverless Cars

Ray-Shine Run
Department of Electronics Engineering National United University Miaoli City, Taiwan rsrun@nuu.edu.tw

Jui-Cheng Yen
Department of Electronics Engineering National United University Miaoli City, Taiwan jcyen@nuu.edu.tw

Cheng-Yu Tsai
Department of Electronics Engineering National United University Miaoli City, Taiwan mattbest1986@hotmail.com

AbstractThe application of GPS is growing fast recently. Not only in military and science purposes, but also in civil use, GPS plays an important role in many electronic systems. For example, the electronic navigation of automobile, the electronic map of PDA, etc. To deploy a research on this topic, we advise a low cost automobile GPS guidance system controlled by an 8-bit MCU (MCS-51), in which functions such as GPS guiding, obstacle avoidance, motion control and wireless communication are integrated. Due to budget limit, we only accomplished the prototype on a toy car. However, the experience of this project encouraged us to go on for the next step. We hope to transfer the related technology to practical vehicle in the near future. Keywords GPS; MCS51.

B. Electronic & Electrical The abilities of moving agilely and positioning precisely are two important objectives of a guidance system. Most of the efforts have been focused on electronic and electrical issues. The block diagram of the guidance system is shown in Fig. 2.

GPS module
electronic compass optical sensor

ultra-sonic sensor

H-bridge driver (moving)


PWM PWM

8 - bit MCU
wireless transceiver

I.

INTRODUCTION

The history of driverless car is over 30 years. The Line Tracing car, for example, has been used in automatic production lines for years. Meanwhile, the 2005 DARPA Grand Challenge and the 2007 DARPA Urban Challenge [7] are two excellent driverless cars of the recent events. The former was definitely a Wild West adventure, whereas the latter was just like a road test for driver(less) license in metropolis. Motivated by these models, we started this research. Although the gap (the level of technology and the scale of budget, etc) between the DARPA Challengers and our model is significant, there is one thing in common Both receive the GPS signal from the satellites! Nevertheless, our model is definitely a cost effective trial for the beginner. II. A. ARCHITECHTURE

H-bridge driver (turning)

Fig. 2. System block diagram of a guidance system.

III.

SUBSYSTEM

Mechanical Because of budget limit, we did not make a car especially for the project. As an alternative, we selected a suitable toy car from the market. Basically, any kind of toy car which can move forward/backward and turn left/right powered electrically is candidate. Eventually, we bought a child-sittable toy car having a maximum speed over 2m/s on a flat playground and a maximum turning angle of the front wheel around 30. Fig. 1 shows the perspective and inside views of the toy car.

A. Driving the dc motor : H-bridge driver + PWM Since the toy car already has two small dc motors respectively for moving and turning, we only need to replace the drivers of the motors. The H-bridge seems to be the most popular approach for driving a dc motor. With proper PWM signals added to the inputs of the H-bridge driver, it is easy to implement speed- and direction- control on a dc motor. In this design, the PWM signals were generated by the MCS-51 based MCU (MPC82G516A). This enhanced version 8051 MCU has 6-channel embedded PWM outputs. The PWM function of MCU supports 8 bit resolution and programmable frequency (500Hz in the case). On the other hand, there are many options of H-bridge driver (ICs). We chose TA8249H IC as the driver which has current capability up to 3A (average), thermal shutdown, short current protection, and 4 modes of operation (forward / reverse / short brake and stop). B. Sensing the movements of car : homemade optical-rotary encoder There is no sensor on the toy car to detect the speed of car, so we adjust the duty cycle of PWM signal to execute the speed control. Basically, this approach worked well when the car moves on a flat surface. But, occasionally, the car stuck at some undetectable obstacles (such as small stones). Under this circumstance, even equipped with ultra-sonic sensor, the system can do nothing but stuck there (the MCU does not know

Fig. 1. Perspective and inside views of the toy car.

978-1-4244-5046-6/10/$26.00 c 2010 IEEE

1610

anything about that). Fortunately, a reflective photo interrupter can overcome the awkward situation. By a proper arrangement nearby the rear wheel, the reflective photo interrupter will output on whenever it is right above the reflective sticker, otherwise it outputs off. Normally, when the car kept moving, the MCU will receive the frequent on/off signal from the photo interrupter. On the contrary, once the on/off signal stopped, meaning that the car was stuck, the MCU will increase the duty cycle of PWM signal to raise the output power of the motor. Usually, this is an effective approach for escaping the situation. Fig. 3 shows the concept of homemade optical rotary sensor. Actually, the frequency of on/off signal is almost proportional to the speed of the car. So, the MCU can make a rough measurement of speed with this signal.
reflective sticker reflective photo interrupter

case and could detect the Earths magnetic field and thereby output the angle from North. Fig. 5 shows the concept of operation of the Compass Module, in which the x-axis of the Compass Module indicates the long axis of the car body.

Fig. 5. The concept of operation of HM55B.

(a) Fig. 3.

(b)

Homemade optical rotary encoder. (a) The reflective sticker on the wheel. (b) The reflective photo interrupter nearby the wheel.

Obviously, it will be much easier to guide when the system combined GPS receiver with Compass Module; the concept of the guidance is shown in Fig. 6 Consider the driverless car is at the origin, the angle (derived from GPS data) from North is 50, and the angle (derived from Compass data) from North is 320(clockwise). At the moment, there is no doubt that the driverless car should make a 90 right turn for the target. Actually, it is difficult for the driverless car to go strait exactly all the time. Therefore, after the right turn, the guidance system still need to adjust the steering wheel (changing the turning angle of front wheel) frequently before the car arrived at the destination. This is consistent with the actual driving experience.
0 =320 =50

Using the same type of photo interrupter and sticker, with a proper arrangement near the front wheel (see Fig. 4), the car can make a null adjustment of forward direction before go strait.

target

270

car

90

Fig. 4. Homemade front-wheel null adjustment.

Clockwise from North( 0)

180

C. Guiding the car : GPS + Compass Module The GPS receiver definitely plays the most important role in the guidance system. The GARMIN 15-H module which used in this case, receives (updates) the GPS signal from the satellites. The information of the GPS signal will be extracted by the module, and re-transmitted to the MCU through the serial port (RS232) once every second. Theoretically, the MCU can derive the distance (and direction) between driverless car and destination through a series of calculation based on the GPS data. According to the result of calculation, the MCU could make a decision for where to go. In practice, however, there would be difficult to guide the car with the GPS data alone. Just imagine the following scenario: you are driving with eyes closed, and the passenger tells you the target is in the South-East direction, 100 meters away from here. How can you make the correct decision for turning left or right if you do not know the direction in front? Fortunately, a small semiconductor sensor can tell you the exact direction in front of the car. The Hitachi HM55B Compass Module was used in the

Fig. 6. The concept of guidance system.

Notice that the Compass Module is sensitive to any kind of magnetic field. Not only the Earths magnetic field, but also the permanent magnet inside the dc motor will affect the sensor. Since there are two dc motors respectively the near front and rear wheels. Testing experiences indicate a minimum distance of 30 cm between the Compass Module must be kept the motor(s) is necessary; or, the sensor will lose the accuracy. D. Obstacle avoidance : Ultra-sonic sensor Ultrasonic reverse parking sensor (subsystem) is almost a standard equipment of car in recent designs. Using the mature technology, the driverless car can avoid the detectable obstacle during the process of guidance. What is detectable obstacle? Using the SRF05 ultra sonic module which has a 4 m range of detection, the driverless car can avoid the obstacle (e.g., human) 1m in front with a cruising speed of 1 m/s. To make

2010 5th IEEE Conference on Industrial Electronics and Applicationsis

1611

the correct decision of turning left or right when faces an obstacle, the driverless car has been equipped with two sets of sensors near the headlights. By comparing the data of the two different sensors, in general, it is easy to detect on which side the obstacle is (see Fig. 7a, Fig. 7c). However, when the obstacle is right in front (see Fig. 7b), there is no way to identify the true situation (unless a visual sensor is used). Under this circumstance, the driverless car can only guess ( e.g., always turn left).

component 2.4GHz wireless transceiver. Furthermore, combining with a homemade human interface which designed in Visual Basic 6, the GPS guidance system can conduct a plurality of cars simultaneously. The IPro2.4GPM used in the case, is a highly integrated multichannel RF transceiver designed for low-cost wireless applications in the 2.4GHz Industry Scientific Medical (ISM) band. According to the specification of datasheet, the effective range of communication is around 500m for an open site test. So far we have test experiences within an 100m x 100m open area (the playground) only, and the quality of communication is perfect. IV. RESULTS

(a)

(b)

(c)

Fig. 7. Demonstration of different cases of obstacle.

A C (language)-like statement that described the obstacle avoidance rule as shown below: if ( d < 1m ) then //*stop back turn around { Stop_and_Back(); if ( (sensor_L) && (!sensor_R) ) turn_Right(); else turn_Left(); } else if ( d < 1.5m) then //*decelerate and turn around { Slow_down(); if ( (sensor_L) && (!sensor_R) ) turn_Right(); else turn_Left(); } //*turn around immediately else if ( d < 2.0m) then { Continue; if ( (sensor_L) && (!sensor_R) ) turn_Right(); else turn_Left(); } d obstacle distance

A. Experiments To verify the performance of the guidance system, we have made some experiments in a playground. The results from the experiments are described as follows. 1) Accuracy: From a viewpoint of a software programmer, in order to know where the car is, we need to translate the GPS data (string of character) into the value of longitude and latitude at first. The GPS receiver sends out many strings of character every second (data updated each second). Each string is led by a $ character. A typical string of GPS data is like this: $GPRMC,125031,A,2432.7581,N,12048.7789,E,000.0,000.0 ,150106,003.2,W*6B Obviously, each individual information (boldface) of the string is separated by a comma, we will focus on the three items of information, its meaning explained as below: 125031,A Greenwich Time 12 : 50 : 31 ( A : valid V : invalid ) 2432.7581,N Latitude 2432.7581 N ( in the south hemisphere N S ) 12048.7789,E Longitude 12049.7789 E ( in the west hemisphere E W ) When the satellite data is valid, GPS module outputs the time information with the status character of A, otherwise V. MCU can identify the status of GPS signal in the process of navigation. Notice that, before making the mathematical operation on latitude and longitude, we must transfer character type of latitude- and longitude- data into numerical type which can be calculated legally in software program. There is an 100m race track in our playground, an excellent reference for testing accuracy. We have recorded the coordinates (GPS data) of Start- and End- of the race track, then calculated the distance of the track by Equations 1-3:

sensor_L the SRF05 on the left side: 1- echo, 0- no echo sensor_R the SRF05 on the right side: 1- echo, 0- no echo Stop_and_Back() turn_Left() turn_Right() the car must stop immediately, then move backward for 1m.

turn left turn right

E. Wireless communication : 2.4 GHz wireless transceiver At first, we only preset one dedicated coordinate (longitude and latitude) of destination into the flash memory of MCU, so, the driverless car can only execute a one-way (or round) trip. Although, it is not difficult to preset a set of coordinates for the car to make a multi-destination traveling. However, it is still not flexible (smart) enough for easy use, because you have to shut down the power, and reprogram the MCU for each update of destination. To implement the function of remote setting of destination, we have built a proprietary Master-Slave wireless LAN using the key

1612

2010 5th IEEE Conference on Industrial Electronics and Applicationsis

x y z

( x_tag ( y_tag

x_cur ) d_LAT y_cur ) d_LON

(1) (2) (3)

touchdown attained 100% when we set the radius of the circle 5m. B. Photos & Specifications Fig. 9 shows the circuit PCB we designed for the model. It is a 2-layor PCB with a size of 11cm x 5cm. The circuit comprises MCU, two H-bridge dc motor drivers, EIA-232 driver for GPS receiver, 12V-5V DC regulator IC, two add-on sockets for Compass module and wireless transceiver. The PCB is powered by the DC 12V battery of the toy car.

( x2 + y2 ) 1/2

x_cur, y_cur : latitude and longitude of current position x_tag, y_tag : latitude and longitude of target position d_LAT : effective distance per minute angle of latitude. d_LON : effective distance per minute angle of longitude. z : the distance of the race track We assume that the earth is a perfect sphere and that the average radius of the sphere is 6371 km. The d_LAT is around 1853m/arcmin, which is a constant value over the world. However, the d_LON is not a constant and depends on latitude, and it can be calculated by Equation (4): d_LON d_LAT cos(latitude) (4)

Fig. 9.

The PCB of the guidance system.

For instance, the longitude and latitude of the playground (Miaoli city, Taiwan) is about 120.8East, 24.5North, and the d_LON is 1686 meter per minute angle of longitude (m/arcmin). Calculation of GPS data measured at the ends of the track showed below: Start End x : 12048.7789 East / 2432.7581 North : 12048.8327 East / 2432.7331 North (32.7581 32.7331 ) arcmin 1853 (m / arcmin)

Fig. 10 shows the wireless transceiver. To show its size, the radius of coin 1cm in diameter was placed adjacent to the circuit. The transceiver is supported by an SPI (Serial Peripheral Interface) bus to interface with the MCU. It needs a DC 3.3V power.

y (48.7789 48.8327 ) arcmin 1686 (m / arcmin) 101.85 m z ( (46.331)2 + (-90.7068)2 ) 1/2 The accuracy is within 2 meters. 2) Reliability: We have made many times of single target / one-way trip test from different start points. Fig. 8 shows the concept of the test.
Fig. 10. The IPro2.4GPM wireless transceiver.

Fig. 11 shows the front view of the toy car. The arrows indicate the ultra-sonic sensors fixed on the bumper beneath the headlights.

A
Fig. 8. Different routes for same target.

ultra-sonic sensor

ultra-sonic sensor

The dashed circle of Fig. 8 stands for the target area. At first, we set the radius of the circle 2m, the probability of touchdown was not 100%. In general, most of the tests (like car A of Fig. 8) were successful in that the driverless car arrived within the target area and stopped there, but, somehow, some failed. Like the car B of Fig. 8, they did not stop at the target but kept circling around the target area. We figured out that the cause is the limited stability of the GPS receiver. We then enlarge the target area. Finally, the probability of

Fig. 11. Front view of the car and ultra-sonic sensors.

The left of Fig. 12 shows the HM55B compass module that communicates MCU through a 3-wire serial interface. It supports a 6-bit (64 direction) resolution for measurement and needs a DC5V power. The right of Fig. 12 shows the SRF05 ultra-sonic module. It starts a measurement of distance with a trigger pulse (duration > 10us) generated by the MCU. The

2010 5th IEEE Conference on Industrial Electronics and Applicationsis

1613

echo signal is proportional to the distance of the obstacle in front. The SRF05 can be triggered every 50ms, or 20 times each second. In this case, the MCU triggers the module at a rate of 10Hz. It also needs a DC 5V power.

V.

CONCLUSIONS

A low cost GPS guidance system has been designed and implanted, in which the functions of guidance, obstacle avoidance, and wireless communication for monitoring multicar are realized. The budget for the working prototype is only US$300. The video of prototype can be viewed at website [8]. We believe that some mid range (less than 1km) transportation applications may adopt the experience of our model, for example, the shuttle bus in airport, the forklift in dock, etc. Actually, we are planning an extended application of this topic the future parking lot (outdoor). Combining the GPS guidance system with the automatic parallel parking system (another concurrent research of our group), the friendly parking management system can support a service like this: The driver gets off (just leaves) the car after an identification at the gate of the parking lot (something like check in), and the car will be guided to and parked at the assigned position by the smart system. Inversely, after an identification at the gate (something like check out), the whole thing rewind, and the car appears in front of the driver! REFERENCES
[1]

Fig. 12. The HM55B and SRF05.

Fig. 13 shows the GPS receiver and the attached antenna. The size of receiver module is around 4.5cm x 3.5cm. It is supported by EIA 232 interface to communicate with the MCU, and it can be powered by DC 8~40V (12V in this case).

Fig. 13. The GPS receiver and the antenna.

[2]

C. Informations
TABLE I. Car Specifications Physical Length 98.7 (cm) Width 51.3 (cm) Height 52 (cm) Weight 9.5 (kg) Battery 12 (V) , 2.3 (Ah) [5] TABLE II. Navigation Information Test Site Latitude 2432.7456North Longitude 12048.8058East Average Speed 1 (m/s) Guidance Accuracy 3~5 (m) [6] [3]

[4]

[7] [8]

Sebastian Thrun, Mike Montemerlo, Andrei Aron, Probabilistic Terrain Analysis For High-Speed Desert Driving. David Stavens, Gabriel Hoffmann, and Sebastian Thrun, Online Speed Adaptation using Supervised Learning for High-Speed, Off-Road Autonomous Driving. Tzuu-Hseng S. Li, and Shih-Jie Chang, Autonomous fuzzy parking control of a car-like mobile robot, IEEE Transactions on Systems, Man, and CyberneticsPart A: Systems and Humans, Vol. 33, No. 4, July 2003. Tzuu-Hseng S. Li, Chih-Yang Chen, et. al., Design and Implementation of Sensor Fusion Based Behavior Strategies for a Surveillance and Security Robot Team, in Proc. of SICE 2008, August 2008, Japan K. Deergha Rao, An approach for accurate GPS navigation with SA, Aerospace and Electronic Systems, IEEE Transactions on Volume 34, Issue 2, April 1998, pp. 695-699. W. Holzapfel, M. Sofsky, U. Neuschaefer-Rube, Road profile recognition for autonomous car navigation and Navstar GPS support, Aerospace and Electronic Systems, IEEE Transactions on Volume 39, Issue 1, Jan. 2003, pp. 2-12. http://en.wikipedia.org/wiki/DARPA_Grand_Challenge http://www.youtube.com/watch?v=_MOZg2gKyjc

1614

2010 5th IEEE Conference on Industrial Electronics and Applicationsis

S-ar putea să vă placă și