
Published: Design and Validation of an Online PID Tuning Tool for Mechatronic Systems
I’m proud to share that my research article has been published in the Turkish Journal of Engineering (TUJE). I wrote it with my supervisor Sohayb Abdulkerim at the Department of Aeronautics and Aerospace Engineering, Gaziantep University.
| Journal | Turkish Journal of Engineering (e-ISSN 2587-1366) |
| Volume / Issue / Pages | Vol. 10, No. 3, pp. 748–757 |
| Timeline | Received 15.12.2025 · Revised 06.02.2026 · Accepted 09.03.2026 · Published July 2026 |
| Type | Research Article, open access (CC BY-SA 4.0) |
| Keywords | Real-Time Control · PID Tuning Tool · Rapid Control Prototyping · System Identification |
The research in one paragraph
PID controllers still run more than 90% of industrial control loops. On embedded hardware, tuning them is stuck in a slow, sequential workflow: edit the code, recompile, re-flash, test, repeat. This paper presents a standalone, open-source desktop tool that tunes a PID controller while it runs on a microcontroller, with live visualization, bidirectional telemetry and logging. It then validates the tool in two stages: first against a MATLAB virtual plant, then on a physically unstable dual-BLDC balancing platform. Besides showing that the tool works, the hardware stage measures how microcontroller loop rate and motor-induced EMI limit closed-loop stability.
The research gap
Interactive PID tuning is not a new idea. What is missing is a version of it that is accessible, hardware-ready and truly real-time at the same time. The tools I reviewed fall into three groups:
- Proprietary ecosystems. MATLAB/Simulink and LabVIEW environments work well but are locked behind licenses (e.g., PIDTOOL, LabVIEW-based speed-control interfaces).
- Simulation-bound tools. Many educational GUIs never touch real hardware, or only work in simulated conditions.
- Platform-specific solutions. These are tied to one robot or one setup, or need complex real-time OS configurations (e.g., Scilab/Scicos with Linux-RTAI).
Advanced controllers like MPC and generalized predictive control often need too much computation for low-cost microcontrollers, so PID remains the practical choice on embedded platforms, if it can be tuned efficiently. The gap this paper addresses is a platform-independent, open-source, real-time PID tuning framework with bidirectional data exchange and live visualization.
Contributions
- A general-purpose desktop tool for PID tuning on microcontroller-based systems, independent of MATLAB or LabVIEW.
- A multithreaded, asynchronous producer–consumer architecture that keeps visualization smooth with zero packet loss during high-rate data exchange.
- A custom bidirectional serial protocol for live parameter updates and telemetry streaming.
- A two-stage validation methodology, Software-in-the-Loop followed by an inherently unstable physical plant, that quantifies the relationship between update rate, communication latency and stability.
Methodology: two-stage validation
(C# host)"] subgraph S1["Stage 1: Software-in-the-Loop"] M["MATLAB virtual plant
G(s) of the BLDC seesaw"] end subgraph S2["Stage 2: Hardware validation"] A["Arduino Uno
PID @ 100 Hz design"] --> P["Dual-BLDC
balancing platform"] P -- "MPU6050 angle" --> A end T <-- "virtual serial bridge" --> M T <-- "USB serial 115200 bps" --> A
Stage 1 isolates the software. A MATLAB model of the platform,
$$ G(s) = \frac{0.5\, L\, C_T}{J s^2 + D s}, $$streams data to the tool through a virtual COM-port bridge. This measures the tool’s own throughput, loss and rendering performance in repeatable conditions, with no hardware effects mixed in.
Stage 2 puts the complete system on real hardware: an Arduino Uno running a discrete PID loop with complementary-filter attitude estimation and differential thrust mixing on an unstable seesaw driven by two BLDC motors. The full hardware design and equations are in the platform post. The software architecture is in the tool post.
Key results
| Result | Value |
|---|---|
| Virtual plant loop time (avg., 25,000 cycles) | 0.25 ms |
| Tool data processing rate (SIL) | 66 Hz |
| Tool rendering rate (SIL) | 54 Hz |
| Packet loss | 0% |
| Real control-loop rate on Arduino Uno | ≈ 33 Hz (designed for 100 Hz) |
| IMU noise increase at balancing throttle (σ / peak-to-peak) | 37× / 48× vs. motors off |
On the software side, the architecture held up: every sample was processed, and rendering kept pace with acquisition, so no backlog built up during long sessions.
On the hardware side, live tuning worked. Gain, setpoint and system commands were applied instantly and the platform was stabilized through manual tuning with the tool. The time-stamped telemetry then showed two physical limits:
- Timing. The ATmega328P had to run sensing, control, actuation and serial communication sequentially, and the real loop dropped to ≈ 33 Hz. That is below the ~50 Hz generally needed for robust balancing of inverted-pendulum-type systems, and it caused persistent low-amplitude oscillations. Disabling telemetry (“Visualization-Off mode”) improved smoothness but did not remove the oscillations, so the microcontroller, not the protocol, is the main bottleneck.
- EMI. Sensor noise grew with motor power, from σ = 0.014° with motors off to σ = 0.534° at balancing throttle. The PID loop read this noise as real motion and responded to it.
Why it matters
- For engineers: a free tool that turns embedded PID tuning from a recompile loop into a live, visual process, and that makes timing and noise problems visible.
- For educators: a low-cost, reproducible setup for teaching real-time control on real hardware, not just in simulation.
- For researchers: a measured baseline showing that, on low-cost hardware, loop rate and signal integrity, more than the control law itself, often set the ceiling on performance.
Future work moves the framework to higher-performance microcontrollers and extends the decoupled communication layer toward IoT protocols (MQTT/HTTP) for remote monitoring.
Abstract
This paper presents the design, implementation, and experimental validation of an online Proportional–Integral–Derivative (PID) tuning and visualization tool applied to a Dual Brushless DC (BLDC) motor balancing platform. The proposed system integrates an Arduino-based embedded controller with a C# desktop application to enable dynamic adjustment of control parameters and online visualization of system responses. A custom bidirectional serial communication protocol was developed to ensure data exchange, while a multithreaded asynchronous architecture maintained continuous operation, high responsiveness, and robust data integrity. The system was validated using both a MATLAB-based virtual plant and a physical dual-BLDC balancing platform. Experimental results demonstrated closed-loop operation, real-time gain adjustment, and stable visualization performance. Hardware testing further revealed that communication latency and electromagnetic interference from the BLDC motors influenced sensor accuracy and control smoothness, highlighting the significance of controller update rate and hardware shielding. The tool demonstrates a robust communication architecture, achieving a sustained data rate of 66 Hz with zero packet loss, enabling effective manual tuning that stabilized a dual-BLDC platform. Experimental results quantify the critical relationship between Arduino processing capability and achievable stability.
Download & indexing
The paper is also indexed and listed on:
How to cite
APA
Hamidi, K., & Abdulkerim, S. (2026). Design and Validation of an Online PID Tuning Tool for Mechatronic Systems: Application to a Dual-BLDC Balancing Platform. Turkish Journal of Engineering, 10(3), 748–757. https://doi.org/10.31127/tuje.1842568
IEEE
K. Hamidi and S. Abdulkerim, “Design and Validation of an Online PID Tuning Tool for Mechatronic Systems: Application to a Dual-BLDC Balancing Platform,” TUJE, vol. 10, no. 3, pp. 748–757, Jul. 2026, doi: 10.31127/tuje.1842568.
BibTeX
@article{hamidi2026online,
author = {Hamidi, Khaled and Abdulkerim, Sohayb},
title = {Design and Validation of an Online PID Tuning Tool for Mechatronic Systems:
Application to a Dual-BLDC Balancing Platform},
journal = {Turkish Journal of Engineering},
volume = {10},
number = {3},
pages = {748--757},
year = {2026},
doi = {10.31127/tuje.1842568}
}
Explore the engineering behind the paper