S22: Firebolt
Contents
FireBolt RC Car
Abstract
Firebolt is battery powered autonomous RC car. The car uses four microcontrollers for communication between the nodes- driver node, motor node, bridge & sensor node, and geological node over the CAN bus. It is interfaced to the mobile application which sends GPS coordinates for the destination location to the driver node and reaches the destination by avoiding any obstacles that comes in the path. For obstacle detection and avoidance it uses Ultrasonic Sensor and makes the decision of steering and maintaining speed after performing calculations based on the bridge and sensor node's data.
Objectives & Introduction
Objectives
The objective of this project is to get hands on experience of application of embedded systems in autonomous vehicles, have understanding of CAN bus communication, CAN database files, TDD and other related tools such as PCAN dongle and Busmaster.
Software side:-
- The car can communicate with an Android application
- Receive coordinates from gps to drive itself to the destination while avoiding obstacles
- Send diagnostic information to the LCD display
- Take care of elevation and make right speeding decisions
- DBC file for all the nodes
Hardware side:-
- Design PCB for four controllers and other necessary components
- Choose good options for mounting the ultrasonic sensors on the car
- Make a good GUI Android application for interfacing with the microcontroller
Introduction
Nodes of the RC Car are:
- Driver Node
- GEO Node
- Sensors and Bridge Node
- Motor Node
- Mobile Application
Team Members & Responsibilities
Priyanka Rai
- Geo Controller
- Integration Testing
- Wiki Page Update
Ritu Patil
- Motor Controller
- Integration Testing
- Wiki Page Update
Ritika Beniwal
- Driver Node
- LCD interfacing
- Integration Testing
- Wiki Page Update
Utsav Savaliya
- Sensor Controller
- Integration Testing
- Wiki Page Update
Dhanush Babu
- Bluetooth module interfacing
- Android App
Schedule
Week# | Start Date | Target Date | Task | Completion Date | Status |
---|---|---|---|---|---|
Week 1 |
|
|
|
|
|
Week 2 |
|
|
|
|
|
Week 3 |
|
|
|
|
|
Week 4 |
|
|
|
|
|
Week 5 |
|
|
|
|
|
Week 6 |
|
|
|
|
|
Week 7 |
|
|
|
|
|
Week 8 |
|
|
|
|
|
Week 9 |
|
|
|
|
|
Week 10 |
|
|
|
|
|
Week 11 |
|
|
|
|
|
Week 12 |
|
|
|
|
|
Parts List & Cost
Item# | Part Desciption | Vendor | Qty | Price($) |
---|---|---|---|---|
1 | RC Car | Traxxas [1] | 1 | 280 |
2 | CAN Transceivers MCP2551-I/P | Comimark [2] | 5 | 8.99 |
3 | Ultrasonic Sensors | Max Botix[3] | 4 | 24.95 |
4 | GPS Breakout Board | Adafruit[4] | 1 | 29.95 |
5 | GPS Antenna | Adafruit[5] | 1 | 19.95 |
6 | RPSMA female to mhf4 | Superbat[6] | 1 | 7.99 |
7 | HC05 bluetooth RF Transceiver | HiLetgo[7] | 1 | 15.99 |
8 | Triple-axis Accelerometer | Adafruit[8] | 1 | 14.95 |
9 | Traxxas RPM Sensor | Traxxas[9] | 1 | 13.76 |
10 | Traxxas Battery and Charger | Traxxas[10] | 1 | 62.95 |
Printed Circuit Board
PCB Schematic
PCB Design
CAN Communication
We use controller area network to broadcast data between the 4 nodes. All nodes are connected to each other through a physically conventional two wire bus. The wires are a twisted pair with 120 Ω resistors at each ends of the bus. 1s and 0s are transmitted as CAN High(0V difference) and Can Low(2v difference). A CAN frame has the following contents:
- Data Length Code (4bits)
- Remote Transmission Request.
- ID extend bit.
- Message ID (11 bit or 29 bit)
- Data bytes( depends on DLC)
- CRC
Arbitration: No two nodes will transmit at the same time because if arbitration. A lower Message-ID has a Higher priority on the CAN bus since 0 is the dominant bit.
Bit Stuffing: CAN bus stuffs extra bits when a long chain of multiple 1's or 0's occur to improve CAN integrity.
DBC File
The DBC file is a simple text file that consists of information for decoding raw CAN bus data to physical values or in human readable form.
Sr. No | Message ID | Message function | Receivers |
---|---|---|---|
Driver command | |||
1 | 300 | speed and steering direction for the motor. | Motor |
2 | 100 | Driver running | Motor, Sensor, Geo |
Sensor Controller | |||
3 | 200 | Sensor sonars from front, back, left ,right sensor | Driver |
Motor Controller | |||
4 | 600 | motor speed, motor direction | Driver |
Geo and Bridge Controller | |||
5 | 250 | Bearing, Heading and Distance | Driver |
Debug messages | |||
6 | Driver Debug | SENSOR,MOTOR,GEO_AND_BRIDGE | |
7 | Motor Debug | SENSOR,MOTOR,GEO_AND_BRIDGE | |
8 | Sensor Debug | SENSOR,MOTOR,GEO_AND_BRIDGE |
The ECUs
In this section we will explain the hardware design, logic and challenges faced during development of every node invloved.
Sensor and Bluetooth ECU
Software Design
Technical Challenges
Neighboring Sensor Interference:
Frequent noisy measurements:
Motor ECU
Hardware Design
The motor node(SJ-2) interfaces primarily interfaces with:
- Traxass Motor ESC over PWM
- Traxass RPM Sensor over GPIO Interrupt
- Traxass Servo Motor over PWM
All these three components have 3 pins each. The functionalities of these pins are mentioned in the table below.
Module | Black | Red | White |
---|---|---|---|
ESC | Ground | Vout : 6 V | PWM Input |
Servo | Ground | Vin : 6 V | PWM Input |
RPM Sensor | Ground | Vin : 6 V | Pulse Output |
Software Design
The motor node acts based on the speed and direction received over CAN bus from the Driver Node. The positive speed values are treated as forward motion and the negative speed values are considered to be the reverse motion of the RC car.
The steering angles are divided into 5-degree segments and the motor node sends the pre-defined pwm duty cycle of the particular segment to the servo motor depending on the angle value received from the driver node.
Technical Challenges
- Firstly, the Traxxas motor ESC and other Traxass parts are members of the Traxxas Hobby Parts family, and they are not intended for development purposes. This is why there are no technical specification documents or any program/development guides available. One needs to test the motor ESC by feeding the PWM duty cycles in various sequences at various duty cycle percentages. We used the Remote control to reproduce some scenarios where the ESC was behaving unexpectedly.
- The ESC configuration changes to the Lipo battery state if the Lipo battery is used. If one switches back to the NiMH battery, then the ESC starts flashing the led in a green-red repeated sequence, and the ESC power button stops working. In this scenario, there is a calibration process that can save your boat and can make the ESC function normally again. Follow this procedure : ESC Calibration
- Another challenge with the motor node program development is that you cannot rely on unit testing. Whoever works on the motor node, should make sure that the sequence of the duty cycles being fed to the ESC produces the expected results on the motor as well. The forward-reverse transitioning and the speed controlling both can be a bit tricky. Also, the hard brake logic can take a while to get working properly.
- Some useful reference values for the ESC are : 15% -> Neutral; 15.8%-> Minimum forward speed, 10%->Full reverse speed.
Geographical And Bridge Controller
Hardware Design
Software Design
Technical Challenges
Driver Node
Driver Node is the master controller. It receives input from sensor and bridge node, processes it to make right decision for controlling the speed and steering direction of the car and finally commands the motor node to drive accordingly. This node is also interfaced to an LCD, which acts as dashboard of the car and displays information such as car speed and distance to destination on the screen.
Hardware Design
Software Design
Technical Challenges
Mobile Application
User Interface
Software Design
Maps Activity
Bluetooth/WIFI
Technical Challenges
Conclusion
Project Video
Project Source Code
Advise for Future Students
Acknowledgement
References
http://socialledge.com/sjsu/index.php/Industrial_Application_using_CAN_Bus