Difference between revisions of "S22: TBD"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Printed Circuit Board)
(Printed Circuit Board)
Line 350: Line 350:
 
<br>
 
<br>
 
[[File:Cmpe-243-can-bus-pcb-schematic.png|left|300px|thumb|CAN Bus PCB Schematic]]
 
[[File:Cmpe-243-can-bus-pcb-schematic.png|left|300px|thumb|CAN Bus PCB Schematic]]
[[File:Cmpe-243-can-bus-pcb-board.png|300px|thumb|CAN Bus PCB Board]]
+
[[File:Cmpe-243-can-bus-pcb-board.png|300px|thumb|middle|CAN Bus PCB Board]]
 
[[File:Cmpe-243-rc-car-pcb-schematic.png|900px|RC Car PCB Schematic]]
 
[[File:Cmpe-243-rc-car-pcb-schematic.png|900px|RC Car PCB Schematic]]
 
[[File:Cmpe-243-rc-car-pcb-board.png|500px|RC Car PCB Board]]
 
[[File:Cmpe-243-rc-car-pcb-board.png|500px|RC Car PCB Board]]

Revision as of 05:51, 11 May 2022

Project Title

<TBD>



Abstract

<2-3 sentence abstract>

Introduction

The project was divided into 5 modules:

  • Sensor
  • Motor
  • Geo Controller
  • Driver/LCD Controller
  • Web application

Team Members & Responsibilities

<Team Picture>

Gitlab Project Link - [1]

<Provide ECU names and members responsible> <One member may participate in more than one ECU>

  • Sensor
    • Brian Ho
    • Jasdip Sekhon
  • Motor
    • Billy Lai
    • Link to Gitlab user2
  • Geographical
    • Justin Stokes
    • Link to Gitlab user2
  • Communication Bridge Controller & LCD
    • Isaac Wahhab
    • Link to Gitlab user2
  • Android Application
    • Link to Gitlab user1
    • Link to Gitlab user2
  • Testing Team
    • Billy Lai
    • Link to Gitlab user2


Schedule

Week# Start Date End Date Task Status
1 02/15/2022 02/21/2022
  • Discussed sensors for prototyping, and reviewed previous projects.
Completed
2 02/22/2022 02/28/2022
  • Ordered Parts
Completed
3 03/01/2022 03/07/2022
  • Looking at potential options for additional sensors
Completed
4 03/08/2022 03/14/2022
  • Learning to use CAN BUSMASTER
Completed
5 03/15/2022 03/21/2022
  • Made prototype for project .dbc file
Completed
6 03/22/2022 03/28/2022
  • Discuss and learn how to use Eagle for PCB fabrication
Completed
7 03/29/2022 04/04/2022
  • Parts testing and prototyping
Completed
8 04/05/2022 04/11/2022
  • List hardware requirements for the PCB fabrication
  • Start research on web application for interfacing with RC car
  • Finalize GPS and sensor testing
    • Verify sensor addresses
Completed
9 04/12/2022 04/18/2022
  • PCB Design and meeting to validate design
    • Design and review PCB prototype
    • Get GEO messages and SENSOR messages to the DRIVER node
  • Continue web application research
    • Find a viable framework and IDE for development
  • Test RC car interfacing
    • Verify wheel control motor on the RC car (can move forward and reverse at various speeds)
    • Verify steering control motor on the RC car (can steer left and right)
  • Integrate GPS and sensors on the same CAN bus using different nodes
    • Ultrasonic sensors tested and integrated with SENSOR node
  • Integrate ESP32 to BRIDGE node
  • Milestones:
    • Detect an obstacle and command the RC car motor to stop
Completed
10 04/19/2022 04/25/2022
  • Order first PCB prototype
  • Have a prototype for the web application
    • Test BRIDGE node receiving data from web application
  • Test interacting with the RC car wirelessly
    • Test RC car wheel control from wireless control
    • Test RC car steering control from wireless control
  • Test LCD peripheral and output debug messages
    • Configure and command LCD display
