S19: Lightfury

From Embedded Systems Learning Academy
Revision as of 07:37, 8 May 2019 by Proj user16 (talk | contribs) (Insane Bug)

Jump to: navigation, search

Project Title



LightFury is an autonomous electric car project that aims to bring different embedded system paradigms together and consolidate them with industry level sophistication and robustness. This project will feature an RC car which will employ different sensors and motors to navigate the track without human assistance. Every sensor/motor combined with a dedicated functionality is managed and processed by a controller. Such different controllers will communicate with the master node using the CAN bus protocol. The autonomous car navigation is a result of all electronic module functioning harmoniously to reach the destination location.


The project is divided into 7 modules:

  • Master Controller
  • Motor Controller
  • Sensor Controller
  • GPS Controller
  • Android application and Bluetooth Connectivity
  • Hardware (PCB designing)
  • Testing

Team Members & Responsibilities

<Team Picture>

Project Link: Gitlab Link


Week# Start Date Task Status Completion Date
1 02/12/2019
  • Form Teams and decide group name. Also look up past projects and learn about the autonomous car design.
Completed 02/12/2019
2 02/19/2019
  • Setup Gitlab
  • Order CAN Transceivers. Study CAN communication.
  • Commit and raise merge request by each member to get hold over Gitlab basics
Completed 02/19/2019
3 02/26/2019
  • Setup Gitlab master branch for Project Light Fury. Create and merge branches for development tracking.
Completed 02/26/2019
4 03/05/2019
  • Read previous projects, gather information and discuss among the group members.
  • Distribute modules to each team member.
  • Divide the applications in different module for independent development.
  • Identify the baseline application.
Completed 03/09/2019
5 03/12/2019
  • Identify components required for the project
  • Allocated budget for the project
  • Order Components
Completed 03/19/2019
5 03/19/2019
  • Sensor: Perused the datasheet to get started with development
  • GPS: Went through the datasheet and circuitry details for GPS module(no.)
  • Compass & LCD: Read the respective datasheets and manuals
  • Motor: Getting hold of the specification and the user manuals
  • Android: Design the basic template of the Application
  • BLE: Thorough understanding of the module
Completed 03/26/2019
6 03/26/2019
  • Sensor: Successful interfaced ultrasonic with LPC to get raw data
  • GPS & Compass: Acquire data from GPS and Compass
  • Motor: Basic motor controlled vehicle orientation
  • Android: Interfacing with other modules
  • Unit-testing for each module
Completed 04/02/2019
7 04/02/2019
  • ----SPRING BREAK-----
Completed 04/09/2019
8 04/09/2019
  • Sensor: Parsed the raw data to achieve useful data
  • GPS & Compass: Parsing of raw data to get meaningful values
  • Motor: Take motor feedback through encoder and speed control on ramp
  • Android: Basic Android app
  • BLE: Bridge to receive Driver Heartbeat
Completed 04/16/2019
9 04/16/2019
  • Sensor: Design mounts and stabilize sensor input
  • GPS & Compass: Acquire GPS coordinate after GPS lock, Compass calliberation
  • Motor: Speed control and angle control precision testing
  • Android: Develop User Interface for data display
  • BLE: Interfacing bridge to Android app
  • PCB designing
Completed 04/23/2019
10 04/23/2019
  • Sensor: Analysis for jitters in sensor value
  • GPS & Compass: Range and bearing calculation
  • Motor: Implemented LCD to display motor parameters
  • Android: Adding UI for destination coordinates
  • BLE: Send checkpoints to GeoSensors
  • Master: Testing Sensor Obstacle Distance Limits
  • PCB Designing
Completed 04/30/2019
10 04/23/2019
  • Integration testing with obstacle avoidance
  • Order designed PCB
Completed 04/30/2019
11 04/30/2019
  • Outdoor testing and GPS navigation
Completed 05/07/2019
12 05/07/2019
  • Outdoor testing
