Swerve drive is a type of omnidirectional robot drive system that allows each wheel to rotate independently, enabling high maneuverability and precision, especially in confined or complex environments. This research focuses on the steering control of a swerve drive using a PID (Proportional-Integral-Derivative) controller applied to a DC motor with magnetic encoder feedback. The main challenge lies in achieving stable and accurate wheel orientation in response to target angles, despite potential mechanical backlash and external disturbances. The objective of this study is to design and implement a closed-loop PID control system capable of minimizing steady-state error, overshoot, and response time. The proposed method involves real-time angle control using an STM32 microcontroller, AS5600 magnetic encoder, and BTS7960 motor driver, with PID parameters tuned through trial-and-error. Experimental results were analyzed by recording transient response data via serial communication and visualizing them with Python and Matplotlib. The best PID parameters (Kp = 30, Ki = 0, Kd = 1300) yielded a delay time of 110 ms, rise time of 110 ms, peak time of 200 ms, settling time of 240 ms, and minimal overshoot (2.69%) without steady-state error. Mechanical analysis further confirmed effective torque and gear ratio utilization. The findings demonstrate that the implemented PID control system ensures accurate and stable steering angle regulation under real-time conditions. This research concludes that PID control with careful tuning is effective for swerve drive steering.
Copyrights © 2025