当前位置:网站首页>飞行器翼尖加速度和控制面的MPC控制
飞行器翼尖加速度和控制面的MPC控制
2022-06-27 06:09:00 【studyer_domi】
1、内容简介
略
372-可以交流、咨询、答疑
2、内容说明
clc
close all
clear
% Open file
path = pwd;
pathFull = strcat(path,'\系统状态空间');
addpath(pathFull);
fid = fopen('180.DAT');
disp(['Read file ' '180.DAT'])
% Read and display the header
head=fgetl(fid); disp(head)
V=str2num(head(36:46)); ro=str2num(head(56:66));
% Read dimensions
tmp=fgetl(fid); tmp=sscanf(tmp,'%i');
if length(tmp)==1
n=tmp(1); m=0; l=0;
elseif length(tmp)==3
n=tmp(1); m=tmp(2); l=tmp(3);
else
disp(['FATAL ERROR: File ' filename ' corupt.']); return
end
% Read state-space matrices
ABCD = zeros(n+l,n+m);
ABCD = fscanf(fid,'%g',[n+l,n+m]);
A=ABCD(1:n,1:n);
B=ABCD(1:n,n+1:n+m);
C=ABCD(n+1:n+l,1:n);
D=ABCD(n+1:n+l,n+1:n+m);
% Read gain matrix
if head(74:80)=='VEHICLE'
fgetl(fid);line = fgetl(fid);
G = fscanf(fid,'%g',[m,l]);
else
G = [];
end
% Read gust state-space matrices
%
fgetl(fid);line = fgetl(fid);
if ~isstr(line)
Bw=[]; CG=[]; return
else
nG2= fscanf(fid,'%g',1);
Bw = fscanf(fid,'%g',[n,nG2]);
end
fgetl(fid);line = fgetl(fid);
if ~isstr(line), CG=[]; return,
else CG = fscanf(fid,'%g',[l,nG2]);
end
% %% 建立MPC模型
% sys = ss(A,B,C,D);
% Ts=0.05; % 采样时间
% p=15; % 预测时域长度
% m=2; % 控制时域长度
% MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% % 设置限制,F的大小不能为0,F斜率绝对值最大1000
% MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e2,'RateMax',1e2);
% MPC1.OV=struct('Min',-1000,'Max',1000);
% MPC1.OV.MaxECR=1;
%% 建立MPC模型
close all
clc
% sys = ss(A,B,C,D);
% Ts=0.05; % 采样时间
% p=15; % 预测时域长度
% m=5; % 控制时域长度
% MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% % 设置限制,F的大小不能为0,F斜率绝对值最大1000
% MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e1,'RateMax',1e1);
% MPC1.OV=struct('Min',-1000,'Max',1000);
% MPC1.OV.MaxECR=1;
sys = ss(A,B,C,D);
Ts=0.05; % 采样时间
p=15; % 预测时域长度
m=5; % 控制时域长度
MPC1=mpc(sys,Ts,p,m); % 定义M1和M2分离的MPC模型
% 设置限制,F的大小不能为0,F斜率绝对值最大1000
MPC1.MV=struct('Min',-1,'Max',1,'RateMin',-1e1,'RateMax',1e1);
MPC1.OV=struct('Min',-10,'Max',10);
MPC1.OV.MaxECR=1;
in = 10;
sim('model_mpc1.slx')
figure
plot(tout,yout(:,1))
xlabel 时间/s
ylabel 翼尖加速度传感器
figure
plot(tout,yout(:,2),tout,yout(:,3))
xlabel 时间/s
ylabel 控制面的偏角
3、仿真分析

4、参考论文
略
边栏推荐
猜你喜欢

How to check the frequency of memory and the number of memory slots in CPU-Z?

Create a basic WDM driver and use MFC to call the driver

树莓派4B上运行opcua协议DEMO接入kubeedge
[email protected][2389:1: columnNameTypeOrConstraint : ( ( tableConstraint ) | ( columnNameT"/>NoViableAltException([email protected][2389:1: columnNameTypeOrConstraint : ( ( tableConstraint ) | ( columnNameT

美摄云服务方案:专为轻量化视频制作场景打造

POI 替换docx中的文字和图片

Distribution gaussienne, régression linéaire, régression logistique

多线程基础部分Part3

【QT小作】使用结构体数据生成读写配置文件代码

openresty使用文档
随机推荐
Multithreading basic part part 1
Information System Project Manager - Chapter VII project cost management
426-二叉树(513.找树左下角的值、112. 路径总和、106.从中序与后序遍历序列构造二叉树、654. 最大二叉树)
C Primer Plus 第11章_字符串和字符串函数_代码和练习题
Go日志-Uber开源库zap使用
线程间等待与唤醒机制、单例模式、阻塞队列、定时器
汇编语言-王爽 第9章 转移指令的原理-笔记
JVM garbage collection mechanism
427-二叉树(617.合并二叉树、700.二叉搜索树中的搜索、98. 验证二叉搜索树、530.二叉搜索树的最小绝对差)
Thinking technology: how to solve the dilemma in work and life?
[cocos creator 3.5.1] addition of coordinates
HTAP 快速上手指南
【Cocos Creator 3.5.1】event. Use of getbutton()
The risk of multithreading -- thread safety
Free SSH and telnet client putty
Matlab quickly converts two-dimensional coordinates of images into longitude and latitude coordinates
Webrtc series - Nomination and ice of 7-ice supplement for network transmission_ Model
IAR Systems全面支持芯驰科技9系列芯片
表单校验 v-model 绑定的变量,校验失效的解决方案
Webrtc Series - Network Transport 7 - ice Supplement nominations and ice Modèle