Design and Implementation of a PID Controller for a Two-Axis Gimbal System Using ESP32
DOI:
https://doi.org/10.25139/ijair.v7i2.10771Keywords:
PID Controller, Camera Stabilizer, ESP32, MPU6050, PID, Voltage SensorAbstract
This study presents the design and implementation of a two-axis smartphone camera stabilizer system that uses an ESP32 microcontroller with a Proportional–Integral–Derivative (PID) control algorithm. The system is designed to maintain camera stability by minimizing unwanted vibrations and angular deviations on the roll and pitch axes. The hardware configuration consists of an ESP32 as the main control unit, an MPU6050 sensor for real-time orientation measurement, and two servo motors functioning as actuators for both axes. The control process operates in a closed loop, with the PID algorithm continuously using feedback from the MPU6050 sensor to correct the camera's orientation relative to the 0° setpoint. Experimental testing was carried out over a 40-second interval under four load conditions—no load, and additional weights of 186 g, 204 g, and 228 g—while manual disturbances were applied to simulate dynamic movement. The PID parameters (Kp, Ki, Kd) were tuned using a trial-and-error approach to achieve optimal response speed, stability, and steady-state accuracy. The best performance was obtained with parameter values of Kp = 1.3, Ki = 0.05, and Kd = 0, which produced the lowest accumulated error and sTable motion across all load variations. The corresponding settling times were 2.2 s (no load), 3.2 s (186 g), 4.2 s (204 g), and 4.5 s (228 g), indicating that increased load inertia slightly extended the stabilization period. Overall, the results indicate that the proposed ESP32-based two-axis gimbal system with PID control provides an effective, low-cost, and reliable stabilization solution suiTable for porTable videography, robotics, and drone applications.
References
A. Chiko Pratama, D. Syauqy, M. Hannats, and H. Ichsan, “Stabilizer Kamera 2-Axis Dengan Pid Control Berdasarkan Setpoint pada Atmega 328,” vol. 2, no. 9, pp. 2548–964, 2018.
B. Irianti and N. Karlinah, “PEMANFAATAN SENSOR GYRO PADA SISTEM PENSTABIL KAMERA,” vol. 3, no. 2, pp. 195–200, 2021.
R. T. Asnada, "Effect of Inertial Measurement Unit (IMU) MPU-6050 3-Axis Gyro and 3-Axis Accelerometer on Camera Stabilizer System (Gimbal) For Videography Applications," vol. 11, no. 1, pp. 48–55, 2020.
R. T. Asnada and S. Sulistyono, “Pengaruh Inertial Measurement Unit (IMU) MPU- 6050 3-Axis Gyro dan 3-Axis Accelerometer pada Sistem Penstabil Kamera (Gimbal) Untuk Aplikasi Videografi,” J. Teknol. Elektro, vol. 11, no. 1, p. 48, 2020, doi: 10.22441/jte.2020.v11i1.007.
S. Abdelhay and A. Zakriti, "Modeling of a Quadcopter Trajectory Tracking System Using PID Controller," Procedia Manuf., vol. 32, no. 2, pp. 564–571, 2019, doi: 10.1016/j.promfg.2019.02.253.
M. S. Haris, A. Dharmawan, and C. Atmaji, “Sistem Kendali Gimbal 2-Sumbu Sebagai Tempat Kamera Pada Quadrotor Menggunakan PID Fuzzy,” IJEIS (Indonesian J. Electron. Instrum. Syst., vol. 7, no. 2, p. 185, 2017, doi: 10.22146/ijeis.24220.
T. K. Priyambodo, “Implementasi Sistem Kendali PID pada Gimbal Kamera 2-sumbu dengan Aktuator Motor Brushless,” IJEIS (Indonesian J. Electron. Instrum. Syst., vol. 7, no. 2, p. 111, 2017, doi: 10.22146/ijeis.18238.
F. Palaha and Yolnasdi, “Analisa Rancangan Keseimbangan Menggunakan Sensor Imu Type – Mpu6050 Pada Quadcopter,” Sainstek (e-Journal), vol. 8, no. 2, pp. 96–104, 2020, doi: 10.35583/js.v8i2.125.
G. Al Azhar, S. Sungkono, M. N. Achmadiyah, and S. Izza, “Peningkatan Kestabilan Sistem Kontrol UGV melalui Optimalisasi Manajemen Core dan Free-RTOS pada ESP32,” J. Elektron. dan Otomasi Ind., vol. 10, no. 2, pp. 253–263, 2023, doi: 10.33795/elkolind.v10i2.3720.
A. Wagyana, “Prototipe Modul Praktik untuk Pengembangan Aplikasi Internet of Things (IoT),” Setrum Sist. Kendai-Tenaga-elektronika-telekomunikasi-komputer, vol. 8, no. 2, p. 238, 2019, doi: 10.36055/setrum.v8i2.6561.
J. Ilmiah, M. Disiplin, M. Esp, and D. A. N. Microsd, “PENGEMBANGAN DETEKTOR PORTABEL TINGKAT KERUSAKAN JALAN,” vol. 8, pp. 7–22, 2024.
Dicky Juliansyah and M. Dr. Ir. Yohannes Dewanto, “Prototype Robot Pensortir Kemasan Obat Berdasarkan Warna RGB Pada Warna Kemasan Obat Menggunakan Sensor TCS-3200 Dan HC-SR04,” J. Tek. Elektro Fak. Tek. Dirgant. dan Ind., vol. 13 N0. 1, pp. 1–8, 2024.
P. A. Guntoro, Muhamad Syariffuddien Zuhrie, Bambang Suprianto, and I. G. P. A. Buditjahjanto, “Sistem Kendali Dual Motor Propeller Pada Alat Self Balancing Menggunakan Kontroler Pid Dengan Tuning Chr,” J. Tek. Elektro, vol. 10, no. 1, pp. 19–27, 2021.
R. I. Putra, S. Sunardi, and R. D. Puriyanto, “Monitoring Tegangan Baterai Lithium Polymer pada Robot Line Follower Secara Nirkabel,” Bul. Ilm. Sarj. Tek. Elektro, vol. 1, no. 2, p. 73, 2019, doi: 10.12928/biste.v1i2.907.
R. Rizanty, “Rancang Bangun Pembangkit Listrik Tenaga Gerak Melalui Sepeda Statis dengan Kontrol Torsi Berbasis Arduino Menggunakan Metode PID,” 2024.
A. A, "Camera Stabilizer 2 Axis by Proporsional Integral Derivative (PID) Based LabView," Telekontran J. Ilm. Telekomun. Kendali dan Elektron. Terap., vol. 3, no. 2, pp. 25–27, 2015, doi: 10.34010/telekontran.v3i2.1879.
F. Beny, “Implementasi Sensor IMU MPU6050 Berbasis Serial I2C pada Self-Balancing Robot,” J. Teknol. Technoscientia, vol. 9, no. 1, 2016.
Mutiar, “Analisa Perubahan Parameter Sistem Pengendalian PID Terhadap Tangapan Keluaran Dengan Menggunakan Aplikasi Matlab,” J. Tek. Elektro, vol. 7, no. 1, pp. 45–53, 2021.
A. Nurmiranto et al., “Pengembangan Desain, Simulasi Dan Pengujian Robot Tangan Menggunakan Flex Sensor Terintegrasi Dengan 3D Animation Simmechanics,” J. Tek. Mesin, vol. 4, no. 1, pp. 105–116, 2016.
A. Fahruzi, B. S. Agomo, and Y. A. Prabowo, "Design Of 4DOF 3D Robotic Arm to Separate the Objects Using a Camera," Int. J. Artif. Intell. Robot., vol. 3, no. 1, pp. 27–35, 2021, doi: 10.25139/ijair.v3i1.3787.
R. R. Ramadhani, M. Yuliana, and A. Pratiarso, "Smart Room Lighting System for Energy Efficiency in Indoor Environment," Int. J. Artif. Intell. Robot., vol. 4, no. 2, pp. 48–58, 2022, doi: 10.25139/ijair.v4i2.5266.
Downloads
Published
How to Cite
Issue
Section
License
Authors who publish with International Journal of Artificial Intelligence & Robotics (IJAIR) agree to the following terms:
-
Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License (CC BY-SA 4.0) that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
-
Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
-
Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.




