Nonlinear MPC Attitude Control

조회 수: 4 (최근 30일)
Tristan
Tristan 2024년 8월 5일
댓글: Swastik Sarkar 2024년 8월 29일
I have been trying to design nonlinear MPC for attitude control.
I put in the code. runsim is the file you need to run, the rest are just accessories.
This is done with quaternions, where I am using the standard quaternion kinematics along with attitude dynamics. The odd thing is how the cost changes throughout the simulation. I am starting with an initial condition that is nonzero in Euler angle land and nonzero angular velocity about x axis. The goal is just to stabilize to zero Euler angles (unit quaternion) with no angular velocity.
Above you can see how the cost changes along the different time steps.
Below is the corresponding state and control input histories
You should expect that based on these values the cost should be going up the entire simulation. However, there are a couple time steps where it decreases. This is kind of telling me there is something wrong. Anyone have any feedback?
  댓글 수: 1
Swastik Sarkar
Swastik Sarkar 2024년 8월 29일
There seems to be a typo on line no. 13 and 14
mlobj.Weights.OutputVariables = [1000 1000 1000];
mlobj.Weights.ManipulatedVariables = [1 1 1];
It should be nlobj as that is the name of variable you have used, could this possibly be the cause ?

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by