Clear Filters
Clear Filters

Adaptive MPCの設計について

2 views (last 30 days)
隆浩 鈴木
隆浩 鈴木 on 23 Jul 2024
線形の状態方程式のB行列が時間と共に変化するため、Adaptive MPCを使用しているのですが、適応MPCコントローラ(mpcobj)の設計がわからないです。
fcnブロックの中身とSimulinkモデル、mpc1の中身を添付します。
mpcobjはAdaptive MPC Controllerを使う前に、MPC Controllerで実装したものを添付しており、B行列をB = [0; Tx/mass]に書き換えるとエラーが起こります。おそらくモデルの更新ができていないと思いますがわからないです。
Simulinkモデルの概要としては、外部で計算された時系列データTxがB行列を変化させており、それに伴うモデルの更新をしたいです。
そこで、Adaptive MPC Design with Simulink - File Exchange - MATLAB Central (mathworks.com))を参考にして、現在作成しているのですが、mpcobjの設計について書いていないためどのようにしたらよいかわからないです。ドキュメント等も参考にしましたが、現状できていません。
改善点やサンプルプログラム等があれば教えていただきたいです。
%MATLAB Functionの中身
function [A,B,C,D,U,Y,X,DX] = fcn(Tx,u,x)
Ts = 0.1;
mass = 4.81;
Ac = [0 1; 0 0];
Bc = [0; Tx/mass];
Cc = [1 0];
Dc = 0;
%離散時間モデルの生成
nx = size(Ac,1);
nu = size(Bc,2);
M = expm([[Ac Bc]*Ts; zeros(nu,nx+nu)]);
A = M(1:nx,1:nx);
B = M(1:nx,nx+1:nx+nu);
C = Cc;
D = Dc;
%離散時間プラントの公称条件
X = x;
U = u;
Y = C*x + D*u;
DX = A*x + B*u-x;
end
%MATLAB Functionの中身
% パラメータの設定
mass = 4.81; % 質量
Ts = 0.1; % サンプリング時間
% システム行列の設定
A = [0 1; 0 0];
B = [0; 1/mass];
C = [1 0];
D = 0;
% 状態空間モデルの定義
plantc = ss(A, B, C, D);
plantd = c2d(plantc, Ts);
% MPCオブジェクトの作成
mpcobj = mpc(plantd);
mpcobj.Model.Plant = minreal(mpcobj.Model.Plant);

Answers (0)

Categories

Find more on ビッグ データの処理 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!