- Const Source block - output = 20
- Transfer function block - output = 0
- Sum block - output = 20 - 0 = 20
- Display block then displays the value 20
Sorted Execution Order, Initial Conditions, PID
2 次查看(过去 30 天)
显示 更早的评论
Below is a closed-loop system of plant Gp(z) with unity gain. I also enabled to display the sorted execution order.
According to the image, the order of execution is:
1. Reference, r, is initialized to 20.
2. Plant calculates output, y.
3. The error, e, is calculated.
Please correct me if I am wrong. If this is correct, at time 0 shouldn't e have an initial value of 0 since the error calculation hasn't occurred yet?
When designing a PID controller, will e = 0 when t = 0? I want to understand this because it ultimately affects the closed-loop response of the system.
0 个评论
回答(1 个)
Aniruddha Katre
2017-8-11
In this case, the value of e is 20 at the initial time step because of the sorted execution order and the fact that you are using a Continuous Transfer Function block. If you look at the execution order, the constant source block generates an output first, then the transfer function block, followed by the sum block, followed by the error display block.
The outputs are generated as follows:
The reason why the transfer function block generates an initial output value of 0 is because of the initial conditions set on that block. The continuous transfer function will have a set of internal states that need to be initialized. This specific block is configured to always initialize these internal states to zero. Therefore, at t = 0 in the simulation, the output of the continuous transfer function block will always be zero. This in turn will make it so that the constant source value minus the output of the T.F. block will be non-zero.
For information on why the initial conditions for the Continuous T.F. block are always set to zero, see the "Specifying Initial Conditions" section of this documentation link: https://www.mathworks.com/help/releases/R2017a/simulink/slref/transferfcn.html
2 个评论
Aniruddha Katre
2017-8-11
Correct, when the simulation starts, at t = 0 the blocks will generate their outputs in determined execution order.
The general process that the Simulink solver follows is to generate outputs from all blocks in the sorted execution order, and then update the states of any blocks that have states before proceeding to the next time step of the simulation.
And sorry for the confusion about the T.F. block. The discrete T.F. block allows you to provide the initial conditions. The edit box is called "Initial States". If that value is set to zero, then I would expect the results you see in the screenshot. The reasoning for that is still the same from my previous post.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Schedule Model Components 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!