Completed
11 04/26/2022 05/02/2022
  • Receive PCB from distributor
  • Create a mount on the RC car to contain all the hardware
  • Fix unit tests for DRIVER, SENSOR, GEO, MOTOR nodes
  • Integrate sensor values with driver logic
    • Update motor steering on obstacles detected
    • Update motor speed on obstacles detected
  • Test PWM for RC car steering and motor movement
  • Maintain GPS lock
    • Verify GPGGA message is parsed correctly
  • Finalize LCD display information
    • Display current compass heading
    • Display desired direction heading
    • Display distance to destination
  • MIA handling
    • GEO handles GPS DESTINATION LOCATION MIA
    • DRIVER handles SENSOR MIA and GEO STATUS MIA
    • MOTOR handles DRIVER_TO_MOTOR_COMMAND message MIA
Completed
12 05/03/2022 05/09/2022
  • Handle Invalid NODE operation
    • GEO compass with invalid i2c read_byte()
    • GPS not locked, GPGGA message with invalid data
    • SENSOR/BRIDGE with Wi-Fi bridge down
  • Add LCD debug menu to replace analyzing BusMaster messages and remove printf() calls
  • Clean up hardware
    • Wire wrapping, mounting, sensor placements
  • Stabilize compass readings by callibrating LSM303
  • Test ESPs for Wi-Fi communication
  • Test RPM wheel encoder sensor
    • Mount wheel encoder to RC car
    • Add RPM calculation code
    • Verify RPM values are accurate
  • Brainstorm collision logic for RC controller
    • Handle case for stair obstacle
    • Handle sensor data
  • Ring LED interfacing
    • Light up an LED for compass heading
    • Light up an LED for destination heading
In Progress
13 05/10/2022 05/16/2022
  • Test collision logic for RC controller
    • Ensure LED lights up when DRIVER logic is taking collision logic branch instead of driving towards destination
  • Finalize the collision logic
  • Display RPM of wheels
  • Validate SENSOR node
    • Use ESP32 Wi-Fi modules to send destination location to SENSOR/BRIDGE node
    • Test sensor readings given new sensor placements
  • Validate GEO node
    • Stabilize compass readings and ensure North, East, South, and West headings are accurate
    • Validate destination_heading calculation
    • Validate distance_to_destination calculation
  • Validate DRIVER node
    • MIA handling for messages from GEO node and SENSOR node
  • Validate MOTOR node
    • Verify appropriate PWM signals are applied to RC car motor/steering on receiving motor commands from DRIVER node
Incomplete
14 05/17/2022 05/25/2022
  • Final testing of full project
    • Verify the SENSOR/BRIDGE node receives data from web application
    • Verify the GEO node receives GPS destination from SENSOR/BRIDGE node
    • Verify the DRIVER node receives GEO status messages
    • Verify the DRIVER node receives SENSOR messages
    • Verify the MOTOR node sends DBG command messages
  • Finalize wiki report
    • Ensure every section is filled
Incomplete


Parts List & Cost

Item# Part Desciption Vendor Qty Cost
1 RC Car Redcat Racing [2] 1 $139.00
2 SJTwo Boards SJTwo Boards On Amazon [3] 1 $139.00
3 CAN Transceivers (SN65HVD230) Waveshare [4] 4 $40.00
4 LSM303 Triple-Axis Accelerometer and Magnetometer Adafruit [5] 1 $15.00
5 GPS with SMA Connector SparkFun [6] 1
6 Ultrasonic Sensors DFRobot Gravity [7] 4 $52.00
7 PCB JLCPCB [8] 1 $5.00
8 Plexiglass 1
9 Ring LED Sparkfun [9] 1 $11.50
9 Wheel Encoder 1


Printed Circuit Board

<Picture and information, including links to your PCB>

We designed and implemented two PCBs: CAN Bus PCB and RC Car PCB.


CAN Bus PCB Schematic
CAN Bus PCB Board

RC Car PCB Schematic RC Car PCB Board

CAN Communication

