- 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)”.
Nonlinear MPC is not converging. Although the predictions go towards the reference
48 views (last 30 days)
Show older comments
Marcos
on 29 Oct 2024 at 0:59
Commented: Marcos
on 8 Nov 2024 at 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.
0 Comments
Accepted Answer
Kothuri
on 6 Nov 2024 at 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:
You can refer the below example link for more info on NPMC https://www.mathworks.com/help/releases/R2023b/mpc/ug/trajectory-optimization-and-control-of-flying-robot-using-nonlinear-mpc.html
You can refer the below links for more info on Sliding Mode control and PID controller with Gain scheduling
More Answers (0)
See Also
Categories
Find more on Model Predictive Control Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!