Planned 05/14/2019
12 05/14/2019
  • ----FINAL PREP----
Planned 05/22/2019
12 05/22/2019
  • ----DEMO DAY----
Planned 05/22/2019

Parts List & Cost

Item# Part Desciption Vendor Qty Cost
1 RC Car Traxxas 1 From Prof. KaiKai Liu
2 CAN Transceivers MCP2551-I/P Microchip 15 Free Samples
3 Semtec GPS Microchip 1 Free Samples
4 Tilt Compensated Magnetic Compass Amazon 1 $29
5 LIPO Batteries + Charger 1 with car package
6 7" LCD 1
7 RPM 6520 Traxxas Amazon 1 $11.67
8 UltraSonic Sensor Maxbotix 4 $150
9 PCB PCBWay 1 $40.00 (estimated)

Printed Circuit Board

Initial prototyping was done on wire wrapping board for a common CAN bus and power input to all the controllers. Over time on finalizing the layout and components, we designed a PCB to have a compact and stable connections for our electronic and mechanical components. Planned a single PCB to place and route CAN transceivers and eliminate dangling wires.

CAN Communication

With the help of CAN transceivers, each sensor module sends data in DBC format to the controller. The data from ultrasonic sensor helps in obstacle detection. The GPS and Compass Module helps with navigation. The LCD gives live information of component status and values. Finally there is motors and control unit for navigating the car as per the controller commands.

Hardware Design

<Show your CAN bus hardware design>

DBC File

Git Link to DBC file

Sensor ECU

<Picture and link to Gitlab>

Hardware Design

3 ultra sonic sensors are used to detect obstacle on left, front and right of the car. The sensor have 150 inch detection range for obstacle in line of sight. All ultrasonic sensors are mounted upright with upward tilt to avoid ground reflection. The sensors have minimum overlap of detection area and have blind spot too close to the car.

Software Design

The sensors transmit ultrasonic signal for 5us and receive it after 780us. Depending on the obstacle distance an interrupt signal is pulled low on detecting obstacle. The time duration for the detected obstacle after sending the ultrasonic signal is used to calculate obstacle distance. Left and right ultrasonic sensors are triggered together. The front ultrasonic sensor is triggered with some delay.

Technical Challenges

Unreliable sonor sensors values

Problem Summary: Observed lots of false detection for sensor over CAN bus resulting in unwanted motor turning.

Problem Resolution: Reduced noise with the help of mounts to reduce vibration from car.

Reduced range when mounted on car

Problem Summary: Max detection range reduced when mounted on car with mounts.

Problem Resolution: Increased ampere to entire circuit to support complete functionality of sensors.

False triggering due to proximity

Problem Summary: The sensors detected transmitted pulse from adjoining sensors.

Problem Resolution: Revised sensor placement to have minimum overlapping detection range.

Motor ECU

Hardware Design

The traxxas chassis came with ECU and servo controller. It has DC motor with servo control for turning. Working on 3.4 V/ 3000mAH power specifications it has axle to rotate all the four wheels. The feedback for PWM controlled speed attained is fed back through magnetic encoder. The front wheels have servo connection for turning. The chassis is placed on suspension unit for shock absorbing. An acrylic sheet is mounted over certain height on which the PCB and controller is placed. The motor controller sends signals for PWM and servo motor angles for driving the car.

Software Design

The motor gets signal from motor controller. The motor controller sends PWM signals for speed control of DC motor. Also it implements PID for uniform performance on ramp. For direction control, the servo has 2 levels of turning: soft and moderate. Depending on Driver Controller signal, the Motor Controller sends control signals to the motor. In case of communication loss from Master Controller, the Motor Controller displays CAN MIA condition on LED.

Technical Challenges

Finding PID constants

Problem Summary: For uniform speed over ramp, we implemented PID. However, calculating the constants for PID proved to be challenging due to oscillations of set speed.

Problem Resolution: Set discrete speed levels to prevent oscillations. Determined PID constants through trials and errors.

Determining RPM accurately

Problem Summary: No support available for motor encoder reed sensor.

Problem Resolution: After checking values on DSO, we noticed irregular output. We resolved it by using pull up resistor of 1k ohms.

Motor stop functioning before demo

Problem Summary: The motor stopped functioning even with correct power and signal input.

Problem Resolution: Had previously dismantled the chassis for encoder study. Re assembled the chassis to function correctly at demo.

Geographical Controller

<Picture and link to Gitlab>

Hardware Design

Software Design

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

Technical Challenges

<Bullet or Headings of a module>

Unreliable GPS lock

<Problem Summary> <Problem Resolution>

Communication Bridge Controller & LCD

<Picture and link to Gitlab>

Hardware Design

The bridge controller communicates with mobile SJ one board over Xbee. This mobile SJ one board and the mobile application communicate over Bluetooth (HC05). The bridge controller then sends start/stop and monitors heartbeat of Master controller. It sends sensor controller data(distance from obstacle from all three ultrasonic sensor), geo sensor data (source latitude and longitude) and motor controller (speed and servo turning data). In addition to this , it gives checkpoint details and destination details to the geo controller. The communication used by geo controller to communicate with remaining controller is CAN communication. It uses on board LEDs to indicate functionality of Master controller and Xbee transmission.

Software Design

The bridge controller being the controller to communicate with all the controller on the car has to adhere to the data formats send by the respective controllers. Especially when it communicates with mobile SJOne board, it receives data of location in string format, which has to be converted into longitude and latitude. The data from different modules is received in different frequency.

Technical Challenges

<Bullet or Headings of a module>

Insane Bug

<Problem Summary> <Problem Resolution>

Master Module

<Picture and link to Gitlab>

Hardware Design

The master controller is connected to all the controllers through CAN bus. It uses on board LEDs to display funtioning controller. To display sent motor command it sets appropriate numeric value on LED segment.

Software Design

The master controller gets start-stop command from bridge controller which communicates the signal from the mobile application. From ultrasonic sensor it gets distance to obstacle and compares it to threshold value. Then it checks for direction and magnitude from geo sensor input to send motor controller commands for driving and steer control. Also it displays heartbeat for remaining controllers through on board LED.

Technical Challenges

Levels of turning

Problem Summary: For turning on detecting obstacle, the large servo turning value would result in oversensitive behaviour.

Problem Resolution: Set 2 discrete servo levels for turning based on how many ultrasonic sensors are triggered. A moderate turning angle command is sent if two sensors (front or any one of the side sensors) and a soft turn command is sent if only one of the side sensor detects obstacle closer than threshold.

Determining threshold

Problem Summary: The car kept crashing even after detecting obstacle.

Problem Resolution: Determined threshold values through trials and errors. For high speed, large clearance is required for stopping distance. Ideally keep higher threshold value for front sensor than side sensors.

Unresponsive to GEO sensor data

Problem Summary: The motor command responded only to ultrasonic commands and disregarded the geo information even after including it the geo data in motor command decision making.

Problem Resolution: This was a programming bug. Code restructuring and verifying the conditions helped solve this problem. The nested if structure had most frequently used command at the top of nested if, to reduce time lag. This proved unreliable as the frequently used command had ultrasonics default condition which overshadowed the geo data analysis part. Putting this condition to the end of the nested structure helped solve this default behaviour taking precedence everytime. Geo data had same conditions for stop and no data received from geo sensors. Hence the car stopped when no geo data was received. Remedying this with separate constants for each helped solve this problem.

Mobile Application

<Picture and link to Gitlab>

Hardware Design

Software Design

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

Technical Challenges

<Bullet or Headings of a module>

Wifi Link Reliability

<Problem Summary> <Problem Resolution>


<Organized summary of the project>

<What did you learn?>

Project Video

Project Source Code

Advise for Future Students

<Bullet points and discussion>