当前位置:网站首页>Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory
Adaptive Control - Simulation Experiment 1 Designing Adaptive Laws Using Lyapunov's Stability Theory
2022-07-30 10:20:00 【lan 606】
自适应控制——仿真实验一 The adaptive law is designed using Lyapunov stability theory
一、问题描述
Let the state equation of the control object be
x ˙ p = A p ( t ) x p + b p ( t ) u (1) \dot{\boldsymbol{x}}_{p}=\boldsymbol{A}_{p}(t) x_{p}+\boldsymbol{b}_{p}(t) u \tag{1} x˙p=Ap(t)xp+bp(t)u(1)
式中
A p = [ 0 1 − 6 − 7 ] , b p = [ 2 4 ] (2) \boldsymbol{A}_{p}=\left[\begin{array}{cc} 0 & 1 \\ -6 & -7 \end{array}\right], \quad \boldsymbol{b}_{p}=\left[\begin{array}{l} 2 \\ 4 \end{array}\right] \tag{2} Ap=[0−61−7],bp=[24](2)
The equation of state of the reference model is
x ˙ m = A m x m + b m r (3) \dot{\boldsymbol{x}}_{m}=\boldsymbol{A}_{m} x_{m}+\boldsymbol{b}_{m} r \tag{3} x˙m=Amxm+bmr(3)
式中
A m = [ 0 1 − 10 − 5 ] , b m = [ 1 2 ] (4) \boldsymbol{A}_{m}=\left[\begin{array}{cc} 0 & 1 \\ -10 & -5 \end{array}\right], \quad \boldsymbol{b}_{m}=\left[\begin{array}{l} 1 \\ 2 \end{array}\right] \tag{4} Am=[0−101−5],bm=[12](4)
The adaptive law is designed using Lyapunov stability theory.
二、问题建模
Because of the parameters of the control object(状态矩阵 A p \boldsymbol{A}_{p} Ap 和控制矩阵 b p \boldsymbol{b}_{p} bp )一般是未知的,and cannot be directly adjusted.So in order to change the dynamic characteristics of the control object,Feedforward control plus feedback control is required.
控制信号 u u u by the feedforward signal K r Kr Kr 和反馈信号 F x p Fx_p Fxp 组成,即
u = K r + F x p (5) u=K r+F \boldsymbol{x}_{p} \tag{5} u=Kr+Fxp(5)
式中, r r r 为 m m m 维输入向量, x p \boldsymbol{x}_{p} xp 为 n n n 维状态向量, K K K 为 m × m m \times m m×m Feedforward gain matrix, F F F 为 m × n m \times n m×n 反馈增益矩阵;Specifically in this simulation experiment,输入向量维度 m = 1 m=1 m=1,State vector dimension n = 2 n=2 n=2.
将(5)Substitute the formula into the state equation of the control object,可得
x ˙ p = [ A p ( t ) + b p ( t ) F ] x p + b p ( t ) K r (6) \dot{\boldsymbol{x}}_{p}=\left[\boldsymbol{A}_{p}(t)+\boldsymbol{b}_{p}(t) F\right] \boldsymbol{x}_{p}+\boldsymbol{b}_{p}(t) K r \tag{6} x˙p=[Ap(t)+bp(t)F]xp+bp(t)Kr(6)
Let the generalized state error vector of the system be
e = x m − x p (7) \boldsymbol{e}=\boldsymbol{x}_{m}-\boldsymbol{x}_{p} \tag{7} e=xm−xp(7)
by the equation of state of the reference model,结合(6)式及(7)式,可得:
e ˙ = A m e + ( A m − A p − b p F ) x p + ( b m − b p K ) r (8) \dot{\boldsymbol{e}}=\boldsymbol{A}_{m} \boldsymbol{e}+\left(\boldsymbol{A}_{m}-\boldsymbol{A}_{p}-\boldsymbol{b}_{p} F\right) \boldsymbol{x}_{p}+\left(\boldsymbol{b}_{m}-\boldsymbol{b}_{p} K\right) r \tag{8} e˙=Ame+(Am−Ap−bpF)xp+(bm−bpK)r(8)
在理想情况,即 e → 0 e \rightarrow 0 e→0 的情况下,(8)The last two terms of the right-hand side of the equation should be equal0.Set up the feedforward gain matrix K K K and the feedback gain matrix F F F 的理想值分别为 K ˉ \bar{K} Kˉ 和 F ˉ \bar{F} Fˉ.
can finally be(8)written as
e ˙ = A m e + b m K ˉ − 1 Φ x p + b m K ˉ − 1 Ψ r (9) \dot{\boldsymbol{e}}=\boldsymbol{A}_{m} \boldsymbol{e}+\boldsymbol{b}_{m} \bar{K}^{-1} \Phi \boldsymbol{x}_{p}+\boldsymbol{b}_{m} \bar{K}^{-1} \Psi r \tag{9} e˙=Ame+bmKˉ−1Φxp+bmKˉ−1Ψr(9)
式中, Φ = F ˉ − F \Phi=\bar{F}-F Φ=Fˉ−F 为 m × n m \times n m×n 矩阵, Ψ = K ˉ − K \Psi=\bar{K}-K Ψ=Kˉ−K 为 m × m m \times m m×m 矩阵.
The Lyapunov function is chosen as :
V = 1 2 [ e T P e + tr ( Φ T Γ 1 − 1 Φ + Ψ T Γ 2 − 1 Ψ ) ] (10) V=\frac{1}{2}\left[\boldsymbol{e}^{T} \boldsymbol{P} \boldsymbol{e}+\operatorname{tr}\left(\Phi^{T} \Gamma_{1}^{-1} \Phi+\Psi^{T} \Gamma_{2}^{-1} \Psi\right)\right] \tag{10} V=21[eTPe+tr(ΦTΓ1−1Φ+ΨTΓ2−1Ψ)](10)
式中, P \boldsymbol{P} P 为 n × n n \times n n×n A dimensionally positive definite symmetric matrix, Γ 1 \Gamma_{1} Γ1 和 Γ 2 \Gamma_{2} Γ2 均为 m × m m \times m m×m A dimensionally positive definite symmetric matrix;符号 tr \operatorname{tr} tr 表示矩阵的迹.
求(10)The derivative of the formula with respect to time,得
V ˙ = 1 2 [ e ˙ P e + e T P e ˙ + tr ( Φ ˙ T Γ 1 − 1 Φ + Φ T Γ 1 − 1 Φ ˙ + Ψ ˙ T Γ 2 − 1 Ψ + Ψ T Γ 2 − 1 Ψ ˙ ) ] (11) \dot{V}=\frac{1}{2}\left[\dot{\boldsymbol{e}} \boldsymbol{P} \boldsymbol{e}+\boldsymbol{e}^{T} \boldsymbol{P} \dot{\boldsymbol{e}}+\operatorname{tr}\left(\dot{\Phi}^{T} \Gamma_{1}^{-1} \Phi+\Phi^{T} \Gamma_{1}^{-1} \dot{\Phi}+\dot{\Psi}^{T} \Gamma_{2}^{-1} \Psi+\Psi^{T} \Gamma_{2}^{-1} \dot{\Psi}\right)\right] \tag{11} V˙=21[e˙Pe+eTPe˙+tr(Φ˙TΓ1−1Φ+ΦTΓ1−1Φ˙+Ψ˙TΓ2−1Ψ+ΨTΓ2−1Ψ˙)](11)
将(9)式代入(11)式,Then according to the properties of the matrix trace,于是有
V ˙ = 1 2 e T ( P A m + A m T P ) e + tr ( Φ ˙ T Γ 1 − 1 Φ + x p e T P b m K ˉ − 1 Φ ) + tr ( Ψ ˙ T Γ 2 − 1 Ψ + r e T P b m K ˉ − 1 Ψ ) (12) \begin{aligned} \dot{V}=&\frac{1}{2} \boldsymbol{e}^{T}\left(\boldsymbol{P} \boldsymbol{A}_{m}+\boldsymbol{A}_{m}^{\boldsymbol{T}} \boldsymbol{P}\right) \boldsymbol{e}+\operatorname{tr}\left(\dot{\Phi}^{T} \Gamma_{1}^{-1} \Phi+\boldsymbol{x}_{p} \boldsymbol{e}^{T} \boldsymbol{P} \boldsymbol{b}_{m} \bar{K}^{-1} \Phi\right) \\ &+\operatorname{tr}\left(\dot{\Psi}^{T} \Gamma_{2}^{-1} \Psi+r \boldsymbol{e}^{T} \boldsymbol{P} \boldsymbol{b}_{m} \bar{K}^{-1} \Psi\right) \end{aligned} \tag{12} V˙=21eT(PAm+AmTP)e+tr(Φ˙TΓ1−1Φ+xpeTPbmKˉ−1Φ)+tr(Ψ˙TΓ2−1Ψ+reTPbmKˉ−1Ψ)(12)
To satisfy Lyapunov's second method,需保证(12)The formula is negative definite,对应的情况为(12)The first term of the formula is negative definite,The latter two are both zero.
因为 A m \boldsymbol{A}_{m} Am is a stable matrix,A positive definite symmetric matrix can be selected Q Q Q,使 P A m + A m T P = − Q \boldsymbol{P} \boldsymbol{A}_{m}+\boldsymbol{A}_{m}^{\boldsymbol{T}} \boldsymbol{P}=-\boldsymbol{Q} PAm+AmTP=−Q 成立.At the same time according to the above corresponding situation, Φ \Phi Φ 和 Ψ \Psi Ψ 的选择如下:
Φ ˙ = − Γ 1 ( b m K ˉ − 1 ) T P e x p T Ψ ˙ = − Γ 2 ( b m K ˉ − 1 ) T P e r T (13) \begin{aligned} \dot{\Phi}&=-\Gamma_{1}\left(\boldsymbol{b}_{m} \bar{K}^{-1}\right)^{T} \boldsymbol{P} \boldsymbol{e} \boldsymbol{x}_{p}^{T} \\ \dot{\Psi}&=-\Gamma_{2}\left(\boldsymbol{b}_{m} \bar{K}^{-1}\right)^{T} \boldsymbol{P} \boldsymbol{e} r^{T} \end{aligned} \tag{13} Φ˙Ψ˙=−Γ1(bmKˉ−1)TPexpT=−Γ2(bmKˉ−1)TPerT(13)
当 A p \boldsymbol{A}_{p} Ap 和 b p \boldsymbol{b}_{p} bp constant or slowly changing,Adaptive regulation can be obtained:
F ( t ) = ∫ 0 t Γ 1 ( b m K ˉ − 1 ) T P e x p T d τ + F ( 0 ) K ( t ) = ∫ 0 t Γ 2 ( b m K ˉ − 1 ) T P e r d τ + K ( 0 ) (14) \begin{aligned} F(t)&=\int_{0}^{t} \Gamma_{1}\left(\boldsymbol{b}_{m} \bar{K}^{-1}\right)^{T} \boldsymbol{P e} \boldsymbol{x}_{p}^{T} d \tau+F(0) \\ K(t)&=\int_{0}^{t} \Gamma_{2}\left(\boldsymbol{b}_{m} \bar{K}^{-1}\right)^{T} \boldsymbol{P e} r d \tau+K(0) \end{aligned} \tag{14} F(t)K(t)=∫0tΓ1(bmKˉ−1)TPexpTdτ+F(0)=∫0tΓ2(bmKˉ−1)TPerdτ+K(0)(14)
An additional point to note is that,According to the above steps, the requirements of the adaptive adjustment law are obtained x p \boldsymbol{x}_{p} xp 与 r r r 线性独立.The two conditions are independent r ( t ) r(t) r(t) is a square wave signal with a certain frequency or is q q q A segmented continuous signal composed of sinusoidal signals of different frequencies,其中 q > n / 2 q>n / 2 q>n/2 或 q > ( n − 1 ) / 2 q>(n-1) / 2 q>(n−1)/2.
三、问题求解
It can be seen from the above derivation,It is designed for adopting Lyapunov stability theoryMRACS,A feedforward gain matrix needs to be introduced K K K and the feedback gain matrix F F F,The goal of the design is to determine K K K 和 F F F 的系数.
After introducing two gain matrices for adaptive control,The state equation of the tunable system becomes :
x ˙ p = [ A p ( t ) + b p ( t ) F ] x p + b p ( t ) K r (15) \dot{\boldsymbol{x}}_{p}=\left[\boldsymbol{A}_{p}(t)+\boldsymbol{b}_{p}(t) F\right] \boldsymbol{x}_{p}+\boldsymbol{b}_{p}(t) K r \tag{15} x˙p=[Ap(t)+bp(t)F]xp+bp(t)Kr(15)
It can be seen from the previous derivation,(14)式中的 b m K ˉ − 1 \boldsymbol{b}_{m} \bar{K}^{-1} bmKˉ−1 与 b p \boldsymbol{b}_{p} bp 的关系如下:
b m K ˉ − 1 = b p = [ 2 4 ] (16) \boldsymbol{b}_{m} \bar{K}^{-1}=\boldsymbol{b}_{p}=\left[\begin{array}{l} 2 \\ 4 \end{array}\right] \tag{16} bmKˉ−1=bp=[24](16)
选取(14)Some of the adaptive parameters in the formula are as follows:
P = [ 3 1 1 1 ] , Γ 1 = Γ 2 = 1 (17) \boldsymbol{P}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 1 \end{array}\right], \quad \Gamma_{1}=\Gamma_{2}=1 \tag{17} P=[3111],Γ1=Γ2=1(17)
So the final adaptive law can be obtained:
F ( t ) = ∫ 0 t [ 2 4 ] [ 3 1 1 1 ] e x p T d τ + F ( 0 ) K ( t ) = ∫ 0 t [ 2 4 ] [ 3 1 1 1 ] e r d τ + K ( 0 ) (18) \begin{aligned} F(t)&=\int_{0}^{t}\left[\begin{array}{ll} 2 & 4 \end{array}\right]\left[\begin{array}{ll} 3 & 1 \\ 1 & 1 \end{array}\right] \boldsymbol{e} \boldsymbol{x}_{p}^{T} d \tau+F(0) \\ K(t)&=\int_{0}^{t}\left[\begin{array}{ll} 2 & 4 \end{array}\right]\left[\begin{array}{ll} 3 & 1 \\ 1 & 1 \end{array}\right] \boldsymbol{e r d} \tau+K(0) \end{aligned} \tag{18} F(t)K(t)=∫0t[24][3111]expTdτ+F(0)=∫0t[24][3111]erdτ+K(0)(18)
Next, the above continuous adaptive law is discretized,For actual numerical simulation experiments.Let the numerical integration step size be h h h,The reference model state vector and the control object state vector at each moment are as follows:
x m ( k + 1 ) = x m ( k ) + h [ A m ( k ) x m ( k ) + B m ( k ) r ( k ) ] x p ( k + 1 ) = x p ( k ) + h [ A p ( k ) x p ( k ) + B p ( k ) u ( k ) ] (19) \begin{aligned} \boldsymbol{x}_{m}(k+1)&=\boldsymbol{x}_{m}(k)+h\left[\boldsymbol{A}_{m}(k) \boldsymbol{x}_{m}(k)+\boldsymbol{B}_{m}(k) r(k)\right] \\ \boldsymbol{x}_{p}(k+1)&=\boldsymbol{x}_{p}(k)+h\left[\boldsymbol{A}_{p}(k) \boldsymbol{x}_{p}(k)+\boldsymbol{B}_{p}(k) u(k)\right] \end{aligned} \tag{19} xm(k+1)xp(k+1)=xm(k)+h[Am(k)xm(k)+Bm(k)r(k)]=xp(k)+h[Ap(k)xp(k)+Bp(k)u(k)](19)
Due to the requirements of the adaptive control law derived from the above x p \boldsymbol{x}_{p} xp 与 r r r 线性独立,即要求 r ( t ) r(t) r(t) is a square wave signal with a certain frequency or is q q q A segmented continuous signal composed of sinusoidal signals of different frequencies,其中 q > n / 2 q>n / 2 q>n/2 或 q > ( n − 1 ) / 2 q>(n-1) / 2 q>(n−1)/2.在本次实验中, n = 2 n=2 n=2,Correspond to the requirements q > 1 q>1 q>1,Therefore, in this experiment, we chose 3A segmented continuous signal composed of sinusoidal signals of different frequencies,The specific form of the input signal is as follows:
r ( k ) = sin ( 0.01 π k ) + 4 sin ( 0.2 π k ) + sin ( π k ) (20) r(k)=\sin (0.01 \pi k)+4 \sin (0.2 \pi k)+\sin (\pi k) \tag{20} r(k)=sin(0.01πk)+4sin(0.2πk)+sin(πk)(20)
The control signal introduced when we design the adaptive law u u u The discretized form of is as follows:
u ( k ) = K ( k ) r ( k ) + F ( k ) x p ( k ) (21) u(k)=K(k) r(k)+F(k) \boldsymbol{x}_{p}(k) \tag{21} u(k)=K(k)r(k)+F(k)xp(k)(21)
最终,The adaptive law also needs to be discretized:
F ( k ) = h ⋅ ∑ j = 0 k b p T P e ( k ) ( x p ( k ) ) T + F ( 0 ) K ( k ) = h ⋅ ∑ j = 0 k b p T P e ( k ) r ( k ) + K ( 0 ) (22) \begin{aligned} F(k)&=h \cdot \sum_{j=0}^{k} \boldsymbol{b}_{p}^{T} \boldsymbol{P} \boldsymbol{e}(k)\left(\boldsymbol{x}_{p}(k)\right)^{T}+F(0) \\ K(k)&=h \cdot \sum_{j=0}^{k} \boldsymbol{b}_{p}^{T} \boldsymbol{P} \boldsymbol{e}(k) r(k)+K(0) \end{aligned} \tag{22} F(k)K(k)=h⋅j=0∑kbpTPe(k)(xp(k))T+F(0)=h⋅j=0∑kbpTPe(k)r(k)+K(0)(22)
After deriving all the adaptive laws and discretizing the corresponding laws,通过MATLABThe related simulation experiments were carried out.
可以得到2The case of the reference model value and the adjustable system value of the state vector of 1 dimension is as follows:

