Difference between revisions of "F14: Self Driving Undergrad Team"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Software Interface)
(Software Implementation)
Line 914: Line 914:
 
     *SHOW SOFTWARE FLOWCHART DIAGRAM
 
     *SHOW SOFTWARE FLOWCHART DIAGRAM
  
=== Software Implementation ===
+
=== Software Interface===
 
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.
 
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.
  

Revision as of 22:06, 30 November 2014

Contents

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

In Memory of Chi Lam

June 7th, 1991 - October 27th, 2014

This project is dedicated to Chi Lam, a beloved friend, dedicated Computer Engineering student, and member of this team.

You will be missed, friend.

Self-Driving Autonomous Car

Abstract

The objective of the project is to create a self-driving autonomous car in a 15 person team. The car utilizes several components and sensors in order to get from Point A to Point B. Implementation of the car involves multiple SJONE processor boards using FreeRTOS to communicate with each other via CAN bus.

Objectives & Introduction

Show list of your objectives. This section includes the high level details of your project. You can write about the various sensors or peripherals you used to get your project completed.

CmpE243 F14 TUndergrad HighLevelDiagram.jpg

Team Members & Responsibilities

Master Controller Team
Charles Pham Joshua Ambion Michael Schneider
- Overall vehicle logic
- Overall software vehicle Integration
- CAN TX/RX messages architecture
- Vehicle hardware
- Assistant to other teams
- Module specific logic
- Module specific logic
- CAN RX processing
Motor Controller Team
Nikko Esplana Chi Lam
- Motor/steering control via PWM signals
- interface/test/attach wheel encoder
- Rest in peace Chi!
Sensor Controller Team
Sanjay Maharaj Wei-chieh "Andy" Lo
- -
Geographical Controller Team
Carlos Fernandez-Martinez Zach Baumgartner Albert Chen
- Compass calibration/integration - GPS testing/integration - CAN communication
Bridge Controller Team
Robert Julius Tim Martin Joseph Bourne
- Android Application - Bluetooth Message Interface - Board to CAN Communication
IO Controller Team
Devin Villarosa George Sebastian
- -

Schedule

Show a simple table or figures that show your scheduled as planned before you started working on the project. Then in another table column, write down the actual schedule so that readers can see the planned vs. actual goals. The point of the schedule is for readers to assess how to pace themselves if they are doing a similar project.


Final Product Schedule

Week# Date Task Actual
1 10/12 CAN Network Benchtest Complete
2 10/15 Basic CAN Communication Complete
3 10/31 Secure devices to R/C car Complete
4 11/7 Basic Vehicle Self-Driving Test In progress
5 11/14 P2P testing and improved obstacle avoidance In progress
6 11/31 Buffer time for previous tasks and increased vehicle speed In progress

Sensor Controller Schedule

Week# Date Task Actual
1 10/13 Sensor Input Distance Calibration Incomplete: Sonar is mostly calibrated, IR still needs work. Need sensor value "filtering" logic.
2 10/17 Off car CAN network test (full team) Completed. Able to send raw sensor value to master.
3 10/20 Interface Sensors with CAN Completed. Updates to the formatting of data being sent is ongoing.
4 10/27 Mount Sensors and test coverage Completed. Still need to mount with actual brackets.
5 10/31 Mount Sensors with 3d printed brackets Completed. IR brackets to be printed based on offset.
6 11/1 Implement diagnostic LED patterns In progress.
7 11/3 Send obstacle avoidance decisions to master Completed. Raw values sent to master for processing.
8 11/4 Add RJ11 cabling to all sensors Completed. Still need to make neat and tidy.
9 11/10 Implement speed sensitivity In progress
10 11/13 Test sensors during outdoor runs In progress
11 11/17 Check wiring and label parts In progress
12 11/24 Continue testing and tuning as necessary In progress

Motor Controller Schedule

Week# Date Task Actual
1 10/12 Open up servo and motor modules,

find a speed sensor

