Self-driving Car

From Embedded Systems Learning Academy
Revision as of 20:49, 22 May 2014 by Preet (talk | contribs) (Created page with "This project is about a team of 20 getting a car to self-drive to a selected destination. This involves working with an RTOS running on a low power processor and various diff...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This project is about a team of 20 getting a car to self-drive to a selected destination. This involves working with an RTOS running on a low power processor and various different processor boards working together over a CAN bus.




Given below are the controllers, their duties, and the number of people involved.

  1. Sensor Controller (3 members)
    • Interfaced to front and rear vision.
      Consider Sonar, and/or IR sensors with long distance vision
    • Sensors must be "filtered" and must provide reliable "vision"
    • What else can you incorporate as additional features?
      Acceleration sensor to provide tilt? (for hill hold assist)
      Light sensor to turn on automatic headlights?
  2. Motor Controller (3 members)
    • Interfaced to motor control system of the car
      Provide a means to steer, and drive the car
    • Provide feedback of the speed using a wheel encoder or speed sensor
  3. I/O Unit (3 members)
    • Provide an LCD screen to report car status
      Errors and communication status
      Sensor values
    • Buttons to start and stop the car
    • Button hard-coded to set a specific destination
    • Provide means to turn on/off the headlights
  4. Communication Bridge + Android (4 members)
    • Provide means to communicate and display status on an Android/iPhone device
    • Allow a user to see sensor values, car speed (etc)
    • Allow a user to select a destination from Google Earth
  5. Geographical Controller (3 members)
    • Interface to a 5Hz or faster GPS
    • Interface to a backup GPS in case primary one fail (use a different manufacturer)
    • Interface to a compass
    • Allow a GPS coordinate to be "set"
      Based on the set coordinate, calculate, and provide CAN data regarding
      the current heading, and the desired heading to reach the destination
    • This unit needs to compute the "heading degree" to reach the destination
  6. Master Controller (4 members)
    • This is the primary unit that communicates with every controller to drive the car
    • This unit shall also turn on headlights (etc), and be the "brain" of the car
    • Upon a detection of a "Start" condition, work with different controllers to drive the car
      Motor Controller and Geographical Controller
      Command the Motor Controller based on Sensor Controller and Geographical Controller data


Each controller shall provide a means to communicate with the other controllers. Before you read any further, it requires that you have deep knowledge of the CAN bus. The most important thing to realize is that CAN bus is 1:1 communication rather than 1:many. Although most of the time, all the controllers should only communicate with the Master Controller, sometimes there may be a necessity for any one controller to communicate with a specific controller, therefore we need to provide a means to facilitate this. Given below is an example communication interface for one controller.

Each controller shall pick a controller number. The controller with the highest priority shall pick the lowest ID. Using this protocol, each controller can specifically send a message to any other controller, and likewise, upon a received message, we can tell who it came from.

CAN Communication Protocol
Destination Controller (8-bit) B28:B21 Source Controller (8-bit) B20:B14 Message number (13-bit) B13:B00

I recommend a standard similar to the following:

  • Message ID 0x000 for critical message
  • Message ID 0x100 - 0x1ff for "common" message types
  • Message ID 0x200 - 0x2FF for "command" messages
  • Message ID 0x300 - 0x3FF for "subscription" messages
  • Message ID 0x400 - 0x4FF for "subscribed" messages
Geographical Controller Communication Table
Message ID Purpose Data layout Notes
0x100 Report status 1 byte: Error code, 1 byte: CPU usage % ... (etc)
0x200 Set GPS destination 4 bytes(float): Longitude, 4 bytes(float): Latitude
0x301 Subscribe to geographical data byte 0: Subscription rate, 1=1Hz, 5=5Hz, 10=10Hz etc. See message number 0x401 for response data
0x401 Subscribed data of 0x301 4 bytes(float): Longitude, 4 bytes(float): Latitude, 2 bytes(uint16): Compass, 2 bytes (uint16): Desired Heading


The first feature to develop is the self-drive capability and everything else comes later. While some people in the team may be focusing on delivering this primary feature, other members can focus on other things such as automatic headlights, hill-hold capability etc.


Your grade is relative. The best team earns the best grade. Remember than three out of three features working 100% is far better than nine out of ten features working. Focus on less features, with highest quality.