可以看到,Tunable systems do not track reference models very well,This is because there is no optimal match in this example.
附录:实现MATLAB代码
% Textbook exercises3.4-The adaptive law is designed using Lyapunov stability theory
clear, clc;
close all;
h=0.01;L=100/h; % Numerical integration step size and simulation steps
% The coefficient matrix for the tunable system
Ap = [0 1;-6 -7];
Bp = [2; 4];
% The coefficient matrix of the reference model
Am = [0 1;-10 -5];
Bm = [1; 2];
% nis the row vector dimension、mis the dimension of the column vector,Bp是n*m的矩阵
n = size(Bp, 1);
m = size(Bp, 2);
P = [3 1;1 1]; % Calculated positive definite symmetric matrix for adaptive law
% Set the initial values of all parameters
yr0 = zeros(m, 1);
xp0 = zeros(n, 1);
xm0 = zeros(n, 1);
u0 = zeros(m, 1);
e0 = zeros(n, 1);
F0 = zeros(m, n); % Feedback gain matrix initial value
K0 = zeros(m, m); % Feedforward gain matrix initial value
% Initially allocate parameter space
time = zeros(1, L); % Used to record the moment of the simulation,Corresponds to the horizontal axis of the plot
yr = zeros(m, L); % 输入信号(L个m维向量)
xp = zeros(n, L); % The state vector of a tunable system(L个n维向量)
xm = zeros(n, L); % The state vector of the reference model(L个n维向量)
u = zeros(m, L); % 控制信号(L个m维向量)
e = zeros(n, L); % Generalized state error vector for the system(L个n维向量)
for k = 1:L
time(k) = k*h;
% 输入信号
yr(k) = 1*sin(0.01*pi*time(k))+4*sin(0.2*pi*time(k))+sin(1*pi*time(k));
xp(:,k) = xp0+h*(Ap*xp0+Bp*u0); % 计算xp
xm(:,k) = xm0+h*(Am*xm0+Bm*yr0); % 计算xm
e(:,k) = xm(:,k)-xp(:,k); % e=xm-xp
% 代入F和Kadaptive control law
F = F0+h*(Bp'*P*e0*xp0');
K = K0+h*(Bp'*P*e0*yr0);
% 控制信号u=K*r+F*xp(Kis the feedforward gain matrix,Fis the feedback gain matrix)
u(:,k) = K*yr(k)+F*xp(:,k);
% Assign the parameters obtained in this round to the initial values of the parameters,It is convenient to use in the next iteration
yr0 = yr(:,k);
u0 = u(:,k);
e0 = e(:,k);
xp0 = xp(:,k);
xm0 = xm(:,k);
F0 = F;
K0 = K;
end
subplot(2,1,1);
plot(time, xm(1,:), 'Color', 'b', 'LineWidth', 0.9);
hold on
plot(time, xp(1,:), 'Color', 'r', 'LineStyle', '--', 'LineWidth', 1.1);
xlabel('t');
ylabel('x_m_1(t)、x_p_1(t)');
legend('x_m_1(t)','x_p_1(t)');
hold off
subplot(2,1,2);
plot(time, xm(2,:), 'Color', 'b', 'LineWidth', 0.9)
hold on
plot(time, xp(2,:), 'Color', 'r', 'LineStyle', '--', 'LineWidth', 1.1)
xlabel('t');
ylabel('x_m_2(t)、x_p_2(t)');
legend('x_m_2(t)', 'x_p_2(t)');
hold off
参考书目
李言俊, 张科. Adaptive Control Theory and Applications[M]. 西北工业大学出版社, 2005.
边栏推荐
- 学习笔记10--局部轨迹生成主要方法
- Matplotlib--绘图标记
- [100个Solidity使用技巧]1、合约重入攻击
- 大数据产品:标签体系0-1搭建实践
- Day113. Shangyitong: WeChat login QR code, login callback interface
- (BUG记录)No module named PIL
- In 2022, the top will be accepted cca shut the list
- 连接mysql报错WARN: Establishing SSL connection without server‘s identity verification is not recommended
- 梅科尔工作室-看鸿蒙设备开发实战笔记五——驱动子系统开发
- Practical Walkthrough | Calculate Daily Average Date or Time Interval in MySQL
猜你喜欢

Alibaba Cloud OSS Object Storage

EViews 12.0 software installation package download and installation tutorial

多线程保证单个线程开启事务并生效的方案

Re15: Read the paper LEVEN: A Large-Scale Chinese Legal Event Detection Dataset

ospf2双点双向重发布(题2)

JCL 学习

spark udf 接受并处理 null值.

Re19: Read the paper Paragraph-level Rationale Extraction through Regularization: A case study on European Court
![idea2021+Activiti [the most complete note one (basic use)]](/img/60/55cccf257523bed2c8829361cea97c.png)
idea2021+Activiti [the most complete note one (basic use)]

MFCC to audio, the effect should not be too funny >V
随机推荐
[100个Solidity使用技巧]1、合约重入攻击
105. 从前序与中序遍历序列构造二叉树(视频讲解!!)
Multi-threading scheme to ensure that a single thread opens a transaction and takes effect
shell脚本
一个近乎完美的 Unity 全平台热更方案
线程池方式开启线程--submit()和execute()的区别
分页 paging
Re15:读论文 LEVEN: A Large-Scale Chinese Legal Event Detection Dataset
PyQt5 - Drawing different types of straight lines
判断一颗树是否为完全二叉树——视频讲解!!!
A new generation of free open source terminal tool, so cool
梅科尔工作室-看鸿蒙设备开发实战笔记六—无线联网开发
PyQt5-用像素点绘制正弦曲线
唯物辩证法-条件论
The method of parameter passing
死锁的理解
Four ways the Metaverse is changing the way humans work
神秘的APT攻击
梅科尔工作室-看鸿蒙设备开发实战笔记七——网络应用开发
spark udf 接受并处理 null值.