Design and Simulation of a Closed-Loop DC Motor Position Control System Based on Arduino
Abstract
The DC motor is affected by hysteresis characteristics, resulting in large steady-state errors and poor positioning accuracy with open-loop control; therefore, open-loop control is not suitable. To verify the PID closed‑loop control logic in a cost‑effective way, this study uses the Tinkercad simulation environment to build a test circuit that includes an Arduino main controller, L293D driver chip, DC motor, and adjustable potentiometer. The potentiometer is connected to the A0 analog pin of the microcontroller to simulate angle sampling, without mechanical coupling between the device shafts. First, the Arduino program reads the potentiometer value on pin A0, maps the 0–1023 range to 0–180 degrees, and calculates the error relative to the 90-degree target angle. PID output is restricted within the 0–255 PWM range and regulates motor rotation direction through L293D pins. The potentiometer serves as simulated angular feedback, and the setup excludes direct mechanical drive from the motor shaft to the potentiometer. Simulation test results show that the system can automatically adjust the PWM output magnitude and motor direction based on real-time errors, the closed-loop control logic operates stably, and it can follow the target angle to complete position adjustment. The significance of this study lies in the use of virtual simulation to debug the control scheme in advance, reducing the cost of processing physical components, quickly verifying the practicality of PID, shortening prototype debugging cycles, and saving experimental materials. On the other hand, the low-cost design approach based on Arduino can lower the barrier to implementing motor closed-loop control systems, providing a reference solution for position control system design in small electromechanical devices and teaching experimental equipment, and has practical significance for popularizing embedded motor closed-loop control in engineering practice.
References
- Li, J. R., Chen, C. H., & Deng, F. (2026). Design and teaching practice of spectrophotometer based on open-source platform under STEM vision: A case of digital exploration on chemical equilibrium shift.Journal of Education and Equipment Research(6), 8–14.
- Yang, J. Y., & Su, L. (2026). UAV control system based on embedded structure and neural network PID.Machine Design and Manufacturing Engineering, 55(4), 41–45.
- Zhang, K. X., Chu, Q. H., Zhang, C., Jiang, C. F., Hao, S. G., & Li, J. (2013). Research on dual closed-loop position control algorithm for DC motor actuator of EGR system.Chinese Internal Combustion Engine Engineering, TK403, 45–51.
- Liang, J. H., & Zhou, K. (2022). Research on experimental teaching of motor PID control based on Tinkercad virtual simulation.Laboratory Science, 25(4), 89–92.
- Li, M. X. (2025). Research on control algorithm of hoist induction motor based on PSA.Mining Machinery, 53(1), 26–29.
- Huang, C., & Chen, J. (2023). Analysis on forward and reverse control logic and experiment of motor based on L293D H-bridge driver.Mechanical & Electrical Engineering Technology, 52(9), 139-142.
- Wang, H., & Li, Z. (2022). Research on oscillation suppression of DC motor PID position control based on dead zone correction.Techniques of Automation and Applications, 41(11), 23-27.
- Shao, X. J., Kang, P. F., Zhang, J. G., et al. (2024). Research on new control strategy of DC motor position servo system.Control Engineering of China, 31(9), 1537-1543.
- Dong, Z. P., Li, X. M., Peng, Y., et al. (2025). Impacts of radiosonde drift on temperature differences between microwave radiometer and radiosonde observations.Meteorological Monthly, 51(5), 529-541.