Complete
2 10/19 Interface/test PWM bus to steering servo and DC motor Complete
3 10/26 Allow self-driving capability with master/bridge/sensor teams Incomplete, only partial self-driving achieved
4 11/2 Improve fine motor movements with master/sensor teams In progress
5 11/9 Once wheel encoder comes in, learn/test/implement onto car In progress
6 11/16 Integrate wheel encoder with rest of car In progress
7 11/23 Test for proper operation In progress
8 11/30 Continue testing until proper operation In progress

I/O Schedule

Week# Date Task Actual
1 10/4 Create LCD Screen Library (create ability to set value, get value, and write string to LCD screen) 10/4 (String function completed on ~10/18)
2 10/4 Create LCD Screen GUI (generate forms for debugging and general usage) 10/4
3 10/11 LCD Library Test (Do unit tests on individual functions for LCD library)

Ability to get value from gauge on screen.

Ability to set value to gauge on screen.

Ability to send a string value to screen.

10/11 (Finished string function on ~10/18)
4 10/11 Interface LCD with CAN

Create task for LCD event loop.

Create task for Receiving on CAN.

Complete (Completed on 10/26/2014)
5 10/18 Test LCD with CAN

Process CAN Messages from system

Complete (Completed on 10/25/2014)
6 10/25 Implement onto Final Product Incomplete (ready for implementation)
7 11/2 Headlights for car (hardware and software) + Aesthetics for GUI + Clean up code

Communication Bridge and Android Schedule

Week# Date Task Actual
1 10/13 CAN Network Test Complete
2 10/20 Interface Bluetooth Module with CAN Complete
3 10/27 Mount PCB on car In progress
4 11/3 Create basic Android application Completed on 10/18
5 11/10 Add map onto the Android application In Progress
6 11/17 Send/receive CAN Messages via Android Application Sending completed on 10/18, receiving in progress
7 11/24 Debug and Optimize Android Application In progress
8 12/1 Continue Debugging and Optimizing as Necessary In progress

Geographical Controller Schedule

Week# Date Task Actual
1 10/8 Interface with GPS/Compass Completed no issues encountered
2 10/15 Finish core API In progress
3 10/22 GPS get fix and receive raw data In progress
4 10/22 Compass determine heading In progress
5 10/29 Self calibration completed In progress
6 10/29 GPS parse raw data to extract needed data In progress
7 10/29 Compass use heading from GPS to improve accuracy In progress
8 11/5 Improve GPS satellite procurement (antennae?) In progress
9 11/12 Improve boot up time of GPS module via warm start In progress
10 11/12 Fine tune compass calibration technique for accuracy In progress
10 12/3 Buffer time for completion of previous tasks In progress


Master Controller Schedule

Line Item # Expected End Date Task Status
1 10/15/14 Decide on raw CAN struct architecture Early completion
2 10/18/14 Develop and layout general common CAN messages On-time completion
3 10/20/14 Design vehicle initialization procedure Early completion
4 10/23/14 Develop and layout Inter-Controller Communication - Each Module's CAN messages Early completion
5 10/25/14 Design vehicle initial running freed drive mode procedure - Controlled via Phone, no object detection and avoidance, no GPS, no Heading Early completion
6 10/28/14 Complete design on vehicle running free drive mode procedure On-time completion
7 10/30/14 Design vehicle initial running indoor drive mode procedure - Timed autonomous drive , object detection and avoidance, (possibly heading), and no GPS In progress
8 11/01/14 All CAN message definitions complete Early Completion
9 11/02/14 Design vehicle initial running gps drive mode procedure - Full autonomous drive , object detection and avoidance, heading and GPS In progress
10 11/05/14 All CAN message receive processing complete In progress
11 11/14/14 All basic vehicle functionality state machines implemented and verified In progress
12 11/15/14 Complete design on vehicle running indoor drive mode procedure In progress
13 11/20/14 Complete design on vehicle running gps drive mode procedure In progress
14 11/30/14 Any additional advanced functionality implemented and verified In progress

