Code covered by the BSD License
-
[param]=db2s(input)
-
[param]=db2w(input)
-
[param]=db3s(input)
-
[param]=db3w(input)
-
[param]=mv2(input)
-
[param]=pp2b_1(input)
-
[param]=pp2b_2(input)
-
[param]=pp2c2dof(input)
[param]=pp2c2dof(input)
-
[param]=pp2chp(input)
-
[param]=pp2chp(input)
-
[param]=pp3c2dof(input)
[param]=pp3c2dof(input)
-
[param]=pp3chp(input)
-
[param]=zn2ast(input)
-
[param]=zn2ast(input)
-
[param]=zn2pd(input)
-
[param]=zn2tak(input)
-
[param]=zn3pd(input)
-
[param]=zn3tak(input)
-
[q]=zn2fpd(input)
-
[q]=zn3fpd(input)
-
[qp]=ba2(input)
-
[qp]=da2(input)
-
[qp]=pp2a_1(input)
-
[qp]=pp2a_2(input)
-
[qp]=zn2br(input)
-
[qp]=zn2fd(input)
-
[qp]=zn2fr(input)
-
[qp]=zn2pi(input)
-
[qp]=zn2tr(input)
-
[qp]=zn3br(input)
-
[qp]=zn3fd(input)
-
[qp]=zn3fr(input)
-
[qp]=zn3pi(input)
-
[qp]=zn3tr(input)
-
[sys,x0,str,ts]=sid(t,x,u,fla...
Discrete model identification function.
-
scast(t,x,u,flag,T0,alfa,beta...
-
scfpd(t,x,u,flag,T0)
PID controller based on forward rectangular method of discretization
-
scqp(t,x,u,flag,T0)
-
scrqp(t,x,u,flag,T0)
RQP feedforward feedback controller
-
scrqp(t,x,u,flag,T0,nr,nq,np)
FBFW feedforward feedback controller
-
slblocks
% Name of the subsystem which will show up in the Simulink Blocksets
-
ultim(B,A,T0,trace)
-
circuit_rtw
-
stcsl_rtw
-
View all files
from
STCSL - RTW version
by Petr Chalupa
Self-Tuning Controllers Simulink Library - Real Time Workshop version.
|
| [param]=pp2c2dof(input)
|
function [param]=pp2c2dof(input)
% [param]=pp2c2dof(input)
% Pole placement controller for 2nd order processes.
% This function computes parameters of the controller.
% The dynamic behaviour of the closed-loop is similar to
% second order continuous system with characteristic polynomial
% s^2 + 2*xi*omega*s + omega^2.
% Output of the controller is calculated follows:
%
% r0 q0 + q1*z^-1 + q2*z^-2
% U(z^-1) = -------------------------- * W(z^-1) - -------------------------- * Y(z^-1)
% (1 - z^-1) * (1 + p1*z^-1) (1 - z^-1) * (1 + p1*z^-1)
%
% Transfer function of the controlled system is:
%
% b1*z^-1 + b2*z^-2
% Gs(z^-1) = -----------------------
% 1 + a1*z^-1 + a2*z^-2
%
% Input:
% input(1:4) ... [a1 b1 a2 b2]
% input(5) ... sample time T0
% input(6) ... damping factor xi
% input(7) ... natural frequency omega
% Output: param ... controller parameters [r0; q0; q1; q2; p0; p1];
a1 = input(1);
b1 = input(2);
a2 = input(3);
b2 = input(4);
T0 = input(5);
xi = input(6);
om = input(7);
d2=exp(-2*xi*om*T0);
if (xi <= 1)
d1=-2*exp(-xi*om*T0)*cos(om*T0*(sqrt(1-xi*xi)));
else
d1=-2*exp(-xi*om*T0)*cosh(om*T0*(sqrt(xi*xi-1)));
end
% FBFW controller: Y=BR/(APK+BQ)*W
% conditions: 1) APK+BQ=D
% 2) BR+FS=D where W=H/F and S is any polynomial
% 1st condition:
% A = 1 + a1*z^-1 + a2*z^-2 B = b1*z^-1 + b2*z^-2
% P = 1 + p1*z^-1 Q = q0 + q1*z^-1 + q2*z^-2
% K = 1 - z^-1
% system of linear equations:
% [b1 0 0 1 ] [q0] [ d1+1-a1]
% [b2 b1 0 a1-1 ] [q1] [d2+a1-a2]
% [ 0 b2 b1 a2-a1] * [q2] = [ a2 ]
% [ 0 0 b2 -a2 ] [p1] [ 0 ]
q0 = -(b1^2*a2*d1+b1^2*a2-b1^2*a2*a1+b1*b2*a2*d1-b1*b2*a2*a1-b1*b2*a1*d1-b1*b2*a1 ...
+b1*b2*a1^2-b2^2*a1*d1-b2^2*a1+b2^2*a1^2+b2^2*d1+b2^2+b2^2*d2-b2^2*a2)/(b2+b1)/(-b1^2*a2+b1*b2*a1-b2^2);
q1 = (b1*b2*a2*d1-2*b1*b2*a2*a1+b2^2*a2*d1-b2^2*a2*a1-b2^2*a1*d1-b2^2*a1+b2^2*a1^2-b1^2*a2*d2...
-b1^2*a2*a1+b1^2*a2^2-b1*b2*a2*d2+b1*b2*a2^2+b1*b2*a1*d2+b1*b2*a1^2)/(b2+b1)/(-b1^2*a2+b1*b2*a1-b2^2);
q2 = a2*(-b2^2*d1-b2^2+b2^2*a1+b1*b2*d2+b1*b2*a1-b1*b2*a2-b1^2*a2)/(b2+b1)/(-b1^2*a2+b1*b2*a1-b2^2);
p1 = b2*(-b2^2*d1-b2^2+b2^2*a1+b1*b2*d2+b1*b2*a1-b1*b2*a2-b1^2*a2)/(b2+b1)/(-b1^2*a2+b1*b2*a1-b2^2);
% 2nd condition - step signal: F = 1 - z^-1
r0 = (1+d1+d2)/(b1+b2);
%parameters for scfbfw (no explicit compensator)
param=[r0; q0; q1; q2; 1; p1-1; -p1];
|
|
Contact us at files@mathworks.com