反馈线性化控制器matlab仿真
x=0;
u=0;
a=100;
Dt=0.001;
t=0;
n=1;
for i=1:10000
%reference signal
ym=sin(t);
dym=cos(t);
Dx=cos(x)+sin(x)+5*sin(x)*u;
x=x+Dx*Dt;
y=sin(x);
u=(-(0.9*cos(x)^2+0.95*cos(x)*sin(x))+dym+a*(ym-y))/(4.95*cos(x)*sin(x));
y_store(:,n)=[y;ym];
u_store(n)=u;
t=t+Dt;
n=n+1;
end
figure(1)
plot((1:n-1)*Dt,y_store(1,:),(1:n-1)*Dt,y_store(2,:))
hold on
例2 考虑如下的非线性系统
x 1=f1(x1,x2)+g1(x1,x2)u=x2 (1.02+1.28x12)x1 2=f2(x1,x2)+g2(x1,x2)u=( 57.17 322.16x12)x1+( 70.12 360.27x12)u x
y=h(x,x)=x121
解:(1)判断相对阶
Lgh=0 Lfh=f1 LgLfh=g2
可见,该非线性系统相对阶为2。
(2)控制器的设计
L2
fh= f1 ff1+1f2=( 1.02 3.84x12)[x2 (1.02+1.28x12)x1]+( 57.17 322.16x12)x1 x1 x2
控制器
u=1( L2
fh+v) LgLfh