Zing Forum

Reading

Practice of Physics-Informed Neural Networks in Rotor-Driven Inverted Pendulum Control: Hybrid Grey-Box Modeling and MPC Optimization

This article introduces a practical project combining Physics-Informed Neural Networks (PINNs) and Model Predictive Control (MPC). By comparing purely data-driven Neural ODEs and residual grey-box models, it demonstrates how to integrate physical prior knowledge into machine learning to improve control performance, ultimately achieving fast and stable control of the inverted pendulum.

物理信息神经网络模型预测控制MPCNeural ODE灰盒建模倒立摆控制非线性系统辨识机器学习PyTorch
Published 2026-06-04 03:45Recent activity 2026-06-04 03:48Estimated read 7 min
Practice of Physics-Informed Neural Networks in Rotor-Driven Inverted Pendulum Control: Hybrid Grey-Box Modeling and MPC Optimization
1

Section 01

Project Introduction: Practice of Rotor-Driven Inverted Pendulum Control Combining PINNs and MPC

This article presents a rotor-driven inverted pendulum control project combining Physics-Informed Neural Networks (PINNs) and Model Predictive Control (MPC). By comparing purely data-driven Neural ODEs and residual grey-box models, it verifies the effectiveness of integrating physical prior knowledge to improve control performance, ultimately achieving fast and stable control of the inverted pendulum. The project source is GitHub, the original author team includes irfanabdullahmsj et al., and the release date is June 3, 2026.

2

Section 02

Project Background and Challenges

The inverted pendulum is a classic nonlinear control problem in industrial control and robotics. Traditional pure physical modeling has strong interpretability but struggles to capture unmodeled dynamics and nonlinear effects like friction; purely data-driven deep learning requires large amounts of data and lacks physical constraint guarantees. This project targets the rotor-driven inverted pendulum scenario and explores a hybrid solution: combining the Newton-Euler equation-based physical model with a neural network to build a grey-box model, and implementing MPC based on this model to balance physical prior knowledge and model error compensation.

3

Section 03

Modeling Methods and Performance Comparison

The controlled object is a rotor motor-driven inverted pendulum. The control inputs include motor torque command u and slider position x, and the states are pendulum angle φ and angular velocity φ̇ (underactuated system). The project compares two modeling approaches:

  1. Purely Data-Driven Neural ODE: Directly learns state derivatives and uses RK4 integration to predict trajectories, but the angle prediction RMSE is about 1.05 degrees, and recursive prediction stability is average;
  2. Residual Grey-Box Model: First builds a physical model, then uses a neural network to learn model residuals. The angle prediction RMSE drops to 0.45 degrees (a 57% reduction), and recursive stability is significantly improved.
4

Section 04

MPC Implementation and Performance Trade-offs

The MPC controller is implemented based on RK4 integration, with two configurations compared:

Controller Configuration Scenario Performance
Pure Physical MPC 20°→0° stabilization Settling time ~2 seconds
Hybrid MPC (Grey-Box Model) 20°→0° stabilization Settling time ~0.1 seconds
Pure Physical MPC 0°→5° tracking Clean trajectory with no steady-state error
Hybrid MPC 0°→5° tracking Has steady-state offset

Trade-off Analysis: Hybrid MPC has obvious advantages in fast stabilization tasks (stabilization time improved by 20x), but pure physical MPC is better in steady-state tracking tasks, because neural networks have insufficient generalization at the edge of data distribution or residual accumulation errors.

5

Section 05

Technology Stack and Team Division

Technology Stack: PyTorch (neural network training/automatic differentiation), torchdiffeq (Neural ODE integration), NumPy/SciPy (scientific computing), MATLAB (physical model derivation/preprocessing), ONNX (model export), Matplotlib (visualization). Team Division: Irfan is responsible for data preprocessing, Neural ODE implementation, and MPC integration; Benedikt focuses on Neural ODE architecture optimization; Lalith develops the residual grey-box model and recursive simulation analysis; Enrique is responsible for data collection and physical model parameter identification.

6

Section 06

Future Work and Key Insights

Future Directions: 1. Hardware-in-the-loop deployment to verify simulation-to-reality transfer; 2. Explore model application in reinforcement learning; 3. Improve recursive stability (current drop after 30 seconds); 4. Optimize computational efficiency to support real-time control. Key Insights: Provides control engineers with a methodology for combining physical modeling and machine learning; offers ML researchers a PINN application case; gives educators a teaching case covering system identification, MPC, and deep learning. The project honestly reports the advantages and disadvantages of each method, reflecting good academic and engineering ethics.