首页 > 其他分享 >【控制】非线性系统反馈线性化和扩张状态观测器(9.2)

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)

时间:2023-03-23 21:02:59浏览次数:42  
标签:function end para sizes 观测器 sys dy 线性化 9.2

1 非线性系统反馈线性化

反馈线性化的步骤:

(1)目标线性系统

(2)线性化系统镇定

(3)从非线性系统到线性化系统---反馈线性化

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_02

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_03

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_04

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_05

2 搭建仿真系统

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_06

MATLAB Function程序

%系统
function fx = fcn(dy,y)

fx = sin(y)+exp(dy)+2*y*dy;
%controller
function u = fcn(dy,y)

k1 = -9;
k2 = -6;
u0 = k1*y + k2*dy;

u = ( u0 - sin(y) - exp(dy) - 2*y*dy )/4;

3 仿真结果

3.1 变步长仿真

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_07

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_08

可以发现,采用变步长仿真出来的图像更为有些不光滑。

3.2 定步长仿真

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_09

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_10

可以发现,采用定步长仿真出来的图像更为光滑。

4 扩张状态观测器

在实际情况中,系统的状态(如【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_11,即【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_12)有时候是不可获得的,此时就需要设计(扩张)状态观测器类进估计系统的状态。

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_13

4.1 设计扩张状态观测器

二阶系统

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_14,其中【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_15

定义【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_16【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_17,则有

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_18

系统的初始状态【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_19【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_20

定义新的状态【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_21,其一阶导数【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_22

 则扩张后状态系统变为:

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_23

设计线性扩张状态观测器如下形式:

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_24

线性扩张状态观测器系统的初始状态【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_25【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_26【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_27

4.2 仿真模型搭建

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_非线性系统反馈线性化_28

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_s function_29

4.3 仿真结果

【控制】非线性系统反馈线性化和扩张状态观测器(9.2)_matlab function_30

系统状态x1和x2

4.4 matlab程序

%%参数para_02.matlab

%线性扩张状态观测器增益
para.beta1=100;
para.beta2=2500;
para.beta3=2500;
para.b=4

%%系统SYS.matlab

%MATLAB Function

function fx = fcn(dy,y)
fx = sin(y)+exp(dy)+2*y*dy;

%%控制器设计controller.matlab

%controller

function u = fcn(y_hat,dy_hat)
k1 = -9;
k2 = -6;
u0 = k1*y_hat + k2*dy_hat;
u = ( u0 - sin(y_hat) - exp(dy_hat) - 2*y_hat*dy_hat )/4;

%%线性扩张状态观测器LSO_02.matlab

%LESO

function [sys,x0,str,ts,simStateCompliance] = LESO_02(t,x,u,flag,para)

% The following outlines the general structure of an S-function.
%
switch flag,
  %%%%%%%%%%%%%%%%%%
  % Initialization %
  %%%%%%%%%%%%%%%%%%
  case 0,
    [sys,x0,str,ts,simStateCompliance]=mdlInitializeSizes;
  %%%%%%%%%%%%%%%
  % Derivatives %
  %%%%%%%%%%%%%%%
  case 1,
    sys=mdlDerivatives(t,x,u,para);
  %%%%%%%%%%
  % Update %
  %%%%%%%%%%
  case 2,
    sys=mdlUpdate(t,x,u);
  %%%%%%%%%%%
  % Outputs %
  %%%%%%%%%%%
  case 3,
    sys=mdlOutputs(t,x,u);
  %%%%%%%%%%%%%%%%%%%%%%%
  % GetTimeOfNextVarHit %
  %%%%%%%%%%%%%%%%%%%%%%%
  case 4,
    sys=mdlGetTimeOfNextVarHit(t,x,u);
  %%%%%%%%%%%%%
  % Terminate %
  %%%%%%%%%%%%%
  case 9,
    sys=mdlTerminate(t,x,u);
  %%%%%%%%%%%%%%%%%%%%
  % Unexpected flags %
  %%%%%%%%%%%%%%%%%%%%
  otherwise
    DAStudio.error('Simulink:blocks:unhandledFlag', num2str(flag));

end

% end sfuntmpl

%
%=============================================================================
% mdlInitializeSizes
% Return the sizes, initial conditions, and sample times for the S-function.
%=============================================================================
%
function [sys,x0,str,ts,simStateCompliance]=mdlInitializeSizes

% call simsizes for a sizes structure, fill it in and convert it to a
% sizes array.
%
% Note that in this example, the values are hard coded.  This is not a
% recommended practice as the characteristics of the block are typically
% defined by the S-function parameters.
%
sizes = simsizes;

sizes.NumContStates  = 3;
sizes.NumDiscStates  = 0;
sizes.NumOutputs     = 3;
sizes.NumInputs      = 2;
sizes.DirFeedthrough = 0;
sizes.NumSampleTimes = 1;   % at least one sample time is needed

sys = simsizes(sizes);

% initialize the initial conditions
%
x0  = [0.8;1.8;1];

% str is always an empty matrix
%
str = [];

% initialize the array of sample times
%
ts  = [0 0];

