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 based on the bridge and sensor node's input.
Objectives & Introduction
Objectives
- RC car can communicate with an Android application to:
- Receive new coordinates to travel to
- Send diagnostic information to the application
- Emergency stop and start driving
- RC car can travel to received coordinates in an efficient path while avoiding obstacles
- RC car can maintain speed when driving on sloped ground
- Design printed circuit board (PCB) to neatly connect all SJ2 boards
- Design and 3D print sensor mounts for the ultrasonic sensors
- Design a simple and intuitive user interface for the Android application
- Design a DBC file
Introduction
The Firebolt RC car uses 4 SJ2 boards as nodes on the CAN bus
- Driver Node
- GEO Node
- Sensors and Bridge Node
- Motor Node
- Mobile Application
Team Members & Responsibilities
- Priyanka Rai
- Geo Controller
- Bridge and Sensor Controller
- Wiki Page Update
- Ritu Patil
- Motor Controller
- Android Application
- Integration Testing
- Ritika Beniwal
- Driver Node
- PCB Designing
- Wiki Page Update
- Utsav Savaliya
- Sensor Controller
- Driver Node
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 | Cost |
---|---|---|---|---|
1 | RC Car | Traxxas [1] | ||
2 | CAN Transceivers MCP2551-I/P | Comimark [2] | ||
3 | Ultrasonic Sensors | Max Botix[3] | ||
4 | GPS and Antenna | Adafruit[4] | ||
5 | HC05 bluetooth RF Transreceiver | HiLetgo[5] | ||
6 | Triple-axis Accelerometer | Adafruit[6] | ||
7 | Traxxas RPM Sensor | Traxxas[7] | ||
8 | Discrete Electronic Components | Generic[8] | ||
9 | Buck-Boost Voltage Regulator | Generic[9] | ||
10 | Traxxas Telemetry Trigger magnet & holder | Traxxas[10] | ||
11 | Acrylic Sheet | Tap Plastic | ||
12 | Battery | |||
13 | Traxxas Battery and Charger |
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.
Sr. No | Message ID | Message function | Receivers |
---|---|---|---|
Driver Controller | |||
1 | speed and steering direction for the motor. | Motor | |
2 | Destination reached | Sensor | |
Sensor Controller | |||
1 | Sensor sonars from front, back, left ,right sensor | Driver | |
Motor Controller | |||
8 | motor speed, motor direction | Driver | |
Geo and Bridge Controller | |||
1 | Bearing, Heading and Distance | Driver | |
Debug messages | |||
1 | Driver Debug | SENSOR,MOTOR,GEO_AND_BRIDGE | |
1 | Motor Debug | SENSOR,MOTOR,GEO_AND_BRIDGE | |
1 | Sensor Debug | SENSOR,MOTOR,GEO_AND_BRIDGE |
Hardware Design
DBC File
Sensor ECU
Hardware Design
Sensor Controller Schematic
Board Pin Connections
Sensors are interfaced with combination of GPIO, ADC Pins on SJTWo board. Below is the descriptive pin layout:
Software Design
VERSION ""
NS_ : BA_ BA_DEF_ BA_DEF_DEF_ BA_DEF_DEF_REL_ BA_DEF_REL_ BA_DEF_SGTYPE_ BA_REL_ BA_SGTYPE_ BO_TX_BU_ BU_BO_REL_ BU_EV_REL_ BU_SG_REL_ CAT_ CAT_DEF_ CM_ ENVVAR_DATA_ EV_DATA_ FILTER NS_DESC_ SGTYPE_ SGTYPE_VAL_ SG_MUL_VAL_ SIGTYPE_VALTYPE_ SIG_GROUP_ SIG_TYPE_REF_ SIG_VALTYPE_ VAL_ VAL_TABLE_
BS_:
BU_: DRIVER MOTOR BRIDGE_SENSOR GEO
BO_ 100 DRIVER_HEARTBEAT: 1 DRIVER
SG_ DRIVER_HEARTBEAT_cmd : 0|8@1+ (1,0) [0|0] "" BRIDGE_SENSOR,MOTOR,GEO
BO_ 200 SENSOR_SONARS: 5 BRIDGE_SENSOR
SG_ SENSOR_SONARS_left : 0|10@1+ (1,0) [0|0] "cm" DRIVER SG_ SENSOR_SONARS_right : 10|10@1+ (1,0) [0|0] "cm" DRIVER SG_ SENSOR_SONARS_middle : 20|10@1+ (1,0) [0|0] "cm" DRIVER SG_ SENSOR_SONARS_rear : 30|10@1+ (1,0) [0|0] "cm" DRIVER
BO_ 250 DESTINATION_LOCATION: 8 BRIDGE_SENSOR
SG_ DEST_LATITUDE : 0|28@1+ (0.000001,-90.000000) [-90|90] "Degrees" GEO SG_ DEST_LONGITUDE : 28|28@1+ (0.000001,-180.000000) [-180|180] "Degrees" GEO
BO_ 300 DRIVER_TO_MOTOR: 2 DRIVER
SG_ DRIVER_TO_MOTOR_speed : 0|8@1+ (1,0) [-99|99] "mph" MOTOR SG_ DRIVER_TO_MOTOR_direction : 8|8@1- (1,-2) [-2|2] "degree" MOTOR
BO_ 600 MOTOR_SPEED: 4 MOTOR SG_ MOTOR_SPEED_info : 0|16@1- (0.01,-30.01) [-30.01|30.01] "mph" DRIVER, BRIDGE_SENSOR SG_ MOTOR_SPEED_pwm : 16|16@1+ (0.01, 0) [0.01|20.01] "pwm" DRIVER, BRIDGE_SENSOR
BO_ 400 GEO_CONTROLLER_COMPASS: 8 GEO
SG_ HEADING : 0|12@1+ (0.1,0) [0|359.9] "Degrees" DRIVER,BRIDGE_SENSOR SG_ BEARING : 12|12@1+ (0.1,0) [0|359.9] "Degrees" DRIVER,BRIDGE_SENSOR SG_ DISTANCE_TO_DESTINATION: 24|16@1+ (0.1,0) [0|359.9] "Degrees" DRIVER,BRIDGE_SENSOR
CM_ BU_ DRIVER "The driver controller driving the car";
CM_ BU_ MOTOR "The motor controller of the car";
CM_ BU_ SENSOR "The sensor controller of the car";
CM_ BO_ 100 "Sync message used to synchronize the controllers";
CM_ BU_ GEO "To provide raw GPS and compass heading";
CM_ SG_ 100 DRIVER_HEARTBEAT_cmd "Heartbeat command from the driver";
//VAL_ 100 DRIVER_HEARTBEAT_cmd 2 "DRIVER_HEARTBEAT_cmd_REBOOT" 1 "DRIVER_HEARTBEAT_cmd_SYNC" 0 "DRIVER_HEARTBEAT_cmd_NOOP" ; VAL_ 300 DRIVER_TO_MOTOR_direction -2 "MOTOR_direction_HARD_LEFT" -1 "MOTOR_direction_SOFT_LEFT" 0 "MOTOR_direction_STRAIGHT" 1 "MOTOR_direction_SOFT_RIGHT" 2 "MOTOR_direction_HARD_RIGHT" ;
Technical Challenges
Neighboring Sensor Interference:
Frequent noisy measurements:
Motor ECU
Hardware Design
Software Design
Technical Challenges
Geographical And Bridge Controller
Hardware Design
Software Design
Technical Challenges
Driver Node
Hardware Design
The Driver Node has one peripheral connected to it and that is the LCD screen.
Software Design
- Driver Node Flow Chart
Technical Challenges
Mobile Application
User Interface
Software Design
This app has mainly two activities, The main activity and maps activity.
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