Parts List & Cost

Line Item# Part Desciption Vendor Part Number Qty Cost ($)
1 CAN Board Waveshare International Limited SN65HVD230 15 92.00
2 Traxxas Slash Pro 2WD Short-Course R/C Truck Traxxas 58034 Slash 1 337.00
3 Adafruit Ultimate GPS Breakout Adafruit MTK3339 1 39.95 + (4.685 Shipping)
4 Triple-axis Accelerometer+Magnetometer (Compass) Board Adafruit LSM303 1 14.95 + (4.685 Shipping)
5 3.5" Intelligent module w/ Touch 4D Systems uLCD 35DT 1 89.00
6 2GB microSD Card
7 uUSB-PA5 Programming Adaptor
8 150mm 5 way Female-Female jumper cable
9 5 way Male-Male adaptor
10 Sharp Infrared Range Finder 4D Systems GP2Y0A21 2 9.95 + 3.32 Shipping
12 SainSmart Sonar Ranging Detector Amazon HC-SR04 3 5.59
13 RC LED Headlights Amazon Prime 2 5.99
14 XBee Bluetooth
15
Additional Shipping $$$.$$
Total Cost $$$.$$

Design & Implementation

The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.

Hardware Design

    Discuss System Level Hardware Design
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

Sensor Controller Team Hardware Design

    Discuss your hardware design of Sensor Controller
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

Motor Controller Team Hardware Design

    Discuss your hardware design of Motor Controller
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

I/O Team Hardware Design

    Discuss your hardware design of I/O
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

I/O Pin Connections

Line Item# Pin SJONE Board Pin Description
1 1 (LCD +5V) 5.5V uLCD 35DT LCD Power
2 7 (LCD GND) GND uLCD 35DT LCD Ground
3 5 (LCD RX) RX3 uLCD 35DT LCD Receive Pin
4 3 (LCD TX) TX3 uLCD 35DT LCD Transmit Pin
5 +3.3V 3V3 SJOne Power
6 +3.3V 3V3 SJOne Power
7 GND GND SJOne Ground
8 UART2 RX RX SJOne RX
9 UART2 TX TX SJOne TX
10 +5V GPIO P2.0 White LED1
11 +5V GPIO P2.1 White LED2
12 +5V GPIO P2.2 Red LED1
13 +5V GPIO P2.3 Red LED2
14 CAN Tx P0.X (Tx) SJOne - CAN Tx
15 CAN Rx P0.X (Rx) SJOne - CAN Rx
16 CAN Power 3.3V SJOne - CAN Power
17 CAN Ground GND SJOne - CAN Ground

Communication Bridge + Android Hardware Design

    Discuss your hardware design of Communication Bridge and Android
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

Communication Bridge Pin Connections

Line Item# Pin SJONE Board Pin Description
1 Tx (Bluetooth) P0.10 (TXD2) Bluetooth Transmit
2 Rx (Bluetooth) P0.11 (RXD2) Bluetooth Receive
3 CAN Tx P0.X (Tx) SJOne - CAN Tx
4 CAN Rx P0.X (Rx) SJOne - CAN Rx
5 CAN Power 3.3V SJOne - CAN Power
6 CAN Ground GND SJOne - CAN Ground

Geographical Controller Team Hardware Design

    Discuss your hardware design of Geographical Controller
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS
    

Master Controller Team Hardware Design

    Discuss your hardware design of Master Controller
    *INCLUDE BLOCK DIAGRAM and PIN CONNECTIONS

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.

SYSTEM LEVEL HARDWARE INTERFACE INTERFACE GOES HERE


Sensor Controller Team Hardware Interface

    Describe how your hardware communicates. WHAT BUSes were used
    *SHOW HOW FRAMES ARE SENT

Motor Controller Team Hardware Interface

    Discuss your hardware design of Motor Controller
    *SHOW HOW FRAMES ARE SENT

