How do I Tune Model Predictive Controller (MPC) in the Real Time?

조회 수: 31 (최근 30일)
Ayesha
Ayesha 2024년 1월 24일
댓글: Ayesha 2024년 1월 30일
I performed a Real-Time Experiment with the MPC controller today and as expected I encountered some issues, The purpose of the controller is to keep in contact sample and tip, in this case tip is connected with a piezoelectric actuator and controlled by the MPC controller. but unfortunately controller is not able to follow the reference value (0V) there is a steady state error/saturation or even controller doesn't even work well, while in the simulations controller performance was excellent.
I am using MPC without Integral Action and also there is no external observer, MPC Simulink Block uses defualt Kalman Filter.
A few months ago I faced the same kind of issue with PI controller and by adjusting P and I gains I made it work, but I am not sure how can I tune MPC in real time and which parameters I have to change, if someone help me in this regards, please.
These were my parameters yesterday control horizons (Nc) = 3, prediction horizon Np 8, sampling time Ts = 0.00003. Now I changes Nc = 10 and Np = 20 and Ts = 0.001, I keep Input Weigths = 0, and Output Weight = 10.
Please help me and guide me on how can I tune MPC in real-time. I am using Simulink Desktop Real-time for implementation.

채택된 답변

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2024년 1월 24일
There could be many reasons why you don't see the expected results. First thing I would check is whether the controller can actually run at the rates you specify. The Ts values you are using are very small considering MPC solves an optimization problem online, so you may be running into overrruns. In simulation that's not much of a problem (simulations can run slower than real time) but when you try to control a real-time systemm this becomes a big requirement.
I would first go to the simulation model (which you mentioned works fine) and do a SIL test to measure how long it takes for the MPC block to run. Simulink profiler can help as well. Your Ts should be smaller than the time MPC requires to run.
  댓글 수: 3
Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis 2024년 1월 25일
You are still trying to run the MPC controller at 1000Hz. Unless you don't have any constraints this is very likely not feasible for real-time control. You may also consider using explicit MPC instead if your state space is not very large. This approach can help speed up the control by a lot
Ayesha
Ayesha 2024년 1월 30일
Thanks I will look into explicit MPC

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Controller Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by