All states explode to increase in Simulink using MPC toolbox

3 ビュー (過去 30 日間)
嵩人 藤森
嵩人 藤森 2021 年 6 月 27 日
編集済み: 嵩人 藤森 2021 年 6 月 28 日
Hi, Im trying to simulate two wheel inverted pendulum model using MPC toolbox on Simulink but the simulation result doesnt make sense. Please tell me what is wrong with my MATLAB code and Simulink.
FYM, this is the two wheel inverted pendulum model. θ,φ represents wheel angle and body angle respectively.
g =9.8100
Jb =8.5450e-04
Jw =2.0100e-06
l =0.0590
m =0.0190
M =0.2360
r =0.0210
X =0.1366
Y =5.2133e-04
Z =0.0028
A=[0 1 0 0 ; 0 0 0 0 ; 0 0 0 1 ; 0 0 X/Z 0 ];
B=[0 ; 1 ; 0 ; -Y/Z];
C=[1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1];
D=[0];
inv=ss(A,B,C,D);
mpcDesigner;
Then, on the MPC Designer tab, in the MPC Structure section, I did like this and clicked “define and import”
Sample time= 0.1
Manipulated Variables = 1
Measured Outputs = [1;2;3;4]
Then, some plots appear on the MPC Designer tab.
Next, I exported the controller with no tuning nor weight nor constraints cus it seems not important in this prototype.
At last, I connected Simulink blocks like this, ref =[0;0;0;0], initial states of inv = [0;0;10;0] which means baby angle is a little bit tilted.
Once run the simulation, all states explode to increase.
I cant tell why this happens and how to solve this problem. I think this might be the causes; All states have reference value, which seems impossible to be achieved.
Please teach me what is wrong with my whole process.
Thank you

回答 (0 件)

カテゴリ

Help Center および File ExchangeController Creation についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by