I/O Team Hardware Interface

    Discuss your hardware design of I/O
    *SHOW HOW FRAMES ARE SENT

Communication Bridge + Android Hardware Interface

    Discuss your hardware design of Communication Bridge and Android
    *SHOW HOW FRAMES ARE SENT

123

Geographical Controller Team Hardware Interface

    Discuss your hardware design of Geographical Controller
    *SHOW HOW FRAMES ARE SENT
    

Master Controller Team Hardware Interface

    Discuss your hardware design of Master Controller
    *SHOW HOW FRAMES ARE SENT

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.

SYSTEM LEVEL SOFTWARE DESIGN GOES HERE

Sensor Controller Team Software Design

    Describe how your hardware communicates. WHAT BUSes were used
    *SHOW SOFTWARE FLOWCHART DIAGRAM

Motor Controller Team Software Design

    Discuss your hardware design of Motor Controller
    *SHOW SOFTWARE FLOWCHART DIAGRAM

I/O Team Software Design

    Discuss your hardware design of I/O
    *SHOW SOFTWARE FLOWCHART DIAGRAM

Communication Bridge + Android Software Design

    Discuss your hardware design of Communication Bridge and Android
    *SHOW SOFTWARE FLOWCHART DIAGRAM

Geographical Controller Team Software Design

    Discuss your hardware design of Geographical Controller
    *SHOW SOFTWARE FLOWCHART DIAGRAM
    

Master Controller Team Software Design

    Discuss your hardware design of Master Controller
    *SHOW SOFTWARE FLOWCHART DIAGRAM

Software Interface

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.

SYSTEM LEVEL SOFTWARE IMPLEMENTATION GOES HERE

Sensor Controller Team Software Interface

    Describe steps to communicate hardware
    

Motor Controller Team Software Interface

    Describe steps to communicate hardware

I/O Team Software Interface

    Describe steps to communicate hardware

Communication Bridge + Android Software Interface

    Describe steps to communicate hardware

Geographical Controller Team Software Interface

    Describe steps to communicate hardware
    

Master Controller Team Software Interface

    Describe steps to communicate hardware

CAN Communication Table

Common CAN Communication Table

Master msgNum MasterMsgRate Master Msg Description Master data payload Module(s) listening Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x100 1hz Heartbeat request N/A 0x100 to everyone, 0xY00 to master, io motor 0x200, sensor 0x300, geo 0x400, bridge 0x500, io 0x600 N/A Heartbeat response timestamp:uint32_t:dwords[0], module_state:uint8_t:bytes[4]
0x101 1hz Sync Vehicle State vehicle_state:uint8_t:bytes[0] 0x101 to everyone
0x440 to everyone 0x440 1hz Sync Time timestamp:uint32_t:dwords[0]

Motor CAN Communication Table

Master msgNum MasterMsgRate Master Msg Description Master data payload Module(s) listening Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x121 20hz Get Torque & Steering Request N/A 0x221 to master, io 0x221 N/A torque value, and wheel angle value torque:float(32bits):dwords[0], angle:float(32bits):dwords[1]
0x122 N/A Set torque value torque:float(32bits):dwords[0] 0x122 to motor
0x123 N/A Set angle value angle:float(32bits):dwords[0] 0x123 to motor

Sensor CAN Communication Table

Module(s) listening Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x330 to master, io 0x330 10hz Distances (in cm) of front left, front, front right, rear left, rear, rear right frontLeftDistance:uint8_t:bytes[0], frontDistance:uint8_t:bytes[1], frontRightDistance:uint8_t:bytes[2], rearLeftDistance:uint8_t:bytes[3], rearDistance:uint8_t:bytes[4], rearRightDistance:uint8_t:bytes[5]


GEO/ GPS CAN Communication Table

