How can I configure the phase delay parameter to accept input from a PID regulator in my simulation?

27 views (last 30 days)
"I want to use a PID regulator to adjust the value of the phase delay in the 'Block Parameters' window. Currently, the phase delay is set with a formula, but I want it to be dynamically controlled by a PID controller instead. How can I configure the phase delay parameter to accept input from a PID regulator in my simulation?"

Answers (1)

Shivam Gothi
Shivam Gothi on 7 Nov 2024 at 7:14
As per my understanding, you are trying to implement a phase delay in “pulse generator” block, which is currently set by a formula. But, you want it to be dynamically controlled by a “PID controller” block.
The “phase delay” property of “pulse generator” block should be coded before compiling the Simulink model because, it is set during the compile time and there is no way to change it during run time.
However, the objective stated by you can be achieved by the below suggested workarounds:
Case-1: use of “Variable Pulse Delay” block.
The “variable pulse delay” block is found in library: “Mixed-Signal Blockset / Utilities”. It introduces a controllable delay in signal samples. Each sample at the in port is delayed by the value at the delay port at the time the input sample arrived.  You can use it as shown in the below Simulink model:
At the beginning of the simulation, the out port is set to the value of the Initial Input parameter.
Refer the documentation to explore more about the block:
Case-2: Use “Variable Transport Delayor “Variable Time Delay” block:
The Variable Transport Delay and Variable Time Delay blocks appear as two blocks in the Simulink block library. However, they are the same Simulink block with different settings for the Select delay type parameter. Refer to the below documentation links for their usage:
1) Variable Transport Delay:
2) Variable time delay:
Below given Simulink model illustrates its usage:
I hope it answers your question !

Community Treasure Hunt

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

Start Hunting!