MATLAB Answers

initial condition of PID-controller via switch

7 views (last 30 days)
AN
AN on 7 Jan 2021
Answered: Nitin Kapgate on 13 Jan 2021
I am using a switch to set the initial condition of my PID-controller. So if a certain constant has one as a value, I want the initial value to be lower. However the switch lets one single value through before the value goes down and the PID-controller uses this initial value and not the whole rest that is lower. I also tried an if-function, but that just does the same thing.
Is there a way to use the second time-value?

Answers (1)

Nitin Kapgate
Nitin Kapgate on 13 Jan 2021
You can use the combination of "Clock", "Relational Operator" and "Multiport Switch" blocks in Simulink to get the desired functionality.
The "Clock" block displays and provides simulation time.
The "Relational Operator" performs specified relational operation on inputs (output of Clock and Constant blocks in your case).
With "Multiport Switch", you can select output signal based on control signal (output of relational operator ijn your case).

Community Treasure Hunt

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

Start Hunting!

Translated by