Adding a delay in state space form
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kashish Pilyal
el 31 de Mayo de 2022
Comentada: Kashish Pilyal
el 2 de Jun. de 2022
I have a control block diagram
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1017225/image.png)
The value of tf_b is written as
tf_b=((0.5*s)+1)/(s^2)*(kp + kd*s);
The transport delay block is equivalent to value of
. I made a state space form of the above system. It is written as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1017230/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1017235/image.jpeg)
I tried adding a delay as shown in the diagram.
sys=ss(A,B,C,D,'InputDelay',theta,'OutputDelay',0);
The simulink model and the state space give different settling times when given as step input. The settling time for the simulink model is 1.82 appoximately and for the state space is 1.97. Is there something I can do to correct this or add a delay properly?
0 comentarios
Respuesta aceptada
Paul
el 1 de Jun. de 2022
The command
sys=ss(A,B,C,D,'InputDelay',theta,'OutputDelay',0);
puts a delay on the input signal, i.e., at the output of the a1input block to the left of the node (assuming that A,B,C,D as written is the state space model for the Simulink block diagram, but with zero transport delay; I did not verify this myself). In other words, the delay is applied to both forward paths, not just the "upper" path.
5 comentarios
Paul
el 1 de Jun. de 2022
I don't believe that a system with a delay can be represented in the simple A,B,C,D form.
This doc page should be of interest.
Though you're not showing your code, I suspect that the descriptor form you're seeing is because you're constructing the model using "transfer function math," like so:
s = tf('s');
Gamma2 = ((exp(-0.02*s)*s^2)+(0.6*s)+0.2)/((0.5*s+1)*(s^2+(0.6*s)+0.2));
Gamma2
Note also that the model has eight states.
I don't have a clear explanation as to why this results in a descriptor form, but I suspect it has to do with how the Control System Toolbox represents that first term in Gamma2 with the delay, and then combines that with all the other terms.
However, transfer function math is generally not recommended; instead use the interconnection fucntions, like so (based on the similar problem discussed here)
Kp = 0.1; Kd = 0.6; theta = 0.02;
pid = Kp + Kd*s;
P = tf(1,[.5 1]);
H = tf([.5 1],[1 0 0]);
clsys = series(parallel(exp(-theta*s),pid/s^2),feedback(P,series(pid,H)));
clsys
Note that clsys doesn't include the E and it also only has 5 states, likely because the CST is smarter when it uses interconnection functions (link).
However, Gamma2 and clsys both represent the same dynamics
bode(Gamma2,clsys)
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!