📄 motor6_2.m
字号:
J=0.01;
b=0.1;
K=0.01;
R=1;
L=0.5;
A=[-b/J K/J
-K/L -R/L];
B=[0
1/L];
C=[1 0];
D=0;
co=ctrb(A,B);%Judge the controlbility of the system
rank(co)
if rank(co)==rank(A)
p1 = -5 + i;
p2 = -5 - i;
K = place(A,B,[p1 p2]);%We use the function place to caculate the K matrix.
Nbar=rscale(A,B,C,D,K)%Use the function rescale to eliminate
t=0:0.01:10; %the steady-state error
step(A-B*K,B*Nbar,C,D,1,t)
title('Step Response with K Controller and Nbar')
else error('It is not controlble ')
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -