Post by Yousef Elnaggar
Junior Computer and AI Engineering student at Ain Shams University, pursuing a dual degree with the University of East London.
šÆ Excited to share our Control Systems project ā A Position Control System for a Geared DC Motor using a PID Controller! As part of our Control Systems course at Faculty of Engineering, Ain Shams University, my teammate Ahmed Elian and I designed and implemented a closed-loop position control system for a geared DC motor. š§ What We Built: A system that accurately drives a DC motor shaft to any desired angular position between 0° and 180°. The system continuously reads the shaft angle, computes the error, and applies a PID algorithm until the shaft reaches the target position with minimal overshoot and no sustained oscillation. āļø How It Works: - Rotary potentiometer: Coupled to the motor shaft to measure angular position by converting the shaft angle into a proportional analog voltage read by the Arduino's ADC. - Arduino microcontroller: Implements the PID control algorithm in real time and generates the PWM control signal. - L298N H-bridge motor driver: Converts the PWM signal into bidirectional motor drive voltages, enabling clockwise and counterclockwise rotation. - Protractor: Mounted concentrically with the motor shaft to provide a visual reference for verifying the measured angular position. š What We Did: - Recorded step and impulse response data from the real hardware using Python serial logging scripts. - Imported and processed experimental data in MATLAB, converting time from milliseconds to seconds and PWM values to equivalent voltages. - Built a full 3rd-order DC motor transfer function model including all six physical parameters (Km, Kb, J, La, Ra, b) without simplifying assumptions. - Performed system identification using Simulink Parameter Estimator, achieving convergence in four iterations with the cost function dropping from 7.68 to 0.003. - Validated the estimated model using a separate impulse response dataset. - Designed and tuned a PID controller through four Simulink trials, analyzing rise time, overshoot, settling time, and steady-state error. - Implemented the final tuned PID controller on Arduino hardware. š ļø Tools and Technologies Used: - Python: Serial data logging, CSV file generation, and data visualization using Matplotlib. - MATLAB: Data preparation, signal processing, and system analysis. - Simulink: Open-loop motor modeling, system identification using the Parameter Estimator app, and closed-loop PID simulation. - Arduino IDE (C++): Real-time implementation of the PID controller on the hardware. Many thanks to my teammate Ahmed Elian for the great teamwork, and to our instructors Dr. Michael Ibrahim and Eng. Mina Maher for their valuable guidance throughout this project! š„ Watch the demo video here: https://lnkd.in/erkKvp6f #ControlSystems #PIDController #Arduino #MATLAB #Simulink #Python #SystemIdentification #ParameterEstimation #EmbeddedSystems #DCMotor #Engineering #AinShamsUniversity #ComputerEngineering #AIEngineering #StudentProject