Skip to content

ozheng2/PID-Autonomous-Robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

PID Autonomous Robot (MicroBlaze Soft-Core)

πŸ“Œ Project Overview

This repository contains the embedded C firmware for an autonomous two-wheeled robot designed to navigate dynamic maze environments. The system is built on the Xilinx Basys3 FPGA (Artix-7), utilizing a MicroBlaze soft-core processor to handle real-time control logic.

Unlike standard microcontroller implementations (e.g., Arduino), this project demonstrates Hardware/Software Co-Design by instantiating a soft processor within programmable logic to interface with custom hardware peripherals.

πŸš€ Key Features

  • Real-Time PID Control: Implemented a custom Proportional-Integral-Derivative (PID) controller to correct motor speed errors in real-time, ensuring straight-line tracking and precise 90-degree turns.
  • Sensor Fusion: Integrates data from Quadrature Encoders (for odometry) and Ultrasonic Sensors (for environment mapping).
  • Hardware-Based Timing: Developed custom drivers using hardware timers to measure ultrasonic echo pulse widths with microsecond precision, offloading timing overhead from the main CPU.
  • State Machine Logic: Features a robust Finite State Machine (FSM) for wall-following behaviors, obstacle avoidance, and maze traversal.

πŸ›  Tech Stack

  • Language: Embedded C
  • Hardware: Xilinx Basys3 FPGA (Artix-7), Digilent PmodHB3 Motor Bridge, HC-SR04 Ultrasonic Sensors
  • Processor: Xilinx MicroBlaze (Soft-Core)
  • Tools: Xilinx Vitis (IDE), Git

πŸ“‚ File Structure

  • main.c - Core application logic containing the PID control loop and State Machine

βš™οΈ System Architecture

The firmware operates on a bare-metal environment (No-OS) on the MicroBlaze processor.

  1. Initialization: Configures GPIO, Timer/Counter, and Interrupt Controller
  2. Control Loop: Reads encoder ticks $\rightarrow$ Calculates Error $\rightarrow$ Computes PID Output $\rightarrow$ Adjusts PWM Duty Cycle
  3. Navigation Logic: The FSM determines the robot's state (e.g., FORWARD, TURN_LEFT, CORRECT_RIGHT) based on filtered sensor inputs

About

Embedded C firmware for a real-time autonomous navigation robot. Runs on a Xilinx Basys3 FPGA using a MicroBlaze soft-core processor, featuring custom PID control loops, quadrature encoder feedback, and ultrasonic obstacle avoidance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages