Nonlinear MPC is not converging. Although the predictions go towards the reference

50 ビュー (過去 30 日間)
Marcos
Marcos 2024 年 10 月 29 日 0:59
コメント済み: Marcos 2024 年 11 月 8 日 23:23
I'm trying to control an aircraft using NPMC (matlab toolbox) and a nonlinear model to make the prediction (the plant is equal to the prediction model). I trimmed the aircraft at mach 0.5 and 4000m. My reference are theta and alpha (0.06rad and after 0.5 second a change it to 0.01 rad) just to see what happens. However, the problem is not converging (I got npl.status = -2) and, as a result, the manipulated variables are not updating (MV = initial condition). When a analyse the y.seq, it seems to converge (am I right?):
For me, it's trivial test and it should converge to 0.1 easily but i don't get why it not converging. I've tried to change prediction/control horizons, Ts (sample time) but the results still the same. Anyone does have any ideia what's happening? why is NMPC controller not sending new inputs to the plant?
Thanks in advance.

採用された回答

Kothuri
Kothuri 2024 年 11 月 6 日 14:00
Hi Marcos,
I understand that you are facing a convergence issue due to NPMC Controller as it is not sending new inputs to the plant. The “npl.status = -2” usually indicates that the solver is failing to find an optimal solution.
You can try the below steps:
  • Ensure that your nonlinear model accurately represents the dynamics of the aircraft. As any discrepancies between the model and the actual system can lead to convergence issues.
  • Ensure that all constraints (e.g., bounds on states or control inputs) are feasible given the initial conditions and the desired reference. Sometimes, overly strict constraints or mismatches in the initial conditions can cause infeasibility.
  • Make sure that the predictive and control horizons are not too short or too long relative to the plant dynamics, as NMPC may struggle to optimize effectively. Try moderate horizons, then gradually increase to see if it improves convergence.
  • Start with a control horizon that’s shorter than the prediction horizon. For example, if your prediction horizon is set to 20, try a control horizon of 5 or 10.
  • Make sure the weights on the control inputs are not excessively high, which might prevent the NMPC from changing the manipulated variables.
  • If your model is highly nonlinear, try to linearize it around the operating point or using a simpler model to test the setup.
  • The plot of ”y.seq” appears to show some convergence towards 0.1, which suggests that the controller might be working to some extent. However, if MVs remain static, it may indicate that the optimizer is struggling with a feasible solution.
  • Use MATLAB’s diagnostic tools to print or log “y.seq”, “u.seq”, and “npl.status” at each iteration to get detailed insights into how the controller and solver are behaving over time.
  • You can also try using other controllers such as “PID Controller with Gain Scheduling”, “Feedback Linearization”, “Sliding Mode Control (SMC)”.
You can refer the below links for more info on Sliding Mode control and PID controller with Gain scheduling
  1 件のコメント
Marcos
Marcos 2024 年 11 月 8 日 23:23
Hi Kothuri. I've adjusted some parameters and constraints, the problem did converge. Thank you a lot for the detailed answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModel Predictive Control Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by