Adding InternalDelay for State Space system

4 views (last 30 days)
Say I have a closed loop feedback system sys without any delays, represented as a state space system. It was 2 inputs: reference and disturbance.
How can I add an InternalDelay after the feedback loop has been created?
I'd like to see the effect of disturbance rejection as a function of plant delay when using step(), after the feedback sys has been built.
I'm NOT trying to add an Input or Output delay, which would only delay the disturbance input or output reading of the result, but an internal delay that reduces the effectiveness of the loop.
Also, secondarily, it seems that perhaps delays need to be added after the loop is closed: If I add the delay to the plant, then when I create a closed-loop A feedback matrix to be used with ss(), the delays are (of course) not present when using eg plant.A -- so ss() won't have delays either. So convenience aside, it seems I'd need to add internal delays after the fact.
delayss() seems to be one option, but I'm unable to follow the documentation examples.
For example, say plant includes delays, and i make the C-L feedback matrix A_cl like so:
A_cl = [ plant.A, -plant.B * K;
L * plant.C, plant.A - plant.B * K - L * plant.C ]
A_cl will not include delays, since (of course), plant.N are just matrices without delays.
To add after the fact, I tried sys.InternalDelay:
Check original sys (build without delay), as expected it's empty:
>> sys.InternalDelay
ans =
0×1 empty double column vector
But when I try to add an internal delay, eg
sys.InternalDelay = ...
I get:
Error using ss/set.InternalDelay
When modifying the "InternalDelay" property, the number of delay entries must remain the
same.
Which seems to imply that i need to match an empty vector; how is that possible?
I'm looking at this documentation, but didn't find any clarification on adding internal delays after the system is constructed.

Accepted Answer

Paul
Paul on 18 Apr 2023
Hi John,
I suspect the error message is telling you that you can only change the value of internal delays that already exist in the model. That's just a guess though.
IMO the best way (and maybe the only way) to include an internal delay in the system is to inlcude the delay(s) at the appropriate location in the plant model and/or any other system elements, and then connect all the system elements using connect to form the model of the closed loop system.
  2 Comments
John
John on 28 Apr 2023
Got it. Thanks @Paul.
It's unfortunate there's no other method when going the ss() route, but understood that connect() will do so... For the time being I like the ss() route because it allows me to build a simulink model with the same components used as inputs to ss(), and these components are physically implementable on a system.
Paul
Paul on 28 Apr 2023
Simulink can be used to connect models of system components, just as is done with connect. So it's easy to maintain a correspondence between the Matlab code used for analysis and the Simulink model used for Simulation. linearize can return the linearized closed loop model from Simulink, even with internal delays if used with the correct options, so Simulink is, in principle, all that's needed (linearize is probably slower than connect). OTOH, Acl isn't really a (part of a) physically impelementable component. It's a mathematical construct that represents the connection of components. So I don't see the advantage of having to do all the by-hand calculations to come up with the closed loop ss model, after which it does not provide much flexibility as seen in this Question. OTOH, keeping everything separate, and letting connect (or linearize) do the job will recduce chance of errors and make it much easier to modify components, add components, etc. Just my opinion ....

Sign in to comment.

More Answers (0)

Categories

Find more on Control System Toolbox in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!