Difference between revisions of "S22: TBD"
(→Parts List & Cost) |
(→Schedule) |
||
Line 122: | Line 122: | ||
| | | | ||
* Parts testing and prototyping | * Parts testing and prototyping | ||
+ | ** Configure and integrate LSM303 as 3-D compass | ||
| style="background-color:#0F0;" | Completed | | style="background-color:#0F0;" | Completed | ||
Line 133: | Line 134: | ||
* Start research on web application for interfacing with RC car | * Start research on web application for interfacing with RC car | ||
* Finalize GPS and sensor testing | * Finalize GPS and sensor testing | ||
− | ** Verify sensor addresses | + | ** Verify sensor I2C addresses |
+ | ** Debug GPS configuration and interfacing to acquire a GPS lock | ||
| style="background-color:#0F0;" | Completed | | style="background-color:#0F0;" | Completed | ||
Line 171: | Line 173: | ||
* Test LCD peripheral and output debug messages | * Test LCD peripheral and output debug messages | ||
** Configure and command LCD display | ** Configure and command LCD display | ||
+ | * Interface with wheel encoder | ||
+ | * Initial attempt to mount plexi-glass and boards to RC car | ||
+ | * MIA management for DRIVER node | ||
+ | * Verify consistent and reliable sensor values | ||
| style="background-color:#0F0;" | Completed | | style="background-color:#0F0;" | Completed | ||
Line 180: | Line 186: | ||
| | | | ||
* Receive PCB from distributor | * Receive PCB from distributor | ||
− | * Create a mount on the RC car to contain all the hardware | + | ** Create a mount on the RC car to contain all the hardware |
+ | ** Solder parts to PCB | ||
* Fix unit tests for DRIVER, SENSOR, GEO, MOTOR nodes | * Fix unit tests for DRIVER, SENSOR, GEO, MOTOR nodes | ||
* Integrate sensor values with driver logic | * Integrate sensor values with driver logic | ||
Line 186: | Line 193: | ||
** Update motor speed on obstacles detected | ** Update motor speed on obstacles detected | ||
* Test PWM for RC car steering and motor movement | * Test PWM for RC car steering and motor movement | ||
+ | ** Update DBC file for DRIVER_TO_MOTOR steering values (update from [-2, 2] steering range) | ||
* Maintain GPS lock | * Maintain GPS lock | ||
** Verify GPGGA message is parsed correctly | ** Verify GPGGA message is parsed correctly | ||
+ | ** Validate GPS coordinates from GPS module | ||
+ | ** GPS lock indication LED | ||
* Finalize LCD display information | * Finalize LCD display information | ||
** Display current compass heading | ** Display current compass heading | ||
Line 211: | Line 221: | ||
* Clean up hardware | * Clean up hardware | ||
** Wire wrapping, mounting, sensor placements | ** Wire wrapping, mounting, sensor placements | ||
+ | ** Power SJTwo Boards and peripheral from RC car battery using a buck converter | ||
* Stabilize compass readings by callibrating LSM303 | * Stabilize compass readings by callibrating LSM303 | ||
* Test ESPs for Wi-Fi communication | * Test ESPs for Wi-Fi communication | ||
Line 232: | Line 243: | ||
| | | | ||
* Test collision logic for RC controller | * Test collision logic for RC controller | ||
− | ** Ensure LED lights up when DRIVER logic is taking collision logic branch instead of driving towards destination | + | ** Ensure external LED lights up when DRIVER logic is taking collision logic branch instead of driving towards destination |
* Finalize the collision logic | * Finalize the collision logic | ||
− | |||
* Validate SENSOR node | * Validate SENSOR node | ||
** Use ESP32 Wi-Fi modules to send destination location to SENSOR/BRIDGE node | ** Use ESP32 Wi-Fi modules to send destination location to SENSOR/BRIDGE node | ||
Line 242: | Line 252: | ||
** Validate destination_heading calculation | ** Validate destination_heading calculation | ||
** Validate distance_to_destination calculation | ** Validate distance_to_destination calculation | ||
+ | ** Verify specific GPS coordinates for waypoint locations at the parking garage | ||
* Validate DRIVER node | * Validate DRIVER node | ||
** MIA handling for messages from GEO node and SENSOR node | ** MIA handling for messages from GEO node and SENSOR node | ||
* Validate MOTOR node | * Validate MOTOR node | ||
** Verify appropriate PWM signals are applied to RC car motor/steering on receiving motor commands from DRIVER node | ** Verify appropriate PWM signals are applied to RC car motor/steering on receiving motor commands from DRIVER node | ||
+ | * Update LCD screen to display debug information from DRIVER node | ||
+ | ** Display current location and destination location | ||
+ | ** Display RPM of wheels | ||
+ | * Design and implement waypoints algorithm to handle ramp (deadzone) on 6th floor of North Garage | ||
+ | * Turn off LED0-LED3 on all nodes after periodic_callbacks__initialize() function | ||
+ | ** Use this feature to visually observe if the LEDs flash red during testing to indicate if a board is resetting unexpectedly | ||
| style="background-color:#0F0;" | Completed | | style="background-color:#0F0;" | Completed | ||
Line 254: | Line 271: | ||
| 05/25/2022 | | 05/25/2022 | ||
| | | | ||
+ | * Finalize and test Ring LED | ||
+ | ** Add North indication on ring LED | ||
+ | ** Add party mode when destination is reached | ||
+ | ** Checkpoint test: rotate the car in a 360 and verify the North LED indicator always points North | ||
+ | * Integrate and test waypoints algorithm | ||
+ | * Update mobile application | ||
+ | ** Send destination coordinates to SENSOR node | ||
+ | ** Expose debug messages to SENSOR node and then relay info to web app | ||
+ | ** Emergency stop from web app | ||
+ | * Integrated headlights and taillights | ||
+ | ** Headlights are always on | ||
+ | ** Taillights are constantly on when the car is idle | ||
+ | ** Taillights are flashing when car is reversing | ||
+ | * Integrate RPM in MOTOR node to adjust PWM for motor speed | ||
+ | * Reverse logic in DRIVER node when front sensors cannot be avoided | ||
+ | * Web app connected indication LED | ||
+ | * Adjust DRIVER_TO_MOTOR steer values to create smooth steering | ||
* Final testing of full project | * Final testing of full project | ||
** Verify the SENSOR/BRIDGE node receives data from web application | ** Verify the SENSOR/BRIDGE node receives data from web application | ||
Line 260: | Line 294: | ||
** Verify the DRIVER node receives SENSOR messages | ** Verify the DRIVER node receives SENSOR messages | ||
** Verify the MOTOR node sends DBG command messages | ** Verify the MOTOR node sends DBG command messages | ||
+ | ** Verify waypoints algorithm by avoiding ramp area on 6th floor of North Garage | ||
+ | ** Verify obstacle detection and reverse logic | ||
* Finalize wiki report | * Finalize wiki report | ||
− | ** | + | ** Video for Proj Wiki |
| style="background-color:#0F0;" | Completed | | style="background-color:#0F0;" | Completed |
Revision as of 07:40, 27 May 2022
Contents
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
Gitlab Project Link - [1]
<Provide ECU names and members responsible> <One member may participate in more than one ECU>
- Sensor
- Jasdip Sekhon
- Brian Ho
- Justin Stokes
- Motor
- Justin Stokes
- Isaac Wahhab
- Geographical
- Brian Ho
- William Hernandez
- Jasdip Sekhon
- Driver Logic & LCD & LED Ring
- William Hernandez
- Billy Lai
- Isaac Wahhab
- Web Application & Communication Bridge Controller
- Isaac Wahhab
- Billy Lai
- Testing Team
- The Best Driver Team
Schedule
Week# | Start Date | End Date | Task | Status |
---|---|---|---|---|
1 | 02/15/2022 | 02/21/2022 |
|
Completed |
2 | 02/22/2022 | 02/28/2022 |
|
Completed |
3 | 03/01/2022 | 03/07/2022 |
|
Completed |
4 | 03/08/2022 | 03/14/2022 |
|
Completed |
5 | 03/15/2022 | 03/21/2022 |
|
Completed |
6 | 03/22/2022 | 03/28/2022 |
|
Completed |
7 | 03/29/2022 | 04/04/2022 |
|
Completed |
8 | 04/05/2022 | 04/11/2022 |
|
Completed |
9 | 04/12/2022 | 04/18/2022 |
|
Completed |
10 | 04/19/2022 | 04/25/2022 |
|
Completed |
11 | 04/26/2022 | 05/02/2022 |
|
Completed |
12 | 05/03/2022 | 05/09/2022 |
|
Completed |
13 | 05/10/2022 | 05/16/2022 |
|
Completed |
14 | 05/17/2022 | 05/25/2022 |
|
Completed |
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] | 4 | $200.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 |
10 | LEDs for Obstacle Detection and GPS Lock Status | 5 | ||
11 | Wheel Encoder | 1 | ||
12 | Headlights | 2 | ||
13 | Tail Lights | 2 | ||
14 | Level Converters | 1 | ||
15 | Buck Converters | 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: 3 DRIVER SG_ DRIVER_TO_MOTOR_steer : 0|9@1+ (1,-180) [-180|179] "" MOTOR SG_ DRIVER_TO_MOTOR_speed : 9|5@1+ (1,0) [0|31] "RPM" MOTOR SG_ DRIVER_TO_MOTOR_current_rpm : 14|10@1+ (1,0) [0|1023] "RPM" MOTOR
BO_ 33 DRIVER_DEBUG_MSG: 1 DRIVER SG_ DRIVER_DEBUG_MSG_sensor_mia : 0|1@1+ (1,0) [0|0] "" DBG SG_ DRIVER_DEBUG_MSG_geo_mia : 1|1@1+ (1,0) [0|0] "" DBG
BO_ 64 SENSOR_TO_DRIVER_SONARS: 4 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 SG_ SENSOR_TO_DRIVER_SONARS_back : 24|8@1+ (1,0) [0|0] "" DRIVER
BO_ 65 GPS_DESTINATION_LOCATION: 7 SENSOR SG_ GPS_DESTINATION_LOCATION_latitude : 0|28@1+ (0.000001,-134.217727) [-134.217727|134.217728] "" GEO,DRIVER SG_ GPS_DESTINATION_LOCATION_longitude : 28|28@1+ (0.000001,-134.217727) [-134.217728|134.217728] "" GEO,DRIVER
BO_ 66 SENSOR_TO_DRIVER_WHEEL_ENCODER_MSG: 2 SENSOR SG_ SENSOR_TO_DRIVER_WHEEL_ENCODER_MSG_rpm : 0|10@1+ (1,0) [0|0] "RPM" DRIVER,DBG
BO_ 67 SENSOR_TO_DRIVER_APP_CONNECTION_MSG: 1 SENSOR SG_ SENSOR_TO_DRIVER_APP_CONNECTION_MSG_app_connected : 0|1@1+ (1,0) [0|0] "" DRIVER
BO_ 96 GEO_STATUS: 5 GEO SG_ GEO_STATUS_compass_heading : 0|9@1+ (1,0) [0|359] "Degrees" SENSOR,DRIVER SG_ GEO_STATUS_destination_heading : 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_ 97 GEO_DEBUG_MSG: 1 GEO SG_ GEO_DEBUG_MSG_lock_status : 0|1@1+ (1,0) [0|0] "" DRIVER,DBG SG_ GEO_DEBUG_MSG_num_satellites : 1|4@1+ (1,0) [0|15] "" DRIVER,DBG
BO_ 98 GEO_CURRENT_LOCATION_DEBUG: 7 GEO SG_ GEO_CURRENT_LOCATION_DEBUG_latitude : 0|28@1+ (0.000001,-134.217727) [-134.217727|134.217728] "" DRIVER,DBG SG_ GEO_CURRENT_LOCATION_DEBUG_longitude : 28|28@1+ (0.000001,-134.217727) [-134.217728|134.217728] "" DRIVER,DBG
BO_ 99 GEO_CURRENT_DESTINATION_LOCATION_DEBUG: 7 GEO SG_ GEO_CURRENT_DESTINATION_LOCATION_DEBUG_latitude : 0|28@1+ (0.000001,-134.217727) [-134.217727|134.217728] "" SENSOR,DBG SG_ GEO_CURRENT_DESTINATION_LOCATION_DEBUG_longitude : 28|28@1+ (0.000001,-134.217727) [-134.217728|134.217728] "" SENSOR,DBG
BO_ 128 MOTOR_DEBUG_MSG: 3 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 SG_ MOTOR_DEBUG_MSG_echo_rpm : 8|10@1+ (1,0) [0|1023] "RPM" DBG
Sensor ECU
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. Three sensors were placed on the front side of the RC car and one on the back. They use I2C communication to send distance data to the SJ2 microcontroller. On the SJ2 microcontroller, P0.10 was used for SDA, and P0.11 was used for SCL. 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
The ultrasonic sensors use the I2C driver available in the project. The implementation is done in the 10Hz periodic callback function. After writing to the control register address of the ultrasonic sensors, the distance values are read from the appropriate distance. The sensors periodically send sound waves at different times. After the distance values were read, they were sent to the driver for obstacle avoidance.
Technical Challenges
- Ultrasonic sensor interference
- Since we had 3 ultrasonic sensors on the front side sending sound waves, there was interference between them. As a result, the values being read from the sensors were incorrect. To resolve this issue, instead of sending sound waves at once from all the front sensors in the periodic callbacks function, we decided to send them at different times.
- Ultrasonic sensor wiring not secure
- One of the issues we faced was that the sensors would not be connected properly because the RC car was constantly being moved around. A solution was to clean up the wiring and using a PCB. Also, we would use CAN Busmaster to check which sensors were not connected.
Motor ECU
Hardware Design
The hardware design for the motor controller was determined by the hardware of the car. We knew that the cars motors were controller through an electronic speed controller(ESC) and just had to interface the SJ2 with this. The top of the receiver revealed 12 pins, in 4 rows of 3. Each row had the following according the the sticker: GND, VCC, and signal. The signal pin would be hooked up to the pins which are firmware configured to output PWM.
Software Design
Controlling the motors was done through firmware generating PWM signals. We decided to begin by hooking up the car's receiver to a Saleae Logic Analyzer to see the waveforms generated when using the remote control that came with the car. This was helpful in many ways. First, we were able to see which channel was used for the steering servo, and which was used for the actual motor. Second, we were able to see the maximum, minimum, and neutral PWM duty cycles required and the period period of the waveform. Lastly, we were able to visually see the different sequences necessary to run the motors.
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.>
Waypoints Algorithm
Technical Challenges
< List of problems and their detailed resolutions>
1. Compass calibration
* Use magnetic field of current position * Use Magneto software
2. Reliable compass readings
a. Flip the compass upside down for more accurate readings
Resources
1. GPGGA Message Definition [10]
2. LSM303DLHC Datasheet [11]
3. Venus638FLPx GPS Receiver Datasheet [12]
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>
- Add a mobile kill-switch to stop the car
- The car may drive at high speeds and not behave as expected. It is helpful to be able to wirelessly stop the car.
- Unit test code modules to verify expected behavior
- Once your car can move, test outside on the garage.
- Ultrasonic sensors give incorrect readings at steep angles, making testing in the hallway somewhat difficult.
- Compass readings are also more accurate outside the building where there is less interferance.