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
-
stcsl_std
-
View all files
from
STCSL - standard version
by Petr Chalupa
Self-Tuning Controllers Simulink Library - standard version.
|
| [qp]=da2(input)
|
function [qp]=da2(input)
% [qp] = da2(input)
% Dahlin's controller for processes of 2nd order.
% This function computes parameters of the controller (q0, q1, q2, p1, p2).
% Transfer function of the controller is as follows:
%
% q0 + q1*z^-1 + q2*z^-2 q0 + q1*z^-1 + q2*z^-2
% G(z^-1) = ------------------------ = ------------------------
% 1 - z^-1 1 + p1*z^-1 + p2*z^-2
%
% where p1=-1 and p2=0.
%
% Transfer function of the controlled system is:
%
% b1*z^-1
% Gs(z^-1) = -----------------------
% 1 + a1*z^-1 + a2*z^-2
%
% Input: input ... input parameters
% input(1) ... a1
% input(2) ... b1
% input(3) ... a2
% input(4) ... sample time T0
% input(5) ... adjustment factor B
% Output: qp ... controller parameters
% qp(1) ... q0
% qp(2) ... q1
% qp(3) ... q2
% qp(4) ... -1 (p1 of the controller)
% qp(5) ... 0 (p2 of the controller)
a1 = input(1);
b1 = input(2);
a2 = input(3);
T0 = input(4);
B = input(5);
% check inputs
if (T0 <= 0)
disp('da2.m: Input parameter T0 (sample time) must be greater than 0');
disp(' parameter value has been changed to 1');
T0 = 1;
end;
if (B <= 0)
disp('da2.m: Input parameter B (adjustment factor) must be greater than 0');
disp(' parameter value has been changed to 1e-6');
B = 1e-6;
end;
Q = 1-exp(-T0/B);
Kp = -(a1+2*a2)*Q/b1;
Td = T0*a2*Q/(Kp*b1);
Ti = -T0/((1/(a1+2*a2))+1+Td/T0);
q0 = Kp*(1+T0/Ti+Td/T0);
q1 = -Kp*(1+2*Td/T0);
q2 = Kp*Td/T0;
p1 = -1;
p2 = 0;
qp=[q0; q1; q2; p1; p2];
|
|
Contact us at files@mathworks.com