Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
/ RobotCar Public archive

Autonomous robot car powered by the Raspberry Pi Pico W

Notifications You must be signed in to change notification settings

ptrpfa/RobotCar

Repository files navigation

Embedded Systems Team 18: Robot Car

Members and Task Allocations

Team Members
Peter Febrianto Afandy
Tng Jian Rong
Lionel Sim Wei Xian
Colin Ng Kar Jun
Muhammad Nur Dinie Bin Aziz

Task Allocations
Peter Febrianto Afandy

  • IR Sensor
  • Barcode Scanning and Recognition (all 3 sizes), and integration with car
  • Side wall detection
  • Optimisations
  • Navigation

Tng Jian Rong

  • User Interface (controls, display of sensor data, map, coordinates)
  • PID Controller
  • Wifi Communications between web interface and car

Lionel Sim Wei Xian

  • Ultrasonic Sensor
  • Obstacle detection with integrated Kalman Filter, and integration with car
  • Navigation
  • Mapping of maze (obstacle, barcode, walls)

Colin Ng Kar Jun

  • User Interface (controls, display of sensor data, map, coordinates)
  • Magnetometer
  • Sensor Fusion
  • Integration of car movement from one grid to another (orientation of car, movement of car)

Muhammad Nur Dinie Bin Aziz

  • Wheel Encoder, Motor, Motor Controller
  • Integration of car movement
  • Assembly of car and integration of different components together
  • Navigation algorithm
  • Integration of car movement from one grid to another (orientation of car, movement of car)

Project Description


Our project is focussed on the development of an autonomous two-wheeled robot car using the Raspberry Pi Pico W as the main microcontroller. The car is able to navigate a predefined map efficiently through the use of advanced navigation algorithms. It is also capable of obstacle detection and avoidance and the decoding of barcodes encoded in the Barcode-39 standard. A PID controller has been implemented into the car to ensure smooth executions during its movement, and the fusion of the different sensors enhances the robot car's performance and robustness through improved decision-making and accuracy.

Program Design


In this section, we will go over the block diagram and modular design of the car. Our project comprises of 8 components, each catered for a particular sensor/aspect of the car:

  • Main (program entrypoint for car to start executions)
  • Navigation and Mapping
  • Wifi
  • Motor
  • Ultrasonic (for obstacle detection)
  • IRLine (for barcode decoding)
  • Encoder (for car movement)
  • Magnetometer (for car direction tracking)

Block Diagram
The block diagram for the robot car is illustrated below. The diagram provides a high-level overview of how the car will be initialised and start up the various components. More details on each part will be provided in the individual flowchart diagrams. Block Diagram

Data Diagram
To illustrate how sensor data and information will be exchanged and its movement throughout the execution process of the robot car, a data diagram is provided below. Data Diagram

Flowchart Diagram
As previously illustrated, the car comprises of many components which each need to be initialised and set up on its own (e.g interrupts, callback functions etc). The individual flowcharts for each component are illustrated below.

Firstly, the main function will be the program entrypoint of the robot car. Its inner workings are illustrated below: Main Flowchart

The other components' flowcharts are illustrated below, in no particular execution order:

First Path
First Path Flowchart

Update Wall
Update Wall Flowchart

Maze (Map) Grid
Maze Grid Flowchart

PID Controller
PID Controller Flowchart

Barcode Decoding
Barcode Flowchart

Ultrasonic (Obstacle Detection)
Ultrasonic Flowchart

Magnetometer
Magnetometer Flowchart

Component List


*Ensure that you have the following components! Sensors

Raspberry Pi

Sensors

Hardware

  • 2 x Car Wheels
  • 1 x Car Chassis
  • 1 x Wire Splitter
  • 1 x Battery Holder
  • 4 x AA Batteries
  • Mounting Plates
  • Nuts and Bolts
  • Jumper Cables (M-M, F-F, M-F)

Wiring Diagram Block Diagram

Project Structure

The program entrypoint for this project resides in the main.c file. References are made by this program to functions and structs stored in the individual components' driver code via libraries enabled by these codes' CMakeLists.txt file.

docs/ (documentation images)

encoder/ (driver code for wheel encoders)

irline/ (driver code for barcode decoding and wall detection)

magnetometer/ (driver code for magnetometer and orientation)

main/ (main program code)

motor/ (driver code for the motors and PID controller)

nav/ (code for navigation algorithms to traverse the map within the shortest amount of time)

ultrasonic/ (code for ultrasonic sensor obstacle detection)

wifi/ (code for SSI and CGI and web server)

README.md (this file)

Build files:
CMakeLists.txt
FreeRTOS_Kernel_import.cmake
pico_extras_import_optional.cmake
pico_sdk_import.cmake

Getting Started


  1. Ensure that all the necessary hardware components are connected to the correct pins on the Raspberry Pi Pico W, and configured properly. Your final car should look something like this: Robot Car
  2. Compile and build main.c, and its required dependencies (all handled in its CMakeLists.txt). Make sure to configure the Wifi SSID and password to connect to your desired network.
  3. Flash your Raspberry Pi Pico W with the generated .uf2 file!
  4. Place the car on a maze map! You can generate a map from here. Your map should look something like this: Map
  5. Using an IP scanner, find the IP address of your Raspberry Pi Pico!
  6. On a device connected to the same network as the Pi, open up a browser and navigate to the car's IP address, then click start! You can test that the car functions as intended by using the ON LED and OFF LED buttons for debugging. UI
  7. Let the car run by clicking the Start Car button 🏎️! You can click on the other buttons to start navigation and reset barcode scans (if any error occurred during scanning) as well.

About

Autonomous robot car powered by the Raspberry Pi Pico W

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •