Skip to content

This repository provides a custom QTR-RC sensor driver for the STM32F4 microcontroller and integrates a PID controller for motor control in line-following applications. The driver handles sensor readings, calibration, and error calculations, while the PID controller adjusts motor speeds based on sensor data for precise movement.

License

Notifications You must be signed in to change notification settings

WassimHedfi/QTR_RC-driver-STM32f4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QTR-RC Sensor Driver(STM32F4) and PID Implementation

This repository provides an implementation of a custom QTR-RC sensor driver for the STM32F4 microcontroller and integrates a PID (Proportional-Integral-Derivative) controller to manage motor movement based on sensor data in a line-follower application. This project is noteworthy as it introduces a QTR-RC sensor driver compatible with STM32F4, which is currently unavailable elsewhere.

QTRRC Sensors Other Sensor

Project Structure

The repository is organized into the following folders:

  1. QTR_RC_Driver

    • Contains the implementation of the QTR-RC sensor driver for STM32F4, Successfully tested on STM32F446RE Board.
    • This folder includes essential files for configuring GPIO pins, reading raw sensor values, calibrating the sensors and reading calibrated sensor values.
  2. PID_implementation For Line-follower Application

    • Contains the PID controller code responsible for adjusting motor speeds based on sensor input to maintain desired movement patterns.
    • The PID controller calculates error calculations based on sensor feedback, which requires correction to keep the robot on track, enabling smooth and responsive navigation.
    • Includes functions to manage motor speed and directional adjustments based on PID output.

Key Features

  • Custom QTR-RC Sensor Driver: A newly developed driver for QTR-RC sensors, specifically tailored for the STM32F4 series.
  • PID-Controlled Motor Speed Adjustment for LineFollower Robot: Real-time PID-based adjustments to motor speeds, allowing precise control over robot movement.
  • Modular Structure: Organized into separate modules for sensor interfacing and control logic, making it easy to maintain and expand.

File Descriptions

qtr-rc_driver

  • qtr_rc_driver.h: Header file defining functions and GPIO modes for QTR-RC sensor handling.
  • qtr_rc_driver.c: Source file implementing the QTR-RC sensor reading, calibration, and error calculation logic.

pid_implementation

  • PID_calculation.h: Header file defining PID functions and parameters.
  • PID_calculation.c: Source file implementing the PID control calculations and motor speed adjustments based on sensor feedback.

Getting Started

To use this code with an STM32F4 board:

  1. Clone the repository to your local machine.
    git clone https://github.com/WassimHedfi/QTR_RC-driver-STM32f4.git

About

This repository provides a custom QTR-RC sensor driver for the STM32F4 microcontroller and integrates a PID controller for motor control in line-following applications. The driver handles sensor readings, calibration, and error calculations, while the PID controller adjusts motor speeds based on sensor data for precise movement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages