Sorted Execution Order, Initial Conditions, PID

2 ビュー (過去 30 日間)
Daniel Gelman
Daniel Gelman 2017 年 8 月 11 日
コメント済み: Aniruddha Katre 2017 年 8 月 11 日
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.

回答 (1 件)

Aniruddha Katre
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:
  1. Const Source block - output = 20
  2. Transfer function block - output = 0
  3. Sum block - output = 20 - 0 = 20
  4. Display block then displays the value 20
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 件のコメント
Daniel Gelman
Daniel Gelman 2017 年 8 月 11 日
編集済み: Daniel Gelman 2017 年 8 月 11 日
Hi Aniruddha,
Correct me if I am wrong, but based on what you said, at t = 0, all the blocks in the simulation have already done 1 iteration (executed once)?
Also, I am using a discrete transfer function block (not continuous) not sure if that matters or not in your answer.
Aniruddha Katre
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 ExchangeSchedule Model Components についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by