当前位置:网站首页>飞行器翼尖加速度和控制面的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、参考论文
略
边栏推荐
- 多线程基础部分Part 1
- Active learning
- My opinion on test team construction
- Crawler learning 5--- anti crawling identification picture verification code (ddddocr and pyteseract measured effect)
- 美摄云服务方案:专为轻量化视频制作场景打造
- 427- binary tree (617. merge binary tree, 700. search in binary search tree, 98. verify binary search tree, 530. minimum absolute difference of binary search tree)
- Code is data
- [collection] Introduction to basic knowledge of point cloud and functions of point cloud catalyst software
- Jump details of item -h5 list, and realize the function of not refreshing when backing up, and refreshing when modifying data (record scroll bar)
- 【Cocos Creator 3.5.1】input. Use of on
猜你喜欢
随机推荐
Assembly language - Wang Shuang Chapter 3 notes and experiments
693. 交替位二进制数
【养成系】常用正则表达式
Crawler learning 5--- anti crawling identification picture verification code (ddddocr and pyteseract measured effect)
Contents in qlistwidget are not displayed
427-二叉树(617.合并二叉树、700.二叉搜索树中的搜索、98. 验证二叉搜索树、530.二叉搜索树的最小绝对差)
汇编语言-王爽 第13章 int指令-笔记
WebRTC系列-網絡傳輸之7-ICE補充之提名(nomination)與ICE_Model
创建一个基础WDM驱动,并使用MFC调用驱动
【Cocos Creator 3.5.1】this.node.getPosition(this._curPos)的使用
项目-h5列表跳转详情,实现后退不刷新,修改数据则刷新的功能(记录滚动条)
The SCP command is used in the expect script. The perfect solution to the problem that the SCP command in the expect script cannot obtain the value
Using CSDN to develop cloud and build navigation websites
日期 数据库日期 字符串 之间互相转换
Webrtc series - Nomination and ice of 7-ice supplement for network transmission_ Model
The risk of multithreading -- thread safety
JVM overall structure analysis
Multithreading basic Part3
JVM整体结构解析
IAR Systems全面支持芯驰科技9系列芯片