Master msgNum MasterMsgRate Master Msg Description Master data payload Module(s) listening Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x441 to master, io 0x441 10hz Current GPS Coordinates latitude:float(32bits):dwords[0], longitude:float(32bits):dwords[1]
0x445 to master, io 0x445 10hz Heading and Bearing heading:float(32bits):dwords[0], bearing:float(32bits):dwords[1]
N/A Send Destination GPS heading:float(32bits):dwords[0], bearing:float(32bits):dwords[1] 0x140 to geo
N/A Calibrate compass N/A 0x14A to geo
N/A Get Compass Heading N/A 0x14B to geo
N/A Get GPS N/A 0x14C to geo
N/A Get Time N/A 0x14D to geo

GEO/ GPS CAN Communication Table

Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x050 to master 0x050 N/A Switch to Free Drive Mode N/A
0x051 to master 0x051 N/A Switch to GPS Drive Mode N/A
0x052 to master 0x052 N/A Switch to Indoor Drive Mode N/A
0x053 to master 0x053 N/A Set Destintation GPS Coordinates latitude:float(32bits):dwords[0], longitude:float(32bits):dwords[1]
0x055 to master 0x055 N/A Start Driving Command N/A
0x056 to master 0x056 N/A Vehicle Turn Off N/A
0x057 to master 0x057 N/A Vehicle Turn On N/A
0x058 to master 0x058 N/A Free Mode Turn Left OMIT
0x058 to master 0x058 N/A Free Mode Turn Left OMIT
0x059 to master 0x059 N/A Free Mode Go Straight OMIT
0x05A to master 0x05A N/A Free Mode Turn Right OMIT
0x05B to master 0x05B N/A Free Mode Stop OMIT
0x05C to master 0x05C N/A Free Mode Reverse Left OMIT
0x05D to master 0x05D N/A Free Mode Reverse Straight OMIT
0x05E to master 0x05E N/A Free Mode Reverse Right OMIT

GEO/ GPS CAN Communication Table

Module(s) listening Module msgNum Module(s) msgRate Module(s) Msg Description Module(s) data payload
0x060 to master 0x060 N/A Switch to Free Drive Mode N/A
0x061 to master 0x061 N/A Switch to GPS Drive Mode N/A
0x062 to master 0x062 N/A Switch to Indoor Drive Mode N/A
0x063 to master 0x063 N/A Vehicle Turn On N/A
0x064 to master 0x064 N/A Vehicle Turn Off N/A
0x065 to master 0x065 N/A latitude:float(32bits):dwords[0], longitude:float(32bits):dwords[1] N/A
0x066 to master 0x066 N/A Start Driving Command N/A

Master TX Format (refer to ID structure for module's TX format)

Modules IDs
Everyone 0x100 - 0x11F
Motor 0x120 - 0x12F
Sensor 0x130 - 0x13F
Geo/ GPS 0x140 - 0x14F
Bridge 0x150 - 0x15F
IO 0x160 - 0x16F

Testing


Sensor Controller Testing

Sensor Controller Testing #1

Describe how you tested the Sensors


Motor Controller Testing

Motor Controller Testing #1

Describe how you tested the motors


I/O Testing

I/O Testing #1

Describe how you tested the I/O Device


Communication Bridge + Android Testing

Communication Bridge + Android Testing #1

Describe how you tested the Communication Bridge + Android


Geographical Controller

Geographical Controller

Describe how you tested the Geographical Controller


Master Controller

Master Controller Testing #1

Describe how you tested the Master Controller


Technical Challenges

Sensor Controller Team Issues

MY ISSUE #1 TITLE

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

MY ISSUE #2 TITLE

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Motor Controller Team Issues

Motor Controller Issue #1

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Motor Controller Issue #2

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

I/O Team Issues

I/O Team Issue #1

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

I/O Team Issue #2

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Communication Bridge + Android Team Issues

Communication Bridge + Android Issue #1

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Communication Bridge + Android #2

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Geographical Controller Issues

Geographical Controller #1

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:


Geographical Controller #2

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

Master Controller Team Issues

Master Controller Issue #1

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:


Master Controller#2

PROBLEM:

RESOLUTION:

FUTURE RECOMMENDATIONS:

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

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.