DC Motor Control with PID

This project demonstrates how to control two DC motors using position encoding and PID control. The implementation is step-by-step, with several test files included to ensure functionality along the way. The main code files for the project are attached in this repository.

Demonstration Video

I have created a YouTube video demonstrating the DC motor control using PID. Watch the video for a detailed explanation and live demonstration of the project.

Watch on YouTube

Project Overview

The project is designed to control two DC motors with precision using PID control. The key features include:

  • Position Encoding: Tracking the position of the motors for accurate control.
  • PID Control: Implementing PID algorithms to maintain desired motor positions.
  • Step-by-Step Testing: Various test files are provided to verify each part of the implementation.

Code Files

The following are the main code files included in this project:

  1. PID_control_for_2DC.ino: Main implementation file for controlling two DC motors using PID.
  2. encoder_testing_2dc.ino: Test file for verifying the encoder functionality with two DC motors.
  3. dc_motor_test_2dc.ino: Test file for basic DC motor operations.

Hardware

  1. DC Motor with a position encoder
    image

  2. Motor Driver
    image

  3. Arduino Uno

Pin Connection

image

PID implementation

image

Usage

  1. Clone the repository to your local machine:
    git clone [https://github.com/abhismirai10/PID_control_for_DC_motor.git]
  2. Open the desired .ino file in the Arduino IDE.
  3. Upload the code to your Arduino board.
  4. Follow the instructions in each test file to verify functionality step by step.

Contributions

Feel free to contribute to this project by opening issues or submitting pull requests. Any contributions, whether it be improvements, bug fixes, or new features, are welcome.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

Contact

For any questions or suggestions, please open an issue on the GitHub repository or contact me at (email)(abhismirai10@gmail.com).


Thank you for checking out my project!