Skip to content

sercanersoy/autonomous-car

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Car

This repository is for our CmpE492 Senior Project. We developed an autonomous car using LPC4088 MCU whose task is to follow the walls of a room in clockwise direction. The car has 4 ultrasonic sensors which are on the front, left, right and back sides of the car. It has 4 wheels controlled in two groups.

The image on the left shows one of its sensors. We used HC-SR04 ultrasonic sensors and included their user manual below. The image in the middle shows the wheels on one side of the car. The image on the right shows the placement of the 4 sensors on the car.

Presentation & Poster

Video Presentation: CMPE492_Presentation
Poster: CMPE492_Poster
Navigation Video for Decision Tree Model: DT_Navigation_Video
Navigation Video for Multilayer Perceptron Model: MLP_Navigation_Video

How to Run

Autonomous Car

To run the project on car or simulator:

  1. Download and install Keil uVision IDE (MDK-Arm)
  2. Download or clone the repository: autonomous-car
  3. Open the project using Keil uVision
  4. Run simulation or flash download to car

If you want to run on the car, make sure to:

  1. Connect the car to the computer using a Micro-B type USB cable
  2. Connect right pins according to Pin Configurations below
  3. Connect sensors and motor driver to voltage

You can change the macro definition in the beginning of the main.c file to update the operation mode. There are 4 modes:

  1. TEST:
    • Ultrasonic sensors can be tested. If the sensor reading is smaller than 15 centimeters, corresponding LED on the Quickstart Board will be turned off.
    • Actions can be tested. Press user push button on the Quickstart Board to take each action one by one.
  2. MLP:
    • Press user push button on the Quickstart Board to start autonomous navigation using MLP model.
    • Press it again to stop the navigation.
  3. SVM:
    • Press user push button on the Quickstart Board to start autonomous navigation using SVM model.
    • Press it again to stop the navigation.
  4. DT:
    • Press user push button on the Quickstart Board to start autonomous navigation using DT model.
    • Press it again to stop the navigation.

Each model is implemented in a separate file. You can check and modify them as you like:

  1. Multilayer Perceptron (MLP): mlp.c and mlp.h
  2. Support Vector Machine (SVM): svm.c and svm.h
  3. Decision Tree (DT): decision_tree.c and decision_tree.h

You can modify the car's actions by updating below macros in action.c file:

  1. ACTION_FORWARD_MICROSECOND: Determines how many microseconds the car will go forward for action Move-Forward and after taking turns.
  2. ACTION_SHARP_MICROSECOND: Determines how many microseconds the car will turn for action Sharp-Right-Turn.
  3. ACTION_SLIGHT_MICROSECOND: Determines how many microseconds the car will turn for actions Slight-Right-Turn and Slight-Left-Turn.
  4. ACTION_FORWARD_SPEED: Determines the motor PWM duty cycle when moving forward for action Move-Forward or after taking turns.
  5. ACTION_TURN_SPEED: Determines the motor PWM duty cycle when turning for actions Sharp-Right-Turn, Slight-Right-Turn, and Slight-Left-Turn.

Jupyter Notebook

You can run the Jupyter Notebook using:

cd path-to-project/autonomous-car
jupyter notebook .

If you want to detach the process from the terminal:

cd path-to-project/autonomous-car
nohup jupyter notebook . &> /dev/null &

Pin Configurations

Timer

Ultrasonic Sensor 0

  • Trigger - T3_MAT_2 - P5.2 - P32
  • Echo - T3_CAP_0 - P0.23 - P15

Ultrasonic Sensor 1

  • Trigger - T2_MAT_3 - P0.9 - P11
  • Echo - T2_CAP_0 - P0.4 - P34

Ultrasonic Sensor 2

  • Trigger - T2_MAT_3 - P0.9 - P11
  • Echo - T2_CAP_1 - P0.5 - P33

Ultrasonic Sensor 3

  • Trigger - T3_MAT_2 - P5.2 - P32
  • Echo - T3_CAP_1 - P0.24 - P16

PWM

Motor Driver

  • ENA - PWM0_1 - P1.2 - P30
  • ENB - PWM0_2 - P1.3 - P29

GPIO

Motor Driver

  • IN1 - P1.24 - P5
  • IN2 - P1.23 - P6
  • IN3 - P1.20 - P7
  • IN4 - P0.21 - P8

User Manuals

Articles Read

About

Autonomous Car for CmpE492 Senior Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published