Disable subsystem during real-time operation
7 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Shubham
2024-8-31
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!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Large-Scale Modeling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!