Difference between revisions of "F12: Self-Driving GPS Following Car"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Schedule)
(Parts List & Cost)
Line 151: Line 151:
  
 
== Parts List & Cost ==
 
== Parts List & Cost ==
Give a simple list of the cost of your project broken down by components.  Do not write long stories here.
 
 
<table class="wikitable">
 
<table class="wikitable">
 
<th>Parts</th> <th>Quantity</th> <th>Cost</th> <th>Link</th>
 
<th>Parts</th> <th>Quantity</th> <th>Cost</th> <th>Link</th>
Line 164: Line 163:
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
$25  
+
~$25  
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
 
Previously owned
 
Previously owned
 
</center>
 
</center>
 
  
 
<tr>
 
<tr>
 
<td> <center>
 
<td> <center>
GPS -  
+
Microcontroller -  
<BR/>GlobalSat ET-318
+
<BR/> 2012 SJ One Board
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
2
+
1
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
$37.21
+
~$120
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
[http://www.globalsat.com.tw/globalsat_admin/new_file_download.php?Pact=FileDownLoad&Pval=3550 GPS DataSheet]
+
[http://www.socialledge.com/sjsu/index.php?title=2012_SJ_One_Board SJ One Board Info]
 
</center>
 
</center>
  
Line 189: Line 187:
 
<td> <center>
 
<td> <center>
 
XBee Module -  
 
XBee Module -  
<BR/>XBee 1mW Chip Antenna
+
<BR/> XBee 1mW Chip Antenna
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
Line 195: Line 193:
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
$24.95
+
~$24.95
 
</center>
 
</center>
<td><center>
+
<td> <center>
[https://sjvalley.com/shop/index.php?page=shop.product_details&category_id=4&flypage=flypage.tpl&product_id=18&option=com_virtuemart&Itemid=63&vmcchk=1&Itemid=63 Xbee Module]
+
[ftp://ftp1.digi.com/support/documentation/90000866_A.pdf Digi Datasheet]
 
</center>
 
</center>
  
<tr>
 
<td> <center>
 
Motor Controller -
 
<BR/> 5A Motor Controller
 
</center>
 
<td> <center>
 
2
 
</center>
 
<td> <center>
 
$17.99
 
</center>
 
<td> <center>
 
[https://www.sjvalley.com/shop/index.php?page=shop.product_details&category_id=2&flypage=flypage.tpl&product_id=13&option=com_virtuemart&Itemid=63 Motor Controller]
 
</center>
 
  
 
<tr>
 
<tr>
 
<td> <center>
 
<td> <center>
Compass -
+
GPS -  
<BR/> LSM303DLM
+
<BR/>GlobalSat ET-318
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
1
+
2
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
$14.95
+
$37.21
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
[http://www.pololu.com/catalog/product/1273 Compass]
+
[http://www.globalsat.com.tw/globalsat_admin/new_file_download.php?Pact=FileDownLoad&Pval=3550 Globalsat DataSheet]
 
</center>
 
</center>
  
 
<tr>
 
<tr>
 
<td> <center>
 
<td> <center>
Sonar Range Finder -  
+
Motor Controller -  
<BR/>LV-MaxSonar-EZ4
+
<BR/> Secret L293D Motor Driver
 
</center>  
 
</center>  
 
<td> <center>
 
<td> <center>
Line 240: Line 224:
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
$26.95
+
~$13
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
[http://www.pololu.com/catalog/product/794 Sonar Range Finder]
+
[https://content.solarbotics.com/products/documentation/l293d%20v1.2-may08,%202010.pdf Solarbotics Datasheet]
 
</center>
 
</center>
  
 
<tr>
 
<tr>
 
<td> <center>
 
<td> <center>
Ultrasonic Range Finder -  
+
Compass -
<BR/>SRF08
+
<BR/> R117-Compass
</center>  
+
</center>
 
<td> <center>
 
<td> <center>
 
1
 
1
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
~$50
+
$50
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
[http://www.robot-electronics.co.uk/htm/srf08tech.shtml Ultrasonic Range Finder]
+
[http://www.robot-electronics.co.uk/htm/cmps3tech.htm Devantech Datasheet]
 
</center>
 
</center>
  
 
<tr>
 
<tr>
 
<td> <center>
 
<td> <center>
Microcontroller -  
+
Sonar Range Finder -  
<BR/>2012 SJ One Board
+
<BR/>LV-MaxSonar-EZ4
 
</center>  
 
</center>  
 
<td> <center>
 
<td> <center>
1
+
3
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
~$120
+
$26.95
 
</center>
 
</center>
 
<td> <center>
 
<td> <center>
[http://www.socialledge.com/sjsu/index.php?title=2012_SJ_One_Board SJ One Board]
+
[http://maxbotix.com/documents/MB1040_Datasheet.pdf MaxBotix Datasheet]
 
</center>
 
</center>
  

Revision as of 19:51, 17 December 2012

Self-Driving GPS Following Car

Abstract

The objective of this project is to create an autonomous vehicle that follows another car. A leading car will continually inform the autonomous car of its location. The autonomous car will then drive to the target location while avoiding obstacles along the way.

Introduction and Objectives

The Self-Driving GPS Following Car follows another car by driving to the GPS coordinates of the leading car. A ZigBee communication link transmits the GPS data from the leading car to the following car. The following car utilizes a GPS and a compass to determine its own location and orientation relative to magnetic north. Using the two pairs of GPS coordinates and the orientation of the car, the bearing and distance necessary to be traveled is calculated. The car uses proximity sensors, so the car can avoid obstacles while navigating to the destination.

The project required the following objectives to be accomplished:

  • Read GPS coordinates of the leading car and the following self-driving car
  • Use XBee modules to send and receive GPS coordinates from the leading car to the following car
  • Compute the true north bearing and distance necessary for the following car to reach the leading car
  • Account for difference between true north and magnetic north in bearing calculation
  • Read the magnetic north bearing using a compass
  • Read the distance to objects using proximity sensors
  • Control steering motor to steer left, right, and straight using a motor controller
  • Control direction motor to move forward, backward, and stop using a motor controller
  • Determine algorithm to drive toward destination
  • Determine algorithm to avoid obstacles

Team Members and Responsibilities

  • Elias Barboza
    • PWM driver, motor controllers, and obstacle avoidance
  • Caleb Chow
    • Read compass, read GPS coordinates, and move toward target GPS coordinates
  • Stephen Lu
    • ADC driver, read proximity sensors, compute distance based on measurement, and obstacle avoidance

Schedule

Week Number Planned Items Actual Items

Week 1: Design
(October 29)

  • Order Parts
  • Design proximity sensors placement
  • Design algorithm to avoid obstacles
  • Design algorithm to move toward GPS coordinate
    using compass
  • Ordered parts
  • Designed proximity sensor placement
  • Designed obstacle avoidance algorithm
  • Designed move to destination GPS algorithm

Week 2: Construction
(November 5)

  • Upgrade leading car with microcontroller, XBee, GPS,
    and a battery pack
  • Upgrade following car with microcontroller, XBee, GPS,
    compass, proximity sensors, motor controllers, and a
    battery pack
  • Read GPS coordinate from GPS module
  • Tested proximity sensors
  • Finished ADC and PWM drivers
  • Paired XBee modules
  • Read GPS coordinates and computed required bearing and
    distance to travel to destination

Week 3: Drivers
(November 12)

  • Read direction from compass
  • Enable car driving capabilities / motor controllers
  • Send / receive data using XBee modules
  • Motors controllers fully interfaced
  • Mounted proximity sensors, motor controllers, microcontroller, and GPS
  • Created upgrade module for leading car

Week 4: Coding
(November 19)

  • Code obstacle avoidance
  • Tested obstacle avoidance
  • Sent GPS data from leading car to following car
  • Swapped to non-tilt compensated compass
  • Mounted compass
  • Restructure and reorganize code

Week 5: Coding
(November 26)

  • Code moving toward GPS coordinate
  • Tested obstacle avoidance
  • Swapped a proximity sensor to unify sensors
  • Swapped to less power hungry motor controllers
  • New motor controllers fully interfaced
  • Upgraded to use 5xAA battery pack
  • Rewired parts with finalized placement

Week 6: Testing
(December 3)

  • Testing
  • Tested obstacle avoidance
  • Tested move to GPS coordinate

Week 7: Finalization
(December 10)

  • Make final changes for demo
  • Finalize content in Wiki article
  • Tested move to GPS coordinate

Parts List & Cost

Parts Quantity Cost Link

RC Car -
Beetle RC Car

2

~$25

Previously owned

Microcontroller -
2012 SJ One Board

1

~$120

SJ One Board Info

XBee Module -
XBee 1mW Chip Antenna

2

~$24.95

Digi Datasheet


GPS -
GlobalSat ET-318

2

$37.21

Globalsat DataSheet

Motor Controller -
Secret L293D Motor Driver

2

~$13

Solarbotics Datasheet

Compass -
R117-Compass

1

$50

Devantech Datasheet

Sonar Range Finder -
LV-MaxSonar-EZ4

3

$26.95

MaxBotix Datasheet

Design & Implementation

Hardware Design The leading car consists of the following additional hardware:

  • XBee module
  • GPS module
  • 3.3V regulator circuit

The leading car is responsible for sending its GPS coordinates to the following car. This is accomplished by sending the raw GPS data over ZigBee to the following car. The GPS and XBee modules both use UART to communicate, so no microcontroller is necessary. The paired XBee modules will take care of the data transfer. Both modules ran off the same 3.3V power supply, which came from a regulator off of the car’s battery pack.

File:CmpE146 F12 T7 Leading Car Block Diagram.png

Hardware Design

Discuss your hardware design here. Show detailed schematics, and the interface here.

Hardware Interface

In this section, you can describe how your hardware communicates, such as which BUSes used. You can discuss your driver implementation here, such that the Software Design section is isolated to talk about high level workings rather than inner working of your project.
Leading Car

Cmpe146 F12 T7 Leading Car Block Diagram.png

Leading Car Block Diagram

  • GPS – UART
    • Outputs GPS data on Tx to XBee Rx
  • XBee – UART
    • Inputs data to send on Rx from GPS Tx
  • Power Supply – 3.3V
    • Supply power to GPS and XBee modules
    • Add 3.3V voltage regulator with filtering capacitors to RC car’s battery pack

Following Car

Cmpe146 F12 T7 Following Car Block Diagram.png

Following Car Block Diagram

  • Microcontroller
    • 2012 SJSU One Board (LPC1758)
  • GPS – UART
    • P2.8 = Tx, P2.9 = Rx
    • PINSEL4 = 0b10 for both
  • Xbee – UART3
    • P4.28 = Tx, P4.29 = Rx
    • PINSEL9 = 0b11 for both
  • I2C2 Devices
    • P0.10 = SDA, P0.11 = SCL
      PINSEL0 = 0b10 for both
    • Components :
      Proximity sensor (SRF08)
      Compass
  • Proximity Sensors (LV-MaxSonar-EZ4) – ADC4 and ADC5
    • P1.30 = AD0.4
    • P1.31 = AD0.5
    • PINSEL3 = 11 for both
  • Motor Controllers (2) – PWM
    • P1.20 = PWM1.2
    • P1.24 = PWM1.5
    • PINSEL3 = 10 for both
  • Power Supply – 5.0V from RC car's original battery pack
    • Supply power to motor controllers for motors
    • Supply power to SRF08 proximity sensor
  • Power Supply – 3.3V
    • Microcontroller 3.3V output
    • Supply power to GPS, Xbee, and LV-MaxSonar-EZ4 proximity sensors

Software Design

Show your software design. For example, if you are designing an MP3 Player, show the tasks that you are using, and what they are doing at a high level. Do not show the details of the code. For example, do not show exact code, but you may show psuedocode and fragments of code. Keep in mind that you are showing DESIGN of your software, not the inner workings of it.

Implementation

This section includes implementation, but again, not the details, just the high level. For example, you can list the steps it takes to communicate over a sensor, or the steps needed to write a page of memory onto SPI Flash. You can include sub-sections for each of your component implementation.

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

Wifi Connection Issues

Many wifi connection issues were encountered. To solve this problem, a dedicated task was created to re-connect to wifi if the connection was ever lost.

Conclusion

Conclude your project here. You can recap your testing and problems. You should address the "so what" part here to indicate what you ultimately learnt from this project. How has this project increased your knowledge?

Project Video

Upload a video of your project and post the link here.

Project Source Code

Send me your zipped source code and I will upload this to SourceForge and link it for you.

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

List any references used in project.

Appendix

You can list the references you used.