All states explode to increase in Simulink using MPC toolbox

조회 수: 2 (최근 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 CenterFile Exchange에서 Controller Creation에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by