⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fig9_78.m

📁 包含了控制理论的各种仿真程序
💻 M
字号:
%  Figure 9.78      Feedback Control of Dynamic Systems, 4e
%                        Franklin, Powell, Emami
%
% fig9_78.m is a script for the lqr(lqg) design for the disk  
% drive case study

clf;
wm= 5*pi;
z=.05;
GM = 4;
a=0.1;
numG= [1/(50*pi) 1];
denG=[1/(25*pi^2) 1/(50*pi) 1  0 0];
sysG=tf(numG,denG);
% form the system with y + a*ydot output
numGv=[0 numG]+.09*[numG 0];
sysGv=tf(numGv,denG);
% convert the design system to state form
[f,g,h,j]=ssdata(sysGv);
sysGvs=ss(f,g,h,j);
K=lqry(sysGvs,10000,1)
% form the state feedback
fc=f-g*K;
sysR=ss(fc,g,h,j);
[num,den]=tfdata(sysR,'v');
% remove the zero used to weight ydot
sysCLR=tf(numG,den);
[ac,b,c,d]=ssdata(sysCLR);
% normalize the gain for unity dc
k=c*inv(-ac)*b
b1=b/k;
sysCLR=ss(ac,b1,c,d);
t=0:.01:1.5;
[y,t]=step(sysCLR,t);
plot(t,y);
xlabel('Time (msec)');
ylabel('Amplitude');
grid;
title('Fig. 9.78 Step response of the lqr design for the disk');
%pause;
pc=eig(sysCLR);
pe=10*pc;
[f,g,h,j]=ssdata(sysG);
L=place(f',h',pe)';
nbar=1
a=[f-g*K-L*h];
b=[L -L];
c=-K;
d=[0 0];
sysF=ss(a,b,c,d);
sysOL=sysF*sysG;
sysH=tf(1,1);
sysCL=feedback(sysOL,sysH,2,1);
%figure(2)
%clf;
%t=0:.01:1.5;
%[y,t]=step(sysCL,t)
%plot(t,y(:,:,2));
%xlabel('Time (msec)');
%ylabel('Amplitude');
%
%grid;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -