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

📄 phlag.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function [ka,kb,kc,kd] = phlag(dbchange,endfreq,hfgain)
%PHLAG  design a phase lag compensator
%
%       [kn,kd] = phlag(dbchange,endfreq,hfgain)
%       [kn,kd] = phlag(dbchange,endfreq)
%       [ka,kb,kc,kd] = phlag(dbchange,endfreq,hfgain)
%       [ka,kb,kc,kd] = phlag(dbchange,endfreq)
%
%       PHLAG returns a first order lag compensator
%       with a change of DBCHANGE decibels between low and high frequencies.
%       If DBCHANGE is positive a phase lead compensator is returned.
%       ENDFREQ specifies the frequency (in rad/s) at which the gain change 
%       is essentially finished. (This is the upper corner frequency of the
%       compensator. Note that up to 45 degrees lag may remain at ENDFREQ.)
%       HFGAIN specifies the high-frequency gain of the compensator in 
%       decibels. If HFGAIN is omitted a value of 0 decibels is assumed.
%
%       [ka,kb,kc,kd]=PHLAG(DBCHANGE,ENDFREQ,HFGAIN) returns the compensator 
%       in state space form.
%       [kn,kd]=PHLAG(DBCHANGE,ENDFREQ,HFGAIN) returns the compensator in 
%       transfer function form.

%       J.M.Maciejowski, 8 Dec 1987.
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd
%       MRN0019

nargs = nargin;
nout = nargout;
error(nargchk(2,3,nargs));
if nargs == 2
	hfgain = 0;     % default hf gain
end

% solve controller equations
ka = 10^(hfgain/20)*[1,endfreq];
if dbchange==(-inf), % This shouldn't be necessary
  kb = [1, 0];
else
  kb = [1, endfreq*10^(dbchange/20)];
end

% convert to state space if required
if nout == 4
	[ka,kb,kc,kd] = mvtf2ss(ka,kb);
end

⌨️ 快捷键说明

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