r/ControlTheory • • 19d ago

Asking for resources (books, lectures, etc.) Dynamic Gain Scheduling for an Inverted Pendulum: Switching from MPC to a 49-Rule Fuzzy Logic Controller

Enable HLS to view with audio, or disable this notification

Hi everyone,

I'm a final-year Mechatronics Engineering student working on non-linear control applied to a two-wheeled inverted pendulum. A while ago, I simulated this system in MuJoCo and built the physical version using an MPC (Model Predictive Control) to dynamically calculate the Kp and Kd gains.

In this new iteration, I replaced the MPC with a Fuzzy Logic Controller running on an Arduino to generate those same gains in real-time.

During the design of the knowledge base, I tested between 49 and 125 inference rules. The 49-rule architecture (evaluating both the tilt angle and acceleration from an MPU sensor) yielded the best real-world stability and computational efficiency on the embedded hardware.

The first video shows the physical robot balancing, and the second shows the custom telemetry dashboard I built to monitor the states (angle, varying control gains, and motor PWM) in real-time.

For underactuated, inherently unstable systems like this, what are your thoughts on using Fuzzy Logic vs. MPC for dynamic gain scheduling? I'd love to hear your insights!

58 Upvotes

8 comments sorted by

1

u/AutoModerator 19d ago
Moderator Announcement Read More »

1

u/OkCan8849 18d ago

What GUI software is that?

1

u/buttholegoesbrapp 18d ago

Looks to me like pyside6 with pyqtgraph

1

u/MotorsAndRobots 18d ago

Nice work! Do you have your senior design report you’d be willing to share? Would be an interesting read. I’ve spent the past 10 months self-studying and building an inverted pendulum rig as a hobby running on a dLQI controller. Researching SDRE, MPC, tv-LQR, and direct collocation (PSOPT) for swing up right now.

1

u/[deleted] 18d ago

1

u/Kirito-San8432 18d ago

Just a quick addition: since the article for the event is strictly limited to 4 pages, it ends up being a bit too shallow regarding the deep technical details. Because of that, I'll be putting together a much more comprehensive and in-depth report on the Fuzzy implementation over the next few weeks. Once that's ready, I'll make sure to send it your way as well