S20: Bucephalus
Contents
ABSTRACT
Bucephalus is a Self Driving RC car using CAN communication based on FreeRTOS(Hard RTOS). The RC car takes real time inputs and covert it into the data that can be processed to monitor and control to meet the desired requirements. In this project, we aim to design and develop a self-driving car that autonomously navigates from the current location to the destination (using Waypoint Algorithm )which is selected through an Android application and at the same time avoiding all the obstacles in the path using Obstacle avoidance algorithm . It also Increases or Decreases speed on Uphill and downhill (using PID Algorithm)as well as applies breaks at required places. The car comprises of 4 control units communicating with each other over the CAN Bus using CAN communication protocol, each having a specific functionality that helps the car to navigate to its destination successfully.
INTRODUCTION
Objectives of the RC Car:-
1) Driver Controller:- Detection and avoidance of the obstacles coming in the path of the RC car by following Obstacle detection avoidance.
2) Geographical Controller:- Getting the GPS coordinates from the Android Application and traveling to that point using Waypoint Algorithm
3) System hardware communication using PCB Design.
4) Bridge and Sensor Controller:- Communication between the Driver Board and Android Mobile Application using wireless bluetooth commmunication.
5) Motor Controller:- Control the Servo Motor for Direction and DC motor for speed. Implementation of PID Algorithm on normal road uphill and down hill to maintain speed
The project is divided into six main modules:
CORE MODULES OF RC CAR | ||||
---|---|---|---|---|
|
Team Members & Responsibilities
<Team Picture>
Bucephalous GitLab - [1]
- Mohit Ingale GitLab LinkedIn
- Driver and LCD Controller
- Hardware Integration and PCB Designing
- Testing Team / Code Reviewers
- Shreya Patankar GitLab LinkedIn
- Geographical Controller
- Hardware Integration and PCB Designing
- Testing Team / Code Reviewers
- Wiki Page
- Nicholas Kaiser GitLab LinkedIn
- Bridge and Sensor Controller
- Wiki Page
- Hardware Integration and PCB Designing
- Hari Haran Kura GitLab LinkedIn
- Motor Controller
- Testing Team / Code Reviewers
- Hardware Integration and PCB Designing
- Abhinandan Burli GitLab LinkedIn
- Driver and LCD Controller
- Testing Team / Code Reviewers
- Hardware Integration and PCB Designing
Schedule
Week# | Start Date | End Date | Task | Status |
---|---|---|---|---|
1 | 02/16/2020 | 02/22/2020 |
|
|
2 | 02/23/2020 | 02/29/2020 |
|
|
3 | 03/01/2020 | 03/07/2020 |
|
|
4 | 03/08/2020 | 03/14/2020 |
|
|
5 | 03/15/2020 | 03/21/2020 |
|
|
6 | 03/22/2020 | 03/28/2020 |
|
|
7 | 03/29/2020 | 04/04/2020 |
|
|
8 | 04/05/2020 | 04/11/2020 |
|
|
9 | 04/12/2020 | 04/18/2020 |
|
|
10 | 04/19/2020 | 04/25/2020 |
|
|
11 | 04/26/2020 | 05/02/2020 |
|
|
12 | 05/03/2020 | 05/09/2020 |
|
|
13 | 05/10/2020 | 05/16/2020 |
|
|
14 | 05/17/2020 | 05/23/2020 |
|
|
Parts List & Cost
Item# | Part Desciption | Vendor | Qty | Cost |
---|---|---|---|---|
1 | RC Car Chassis | Traxxas | 1 | $250.00 |
2 | Lithium-Ion Battery | 1 | ||
3 | Battery Charger | 1 | ||
4 | Tap Plastics Acrylic Sheet | 1 | ||
5 | Ultrasonic Sensors | Amazon [2] | 4 | |
6 | GPS Module | 1 | ||
7 | GPS Antenna | 1 | ||
8 | Compass Module | 1 | ||
9 | UART LCD Display | 1 | ||
10 | Bluetooth Module | 1 | ||
11 | CAN Transceivers SN65HVD230DR | 15 | Free Samples | |
12 | Sjtwo Board | Preet | 4 | $50.00 |
13 | 12" Pipe | 1 | ||
14 | Android Mobile Phone | 1 | ||
15 | Sensor Mounts | 4 |
Hardware Integration:- Printed Circuit Board
We Initially started with a very basic design of mounting all the hardware on a cardboard sheet for our first round of Integrated hardware testing.
Challenges:- The wires were an entire mess and the car could not navigate properly due to the wiring issues as all the wires were entangling and few had connectivity issues.
Hence we decided to go for a basic dot matrix Design before finalizing our final PCB Design as a Prototype board for testing if anything goes haywire.
The Prototype Board just before the actual PCB board was created on a dot matrix PCB along with all the hardware components for the Intermediate Integrated testing phase is as follows:
1) To avoid all the above challenges We designed the custom PCB using EasyEDA in which we implemented connections for all the controller modules(SJTwo Board LPC4078) all communicating/sending data via CAN bus. The data is sent by individual sensors to the respective controllers. GPS and Compass are connected to Geographical Controller. RPM sensor, DC and Servo Motors are connected to Motor Controller.
2) Ultrasonic are connected to Bridge and Sensor Controller. LCD is connected to Driver Controller. Bluetooth is connected to Bridge and Sensor Controller. CAN Bus is implemented using CAN Transceivers SN65HVD230 terminated by 120 Ohms; with PCAN for monitoring CAN Debug Messages and Data. Some Components need 5V while some sensors worked on 3.3V power supply. Also it was difficult to use separate USB's to power up all boards.Hence we used CorpCo breadboard power supply 3.3V/5V.
3) PCB was sent to fabrication to JLCPCB China which provided PCB with MOQ of 5 with the lead time of 1 week. We implemented 2 layers of PCB with most of the parts in top layer GPS sensor and Compass sensor. We implemented rectangular header connector for SJTwo boards, RPM sensor, DC & Servo Motor on the bottom layer. There were 2 iterations of this board.
4) Challenges :-We also need to change the header for LCD since it was having different pitch.
DESIGNING:-
AFTER DELIVERY:-
CAN Communication
<Talk about your message IDs or communication strategy, such as periodic transmission, MIA management etc.>
Hardware Design
<Show your CAN bus hardware design>
DBC File
Bridge and Sensor 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>
Motor Controller
The Motor Controller SJ2-Board is mainly responsible for RC-Car’s steering and speed to move the car towards the destination. The RC-Car we are using is 2 Wheel Drive which means the front wheels are used for steering which is controlled by servo motor and the rear wheels are used for car’s forward and reverse movements which are controlled by DC Motor through ESC.
Hardware Design
<Motor_Module_Schematic.png>
ESC & DC Motor
<esc.jpg> <motor.jpg>
The ESC(Electronic Speed Control, Traxxas ESC XL-05) and DC Motor we used were provided with the RC car. The DC motor is controlled by ESC using PWM signals provided by the motor controller for forward and reverse movements. We used the 7.4v LiPo battery to power up the ESC. The DC motor is powered by the ESC which has a dc-to-dc converter which converts 7.4v to 6v. ESC can provide high current to the power-hungry DC motor running at faster speeds. ESC has an LED and a button which is used for calibration and setting different modes for the car.
The car can be operated in the following 3 modes: Sport mode(100% Forward, 100% Brakes, 100% Reverse) Racing mode(100% Forward, 100% Brakes, No Reverse) Training mode(50% Forward, 100% Brakes, 50% Reverse)
As we needed more than 50% speed for steep ramps, we used Sport mode. The frequency of the PWM signal fed to the servo motor is 100Hz. Based on the duty cycle set by the user, the car will go forward, reverse, or neutral. 10% - 20% duty cycle for reverse. 15% duty cycle for neutral. 15%-20% duty cycle for the forward motion.
SERVO
<servo.jpg>
The servo motor we used is Traxxas 2075 which was provided with the car and it is responsible for steering the car. It takes the 6V power directly from ESC. The servo motor is controlled directly from the SJ2 micro-controller board. The PWM signal fed to the servo motor is of frequency 100Hz. Based on the duty cycle of the signal sent to the servo, it rotates in the left / right direction. 10% - 20% duty cycle for left. 15% duty cycle for straight. 15%-20% duty cycle for right.
RPM SENSOR
<rpm_sensor.jpg> <trigger_magnet.jpg>
There are two parts to the RPM sensor - one is the trigger magnet and the other is the sensor. The RPM sensor is used as an input to maintain a constant speed of the vehicle. The sensor mounts on the inside of the gear cover, the trigger magnet mounts on the DC motor shaft. The gear cover and motor shaft need to be removed using the toolkit provided along with the RC car. The procedure is similar to this video, but note that the car used in the video is a 4WD RC car by Traxxas. We made use of the trigger magnet attached to the spur gear to trigger a pulse on the sensor for every rotation of the spur gear. These pulses are then read by the SJ2 board to calculate rotations in a second and later convert it to RPM and MPH. The RPM sensor has 3 wires, the white wire is the output wire that provides the pulses to the SJ2 Board, and the other wires are Supply(6V) and GND. We also used a Pull Down 1K Resistor between Supply and RPM output wires.
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>
Driver 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
This project taught us how to work with so many people with same goal but different working patterns to come together and execute their ideas together in tandem to accomplish the team goal. We developed an autonomously navigating RC car. Each team member brought unique skills, passions and personalities to the project. Some team people were skilled with designing and placing components on the PCB Board, while others were skilled in firmware development, project management, catching bugs, organizing meetings etc. Some people had the ability to lighten the mood on disappointing demo days, while others had the management skill to keep the team focused and making the car its best version than the day before, while avoiding burning the team out at each other. When these different minds and their skills came together, it resulted in the final product that we all are extremely proud of, as well as one that performed well on the final demo day. The shelter in place brought more challenges in coordination as we couldn't meet much for in person meetings and everyone needed the hardware for testing their code. It was difficult for a single person who had all the hardware to always test with few members or alone and to explain others where exactly their code was failing.
It wasn't always fun and lively though. We experienced soaring highs, during few of our progress demos, where we hit almost all of our specs. We also experienced devastating lows, when we were not able to demo properly as there were coordination issues offline at the start. While we look back fondly on our project, the reality is that it was the result of 7 graduate students spending almost every day of the semester developing and fine tuning the final product. We failed and succeeded together as a team. The goal was too important. Blame fell on the team as a whole and so did success and praise. We succeeded because we failed together. We succeeded because we didn't let failure break us and instead worked harder to fine tune and improve our test cases so that no case in the testing is left unexplored and the car worked exceptionally well.
There was so much to learn. Always something new, it felt like. We developed a clean and best working PCB, to integrate all of our subsystems together with least number of wires needed and visible on the car, even though none of us had experience developing a board that complex before. We also approached new challenges such as developing an Android Mobile Application, even though none of us knew JAVA or knew Android Studio beforehand. We never stopped learning. We learned the value of investing in quality components. We honed our unit testing skills, trying to write firmware that was as high quality as our hardware. We learned about CANbus on an intimate level and applied all of the knowledge.
Working on this project was a difficult yet ultimately rewarding experience. It taught us how to make use of unit tests so that we don't need hardware at all and this helped alot in online coordination with team members. We can't stress enough how important is to start the project as early as possible in the semester and to keep pushing until the final demo. Each of contributed roughly 20 hours a week to work on the project. As a result, we were exhausted by the end of it, but we also never had to pull nights sometimes to meet the deadlines. We had excellent leadership from our team lead, Mohit, as well as our mentors, Preet and ISA members Aakash, Vignesh. We also had excellent peers in CMPE 243 and are proud of what they achieved as well. Overall, we were happy to be part of this class and we hope that our project will inspire future students to develop electric vehicles.
<What did you learn?>
Project Video
Project Source Code
Advise for Future Students
<Bullet points and discussion>
Acknowledgement
=== References ===