Disable subsystem during real-time operation

7 visualizaciones (últimos 30 días)
Lars
Lars el 29 de Ag. de 2024
Comentada: Lars el 5 de Sept. de 2024
Hello everyone,
I am building a real- time control system on a C2000 F280049C launch pad, and I am having a hard time making the control loop fast enough to keep up with my system. I am therefore wondering if there is a way to disable parts of my model after running the system for a few milliseconds.
I am actively calibrating my measurement inputs (ADCs) by measuring their no-load values and saving their offset values before starting the regular operation of my circuit.
I have disabled the operation of this calibration function after the initial offset measurement, but it seems like the controller is still beeing slowed down by the offset subsystem. So, is there a way to use a block like a variant source to fully disable a subsystem after a few milliseconds of operation?
I have already tried to realize this using enable blocks and an if statement block, but they only have a minimal effect compared to how fast my control loop runs if I comment out the calibration sub system completely.
For context I am building a voltage and current control loop with discrete PI controllers to manage the direct and quadrature components of the currents and voltages of a 3-phase inverter. My goal is to realize a switching frequency of 30 kHz, but currently my control loop can only operate at a frequency of 15 kHz.
Any other tips for how to speed up my control would also be appreciated, but I suppose I should make a separate post for that.

Respuestas (1)

Shubham
Shubham el 31 de Ag. de 2024
Hey Lars,
In order to disable a subsystem during real-time operation in Simulink, you can use a Variant Subsystem. The Variant Subsystems allows you to switch between different subsystem configurations based on certain conditions, effectively disabling parts of your model when they are not needed.
For more information on disabling the subsystem, refer to @Guy Rouleau's Answer in the following MATLAB Answer post mentioning a similar situation: https://www.mathworks.com/matlabcentral/answers/26447-simulink-disabling-enabling-switching-off-on-blocks-subsystems
I hope this helps!
  1 comentario
Lars
Lars el 5 de Sept. de 2024
Thank you Shubham!
I can now select each variant sub system by using the variant conditional expressions “offset_done == 0” and “offset_done == 1” for each sub system. But I cannot figure out how to change the offset_done variable while running the model on the F280049C board.
I have tried using a Matlab function block to access and change the variable, but I have not been able to make it work.
Do you know how I can access and change the control variable during operation?
Thanks again for your help!

Iniciar sesión para comentar.

Categorías

Más información sobre Large-Scale Modeling en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by