% Specify the block simStateCompliance. The allowed values are:
%    'UnknownSimState', < The default setting; warn and assume DefaultSimState
%    'DefaultSimState', < Same sim state as a built-in block
%    'HasNoSimState',   < No sim state
%    'DisallowSimState' < Error out when saving or restoring the model sim state
simStateCompliance = 'UnknownSimState';

% end mdlInitializeSizes

%=============================================================================
% mdlDerivatives
% Return the derivatives for the continuous states.
%=============================================================================
%
function sys=mdlDerivatives(t,x,u,para)

beta1=para.beta1;
beta2=para.beta2;
beta3=para.beta3;

uc=u(1);
x1=u(2);

z1=x(1);
z2=x(2);
z3=x(3);

e=z1-x1;
dz1=z2-beta1*e;
dz2=z2-beta2*e;
dz3=-beta3*e;

sys = [dz1;dz2;dz3];

% end mdlDerivatives

%=============================================================================
% mdlUpdate
% Handle discrete state updates, sample time hits, and major time step
% requirements.
%=============================================================================
%
function sys=mdlUpdate(t,x,u)

sys = [];

% end mdlUpdate

%=============================================================================
% mdlOutputs
% Return the block outputs.
%=============================================================================
%
function sys=mdlOutputs(t,x,u)

sys = [x];

% end mdlOutputs

%=============================================================================
% mdlGetTimeOfNextVarHit
% Return the time of the next hit for this block.  Note that the result is
% absolute time.  Note that this function is only used when you specify a
% variable discrete-time sample time [-2 0] in the sample time array in
% mdlInitializeSizes.
%=============================================================================
%
function sys=mdlGetTimeOfNextVarHit(t,x,u)

sampleTime = 1;    %  Example, set the next hit to be one second later.
sys = t + sampleTime;

% end mdlGetTimeOfNextVarHit

%=============================================================================
% mdlTerminate
% Perform any end of simulation tasks.
%=============================================================================
%
function sys=mdlTerminate(t,x,u)

sys = [];

% end mdlTerminate


标签:function,end,para,sizes,观测器,sys,dy,线性化,9.2
From: https://blog.51cto.com/u_15714963/6145957

相关文章

  • 【控制】高增益扩张状态观测器的设计(9.1)
    1理论框架2一阶系统描述3二阶系统描述对于上述状态及扰动项的估计,参考​​状态观测器的设计​​内容。4仿真实例5仿真结果相关参数matlab中均已给出。仿真分别采用了线......
  • 【控制】高增益扩张状态观测器的设计(9)
    1高增益扩张状态观测器状态观测器是根据系统的输入输出来确定系统内部状态变量的装置,它的示意图如下:1)在自抗扰控制器的设计过程中,我们通常把未知的干扰都用fff来表示。2)如......
  • centos7 安装 postgresql-9.2
    1.添加yum配置yuminstall-yhttp://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-7-x86_64/pgdg-centos92-9.2-3.noarch.rpm2.安装服务yumins......
  • 解决 IntelliJ IDEA 2019.2.3 java 工程运行中文乱码问题
    前言java语言的语法类似于C++,目前接触的开发环境:eclipse与IntelliJIDEA,AndroidStudio应该跟IntelliJIDEA很类似虽然之前改改AndroidAPK,了解了一些java开发相关的东......
  • 9.2第二媒介原理2
    前面讨论符号的媒介物时,我们讲到口语的媒介物是声音,书面语言的媒介物是墨水线条印迹。古人在用石子计数时,小石子也是一种媒介,天然的实物媒介。后来的传统计算工具,如算筹、......
  • VTK-9.2 .lib文件列表
    vtkcgns-9.2d.libvtkChartsCore-9.2d.libvtkCommonColor-9.2d.libvtkCommonComputationalGeometry-9.2d.libvtkCommonCore-9.2d.libvtkCommonDataModel-9.2d.libvtkCommonE......
  • centos7.9编译安装libzip-1.9.2 和 cmake 3.23.0
    centos7.9编译安装libzip-1.9.2在编译安装php时系统会报configure:error:Packagerequirements(libzip>=0.11libzip!=1.3.1libzip!=…这是因为libzip版本过......
  • RockyLinux8.7 制作OpenSSH9.2 rpm包
    由于系统原装的openssh存在高危的漏洞,安全扫描不过,故制作出最新版本的rpm包修复openssh高危漏洞。1.安装基础环境工具dnfinstallwgetmakegccperlrpm-buildgtk2-de......
  • Openssh升级到9.2版本
    操作系统:centos7.61、安装依赖yuminstallgccgcc-c++zlib-develpam-developenssl-develmakevimwget-y备份之前的sshmv/etc/ssh{,.bak}2、openssl升级opens......
  • openEuler-22.03-LTS-SP1 RPM升级 OpenSSH9.2p1
    #安装rpm编译环境 yuminstall-yrpm-buildgccgcc-c++glibcglibc-developenssl-developensslpcrepcre-develzlibzlib-develmakewgetkrb5-develpam-deve......