The goal of this Mechatronics project was to design and deploy a closed-loop controller that would balance a rotating rod actuated by a brushless DC motor, first in simulation then on physical hardware. In the first phase, we derived the full nonlinear equations of motion by hand, computing rotational inertia, summing gravitational and friction torques, and linearizing the system around equilibrium to produce a transfer function. We then implemented a discrete-time PID controller in MATLAB and used the built-in PID tuner to select three gain sets optimized for fastest response, minimum overshoot, and a balanced compromise, running nine closed-loop simulations across different perturbation and noise conditions to analyze stability and robustness trade-offs.
In the second phase, we took our controller off the simulation and onto the real mechanism, commanding actual motor throttle based on live IMU angle feedback. We tested all three gain sets on the physical hardware and compared the experimental theta plots to our simulation results. Our expected results held: high Kp drove fast but oscillatory response, low Ki left steady-state error, and our balanced set gave the most stable real-world performance. Bridging the gap between simulation and hardware was the most instructive part, as sensor noise, actuator saturation, and real mechanical dynamics all showed up in ways the linearized model didn't fully capture.

(214) - 843 - 9070
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.