Multiple times of execution of PID controller in a single loop (Simulink)

1 visualización (últimos 30 días)
Hi
I have a problem concerning multiple times of execution of a PID controller per loop in a real-time constant temperature control system shown in the Figure. A source meter (Keithley 2400 with GPIB interface) read the real-time resistance of a wire-thermometer (i.e. real-time temperature) and source a current based on difference between the real-time resistance and the temperature setpoint to keep the wire-thermometer at the temperature setpoint.
The problem I have is that the PID controller executes multiple times (6 or 7 times) in a single loop (a loop in simulink) because I found multiple "Current_Ouput" from the plant in a single loop. However, I want the PID controller to execute "one" time per "loop" (one Current_Output per loop).
Please explain why this PID works in this manner and the way I can set 1 execution per loop. Thanks.
Thanks, William

Respuestas (2)

Sebastian Castro
Sebastian Castro el 3 de Mzo. de 2016
That PID Controller block is Continuous, so it will execute whenever the model solver decides to take a time step. If you're using a variable-step solver (such as ode45), this is completely expected. A model may take several "minor steps" to try reduce integration errors.
What you can do is change the block to a discrete-time controller so you control how often the block updates.
- Sebastiam

X W
X W el 24 de Jul. de 2017
Hi William, Would you mind sharing your "Customized GPIB input" block for the Keithley? I assume it is a Simulink Matlab Function block? I am trying to do the same thing, but couldn't get the correct data input with the "To instrument" or "Query" blocks and am going to put the already-written .m file codes into a function to put into Simulink. However, I see the functions supported https://www.mathworks.com/help/simulink/ug/functions-supported-for-code-generation--alphabetical-list.html have neither gpib() nor visa(), and assume I need to look at some "extrinsic" statement to allow full access to MATLAB codes?
Would greatly appreciate if you could share your GPIB read function blocks in Simulink.
Many thanks, X.W.

Community Treasure Hunt

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

Start Hunting!

Translated by