<Talk about your message IDs or communication strategy, such as periodic transmission, MIA management etc.>

Our message IDs are arranged with priority given to the nodes in the following order: DRIVER, SENSOR, GEO, MOTOR.

We decided to give 32 message IDs to each node and to separate the nodes' message IDs accordingly.

Node Message ID Range
1 DRIVER 32 - 63
2 SENSOR 63 - 95
3 GEO 96 - 127
4 MOTOR 128 - 159

Hardware Design

<Show your CAN bus hardware design>

DBC File

Gitlab link to our master branch's DBC file

Our DBC file includes the SENSOR, DRIVER, MOTOR, and GEO nodes.

Below are the messages defined in the file:

BO_ 32 DRIVER_TO_MOTOR_CMD: 1 DRIVER

SG_ DRIVER_TO_MOTOR_steer : 0|3@1+ (1,-2) [-2|2] "" MOTOR
SG_ DRIVER_TO_MOTOR_speed : 3|5@1+ (1,0) [0|31] "RPM" MOTOR

BO_ 64 SENSOR_TO_DRIVER_SONARS: 3 SENSOR

SG_ SENSOR_TO_DRIVER_SONARS_front_left : 0|8@1+ (1,0) [0|0] "" DRIVER
SG_ SENSOR_TO_DRIVER_SONARS_front_middle : 8|8@1+ (1,0) [0|0] "" DRIVER
SG_ SENSOR_TO_DRIVER_SONARS_front_right : 16|8@1+ (1,0) [0|0] "" DRIVER

BO_ 65 GPS_DESTINATION_LOCATION: 8 SENSOR

SG_ GPS_DESTINATION_LOCATION_latitude : 0|28@1+ (0.000001,-90.000000) [-90|90] "Degrees" GEO
SG_ GPS_DESTINATION_LOCATION_longitude : 28|29@1+ (0.000001,-180.000000) [-180|180] "Degrees" GEO

BO_ 96 GEO_STATUS: 5 GEO

 SG_ GEO_STATUS_compass_direction : 0|9@1+ (1,0) [0|359] "Degrees" SENSOR,DRIVER
 SG_ GEO_STATUS_destination_direction : 9|9@1+ (1,0) [0|359] "Degrees" SENSOR,DRIVER
 SG_ GEO_STATUS_distance_to_destination : 18|16@1+ (0.1,0) [0|0] "Meters" SENSOR,DRIVER

BO_ 128 MOTOR_DEBUG_MSG: 1 MOTOR

SG_ MOTOR_DEBUG_MSG_echo_steer : 0|3@1+ (1,-2) [-2|2] "" DBG
SG_ MOTOR_DEBUG_MSG_echo_speed : 3|5@1+ (1,0) [0|31] "RPM" DBG




Sensor ECU

<Picture and link to Gitlab> Ultrasonic.png

Hardware Design

We used 4 Gravity DFRobot URM09 ultrasonic sensors. These ultrasonic sensors are used by the RC car for the purpose of obstacle avoidance. They use I2C communication to send distance data to the SJ2 microcontroller. The measurement range is 300cm. It takes in 3.3V supply voltage. Using the I2C driver the registers on the ultrasonic sensors were configured and the distance was read from the specified registers in the datasheet.



Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>



Motor ECU

<Picture and link to Gitlab>

Hardware Design

Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>



Geographical Controller

<Picture and link to Gitlab>

Hardware Design

Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>

Resources

1. GPGGA Message Definition [10]
2. LSM303DLHC Datasheet [11]





Communication Bridge Controller & LCD

<Picture and link to Gitlab>

Hardware Design

Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>



Master Module

<Picture and link to Gitlab>

Hardware Design

Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>



Mobile Application

<Picture and link to Gitlab>

Hardware Design

Software Design

<List the code modules that are being called periodically.>

Technical Challenges

< List of problems and their detailed resolutions>






Conclusion

<Organized summary of the project>

<What did you learn?>

Project Video

Project Source Code

Advise for Future Students

<Bullet points and discussion>

Acknowledgement

References