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.
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
To run the project on car or simulator:
- Download and install Keil uVision IDE (MDK-Arm)
- Download or clone the repository: autonomous-car
- Open the project using Keil uVision
- Run simulation or flash download to car
If you want to run on the car, make sure to:
- Connect the car to the computer using a Micro-B type USB cable
- Connect right pins according to Pin Configurations below
- 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:
- 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.
- MLP:
- Press user push button on the Quickstart Board to start autonomous navigation using MLP model.
- Press it again to stop the navigation.
- SVM:
- Press user push button on the Quickstart Board to start autonomous navigation using SVM model.
- Press it again to stop the navigation.
- 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:
- Multilayer Perceptron (MLP): mlp.c and mlp.h
- Support Vector Machine (SVM): svm.c and svm.h
- 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:
- ACTION_FORWARD_MICROSECOND: Determines how many microseconds the car will go forward for action
Move-Forward
and after taking turns. - ACTION_SHARP_MICROSECOND: Determines how many microseconds the car will turn for action
Sharp-Right-Turn
. - ACTION_SLIGHT_MICROSECOND: Determines how many microseconds the car will turn for actions
Slight-Right-Turn
andSlight-Left-Turn
. - ACTION_FORWARD_SPEED: Determines the motor PWM duty cycle when moving forward for action
Move-Forward
or after taking turns. - ACTION_TURN_SPEED: Determines the motor PWM duty cycle when turning for actions
Sharp-Right-Turn
,Slight-Right-Turn
, andSlight-Left-Turn
.
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 &
- Trigger - T3_MAT_2 - P5.2 - P32
- Echo - T3_CAP_0 - P0.23 - P15
- Trigger - T2_MAT_3 - P0.9 - P11
- Echo - T2_CAP_0 - P0.4 - P34
- Trigger - T2_MAT_3 - P0.9 - P11
- Echo - T2_CAP_1 - P0.5 - P33
- Trigger - T3_MAT_2 - P5.2 - P32
- Echo - T3_CAP_1 - P0.24 - P16
- ENA - PWM0_1 - P1.2 - P30
- ENB - PWM0_2 - P1.3 - P29
- IN1 - P1.24 - P5
- IN2 - P1.23 - P6
- IN3 - P1.20 - P7
- IN4 - P0.21 - P8